MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / MakeProto

Function MakeProto

tensorflow/core/distributed_runtime/rpc/grpc_util_test.cc:51–62  ·  view source on GitHub ↗

Make a proto with approximately the specified length.

Source from the content-addressed store, hash-verified

49
50// Make a proto with approximately the specified length.
51CleanupAllRequest MakeProto(int size) {
52 int approx_size = 0;
53 CleanupAllRequest proto;
54 int index = 0;
55 while (approx_size < size) {
56 int item_size = std::min(size - approx_size, 1024);
57 proto.add_container(string(item_size, 'a' + static_cast<char>(index % 26)));
58 approx_size += item_size + 3; // +3 for encoding overhead.
59 index++;
60 }
61 return proto;
62}
63} // namespace
64
65TEST(GrpcProto, Unparse) {

Callers 5

TESTFunction · 0.85
BM_UnparseGrpcFunction · 0.85
BM_UnparseStringFunction · 0.85
BM_ParseGrpcFunction · 0.85
BM_ParseStringFunction · 0.85

Calls 1

minFunction · 0.50

Tested by

no test coverage detected