1 // Generated from mean.mod.py
2 // DO NOT EDIT
3 // clang-format off
4 #include "TestHarness.h"
5 using namespace test_helper;
6
7 namespace generated_tests::mean {
8
get_test_model()9 const TestModel& get_test_model() {
10 static TestModel model = {
11 .expectFailure = false,
12 .expectedMultinomialDistributionTolerance = 0,
13 .isRelaxed = false,
14 .main = {
15 .inputIndexes = {0},
16 .operands = {{ // input
17 .channelQuant = {},
18 .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}),
19 .dimensions = {1, 2, 2, 1},
20 .isIgnored = false,
21 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
22 .numberOfConsumers = 1,
23 .scale = 0.0f,
24 .type = TestOperandType::TENSOR_FLOAT32,
25 .zeroPoint = 0
26 }, { // axis
27 .channelQuant = {},
28 .data = TestBuffer::createFromVector<int32_t>({2}),
29 .dimensions = {1},
30 .isIgnored = false,
31 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
32 .numberOfConsumers = 1,
33 .scale = 0.0f,
34 .type = TestOperandType::TENSOR_INT32,
35 .zeroPoint = 0
36 }, { // keepDims
37 .channelQuant = {},
38 .data = TestBuffer::createFromVector<int32_t>({0}),
39 .dimensions = {},
40 .isIgnored = false,
41 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
42 .numberOfConsumers = 1,
43 .scale = 0.0f,
44 .type = TestOperandType::INT32,
45 .zeroPoint = 0
46 }, { // output
47 .channelQuant = {},
48 .data = TestBuffer::createFromVector<float>({1.5f, 3.5f}),
49 .dimensions = {1, 2, 1},
50 .isIgnored = false,
51 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
52 .numberOfConsumers = 0,
53 .scale = 0.0f,
54 .type = TestOperandType::TENSOR_FLOAT32,
55 .zeroPoint = 0
56 }},
57 .operations = {{
58 .inputs = {0, 1, 2},
59 .outputs = {3},
60 .type = TestOperationType::MEAN
61 }},
62 .outputIndexes = {3}
63 },
64 .minSupportedVersion = TestHalVersion::V1_1,
65 .referenced = {}
66 };
67 return model;
68 }
69
70 const auto dummy_test_model = TestModelManager::get().add("mean", get_test_model());
71
72 } // namespace generated_tests::mean
73
74 namespace generated_tests::mean {
75
get_test_model_all_inputs_as_internal()76 const TestModel& get_test_model_all_inputs_as_internal() {
77 static TestModel model = {
78 .expectFailure = false,
79 .expectedMultinomialDistributionTolerance = 0,
80 .isRelaxed = false,
81 .main = {
82 .inputIndexes = {4},
83 .operands = {{ // input
84 .channelQuant = {},
85 .data = TestBuffer::createFromVector<float>({}),
86 .dimensions = {1, 2, 2, 1},
87 .isIgnored = false,
88 .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
89 .numberOfConsumers = 1,
90 .scale = 0.0f,
91 .type = TestOperandType::TENSOR_FLOAT32,
92 .zeroPoint = 0
93 }, { // axis
94 .channelQuant = {},
95 .data = TestBuffer::createFromVector<int32_t>({2}),
96 .dimensions = {1},
97 .isIgnored = false,
98 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
99 .numberOfConsumers = 1,
100 .scale = 0.0f,
101 .type = TestOperandType::TENSOR_INT32,
102 .zeroPoint = 0
103 }, { // keepDims
104 .channelQuant = {},
105 .data = TestBuffer::createFromVector<int32_t>({0}),
106 .dimensions = {},
107 .isIgnored = false,
108 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
109 .numberOfConsumers = 1,
110 .scale = 0.0f,
111 .type = TestOperandType::INT32,
112 .zeroPoint = 0
113 }, { // output
114 .channelQuant = {},
115 .data = TestBuffer::createFromVector<float>({1.5f, 3.5f}),
116 .dimensions = {1, 2, 1},
117 .isIgnored = false,
118 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
119 .numberOfConsumers = 0,
120 .scale = 0.0f,
121 .type = TestOperandType::TENSOR_FLOAT32,
122 .zeroPoint = 0
123 }, { // input_new
124 .channelQuant = {},
125 .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}),
126 .dimensions = {1, 2, 2, 1},
127 .isIgnored = false,
128 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
129 .numberOfConsumers = 1,
130 .scale = 0.0f,
131 .type = TestOperandType::TENSOR_FLOAT32,
132 .zeroPoint = 0
133 }, { // dummy
134 .channelQuant = {},
135 .data = TestBuffer::createFromVector<float>({0.0f}),
136 .dimensions = {1},
137 .isIgnored = false,
138 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
139 .numberOfConsumers = 1,
140 .scale = 0.0f,
141 .type = TestOperandType::TENSOR_FLOAT32,
142 .zeroPoint = 0
143 }, { // param
144 .channelQuant = {},
145 .data = TestBuffer::createFromVector<int32_t>({0}),
146 .dimensions = {},
147 .isIgnored = false,
148 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
149 .numberOfConsumers = 1,
150 .scale = 0.0f,
151 .type = TestOperandType::INT32,
152 .zeroPoint = 0
153 }},
154 .operations = {{
155 .inputs = {4, 5, 6},
156 .outputs = {0},
157 .type = TestOperationType::ADD
158 }, {
159 .inputs = {0, 1, 2},
160 .outputs = {3},
161 .type = TestOperationType::MEAN
162 }},
163 .outputIndexes = {3}
164 },
165 .minSupportedVersion = TestHalVersion::V1_1,
166 .referenced = {}
167 };
168 return model;
169 }
170
171 const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add("mean_all_inputs_as_internal", get_test_model_all_inputs_as_internal());
172
173 } // namespace generated_tests::mean
174
175 namespace generated_tests::mean {
176
get_test_model_all_tensors_as_inputs()177 const TestModel& get_test_model_all_tensors_as_inputs() {
178 static TestModel model = {
179 .expectFailure = false,
180 .expectedMultinomialDistributionTolerance = 0,
181 .isRelaxed = false,
182 .main = {
183 .inputIndexes = {0, 1},
184 .operands = {{ // input
185 .channelQuant = {},
186 .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}),
187 .dimensions = {1, 2, 2, 1},
188 .isIgnored = false,
189 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
190 .numberOfConsumers = 1,
191 .scale = 0.0f,
192 .type = TestOperandType::TENSOR_FLOAT32,
193 .zeroPoint = 0
194 }, { // axis
195 .channelQuant = {},
196 .data = TestBuffer::createFromVector<int32_t>({2}),
197 .dimensions = {1},
198 .isIgnored = false,
199 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
200 .numberOfConsumers = 1,
201 .scale = 0.0f,
202 .type = TestOperandType::TENSOR_INT32,
203 .zeroPoint = 0
204 }, { // keepDims
205 .channelQuant = {},
206 .data = TestBuffer::createFromVector<int32_t>({0}),
207 .dimensions = {},
208 .isIgnored = false,
209 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
210 .numberOfConsumers = 1,
211 .scale = 0.0f,
212 .type = TestOperandType::INT32,
213 .zeroPoint = 0
214 }, { // output
215 .channelQuant = {},
216 .data = TestBuffer::createFromVector<float>({1.5f, 3.5f}),
217 .dimensions = {1, 2, 1},
218 .isIgnored = false,
219 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
220 .numberOfConsumers = 0,
221 .scale = 0.0f,
222 .type = TestOperandType::TENSOR_FLOAT32,
223 .zeroPoint = 0
224 }},
225 .operations = {{
226 .inputs = {0, 1, 2},
227 .outputs = {3},
228 .type = TestOperationType::MEAN
229 }},
230 .outputIndexes = {3}
231 },
232 .minSupportedVersion = TestHalVersion::V1_1,
233 .referenced = {}
234 };
235 return model;
236 }
237
238 const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("mean_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs());
239
240 } // namespace generated_tests::mean
241
242 namespace generated_tests::mean {
243
get_test_model_all_tensors_as_inputs_all_inputs_as_internal()244 const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() {
245 static TestModel model = {
246 .expectFailure = false,
247 .expectedMultinomialDistributionTolerance = 0,
248 .isRelaxed = false,
249 .main = {
250 .inputIndexes = {1, 4},
251 .operands = {{ // input
252 .channelQuant = {},
253 .data = TestBuffer::createFromVector<float>({}),
254 .dimensions = {1, 2, 2, 1},
255 .isIgnored = false,
256 .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
257 .numberOfConsumers = 1,
258 .scale = 0.0f,
259 .type = TestOperandType::TENSOR_FLOAT32,
260 .zeroPoint = 0
261 }, { // axis
262 .channelQuant = {},
263 .data = TestBuffer::createFromVector<int32_t>({2}),
264 .dimensions = {1},
265 .isIgnored = false,
266 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
267 .numberOfConsumers = 1,
268 .scale = 0.0f,
269 .type = TestOperandType::TENSOR_INT32,
270 .zeroPoint = 0
271 }, { // keepDims
272 .channelQuant = {},
273 .data = TestBuffer::createFromVector<int32_t>({0}),
274 .dimensions = {},
275 .isIgnored = false,
276 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
277 .numberOfConsumers = 1,
278 .scale = 0.0f,
279 .type = TestOperandType::INT32,
280 .zeroPoint = 0
281 }, { // output
282 .channelQuant = {},
283 .data = TestBuffer::createFromVector<float>({1.5f, 3.5f}),
284 .dimensions = {1, 2, 1},
285 .isIgnored = false,
286 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
287 .numberOfConsumers = 0,
288 .scale = 0.0f,
289 .type = TestOperandType::TENSOR_FLOAT32,
290 .zeroPoint = 0
291 }, { // input_new
292 .channelQuant = {},
293 .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}),
294 .dimensions = {1, 2, 2, 1},
295 .isIgnored = false,
296 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
297 .numberOfConsumers = 1,
298 .scale = 0.0f,
299 .type = TestOperandType::TENSOR_FLOAT32,
300 .zeroPoint = 0
301 }, { // dummy1
302 .channelQuant = {},
303 .data = TestBuffer::createFromVector<float>({0.0f}),
304 .dimensions = {1},
305 .isIgnored = false,
306 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
307 .numberOfConsumers = 1,
308 .scale = 0.0f,
309 .type = TestOperandType::TENSOR_FLOAT32,
310 .zeroPoint = 0
311 }, { // param1
312 .channelQuant = {},
313 .data = TestBuffer::createFromVector<int32_t>({0}),
314 .dimensions = {},
315 .isIgnored = false,
316 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
317 .numberOfConsumers = 1,
318 .scale = 0.0f,
319 .type = TestOperandType::INT32,
320 .zeroPoint = 0
321 }},
322 .operations = {{
323 .inputs = {4, 5, 6},
324 .outputs = {0},
325 .type = TestOperationType::ADD
326 }, {
327 .inputs = {0, 1, 2},
328 .outputs = {3},
329 .type = TestOperationType::MEAN
330 }},
331 .outputIndexes = {3}
332 },
333 .minSupportedVersion = TestHalVersion::V1_1,
334 .referenced = {}
335 };
336 return model;
337 }
338
339 const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("mean_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal());
340
341 } // namespace generated_tests::mean
342
343