diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-03-05 14:45:28 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-03-05 14:49:23 -0800 |
commit | 5279cf29cea96b3ec50df506bb51d8ffabdabac9 (patch) | |
tree | 2a19ffcb78e2fc3836d08a63287d367a5da6c88b /tensorflow/cc/framework | |
parent | 06c7a190ac122512edf7229041f34391d8993da0 (diff) |
Correct op::Attr usage in C++ gradient implementations.
Also enabled TF_MUST_USE_RESULT for the generated Attr API, so we
can catch any new errors early.
Fixes #17360
PiperOrigin-RevId: 187925761
Diffstat (limited to 'tensorflow/cc/framework')
-rw-r--r-- | tensorflow/cc/framework/cc_op_gen.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tensorflow/cc/framework/cc_op_gen.cc b/tensorflow/cc/framework/cc_op_gen.cc index a40ad1ffc3..39893f5ccd 100644 --- a/tensorflow/cc/framework/cc_op_gen.cc +++ b/tensorflow/cc/framework/cc_op_gen.cc @@ -697,7 +697,8 @@ string OpInfo::GetOpAttrStruct() const { attr_comment = MakeComment(attr_comment, " "); strings::StrAppend(&setters, attr_comment); - strings::StrAppend(&setters, " Attrs ", attr_func_def, " x) {\n"); + strings::StrAppend(&setters, " TF_MUST_USE_RESULT Attrs ", attr_func_def, + " x) {\n"); strings::StrAppend(&setters, " Attrs ret = *this;\n"); strings::StrAppend(&setters, " ret.", api_def_attr.rename_to(), "_ = x;\n"); |