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

Method TensorDebugString

tensorflow/core/common_runtime/ring_alg.cc:252–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252string RingAlg::TensorDebugString(const Tensor& tensor) {
253 const DeviceBase::GpuDeviceInfo* gpu_device_info =
254 col_ctx_->op_ctx->device()->tensorflow_gpu_device_info();
255 if (gpu_device_info) {
256 Tensor cpu_tensor(tensor.dtype(), tensor.shape());
257 Notification note;
258 gpu_device_info->default_context->CopyDeviceTensorToCPU(
259 &tensor, "" /*tensor_name*/, col_ctx_->device, &cpu_tensor,
260 [&note](const Status& s) {
261 DCHECK(s.ok());
262 note.Notify();
263 });
264 note.WaitForNotification();
265 return cpu_tensor.SummarizeValue(64);
266 } else {
267 return tensor.SummarizeValue(64);
268 }
269}
270
271void RingAlg::StartAbort(const Status& s) {
272 // In abort mode we stop issuing additional ProvideBuf

Callers

nothing calls this directly

Calls 9

SummarizeValueMethod · 0.80
deviceMethod · 0.45
dtypeMethod · 0.45
shapeMethod · 0.45
CopyDeviceTensorToCPUMethod · 0.45
okMethod · 0.45
NotifyMethod · 0.45
WaitForNotificationMethod · 0.45

Tested by

no test coverage detected