| 38 | namespace one { |
| 39 | |
| 40 | Maybe<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 | |
| 49 | Maybe<void> Tensor::set_ref_tensor(const std::shared_ptr<Tensor>& ref) { |
| 50 | ref_tensor_ = ref; |