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

Function createVar

tools/cpp/testModelWithDescribe.cpp:101–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101VARP createVar(const std::string name, INTS shape, halide_type_t dtype) {
102 int size = 1;
103 for (int dim : shape) {
104 size *= dim;
105 }
106 std::unique_ptr<char[]> data(new char[size * dtype.bytes()]);
107 loadData(name, data.get(), size, dtype);
108 return _Const(data.get(), shape, NHWC, dtype);
109}
110
111template <typename T>
112bool compareVar(VARP var, std::string name) {

Callers 2

compareVarFunction · 0.85
mainFunction · 0.85

Calls 4

loadDataFunction · 0.85
_ConstFunction · 0.85
bytesMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected