| 455 | |
| 456 | virtual user_op::TensorDesc* mut_tensor_meta() override { return tensor_->mut_tensor_meta(); } |
| 457 | virtual Maybe<void> set_data(const std::shared_ptr<Tensor>& other) override { |
| 458 | bool old_requires_grad = tensor_->requires_grad(); |
| 459 | this->tensor_ = JUST(other->detach()); |
| 460 | JUST(this->tensor_->set_requires_grad(old_requires_grad)); |
| 461 | if (other->is_lazy()) { JUST(this->BorrowTensorName(other.get())); } |
| 462 | return Maybe<void>::Ok(); |
| 463 | } |
| 464 | |
| 465 | virtual Maybe<void> offload() override { |
| 466 | JUST(tensor_->offload()); |
nothing calls this directly
no test coverage detected