aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/c/c_api.h
diff options
context:
space:
mode:
authorGravatar Skye Wanderman-Milne <skyewm@google.com>2017-10-18 11:58:01 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-10-18 12:04:54 -0700
commitf5d3bf42b892ecfbde2ce9eb45f00b76473c824a (patch)
treefe8f8a9965f40ab5a463932b2073df32be21a1af /tensorflow/c/c_api.h
parent6a725f6d0974dc71fe4ac311fc8dd16db4257452 (diff)
Add TF_GraphGetOpDef() to C API and use in Operation.op_def()
Note that this creates a small change in behavior with the C API enabled, since previously not all Python Operations had an OpDef (op_def() returns None). With the C API enabled, op_def() always returns an OpDef. PiperOrigin-RevId: 172634411
Diffstat (limited to 'tensorflow/c/c_api.h')
-rw-r--r--tensorflow/c/c_api.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/tensorflow/c/c_api.h b/tensorflow/c/c_api.h
index 68a758498d..0c6bb53d01 100644
--- a/tensorflow/c/c_api.h
+++ b/tensorflow/c/c_api.h
@@ -864,6 +864,13 @@ TF_CAPI_EXPORT extern void TF_GraphToGraphDef(TF_Graph* graph,
TF_Buffer* output_graph_def,
TF_Status* status);
+// Returns the serialized OpDef proto with name `op_name`, or a bad status if no
+// such op exists. This can return OpDefs of functions copied into the graph.
+TF_CAPI_EXPORT extern void TF_GraphGetOpDef(TF_Graph* graph,
+ const char* op_name,
+ TF_Buffer* output_op_def,
+ TF_Status* status);
+
// TF_ImportGraphDefOptions holds options that can be passed to
// TF_GraphImportGraphDef.
typedef struct TF_ImportGraphDefOptions TF_ImportGraphDefOptions;