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

Method allocTensor

source/geometry/GeometryComputer.cpp:64–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64bool GeometryComputer::Context::allocTensor(Tensor* tensor) {
65 auto res = mBackend->onAcquireBuffer(tensor, Backend::STATIC);
66 if (!res) {
67 return false;
68 }
69 TensorUtils::getDescribe(tensor)->usage = Tensor::InsideDescribe::CONSTANT;
70 TensorUtils::getDescribeOrigin(tensor)->setBackend(mBackend.get());
71 return true;
72}
73
74inline bool _hasZeroDim(const Tensor* t) {
75

Callers 9

onComputeMethod · 0.80
onComputeMethod · 0.80
buildScatterNDFunction · 0.80
onComputeMethod · 0.80
onComputeMethod · 0.80
onComputeMethod · 0.80
onComputeMethod · 0.80
buildGatherNDMethod · 0.80
onRecomputeMethod · 0.80

Calls 3

onAcquireBufferMethod · 0.80
setBackendMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected