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

Function _getDataType

tools/cpp/GetMNNInfo.cpp:24–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22using namespace MNN::Express;
23using namespace MNN;
24static std::string _getDataType(const halide_type_t& type) {
25 switch (type.code) {
26 case halide_type_float:
27 if (type.bits == 32) {
28 return "float";
29 }
30 if (type.bits == 16) {
31 return "half";
32 }
33 break;
34 case halide_type_uint:
35 if (type.bits == 32) {
36 return "uint32";
37 }
38 if (type.bits == 16) {
39 return "uint16";
40 }
41 if (type.bits == 8) {
42 return "uint8";
43 }
44 break;
45 case halide_type_int:
46 if (type.bits == 32) {
47 return "int32";
48 }
49 if (type.bits == 16) {
50 return "int16";
51 }
52 if (type.bits == 8) {
53 return "int8";
54 }
55 break;
56 default:
57 break;
58 }
59 return "Unknown";
60}
61static std::string _getFormatString(Dimensionformat format) {
62 switch (format) {
63 case MNN::Express::NCHW:

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected