|
|
@@ -13,5 +13,27 @@ namespace TensorFlowNET.Core |
|
|
|
public static extern unsafe IntPtr TF_Version(); |
|
|
|
|
|
|
|
public static string VERSION => Marshal.PtrToStringAnsi(TF_Version()); |
|
|
|
|
|
|
|
[DllImport(TensorFlowLibName)] |
|
|
|
static extern unsafe IntPtr TF_NewOperation(IntPtr graph, string opType, string oper_name); |
|
|
|
|
|
|
|
[DllImport(TensorFlowLibName)] |
|
|
|
static extern unsafe IntPtr TF_FinishOperation(IntPtr desc, IntPtr status); |
|
|
|
|
|
|
|
public static IntPtr constant<T>(T value) |
|
|
|
{ |
|
|
|
var g = Graph(); |
|
|
|
return TF_NewOperation(g.TFGraph, "Const", "Const"); |
|
|
|
} |
|
|
|
|
|
|
|
[DllImport(TensorFlowLibName)] |
|
|
|
static extern unsafe IntPtr TF_NewGraph(); |
|
|
|
|
|
|
|
public static Graph Graph() |
|
|
|
{ |
|
|
|
Graph g = new Graph(); |
|
|
|
g.TFGraph = TF_NewGraph(); |
|
|
|
return g; |
|
|
|
} |
|
|
|
} |
|
|
|
} |