From 92b3a88be7736fd49cea2a5a313b368ae5671203 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Wed, 26 Jun 2019 20:42:03 -0500 Subject: [PATCH] overload Graph.Import(byte[] bytes) --- src/TensorFlowNET.Core/Graphs/Graph.Import.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/TensorFlowNET.Core/Graphs/Graph.Import.cs b/src/TensorFlowNET.Core/Graphs/Graph.Import.cs index 1576c650..776246b1 100644 --- a/src/TensorFlowNET.Core/Graphs/Graph.Import.cs +++ b/src/TensorFlowNET.Core/Graphs/Graph.Import.cs @@ -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();