Skip to content

Commit 92b3a88

Browse files
committed
overload Graph.Import(byte[] bytes)
1 parent 3759a2d commit 92b3a88

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/TensorFlowNET.Core/Graphs/Graph.Import.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ public Status Import(string file_path)
3535
return Status;
3636
}
3737

38+
public Status Import(byte[] bytes)
39+
{
40+
var graph_def = new Tensorflow.Buffer(bytes);
41+
var opts = c_api.TF_NewImportGraphDefOptions();
42+
c_api.TF_GraphImportGraphDef(_handle, graph_def, opts, Status);
43+
return Status;
44+
}
45+
3846
public static Graph ImportFromPB(string file_path)
3947
{
4048
var graph = tf.Graph().as_default();

0 commit comments

Comments
 (0)