diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-01-16 19:02:15 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-01-16 19:05:41 -0800 |
commit | baea13831c2d1ffa08c4fcc8944a3870d19826cb (patch) | |
tree | ca046dbc0927c012e0898e0a0bc31044fe7312f2 /tensorflow/c/c_api.cc | |
parent | 786dcb0b3ee719ae44ac23ea6ee878bbb04792cd (diff) |
Introduce a new C API entrypoint to set a 'func' attribute on an op
description.
PiperOrigin-RevId: 182146876
Diffstat (limited to 'tensorflow/c/c_api.cc')
-rw-r--r-- | tensorflow/c/c_api.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tensorflow/c/c_api.cc b/tensorflow/c/c_api.cc index bc19044fa2..ead36506f0 100644 --- a/tensorflow/c/c_api.cc +++ b/tensorflow/c/c_api.cc @@ -1201,6 +1201,13 @@ void TF_SetAttrTypeList(TF_OperationDescription* desc, const char* attr_name, reinterpret_cast<const DataType*>(values), num_values)); } +void TF_SetAttrFunc(TF_OperationDescription* desc, const char* attr_name, + const char* value, size_t length) { + tensorflow::NameAttrList func_name; + func_name.set_name(std::string(value, value + length)); + desc->node_builder.Attr(attr_name, func_name); +} + void TF_SetAttrShape(TF_OperationDescription* desc, const char* attr_name, const int64_t* dims, int num_dims) { PartialTensorShape shape; |