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

Method SetTensor

tensorflow/core/common_runtime/eager/tensor_handle.cc:441–456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

439#endif
440
441Status TensorHandle::SetTensor(const tensorflow::Tensor& tensor) {
442 DCHECK(!is_remote_) << "SetTensor is not called on remote handles.";
443 DCHECK(!is_ready_notification_.HasBeenNotified())
444 << "SetTensor is only called on non-ready handles.";
445
446 VLOG(3) << "SetTensor on TensorHandle: " << this;
447
448 if (tensor.dtype() == DT_RESOURCE) {
449 auto& resource_handle = tensor.flat<class ResourceHandle>()(0);
450 handle_dtypes_and_shapes_ = resource_handle.dtypes_and_shapes();
451 }
452 tensor_handle_data_ = absl::make_unique<LocalTensorHandleData>(tensor);
453 is_poisoned_ = Status::OK();
454 is_ready_notification_.Notify();
455 return Status::OK();
456}
457
458void TensorHandle::Poison(Status status) {
459 DCHECK(!is_ready_notification_.HasBeenNotified())

Callers 3

RunMethod · 0.45
EagerKernelExecuteFunction · 0.45
StartRecvMethod · 0.45

Calls 4

HasBeenNotifiedMethod · 0.80
dtypes_and_shapesMethod · 0.80
dtypeMethod · 0.45
NotifyMethod · 0.45

Tested by

no test coverage detected