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

Method Init

tensorflow/core/distributed_runtime/rpc/grpc_util.cc:38–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36GrpcByteBufferSource::GrpcByteBufferSource() {}
37
38bool GrpcByteBufferSource::Init(const grpc::ByteBuffer& src) {
39 cur_ = -1;
40 left_ = 0;
41 ptr_ = nullptr;
42 byte_count_ = 0;
43 bool ok = src.Dump(&slices_).ok();
44 if (!ok) {
45 slices_.clear();
46 }
47 return ok;
48}
49
50bool GrpcByteBufferSource::Next(const void** data, int* size) {
51 // Use loop instead of if in case buffer contained empty slices.

Callers 2

GrpcMaybeParseProtoFunction · 0.45

Calls 3

okMethod · 0.45
DumpMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected