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

Method copyToHostTensor

source/core/Tensor.cpp:187–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187bool 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
196Tensor* Tensor::createHostTensorFromDevice(const Tensor* device, bool copyContent) {
197 auto tensor = Tensor::create(device->shape(), device->getType(), nullptr, TensorUtils::getDimType(device));

Callers 15

updateRangeMethod · 0.80
updateDistributionMethod · 0.80
_initDebugFunction · 0.80
_countForTensorValidFunction · 0.80
mainFunction · 0.80
test_mainFunction · 0.80
initGetThresholdFunction · 0.80
initGetMaxValueFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
runMNNModelFunction · 0.80
runNetFunction · 0.80

Calls 2

getBackendMethod · 0.45
onCopyBufferMethod · 0.45

Tested by 11

mainFunction · 0.64
test_mainFunction · 0.64
mainFunction · 0.64
runMNNModelFunction · 0.64
runMethod · 0.64
_runMethod · 0.64
runMethod · 0.64
runMethod · 0.64
modelTestFunction · 0.64
modelTestWithConfigFunction · 0.64
testSessionConfigFunction · 0.64