From db63127fb46f9d69227fb39d3397283b15658cec Mon Sep 17 00:00:00 2001 From: Jonathan Close Date: Thu, 14 Feb 2019 11:07:24 +0000 Subject: [PATCH] Fixed: Number of dims for each shape in list wasn't set. Prevented iterator and data set operations from working --- TensorFlowSharp/Tensorflow.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TensorFlowSharp/Tensorflow.cs b/TensorFlowSharp/Tensorflow.cs index b09dc8f8..a3ed344b 100644 --- a/TensorFlowSharp/Tensorflow.cs +++ b/TensorFlowSharp/Tensorflow.cs @@ -1917,7 +1917,8 @@ public TFOperationDesc SetAttrShape (string attrName, TFShape [] shapeList) IntPtr array = Marshal.AllocHGlobal (sizeof (long) * shapeList [i].dims.Length); Marshal.Copy (shapeList [i].dims, 0, array, shapeList [i].dims.Length); Marshal.WriteIntPtr (unmanaged, ofs, array); - ofs += sizeof (IntPtr); + num_dims[i] = shapeList[i].NumDimensions; + ofs += sizeof (IntPtr); } TF_SetAttrShapeList (handle, attrName, unmanaged, num_dims, num_shapes); ofs = 0;