| 185 | } |
| 186 | |
| 187 | bool Tensor::copyToHostTensor(Tensor* hostTensor) const { |
| 188 | auto bn = mDescribe->getBackend(); |
| 189 | if (nullptr == bn) { |
| 190 | return false; |
| 191 | } |
| 192 | bn->onCopyBuffer(this, hostTensor); |
| 193 | return true; |
| 194 | } |
| 195 | |
| 196 | Tensor* Tensor::createHostTensorFromDevice(const Tensor* device, bool copyContent) { |
| 197 | auto tensor = Tensor::create(device->shape(), device->getType(), nullptr, TensorUtils::getDimType(device)); |