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

Method InitFrom

tensorflow/core/distributed_runtime/tensor_coding.cc:53–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53Status TensorResponse::InitFrom(RecvTensorResponse* response) {
54 Status s;
55 meta_.Swap(response);
56 if (on_host_) {
57 if (!tensor_.FromProto(allocator_, meta_.tensor())) {
58 s = errors::InvalidArgument("Cannot parse tensor from response");
59 }
60 } else {
61 s = device_->MakeTensorFromProto(meta_.tensor(), alloc_attrs_, &tensor_);
62 }
63 {
64 TensorProto empty;
65 meta_.mutable_tensor()->Swap(&empty);
66 }
67 meta_.clear_tensor();
68 return s;
69}
70
71void TensorResponse::InitPartial(const RecvTensorResponse& response,
72 const AllocationAttributes& allocation_attr) {

Callers

nothing calls this directly

Calls 5

InvalidArgumentFunction · 0.85
SwapMethod · 0.45
FromProtoMethod · 0.45
tensorMethod · 0.45
MakeTensorFromProtoMethod · 0.45

Tested by

no test coverage detected