Browse Source

fix compile

tags/v0.8.0
Oceania2018 6 years ago
parent
commit
afae3e9df9
2 changed files with 3 additions and 3 deletions
  1. +1
    -2
      test/TensorFlowNET.Examples/ImageRecognition.cs
  2. +2
    -1
      test/TensorFlowNET.UnitTest/ConstantTest.cs

+ 1
- 2
test/TensorFlowNET.Examples/ImageRecognition.cs View File

@@ -14,8 +14,7 @@ namespace TensorFlowNET.Examples
public void Run()
{
var graph = new Graph();
// 从文件加载序列化的GraphDef
//导入GraphDef
//import GraphDef from pb file
graph.Import("tmp/tensorflow_inception_graph.pb");
with<Session>(tf.Session(graph), sess =>
{


+ 2
- 1
test/TensorFlowNET.UnitTest/ConstantTest.cs View File

@@ -103,10 +103,11 @@ namespace TensorFlowNET.UnitTest
public void StringEncode()
{
string str = "Hello, TensorFlow.NET!";
var handle = Marshal.StringToHGlobalAnsi(str);
ulong dst_len = c_api.TF_StringEncodedSize((ulong)str.Length);
Assert.AreEqual(dst_len, (ulong)23);
IntPtr dst = Marshal.AllocHGlobal((int)dst_len);
ulong encoded_len = c_api.TF_StringEncode(str, (ulong)str.Length, dst, dst_len, status);
ulong encoded_len = c_api.TF_StringEncode(handle, (ulong)str.Length, dst, dst_len, status);
Assert.AreEqual((ulong)23, encoded_len);
Assert.AreEqual(status.Code, TF_Code.TF_OK);
string encoded_str = Marshal.PtrToStringUTF8(dst + sizeof(byte));


Loading…
Cancel
Save