1 // clang-format off
2 // Generated file (from: mean.mod.py). Do not edit
3 // Create the model
createTestModel()4 Model createTestModel() {
5 const std::vector<Operand> operands = {
6 {
7 .type = OperandType::TENSOR_FLOAT32,
8 .dimensions = {1, 2, 2, 1},
9 .numberOfConsumers = 1,
10 .scale = 0.0f,
11 .zeroPoint = 0,
12 .lifetime = OperandLifeTime::MODEL_INPUT,
13 .location = {.poolIndex = 0, .offset = 0, .length = 0},
14 },
15 {
16 .type = OperandType::TENSOR_INT32,
17 .dimensions = {1},
18 .numberOfConsumers = 1,
19 .scale = 0.0f,
20 .zeroPoint = 0,
21 .lifetime = OperandLifeTime::CONSTANT_COPY,
22 .location = {.poolIndex = 0, .offset = 0, .length = 4},
23 },
24 {
25 .type = OperandType::INT32,
26 .dimensions = {},
27 .numberOfConsumers = 1,
28 .scale = 0.0f,
29 .zeroPoint = 0,
30 .lifetime = OperandLifeTime::CONSTANT_COPY,
31 .location = {.poolIndex = 0, .offset = 4, .length = 4},
32 },
33 {
34 .type = OperandType::TENSOR_FLOAT32,
35 .dimensions = {1, 2, 1},
36 .numberOfConsumers = 0,
37 .scale = 0.0f,
38 .zeroPoint = 0,
39 .lifetime = OperandLifeTime::MODEL_OUTPUT,
40 .location = {.poolIndex = 0, .offset = 0, .length = 0},
41 }
42 };
43
44 const std::vector<Operation> operations = {
45 {
46 .type = OperationType::MEAN,
47 .inputs = {0, 1, 2},
48 .outputs = {3},
49 }
50 };
51
52 const std::vector<uint32_t> inputIndexes = {0};
53 const std::vector<uint32_t> outputIndexes = {3};
54 std::vector<uint8_t> operandValues = {
55 2, 0, 0, 0, 0, 0, 0, 0
56 };
57 const std::vector<hidl_memory> pools = {};
58
59 return {
60 .operands = operands,
61 .operations = operations,
62 .inputIndexes = inputIndexes,
63 .outputIndexes = outputIndexes,
64 .operandValues = operandValues,
65 .pools = pools,
66 };
67 }
68
is_ignored(int i)69 inline bool is_ignored(int i) {
70 static std::set<int> ignore = {};
71 return ignore.find(i) != ignore.end();
72 }
73
74 // Create the model
createTestModel_dynamic_output_shape()75 Model createTestModel_dynamic_output_shape() {
76 const std::vector<Operand> operands = {
77 {
78 .type = OperandType::TENSOR_FLOAT32,
79 .dimensions = {1, 2, 2, 1},
80 .numberOfConsumers = 1,
81 .scale = 0.0f,
82 .zeroPoint = 0,
83 .lifetime = OperandLifeTime::MODEL_INPUT,
84 .location = {.poolIndex = 0, .offset = 0, .length = 0},
85 },
86 {
87 .type = OperandType::TENSOR_INT32,
88 .dimensions = {1},
89 .numberOfConsumers = 1,
90 .scale = 0.0f,
91 .zeroPoint = 0,
92 .lifetime = OperandLifeTime::CONSTANT_COPY,
93 .location = {.poolIndex = 0, .offset = 0, .length = 4},
94 },
95 {
96 .type = OperandType::INT32,
97 .dimensions = {},
98 .numberOfConsumers = 1,
99 .scale = 0.0f,
100 .zeroPoint = 0,
101 .lifetime = OperandLifeTime::CONSTANT_COPY,
102 .location = {.poolIndex = 0, .offset = 4, .length = 4},
103 },
104 {
105 .type = OperandType::TENSOR_FLOAT32,
106 .dimensions = {0, 0, 0},
107 .numberOfConsumers = 0,
108 .scale = 0.0f,
109 .zeroPoint = 0,
110 .lifetime = OperandLifeTime::MODEL_OUTPUT,
111 .location = {.poolIndex = 0, .offset = 0, .length = 0},
112 }
113 };
114
115 const std::vector<Operation> operations = {
116 {
117 .type = OperationType::MEAN,
118 .inputs = {0, 1, 2},
119 .outputs = {3},
120 }
121 };
122
123 const std::vector<uint32_t> inputIndexes = {0};
124 const std::vector<uint32_t> outputIndexes = {3};
125 std::vector<uint8_t> operandValues = {
126 2, 0, 0, 0, 0, 0, 0, 0
127 };
128 const std::vector<hidl_memory> pools = {};
129
130 return {
131 .operands = operands,
132 .operations = operations,
133 .inputIndexes = inputIndexes,
134 .outputIndexes = outputIndexes,
135 .operandValues = operandValues,
136 .pools = pools,
137 };
138 }
139
is_ignored_dynamic_output_shape(int i)140 inline bool is_ignored_dynamic_output_shape(int i) {
141 static std::set<int> ignore = {};
142 return ignore.find(i) != ignore.end();
143 }
144
145