MCPcopy Create free account
hub / github.com/alibaba/MNN / createHostTensorFromDevice

Method createHostTensorFromDevice

source/core/Tensor.cpp:196–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196Tensor* Tensor::createHostTensorFromDevice(const Tensor* device, bool copyContent) {
197 auto tensor = Tensor::create(device->shape(), device->getType(), nullptr, TensorUtils::getDimType(device));
198 if (copyContent) {
199 device->copyToHostTensor(tensor);
200 }
201 return tensor;
202}
203
204Tensor::DimensionType Tensor::getDimensionType() const {
205 auto nativeDescribe = mDescribe->mContent.get();

Callers 2

printMethod · 0.95
createHostPlanarFunction · 0.80

Calls 4

shapeMethod · 0.80
copyToHostTensorMethod · 0.80
createFunction · 0.50
getTypeMethod · 0.45

Tested by

no test coverage detected