Skip to content

Commit 82156e0

Browse files
committed
1.7 API work
1 parent 206a071 commit 82156e0

2 files changed

Lines changed: 501 additions & 261 deletions

File tree

OpGenerator/OpGenerator.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ public unsafe bool Put (string text)
127127

128128
class OpGenerator
129129
{
130+
[DllImport ("libtensorflow")]
131+
static extern unsafe IntPtr TF_Version ();
132+
133+
public static string GetVersion ()
134+
{
135+
return Marshal.PtrToStringAnsi (TF_Version ());
136+
}
137+
130138
//
131139
// Maps a TensorFlow type to a C# type
132140
//
@@ -637,11 +645,14 @@ void p (string fmt, params object [] args)
637645

638646
public static void Main (string [] args)
639647
{
648+
Console.WriteLine ("Getting code for {0}", GetVersion ());
640649
if (Marshal.SizeOf (typeof (IntPtr)) != 8)
641650
throw new Exception ("Need to run in 64");
642651
if (args.Length == 0)
643652
args = new string [] { "/cvs/tensorflow/tensorflow/core/api_def/base_api" };
644-
653+
654+
655+
645656
new OpGenerator ().Run (args);
646657
}
647658
}

0 commit comments

Comments
 (0)