aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/c/c_api.h
diff options
context:
space:
mode:
authorGravatar Igor Ganichev <iga@google.com>2017-09-19 18:54:03 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-09-19 18:57:41 -0700
commit7ad8e25495a2793ea14189359af736d2c662a694 (patch)
treea45d248a4eaff33d65b48864f06b59acf884f905 /tensorflow/c/c_api.h
parented89a2b31f775db8ae6adf894fee27cc963ba030 (diff)
Add attribute setting and getting support to TF_Function
PiperOrigin-RevId: 169337159
Diffstat (limited to 'tensorflow/c/c_api.h')
-rw-r--r--tensorflow/c/c_api.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/tensorflow/c/c_api.h b/tensorflow/c/c_api.h
index ccaaa30041..719374f2a4 100644
--- a/tensorflow/c/c_api.h
+++ b/tensorflow/c/c_api.h
@@ -1136,6 +1136,24 @@ TF_CAPI_EXPORT extern void TF_FunctionToFunctionDef(TF_Function* func,
TF_CAPI_EXPORT extern TF_Function* TF_FunctionImportFunctionDef(
const TF_Buffer* func_def, TF_Status* status);
+// Sets function attribute named `attr_name` to value stored in `proto`.
+// If this attribute is already set to another value, it is overriden.
+// `proto` should point to a sequence of bytes of length `proto_len`
+// representing a binary serialization of an AttrValue protocol
+// buffer.
+TF_CAPI_EXPORT extern void TF_FunctionSetAttrValueProto(TF_Function* func,
+ const char* attr_name,
+ const void* proto,
+ size_t proto_len,
+ TF_Status* status);
+
+// Sets `output_attr_value` to the binary-serialized AttrValue proto
+// representation of the value of the `attr_name` attr of `func`.
+// If `attr_name` attribute is not present, status is set to an error.
+TF_CAPI_EXPORT extern void TF_FunctionGetAttrValueProto(
+ TF_Function* func, const char* attr_name, TF_Buffer* output_attr_value,
+ TF_Status* status);
+
// Frees the memory used by the `func` struct.
// TF_DeleteFunction is a noop if `func` is null.
// Deleting a function does not remove it from any graphs it was copied to.