Browse Source

"HelloWorld" passed.

tags/v0.12
Oceania2018 6 years ago
parent
commit
bba0dcf6b2
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      src/TensorFlowNET.Core/Sessions/BaseSession.cs
  2. +1
    -1
      test/TensorFlowNET.Examples/HelloWorld.cs

+ 1
- 1
src/TensorFlowNET.Core/Sessions/BaseSession.cs View File

@@ -261,7 +261,7 @@ namespace Tensorflow
// wired, don't know why we have to start from offset 9. // wired, don't know why we have to start from offset 9.
// length in the begin // length in the begin
var str = UTF8Encoding.Default.GetString(bytes, 9, bytes[8]); var str = UTF8Encoding.Default.GetString(bytes, 9, bytes[8]);
nd = np.array(str).reshape();
nd = NDArray.FromString(str);
break; break;
case TF_DataType.TF_UINT8: case TF_DataType.TF_UINT8:
nd = NDArray.Scalar(*(byte*)offset); nd = NDArray.Scalar(*(byte*)offset);


+ 1
- 1
test/TensorFlowNET.Examples/HelloWorld.cs View File

@@ -28,7 +28,7 @@ namespace TensorFlowNET.Examples
using (var sess = tf.Session()) using (var sess = tf.Session())
{ {
// Run the op // Run the op
var result = sess.run(hello);
var result = sess.run(hello)[0];
Console.WriteLine(result.ToString()); Console.WriteLine(result.ToString());
return result.ToString().Equals(str); return result.ToString().Equals(str);
} }


Loading…
Cancel
Save