Browse Source

overload Graph.Import(byte[] bytes)

tags/v0.9
Oceania2018 6 years ago
parent
commit
92b3a88be7
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      src/TensorFlowNET.Core/Graphs/Graph.Import.cs

+ 8
- 0
src/TensorFlowNET.Core/Graphs/Graph.Import.cs View File

@@ -35,6 +35,14 @@ namespace Tensorflow
return Status;
}

public Status Import(byte[] bytes)
{
var graph_def = new Tensorflow.Buffer(bytes);
var opts = c_api.TF_NewImportGraphDefOptions();
c_api.TF_GraphImportGraphDef(_handle, graph_def, opts, Status);
return Status;
}

public static Graph ImportFromPB(string file_path)
{
var graph = tf.Graph().as_default();


Loading…
Cancel
Save