diff options
Diffstat (limited to 'tensorflow/tools/proto_text/gen_proto_text_functions_lib.cc')
-rw-r--r-- | tensorflow/tools/proto_text/gen_proto_text_functions_lib.cc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tensorflow/tools/proto_text/gen_proto_text_functions_lib.cc b/tensorflow/tools/proto_text/gen_proto_text_functions_lib.cc index a5b0f03a25..c31f3c4e81 100644 --- a/tensorflow/tools/proto_text/gen_proto_text_functions_lib.cc +++ b/tensorflow/tools/proto_text/gen_proto_text_functions_lib.cc @@ -224,9 +224,18 @@ string GetProtoHeaderName(const FileDescriptor& fd) { // Returns the C++ class name for the given proto field. string GetCppClass(const FieldDescriptor& d) { - return d.cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE - ? GetQualifiedName(*d.message_type()) - : d.cpp_type_name(); + string cpp_class = d.cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE + ? GetQualifiedName(*d.message_type()) + : d.cpp_type_name(); + + // In open-source TensorFlow, the definition of int64 varies across + // platforms. The following line, which is manipulated during internal- + // external sync'ing, takes care of the variability. + if (cpp_class == "int64") { + cpp_class = kProtobufInt64Typename; + } + + return cpp_class; } // Returns the string that can be used for a header guard for the generated |