| 27 | namespace protobuf_util { |
| 28 | |
| 29 | bool ProtobufEquals(const tensorflow::protobuf::Message& m1, |
| 30 | const tensorflow::protobuf::Message& m2) { |
| 31 | // This is a bit fast and loose, but avoids introducing a dependency on |
| 32 | // the much more complex protobuf::util::MessageDifferencer class. For |
| 33 | // our purposes we just say that two protobufs are equal if their serialized |
| 34 | // representations are equal. |
| 35 | string serialized1, serialized2; |
| 36 | m1.AppendToString(&serialized1); |
| 37 | m2.AppendToString(&serialized2); |
| 38 | return (serialized1 == serialized2); |
| 39 | } |
| 40 | |
| 41 | Status DumpProtoToDirectory(const tensorflow::protobuf::Message& message, |
| 42 | const string& directory, const string& file_name, |
no outgoing calls