diff --git a/src/TensorFlowHub/MnistDataSet.cs b/src/TensorFlowHub/MnistDataSet.cs index 07b2c181..9cdd8c0c 100644 --- a/src/TensorFlowHub/MnistDataSet.cs +++ b/src/TensorFlowHub/MnistDataSet.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Text; using NumSharp; using Tensorflow; @@ -21,7 +22,12 @@ namespace Tensorflow.Hub images = images.reshape(images.shape[0], images.shape[1] * images.shape[2]); images = images.astype(dataType); + // for debug np.multiply performance + var sw = new Stopwatch(); + sw.Start(); images = np.multiply(images, 1.0f / 255.0f); + sw.Stop(); + Console.WriteLine($"{sw.ElapsedMilliseconds}ms"); Data = images; labels = labels.astype(dataType); diff --git a/src/TensorFlowNET.Core/Status/Status.cs b/src/TensorFlowNET.Core/Status/Status.cs index cc4fdff1..7eb2d7e3 100644 --- a/src/TensorFlowNET.Core/Status/Status.cs +++ b/src/TensorFlowNET.Core/Status/Status.cs @@ -55,7 +55,7 @@ namespace Tensorflow Console.WriteLine(Message); if (throwException) { - // throw new Exception(Message); + throw new Exception(Message); } } }