FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

add debug info · MSavameri/TensorFlow.NET@403aa38 · GitHub

Repository navigation

Commit 403aa38

Browse files
committed
add debug info
1 parent cfec53e commit 403aa38

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎src/TensorFlowHub/MnistDataSet.cs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Diagnostics;
34
using System.Text;
45
using NumSharp;
56
using Tensorflow;
@@ -21,7 +22,12 @@ public MnistDataSet(NDArray images, NDArray labels, Type dataType, bool reshape)
2122

2223
images = images.reshape(images.shape[0], images.shape[1] * images.shape[2]);
2324
images = images.astype(dataType);
25+
// for debug np.multiply performance
26+
var sw = new Stopwatch();
27+
sw.Start();
2428
images = np.multiply(images, 1.0f / 255.0f);
29+
sw.Stop();
30+
Console.WriteLine($"{sw.ElapsedMilliseconds}ms");
2531
Data = images;
2632

2733
labels = labels.astype(dataType);

‎src/TensorFlowNET.Core/Status/Status.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void Check(bool throwException = false)
5555
Console.WriteLine(Message);
5656
if (throwException)
5757
{
58-
// throw new Exception(Message);
58+
throw new Exception(Message);
5959
}
6060
}
6161
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL