From 5031e9f169a488eebd00eb7602e27ba6516f2486 Mon Sep 17 00:00:00 2001 From: Anna R Date: Wed, 24 Jan 2018 10:55:55 -0800 Subject: [PATCH] Fix update_api_def.sh script to output ApiDefs instead of ApiDef proto. PiperOrigin-RevId: 183109303 --- tensorflow/core/api_def/update_api_def.cc | 8 ++--- tensorflow/core/api_def/update_api_def.h | 2 +- .../core/api_def/update_api_def_test.cc | 32 ++++++++++--------- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/tensorflow/core/api_def/update_api_def.cc b/tensorflow/core/api_def/update_api_def.cc index 1a6d15ec68b..ea9a1482605 100644 --- a/tensorflow/core/api_def/update_api_def.cc +++ b/tensorflow/core/api_def/update_api_def.cc @@ -224,14 +224,14 @@ void RemoveDocs(const std::vector& ops, } } // namespace -// Returns ApiDef text representation in multi-line format +// Returns ApiDefs text representation in multi-line format // constructed based on the given op. string CreateApiDef(const OpDef& op) { - ApiDef api_def; - FillBaseApiDef(&api_def, op); + ApiDefs api_defs; + FillBaseApiDef(api_defs.add_op(), op); const std::vector multi_line_fields = {"description"}; - string new_api_defs_str = api_def.DebugString(); + string new_api_defs_str = api_defs.DebugString(); return PBTxtToMultiline(new_api_defs_str, multi_line_fields); } diff --git a/tensorflow/core/api_def/update_api_def.h b/tensorflow/core/api_def/update_api_def.h index 5eae7e528ef..5d6c15010d3 100644 --- a/tensorflow/core/api_def/update_api_def.h +++ b/tensorflow/core/api_def/update_api_def.h @@ -21,7 +21,7 @@ limitations under the License. namespace tensorflow { -// Returns ApiDef text representation in multi-line format +// Returns ApiDefs text representation in multi-line format // constructed based on the given op. string CreateApiDef(const OpDef& op); diff --git a/tensorflow/core/api_def/update_api_def_test.cc b/tensorflow/core/api_def/update_api_def_test.cc index 8948f2c1d5b..4200c9da23c 100644 --- a/tensorflow/core/api_def/update_api_def_test.cc +++ b/tensorflow/core/api_def/update_api_def_test.cc @@ -173,30 +173,32 @@ description: "Description\nfor Op1." OpDef op; protobuf::TextFormat::ParseFromString(op_text, &op); // NOLINT - const string expected_api_def = R"(graph_op_name: "Op1" -in_arg { - name: "a" - description: <