MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / BorrowTensorName

Method BorrowTensorName

oneflow/core/framework/tensor.cpp:40–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38namespace one {
39
40Maybe<void> Tensor::BorrowTensorName(const Tensor* other) const {
41 CHECK_OR_RETURN(other->is_lazy())
42 << Error::RuntimeError() << "can not borrow tensor name from an eager tensor";
43 const auto& lbn = TensorNameScope::Global()->Lookup(other);
44 CHECK_OR_RETURN(!lbn.empty()) << "the input lazy tensor has no tensor name";
45 TensorNameScope::Global()->Record(this, lbn);
46 return Maybe<void>::Ok();
47}
48
49Maybe<void> Tensor::set_ref_tensor(const std::shared_ptr<Tensor>& ref) {
50 ref_tensor_ = ref;

Callers 4

detachMethod · 0.80
set_dataMethod · 0.80
ProxyTensorMethod · 0.80
set_dataMethod · 0.80

Calls 4

RecordMethod · 0.80
is_lazyMethod · 0.45
LookupMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected