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

Function createTensor

tools/cpp/testModelWithDescribe.cpp:91–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91MNN::Tensor* createTensor(const MNN::Tensor* shape, const std::string name) {
92 auto result = new MNN::Tensor(shape, shape->getDimensionType());
93 result->buffer().type = shape->buffer().type;
94 if (!loadData(name, result->host<void>(), result->elementSize(), result->getType())) {
95 return result;
96 }
97 delete result;
98 return NULL;
99}
100
101VARP createVar(const std::string name, INTS shape, halide_type_t dtype) {
102 int size = 1;

Callers 1

mainFunction · 0.70

Calls 4

loadDataFunction · 0.85
getDimensionTypeMethod · 0.80
bufferMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected