aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/c/c_api_internal.h
diff options
context:
space:
mode:
authorGravatar Skye Wanderman-Milne <skyewm@google.com>2017-10-30 08:07:11 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-10-30 08:10:56 -0700
commitce0238198052358d102ca7786ad9be60a5e76d28 (patch)
treeb1694c3fe23b4933b7967f9494cb7337e673b07e /tensorflow/c/c_api_internal.h
parentef4490f637e17f3ce599f55522e63d06f470e540 (diff)
Add ability to fetch return nodes and unused input mappings from C API GraphDef import
This change introduces yet another ImportGraphDef function to the C API (TF_GraphImportGraphDefWithResults), but this one has extensible return values so we shouldn't have to add more in the future. This change also modifies the ImportGraphDef C interface to manage all string data for the user. PiperOrigin-RevId: 173894710
Diffstat (limited to 'tensorflow/c/c_api_internal.h')
-rw-r--r--tensorflow/c/c_api_internal.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/tensorflow/c/c_api_internal.h b/tensorflow/c/c_api_internal.h
index 23ec1fac6f..bb04e01bee 100644
--- a/tensorflow/c/c_api_internal.h
+++ b/tensorflow/c/c_api_internal.h
@@ -18,7 +18,9 @@ limitations under the License.
#include "tensorflow/c/c_api.h"
+#include <list>
#include <set>
+#include <string>
#include <unordered_map>
#include <vector>
@@ -124,6 +126,20 @@ struct TF_Session {
struct TF_ImportGraphDefOptions {
tensorflow::ImportGraphDefOptions opts;
+
+ // Backing memory for TensorId fields in opts.
+ // TODO(skyewm): it'd be better if ImportGraphDefOptions owned this.
+ std::list<tensorflow::string> tensor_id_data;
+};
+
+struct TF_ImportGraphDefResults {
+ std::vector<TF_Output> return_tensors;
+ std::vector<TF_Operation*> return_nodes;
+ std::vector<const char*> unused_key_names;
+ std::vector<int> unused_key_indexes;
+
+ // Backing memory for unused_key_names values.
+ std::list<tensorflow::string> unused_key_names_data;
};
struct TF_DeviceList {