| 1291 | } |
| 1292 | |
| 1293 | void* Tensor::data() const { |
| 1294 | if (buf_ == nullptr) return nullptr; // Don't die for empty tensors |
| 1295 | return static_cast<void*>(buf_->data()); |
| 1296 | } |
| 1297 | |
| 1298 | bool Tensor::SharesBufferWith(const Tensor& b) const { |
| 1299 | return buf_ != nullptr && b.buf_ != nullptr && |
no outgoing calls