Translates the length of a string to number of bytes when the string is encoded as bytes in protobuf. Note that this makes a conservative estimate (i.e., an estimate that is usually too large, but never too small under the gRPC message size limit) of the Varint-encoded length, to workaround the lack of a portable length function.
| 116 | // gRPC message size limit) of the Varint-encoded length, to workaround the lack |
| 117 | // of a portable length function. |
| 118 | const size_t StringValMaxBytesInProto(const string& str) { |
| 119 | #if defined(PLATFORM_GOOGLE) |
| 120 | return str.size() + DebugGrpcIO::kGrpcMaxVarintLengthSize; |
| 121 | #else |
| 122 | return str.size(); |
| 123 | #endif |
| 124 | } |
| 125 | |
| 126 | // Breaks a string Tensor (represented as a TensorProto) as a vector of Event |
| 127 | // protos. |
no test coverage detected