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

Method Transfer

tensorflow/compiler/xla/client/client.cc:41–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39Client::~Client() = default;
40
41StatusOr<Literal> Client::Transfer(const GlobalData& data,
42 const Shape* shape_with_layout) {
43 TransferToClientRequest request;
44 *request.mutable_data() = data.handle();
45 if (shape_with_layout != nullptr) {
46 *request.mutable_shape_with_layout() = shape_with_layout->ToProto();
47 }
48 TransferToClientResponse response;
49
50 VLOG(1) << "making transfer request";
51 VLOG(3) << "TransferToClientRequest: {" << request.DebugString() << "}";
52 Status s = stub_->TransferToClient(&request, &response);
53 VLOG(1) << "done with request";
54
55 if (!s.ok()) {
56 return s;
57 }
58 VLOG(3) << "TransferToClientResponse: {" << response.DebugString() << "}";
59
60 if (!response.has_literal()) {
61 return FailedPrecondition(
62 "server provided response without a literal in "
63 "TransferToClient request");
64 }
65 return Literal::CreateFromProto(*response.mutable_literal());
66}
67
68StatusOr<std::unique_ptr<GlobalData>> Client::TransferToServer(
69 const LiteralSlice& literal, const DeviceHandle* device_handle) {

Callers 12

TEST_FFunction · 0.80
TEST_FFunction · 0.80
TEST_FFunction · 0.80
XLA_TEST_FFunction · 0.80
RoundTripToServerMethod · 0.80
RoundTripTestMethod · 0.80
TEST_FFunction · 0.80
XLA_TEST_FFunction · 0.80

Calls 7

FailedPreconditionFunction · 0.85
mutable_dataMethod · 0.80
handleMethod · 0.45
ToProtoMethod · 0.45
DebugStringMethod · 0.45
TransferToClientMethod · 0.45
okMethod · 0.45

Tested by 12

TEST_FFunction · 0.64
TEST_FFunction · 0.64
TEST_FFunction · 0.64
XLA_TEST_FFunction · 0.64
RoundTripToServerMethod · 0.64
RoundTripTestMethod · 0.64
TEST_FFunction · 0.64
XLA_TEST_FFunction · 0.64