| 80 | #endif // defined(TENSORFLOW_PROTOBUF_USES_CORD) |
| 81 | |
| 82 | inline bool SerializeToTString(const protobuf::MessageLite& proto, |
| 83 | tstring* output) { |
| 84 | #ifdef USE_TSTRING |
| 85 | size_t size = proto.ByteSizeLong(); |
| 86 | output->resize_uninitialized(size); |
| 87 | return proto.SerializeToArray(output->data(), static_cast<int>(size)); |
| 88 | #else // USE_TSTRING |
| 89 | return proto.SerializeToString(output); |
| 90 | #endif // USE_TSTRING |
| 91 | } |
| 92 | |
| 93 | } // namespace tensorflow |
| 94 |