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

Method GetOutput

tensorflow/core/kernels/ops_testutil.cc:51–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51Tensor* OpsTestBase::GetOutput(int output_index) {
52 CHECK_LT(output_index, context_->num_outputs());
53 Tensor* output = context_->mutable_output(output_index);
54#ifdef GOOGLE_CUDA
55 if (device_type_ == DEVICE_GPU) {
56 managed_outputs_.resize(context_->num_outputs());
57 // Copy the output tensor to managed memory if we haven't done so.
58 if (!managed_outputs_[output_index]) {
59 Tensor* managed_output =
60 new Tensor(allocator(), output->dtype(), output->shape());
61 auto src = output->tensor_data();
62 auto dst = managed_output->tensor_data();
63 context_->eigen_gpu_device().memcpyDeviceToHost(
64 const_cast<char*>(dst.data()), src.data(), src.size());
65 context_->eigen_gpu_device().synchronize();
66 managed_outputs_[output_index] = managed_output;
67 }
68 output = managed_outputs_[output_index];
69 }
70#endif
71 return output;
72}
73
74} // namespace tensorflow

Callers

nothing calls this directly

Calls 8

tensor_dataMethod · 0.80
mutable_outputMethod · 0.60
num_outputsMethod · 0.45
resizeMethod · 0.45
dtypeMethod · 0.45
shapeMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected