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

Method RecvTensor

tensorflow/compiler/xrt/client/xrt_tf_client.cc:352–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350}
351
352std::shared_ptr<XrtRecvTensorFuture> XrtTfContext::RecvTensor(
353 const XrtTensorHandle& tensor, DataType dtype, bool host_memory) {
354 auto response = std::make_shared<XrtRecvTensorFuture>();
355
356 int device_id = tensor.device_id();
357
358 std::string wire_id = XrtGetUniqueWireID();
359 EnqueueSend(this, tensor, dtype, /*recv_device_id=*/-1, wire_id,
360 /*host_memory=*/host_memory, /*future=*/response);
361
362 const DeviceAttributes& device = devices().at(device_id);
363 RecvTensorRequest request;
364 request.set_step_id(rendezvous_id_);
365 request.set_rendezvous_key(GetRendezvousKey(device.name(),
366 GetReceiverDevice(this, -1),
367 device.incarnation(), wire_id));
368 request.set_request_id(GetUniqueRequestId());
369 // TODO(phawkins): verify uniqueness of request ID. Random IDs won't collide
370 // with high probability, but we should probably add code to guard against
371 // collisions nonetheless.
372
373 eager_client_->RecvTensorAsync(
374 &request, &response->value_,
375 [response, wire_id](Status status) {
376 VLOG(10) << "RecvTensor complete for " << wire_id;
377 response->Notify(status);
378 },
379 &response->call_options_);
380 return response;
381}
382
383Status XrtTfContext::RegisterFunction(const FunctionDef& def) {
384 eager::RegisterFunctionRequest request;

Callers 3

ToLiteralMethod · 0.80
InitializeTPUMethod · 0.80
TEST_FFunction · 0.80

Calls 13

XrtGetUniqueWireIDFunction · 0.85
EnqueueSendFunction · 0.85
GetReceiverDeviceFunction · 0.85
GetUniqueRequestIdFunction · 0.85
set_step_idMethod · 0.80
incarnationMethod · 0.80
set_request_idMethod · 0.80
GetRendezvousKeyFunction · 0.70
nameMethod · 0.65
device_idMethod · 0.45
atMethod · 0.45
RecvTensorAsyncMethod · 0.45

Tested by 1

TEST_FFunction · 0.64