1 // clang-format off
2 // Generated file (from: l2_normalization_axis.mod.py). Do not edit
CreateModel_dim4_axis0(Model * model)3 void CreateModel_dim4_axis0(Model *model) {
4 OperandType type1(Type::INT32, {});
5 OperandType type2(Type::TENSOR_FLOAT32, {3, 2, 2, 2});
6 // Phase 1, operands
7 auto op1 = model->addOperand(&type2);
8 auto axis = model->addOperand(&type1);
9 auto op2 = model->addOperand(&type2);
10 // Phase 2, operations
11 static int32_t axis_init[] = {0};
12 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
13 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
14 // Phase 3, inputs and outputs
15 model->identifyInputsAndOutputs(
16 {op1},
17 {op2});
18 assert(model->isValid());
19 }
20
is_ignored_dim4_axis0(int i)21 inline bool is_ignored_dim4_axis0(int i) {
22 static std::set<int> ignore = {};
23 return ignore.find(i) != ignore.end();
24 }
25
CreateModel_dim4_axis0_relaxed(Model * model)26 void CreateModel_dim4_axis0_relaxed(Model *model) {
27 OperandType type1(Type::INT32, {});
28 OperandType type2(Type::TENSOR_FLOAT32, {3, 2, 2, 2});
29 // Phase 1, operands
30 auto op1 = model->addOperand(&type2);
31 auto axis = model->addOperand(&type1);
32 auto op2 = model->addOperand(&type2);
33 // Phase 2, operations
34 static int32_t axis_init[] = {0};
35 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
36 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
37 // Phase 3, inputs and outputs
38 model->identifyInputsAndOutputs(
39 {op1},
40 {op2});
41 // Phase 4: set relaxed execution
42 model->relaxComputationFloat32toFloat16(true);
43 assert(model->isValid());
44 }
45
is_ignored_dim4_axis0_relaxed(int i)46 inline bool is_ignored_dim4_axis0_relaxed(int i) {
47 static std::set<int> ignore = {};
48 return ignore.find(i) != ignore.end();
49 }
50
CreateModel_dim4_axis0_float16(Model * model)51 void CreateModel_dim4_axis0_float16(Model *model) {
52 OperandType type1(Type::INT32, {});
53 OperandType type3(Type::TENSOR_FLOAT16, {3, 2, 2, 2});
54 // Phase 1, operands
55 auto op1 = model->addOperand(&type3);
56 auto axis = model->addOperand(&type1);
57 auto op2 = model->addOperand(&type3);
58 // Phase 2, operations
59 static int32_t axis_init[] = {0};
60 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
61 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
62 // Phase 3, inputs and outputs
63 model->identifyInputsAndOutputs(
64 {op1},
65 {op2});
66 assert(model->isValid());
67 }
68
is_ignored_dim4_axis0_float16(int i)69 inline bool is_ignored_dim4_axis0_float16(int i) {
70 static std::set<int> ignore = {};
71 return ignore.find(i) != ignore.end();
72 }
73
CreateModel_dim4_axis0_quant8(Model * model)74 void CreateModel_dim4_axis0_quant8(Model *model) {
75 OperandType type1(Type::INT32, {});
76 OperandType type4(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2, 2}, 0.1f, 32);
77 OperandType type5(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2, 2}, 0.0078125f, 128);
78 // Phase 1, operands
79 auto op1 = model->addOperand(&type4);
80 auto axis = model->addOperand(&type1);
81 auto op2 = model->addOperand(&type5);
82 // Phase 2, operations
83 static int32_t axis_init[] = {0};
84 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
85 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
86 // Phase 3, inputs and outputs
87 model->identifyInputsAndOutputs(
88 {op1},
89 {op2});
90 assert(model->isValid());
91 }
92
is_ignored_dim4_axis0_quant8(int i)93 inline bool is_ignored_dim4_axis0_quant8(int i) {
94 static std::set<int> ignore = {};
95 return ignore.find(i) != ignore.end();
96 }
97
CreateModel_dim4_axis0_neg(Model * model)98 void CreateModel_dim4_axis0_neg(Model *model) {
99 OperandType type1(Type::INT32, {});
100 OperandType type2(Type::TENSOR_FLOAT32, {3, 2, 2, 2});
101 // Phase 1, operands
102 auto op1 = model->addOperand(&type2);
103 auto axis = model->addOperand(&type1);
104 auto op2 = model->addOperand(&type2);
105 // Phase 2, operations
106 static int32_t axis_init[] = {-4};
107 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
108 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
109 // Phase 3, inputs and outputs
110 model->identifyInputsAndOutputs(
111 {op1},
112 {op2});
113 assert(model->isValid());
114 }
115
is_ignored_dim4_axis0_neg(int i)116 inline bool is_ignored_dim4_axis0_neg(int i) {
117 static std::set<int> ignore = {};
118 return ignore.find(i) != ignore.end();
119 }
120
CreateModel_dim4_axis0_neg_relaxed(Model * model)121 void CreateModel_dim4_axis0_neg_relaxed(Model *model) {
122 OperandType type1(Type::INT32, {});
123 OperandType type2(Type::TENSOR_FLOAT32, {3, 2, 2, 2});
124 // Phase 1, operands
125 auto op1 = model->addOperand(&type2);
126 auto axis = model->addOperand(&type1);
127 auto op2 = model->addOperand(&type2);
128 // Phase 2, operations
129 static int32_t axis_init[] = {-4};
130 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
131 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
132 // Phase 3, inputs and outputs
133 model->identifyInputsAndOutputs(
134 {op1},
135 {op2});
136 // Phase 4: set relaxed execution
137 model->relaxComputationFloat32toFloat16(true);
138 assert(model->isValid());
139 }
140
is_ignored_dim4_axis0_neg_relaxed(int i)141 inline bool is_ignored_dim4_axis0_neg_relaxed(int i) {
142 static std::set<int> ignore = {};
143 return ignore.find(i) != ignore.end();
144 }
145
CreateModel_dim4_axis0_neg_float16(Model * model)146 void CreateModel_dim4_axis0_neg_float16(Model *model) {
147 OperandType type1(Type::INT32, {});
148 OperandType type3(Type::TENSOR_FLOAT16, {3, 2, 2, 2});
149 // Phase 1, operands
150 auto op1 = model->addOperand(&type3);
151 auto axis = model->addOperand(&type1);
152 auto op2 = model->addOperand(&type3);
153 // Phase 2, operations
154 static int32_t axis_init[] = {-4};
155 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
156 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
157 // Phase 3, inputs and outputs
158 model->identifyInputsAndOutputs(
159 {op1},
160 {op2});
161 assert(model->isValid());
162 }
163
is_ignored_dim4_axis0_neg_float16(int i)164 inline bool is_ignored_dim4_axis0_neg_float16(int i) {
165 static std::set<int> ignore = {};
166 return ignore.find(i) != ignore.end();
167 }
168
CreateModel_dim4_axis0_neg_quant8(Model * model)169 void CreateModel_dim4_axis0_neg_quant8(Model *model) {
170 OperandType type1(Type::INT32, {});
171 OperandType type4(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2, 2}, 0.1f, 32);
172 OperandType type5(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2, 2}, 0.0078125f, 128);
173 // Phase 1, operands
174 auto op1 = model->addOperand(&type4);
175 auto axis = model->addOperand(&type1);
176 auto op2 = model->addOperand(&type5);
177 // Phase 2, operations
178 static int32_t axis_init[] = {-4};
179 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
180 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
181 // Phase 3, inputs and outputs
182 model->identifyInputsAndOutputs(
183 {op1},
184 {op2});
185 assert(model->isValid());
186 }
187
is_ignored_dim4_axis0_neg_quant8(int i)188 inline bool is_ignored_dim4_axis0_neg_quant8(int i) {
189 static std::set<int> ignore = {};
190 return ignore.find(i) != ignore.end();
191 }
192
CreateModel_dim4_axis1(Model * model)193 void CreateModel_dim4_axis1(Model *model) {
194 OperandType type1(Type::INT32, {});
195 OperandType type6(Type::TENSOR_FLOAT32, {2, 3, 2, 2});
196 // Phase 1, operands
197 auto op1 = model->addOperand(&type6);
198 auto axis = model->addOperand(&type1);
199 auto op2 = model->addOperand(&type6);
200 // Phase 2, operations
201 static int32_t axis_init[] = {1};
202 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
203 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
204 // Phase 3, inputs and outputs
205 model->identifyInputsAndOutputs(
206 {op1},
207 {op2});
208 assert(model->isValid());
209 }
210
is_ignored_dim4_axis1(int i)211 inline bool is_ignored_dim4_axis1(int i) {
212 static std::set<int> ignore = {};
213 return ignore.find(i) != ignore.end();
214 }
215
CreateModel_dim4_axis1_relaxed(Model * model)216 void CreateModel_dim4_axis1_relaxed(Model *model) {
217 OperandType type1(Type::INT32, {});
218 OperandType type6(Type::TENSOR_FLOAT32, {2, 3, 2, 2});
219 // Phase 1, operands
220 auto op1 = model->addOperand(&type6);
221 auto axis = model->addOperand(&type1);
222 auto op2 = model->addOperand(&type6);
223 // Phase 2, operations
224 static int32_t axis_init[] = {1};
225 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
226 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
227 // Phase 3, inputs and outputs
228 model->identifyInputsAndOutputs(
229 {op1},
230 {op2});
231 // Phase 4: set relaxed execution
232 model->relaxComputationFloat32toFloat16(true);
233 assert(model->isValid());
234 }
235
is_ignored_dim4_axis1_relaxed(int i)236 inline bool is_ignored_dim4_axis1_relaxed(int i) {
237 static std::set<int> ignore = {};
238 return ignore.find(i) != ignore.end();
239 }
240
CreateModel_dim4_axis1_float16(Model * model)241 void CreateModel_dim4_axis1_float16(Model *model) {
242 OperandType type1(Type::INT32, {});
243 OperandType type7(Type::TENSOR_FLOAT16, {2, 3, 2, 2});
244 // Phase 1, operands
245 auto op1 = model->addOperand(&type7);
246 auto axis = model->addOperand(&type1);
247 auto op2 = model->addOperand(&type7);
248 // Phase 2, operations
249 static int32_t axis_init[] = {1};
250 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
251 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
252 // Phase 3, inputs and outputs
253 model->identifyInputsAndOutputs(
254 {op1},
255 {op2});
256 assert(model->isValid());
257 }
258
is_ignored_dim4_axis1_float16(int i)259 inline bool is_ignored_dim4_axis1_float16(int i) {
260 static std::set<int> ignore = {};
261 return ignore.find(i) != ignore.end();
262 }
263
CreateModel_dim4_axis1_quant8(Model * model)264 void CreateModel_dim4_axis1_quant8(Model *model) {
265 OperandType type1(Type::INT32, {});
266 OperandType type8(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2, 2}, 0.1f, 32);
267 OperandType type9(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2, 2}, 0.0078125f, 128);
268 // Phase 1, operands
269 auto op1 = model->addOperand(&type8);
270 auto axis = model->addOperand(&type1);
271 auto op2 = model->addOperand(&type9);
272 // Phase 2, operations
273 static int32_t axis_init[] = {1};
274 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
275 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
276 // Phase 3, inputs and outputs
277 model->identifyInputsAndOutputs(
278 {op1},
279 {op2});
280 assert(model->isValid());
281 }
282
is_ignored_dim4_axis1_quant8(int i)283 inline bool is_ignored_dim4_axis1_quant8(int i) {
284 static std::set<int> ignore = {};
285 return ignore.find(i) != ignore.end();
286 }
287
CreateModel_dim4_axis1_neg(Model * model)288 void CreateModel_dim4_axis1_neg(Model *model) {
289 OperandType type1(Type::INT32, {});
290 OperandType type6(Type::TENSOR_FLOAT32, {2, 3, 2, 2});
291 // Phase 1, operands
292 auto op1 = model->addOperand(&type6);
293 auto axis = model->addOperand(&type1);
294 auto op2 = model->addOperand(&type6);
295 // Phase 2, operations
296 static int32_t axis_init[] = {-3};
297 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
298 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
299 // Phase 3, inputs and outputs
300 model->identifyInputsAndOutputs(
301 {op1},
302 {op2});
303 assert(model->isValid());
304 }
305
is_ignored_dim4_axis1_neg(int i)306 inline bool is_ignored_dim4_axis1_neg(int i) {
307 static std::set<int> ignore = {};
308 return ignore.find(i) != ignore.end();
309 }
310
CreateModel_dim4_axis1_neg_relaxed(Model * model)311 void CreateModel_dim4_axis1_neg_relaxed(Model *model) {
312 OperandType type1(Type::INT32, {});
313 OperandType type6(Type::TENSOR_FLOAT32, {2, 3, 2, 2});
314 // Phase 1, operands
315 auto op1 = model->addOperand(&type6);
316 auto axis = model->addOperand(&type1);
317 auto op2 = model->addOperand(&type6);
318 // Phase 2, operations
319 static int32_t axis_init[] = {-3};
320 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
321 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
322 // Phase 3, inputs and outputs
323 model->identifyInputsAndOutputs(
324 {op1},
325 {op2});
326 // Phase 4: set relaxed execution
327 model->relaxComputationFloat32toFloat16(true);
328 assert(model->isValid());
329 }
330
is_ignored_dim4_axis1_neg_relaxed(int i)331 inline bool is_ignored_dim4_axis1_neg_relaxed(int i) {
332 static std::set<int> ignore = {};
333 return ignore.find(i) != ignore.end();
334 }
335
CreateModel_dim4_axis1_neg_float16(Model * model)336 void CreateModel_dim4_axis1_neg_float16(Model *model) {
337 OperandType type1(Type::INT32, {});
338 OperandType type7(Type::TENSOR_FLOAT16, {2, 3, 2, 2});
339 // Phase 1, operands
340 auto op1 = model->addOperand(&type7);
341 auto axis = model->addOperand(&type1);
342 auto op2 = model->addOperand(&type7);
343 // Phase 2, operations
344 static int32_t axis_init[] = {-3};
345 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
346 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
347 // Phase 3, inputs and outputs
348 model->identifyInputsAndOutputs(
349 {op1},
350 {op2});
351 assert(model->isValid());
352 }
353
is_ignored_dim4_axis1_neg_float16(int i)354 inline bool is_ignored_dim4_axis1_neg_float16(int i) {
355 static std::set<int> ignore = {};
356 return ignore.find(i) != ignore.end();
357 }
358
CreateModel_dim4_axis1_neg_quant8(Model * model)359 void CreateModel_dim4_axis1_neg_quant8(Model *model) {
360 OperandType type1(Type::INT32, {});
361 OperandType type8(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2, 2}, 0.1f, 32);
362 OperandType type9(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2, 2}, 0.0078125f, 128);
363 // Phase 1, operands
364 auto op1 = model->addOperand(&type8);
365 auto axis = model->addOperand(&type1);
366 auto op2 = model->addOperand(&type9);
367 // Phase 2, operations
368 static int32_t axis_init[] = {-3};
369 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
370 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
371 // Phase 3, inputs and outputs
372 model->identifyInputsAndOutputs(
373 {op1},
374 {op2});
375 assert(model->isValid());
376 }
377
is_ignored_dim4_axis1_neg_quant8(int i)378 inline bool is_ignored_dim4_axis1_neg_quant8(int i) {
379 static std::set<int> ignore = {};
380 return ignore.find(i) != ignore.end();
381 }
382
CreateModel_dim4_axis2(Model * model)383 void CreateModel_dim4_axis2(Model *model) {
384 OperandType type1(Type::INT32, {});
385 OperandType type10(Type::TENSOR_FLOAT32, {2, 2, 3, 2});
386 // Phase 1, operands
387 auto op1 = model->addOperand(&type10);
388 auto axis = model->addOperand(&type1);
389 auto op2 = model->addOperand(&type10);
390 // Phase 2, operations
391 static int32_t axis_init[] = {2};
392 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
393 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
394 // Phase 3, inputs and outputs
395 model->identifyInputsAndOutputs(
396 {op1},
397 {op2});
398 assert(model->isValid());
399 }
400
is_ignored_dim4_axis2(int i)401 inline bool is_ignored_dim4_axis2(int i) {
402 static std::set<int> ignore = {};
403 return ignore.find(i) != ignore.end();
404 }
405
CreateModel_dim4_axis2_relaxed(Model * model)406 void CreateModel_dim4_axis2_relaxed(Model *model) {
407 OperandType type1(Type::INT32, {});
408 OperandType type10(Type::TENSOR_FLOAT32, {2, 2, 3, 2});
409 // Phase 1, operands
410 auto op1 = model->addOperand(&type10);
411 auto axis = model->addOperand(&type1);
412 auto op2 = model->addOperand(&type10);
413 // Phase 2, operations
414 static int32_t axis_init[] = {2};
415 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
416 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
417 // Phase 3, inputs and outputs
418 model->identifyInputsAndOutputs(
419 {op1},
420 {op2});
421 // Phase 4: set relaxed execution
422 model->relaxComputationFloat32toFloat16(true);
423 assert(model->isValid());
424 }
425
is_ignored_dim4_axis2_relaxed(int i)426 inline bool is_ignored_dim4_axis2_relaxed(int i) {
427 static std::set<int> ignore = {};
428 return ignore.find(i) != ignore.end();
429 }
430
CreateModel_dim4_axis2_float16(Model * model)431 void CreateModel_dim4_axis2_float16(Model *model) {
432 OperandType type1(Type::INT32, {});
433 OperandType type11(Type::TENSOR_FLOAT16, {2, 2, 3, 2});
434 // Phase 1, operands
435 auto op1 = model->addOperand(&type11);
436 auto axis = model->addOperand(&type1);
437 auto op2 = model->addOperand(&type11);
438 // Phase 2, operations
439 static int32_t axis_init[] = {2};
440 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
441 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
442 // Phase 3, inputs and outputs
443 model->identifyInputsAndOutputs(
444 {op1},
445 {op2});
446 assert(model->isValid());
447 }
448
is_ignored_dim4_axis2_float16(int i)449 inline bool is_ignored_dim4_axis2_float16(int i) {
450 static std::set<int> ignore = {};
451 return ignore.find(i) != ignore.end();
452 }
453
CreateModel_dim4_axis2_quant8(Model * model)454 void CreateModel_dim4_axis2_quant8(Model *model) {
455 OperandType type1(Type::INT32, {});
456 OperandType type12(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3, 2}, 0.1f, 32);
457 OperandType type13(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3, 2}, 0.0078125f, 128);
458 // Phase 1, operands
459 auto op1 = model->addOperand(&type12);
460 auto axis = model->addOperand(&type1);
461 auto op2 = model->addOperand(&type13);
462 // Phase 2, operations
463 static int32_t axis_init[] = {2};
464 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
465 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
466 // Phase 3, inputs and outputs
467 model->identifyInputsAndOutputs(
468 {op1},
469 {op2});
470 assert(model->isValid());
471 }
472
is_ignored_dim4_axis2_quant8(int i)473 inline bool is_ignored_dim4_axis2_quant8(int i) {
474 static std::set<int> ignore = {};
475 return ignore.find(i) != ignore.end();
476 }
477
CreateModel_dim4_axis2_neg(Model * model)478 void CreateModel_dim4_axis2_neg(Model *model) {
479 OperandType type1(Type::INT32, {});
480 OperandType type10(Type::TENSOR_FLOAT32, {2, 2, 3, 2});
481 // Phase 1, operands
482 auto op1 = model->addOperand(&type10);
483 auto axis = model->addOperand(&type1);
484 auto op2 = model->addOperand(&type10);
485 // Phase 2, operations
486 static int32_t axis_init[] = {-2};
487 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
488 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
489 // Phase 3, inputs and outputs
490 model->identifyInputsAndOutputs(
491 {op1},
492 {op2});
493 assert(model->isValid());
494 }
495
is_ignored_dim4_axis2_neg(int i)496 inline bool is_ignored_dim4_axis2_neg(int i) {
497 static std::set<int> ignore = {};
498 return ignore.find(i) != ignore.end();
499 }
500
CreateModel_dim4_axis2_neg_relaxed(Model * model)501 void CreateModel_dim4_axis2_neg_relaxed(Model *model) {
502 OperandType type1(Type::INT32, {});
503 OperandType type10(Type::TENSOR_FLOAT32, {2, 2, 3, 2});
504 // Phase 1, operands
505 auto op1 = model->addOperand(&type10);
506 auto axis = model->addOperand(&type1);
507 auto op2 = model->addOperand(&type10);
508 // Phase 2, operations
509 static int32_t axis_init[] = {-2};
510 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
511 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
512 // Phase 3, inputs and outputs
513 model->identifyInputsAndOutputs(
514 {op1},
515 {op2});
516 // Phase 4: set relaxed execution
517 model->relaxComputationFloat32toFloat16(true);
518 assert(model->isValid());
519 }
520
is_ignored_dim4_axis2_neg_relaxed(int i)521 inline bool is_ignored_dim4_axis2_neg_relaxed(int i) {
522 static std::set<int> ignore = {};
523 return ignore.find(i) != ignore.end();
524 }
525
CreateModel_dim4_axis2_neg_float16(Model * model)526 void CreateModel_dim4_axis2_neg_float16(Model *model) {
527 OperandType type1(Type::INT32, {});
528 OperandType type11(Type::TENSOR_FLOAT16, {2, 2, 3, 2});
529 // Phase 1, operands
530 auto op1 = model->addOperand(&type11);
531 auto axis = model->addOperand(&type1);
532 auto op2 = model->addOperand(&type11);
533 // Phase 2, operations
534 static int32_t axis_init[] = {-2};
535 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
536 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
537 // Phase 3, inputs and outputs
538 model->identifyInputsAndOutputs(
539 {op1},
540 {op2});
541 assert(model->isValid());
542 }
543
is_ignored_dim4_axis2_neg_float16(int i)544 inline bool is_ignored_dim4_axis2_neg_float16(int i) {
545 static std::set<int> ignore = {};
546 return ignore.find(i) != ignore.end();
547 }
548
CreateModel_dim4_axis2_neg_quant8(Model * model)549 void CreateModel_dim4_axis2_neg_quant8(Model *model) {
550 OperandType type1(Type::INT32, {});
551 OperandType type12(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3, 2}, 0.1f, 32);
552 OperandType type13(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3, 2}, 0.0078125f, 128);
553 // Phase 1, operands
554 auto op1 = model->addOperand(&type12);
555 auto axis = model->addOperand(&type1);
556 auto op2 = model->addOperand(&type13);
557 // Phase 2, operations
558 static int32_t axis_init[] = {-2};
559 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
560 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
561 // Phase 3, inputs and outputs
562 model->identifyInputsAndOutputs(
563 {op1},
564 {op2});
565 assert(model->isValid());
566 }
567
is_ignored_dim4_axis2_neg_quant8(int i)568 inline bool is_ignored_dim4_axis2_neg_quant8(int i) {
569 static std::set<int> ignore = {};
570 return ignore.find(i) != ignore.end();
571 }
572
CreateModel_dim4_axis3(Model * model)573 void CreateModel_dim4_axis3(Model *model) {
574 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
575 OperandType type1(Type::INT32, {});
576 // Phase 1, operands
577 auto op1 = model->addOperand(&type0);
578 auto axis = model->addOperand(&type1);
579 auto op2 = model->addOperand(&type0);
580 // Phase 2, operations
581 static int32_t axis_init[] = {3};
582 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
583 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
584 // Phase 3, inputs and outputs
585 model->identifyInputsAndOutputs(
586 {op1},
587 {op2});
588 assert(model->isValid());
589 }
590
is_ignored_dim4_axis3(int i)591 inline bool is_ignored_dim4_axis3(int i) {
592 static std::set<int> ignore = {};
593 return ignore.find(i) != ignore.end();
594 }
595
CreateModel_dim4_axis3_relaxed(Model * model)596 void CreateModel_dim4_axis3_relaxed(Model *model) {
597 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
598 OperandType type1(Type::INT32, {});
599 // Phase 1, operands
600 auto op1 = model->addOperand(&type0);
601 auto axis = model->addOperand(&type1);
602 auto op2 = model->addOperand(&type0);
603 // Phase 2, operations
604 static int32_t axis_init[] = {3};
605 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
606 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
607 // Phase 3, inputs and outputs
608 model->identifyInputsAndOutputs(
609 {op1},
610 {op2});
611 // Phase 4: set relaxed execution
612 model->relaxComputationFloat32toFloat16(true);
613 assert(model->isValid());
614 }
615
is_ignored_dim4_axis3_relaxed(int i)616 inline bool is_ignored_dim4_axis3_relaxed(int i) {
617 static std::set<int> ignore = {};
618 return ignore.find(i) != ignore.end();
619 }
620
CreateModel_dim4_axis3_float16(Model * model)621 void CreateModel_dim4_axis3_float16(Model *model) {
622 OperandType type1(Type::INT32, {});
623 OperandType type14(Type::TENSOR_FLOAT16, {2, 2, 2, 3});
624 // Phase 1, operands
625 auto op1 = model->addOperand(&type14);
626 auto axis = model->addOperand(&type1);
627 auto op2 = model->addOperand(&type14);
628 // Phase 2, operations
629 static int32_t axis_init[] = {3};
630 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
631 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
632 // Phase 3, inputs and outputs
633 model->identifyInputsAndOutputs(
634 {op1},
635 {op2});
636 assert(model->isValid());
637 }
638
is_ignored_dim4_axis3_float16(int i)639 inline bool is_ignored_dim4_axis3_float16(int i) {
640 static std::set<int> ignore = {};
641 return ignore.find(i) != ignore.end();
642 }
643
CreateModel_dim4_axis3_quant8(Model * model)644 void CreateModel_dim4_axis3_quant8(Model *model) {
645 OperandType type1(Type::INT32, {});
646 OperandType type15(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 3}, 0.1f, 32);
647 OperandType type16(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 3}, 0.0078125f, 128);
648 // Phase 1, operands
649 auto op1 = model->addOperand(&type15);
650 auto axis = model->addOperand(&type1);
651 auto op2 = model->addOperand(&type16);
652 // Phase 2, operations
653 static int32_t axis_init[] = {3};
654 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
655 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
656 // Phase 3, inputs and outputs
657 model->identifyInputsAndOutputs(
658 {op1},
659 {op2});
660 assert(model->isValid());
661 }
662
is_ignored_dim4_axis3_quant8(int i)663 inline bool is_ignored_dim4_axis3_quant8(int i) {
664 static std::set<int> ignore = {};
665 return ignore.find(i) != ignore.end();
666 }
667
CreateModel_dim4_axis3_neg(Model * model)668 void CreateModel_dim4_axis3_neg(Model *model) {
669 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
670 OperandType type1(Type::INT32, {});
671 // Phase 1, operands
672 auto op1 = model->addOperand(&type0);
673 auto axis = model->addOperand(&type1);
674 auto op2 = model->addOperand(&type0);
675 // Phase 2, operations
676 static int32_t axis_init[] = {-1};
677 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
678 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
679 // Phase 3, inputs and outputs
680 model->identifyInputsAndOutputs(
681 {op1},
682 {op2});
683 assert(model->isValid());
684 }
685
is_ignored_dim4_axis3_neg(int i)686 inline bool is_ignored_dim4_axis3_neg(int i) {
687 static std::set<int> ignore = {};
688 return ignore.find(i) != ignore.end();
689 }
690
CreateModel_dim4_axis3_neg_relaxed(Model * model)691 void CreateModel_dim4_axis3_neg_relaxed(Model *model) {
692 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
693 OperandType type1(Type::INT32, {});
694 // Phase 1, operands
695 auto op1 = model->addOperand(&type0);
696 auto axis = model->addOperand(&type1);
697 auto op2 = model->addOperand(&type0);
698 // Phase 2, operations
699 static int32_t axis_init[] = {-1};
700 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
701 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
702 // Phase 3, inputs and outputs
703 model->identifyInputsAndOutputs(
704 {op1},
705 {op2});
706 // Phase 4: set relaxed execution
707 model->relaxComputationFloat32toFloat16(true);
708 assert(model->isValid());
709 }
710
is_ignored_dim4_axis3_neg_relaxed(int i)711 inline bool is_ignored_dim4_axis3_neg_relaxed(int i) {
712 static std::set<int> ignore = {};
713 return ignore.find(i) != ignore.end();
714 }
715
CreateModel_dim4_axis3_neg_float16(Model * model)716 void CreateModel_dim4_axis3_neg_float16(Model *model) {
717 OperandType type1(Type::INT32, {});
718 OperandType type14(Type::TENSOR_FLOAT16, {2, 2, 2, 3});
719 // Phase 1, operands
720 auto op1 = model->addOperand(&type14);
721 auto axis = model->addOperand(&type1);
722 auto op2 = model->addOperand(&type14);
723 // Phase 2, operations
724 static int32_t axis_init[] = {-1};
725 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
726 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
727 // Phase 3, inputs and outputs
728 model->identifyInputsAndOutputs(
729 {op1},
730 {op2});
731 assert(model->isValid());
732 }
733
is_ignored_dim4_axis3_neg_float16(int i)734 inline bool is_ignored_dim4_axis3_neg_float16(int i) {
735 static std::set<int> ignore = {};
736 return ignore.find(i) != ignore.end();
737 }
738
CreateModel_dim4_axis3_neg_quant8(Model * model)739 void CreateModel_dim4_axis3_neg_quant8(Model *model) {
740 OperandType type1(Type::INT32, {});
741 OperandType type15(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 3}, 0.1f, 32);
742 OperandType type16(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 3}, 0.0078125f, 128);
743 // Phase 1, operands
744 auto op1 = model->addOperand(&type15);
745 auto axis = model->addOperand(&type1);
746 auto op2 = model->addOperand(&type16);
747 // Phase 2, operations
748 static int32_t axis_init[] = {-1};
749 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
750 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
751 // Phase 3, inputs and outputs
752 model->identifyInputsAndOutputs(
753 {op1},
754 {op2});
755 assert(model->isValid());
756 }
757
is_ignored_dim4_axis3_neg_quant8(int i)758 inline bool is_ignored_dim4_axis3_neg_quant8(int i) {
759 static std::set<int> ignore = {};
760 return ignore.find(i) != ignore.end();
761 }
762
CreateModel_dim3_axis0(Model * model)763 void CreateModel_dim3_axis0(Model *model) {
764 OperandType type1(Type::INT32, {});
765 OperandType type17(Type::TENSOR_FLOAT32, {3, 2, 2});
766 // Phase 1, operands
767 auto op1 = model->addOperand(&type17);
768 auto axis = model->addOperand(&type1);
769 auto op2 = model->addOperand(&type17);
770 // Phase 2, operations
771 static int32_t axis_init[] = {0};
772 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
773 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
774 // Phase 3, inputs and outputs
775 model->identifyInputsAndOutputs(
776 {op1},
777 {op2});
778 assert(model->isValid());
779 }
780
is_ignored_dim3_axis0(int i)781 inline bool is_ignored_dim3_axis0(int i) {
782 static std::set<int> ignore = {};
783 return ignore.find(i) != ignore.end();
784 }
785
CreateModel_dim3_axis0_relaxed(Model * model)786 void CreateModel_dim3_axis0_relaxed(Model *model) {
787 OperandType type1(Type::INT32, {});
788 OperandType type17(Type::TENSOR_FLOAT32, {3, 2, 2});
789 // Phase 1, operands
790 auto op1 = model->addOperand(&type17);
791 auto axis = model->addOperand(&type1);
792 auto op2 = model->addOperand(&type17);
793 // Phase 2, operations
794 static int32_t axis_init[] = {0};
795 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
796 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
797 // Phase 3, inputs and outputs
798 model->identifyInputsAndOutputs(
799 {op1},
800 {op2});
801 // Phase 4: set relaxed execution
802 model->relaxComputationFloat32toFloat16(true);
803 assert(model->isValid());
804 }
805
is_ignored_dim3_axis0_relaxed(int i)806 inline bool is_ignored_dim3_axis0_relaxed(int i) {
807 static std::set<int> ignore = {};
808 return ignore.find(i) != ignore.end();
809 }
810
CreateModel_dim3_axis0_float16(Model * model)811 void CreateModel_dim3_axis0_float16(Model *model) {
812 OperandType type1(Type::INT32, {});
813 OperandType type18(Type::TENSOR_FLOAT16, {3, 2, 2});
814 // Phase 1, operands
815 auto op1 = model->addOperand(&type18);
816 auto axis = model->addOperand(&type1);
817 auto op2 = model->addOperand(&type18);
818 // Phase 2, operations
819 static int32_t axis_init[] = {0};
820 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
821 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
822 // Phase 3, inputs and outputs
823 model->identifyInputsAndOutputs(
824 {op1},
825 {op2});
826 assert(model->isValid());
827 }
828
is_ignored_dim3_axis0_float16(int i)829 inline bool is_ignored_dim3_axis0_float16(int i) {
830 static std::set<int> ignore = {};
831 return ignore.find(i) != ignore.end();
832 }
833
CreateModel_dim3_axis0_quant8(Model * model)834 void CreateModel_dim3_axis0_quant8(Model *model) {
835 OperandType type1(Type::INT32, {});
836 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2}, 0.1f, 32);
837 OperandType type20(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2}, 0.0078125f, 128);
838 // Phase 1, operands
839 auto op1 = model->addOperand(&type19);
840 auto axis = model->addOperand(&type1);
841 auto op2 = model->addOperand(&type20);
842 // Phase 2, operations
843 static int32_t axis_init[] = {0};
844 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
845 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
846 // Phase 3, inputs and outputs
847 model->identifyInputsAndOutputs(
848 {op1},
849 {op2});
850 assert(model->isValid());
851 }
852
is_ignored_dim3_axis0_quant8(int i)853 inline bool is_ignored_dim3_axis0_quant8(int i) {
854 static std::set<int> ignore = {};
855 return ignore.find(i) != ignore.end();
856 }
857
CreateModel_dim3_axis0_neg(Model * model)858 void CreateModel_dim3_axis0_neg(Model *model) {
859 OperandType type1(Type::INT32, {});
860 OperandType type17(Type::TENSOR_FLOAT32, {3, 2, 2});
861 // Phase 1, operands
862 auto op1 = model->addOperand(&type17);
863 auto axis = model->addOperand(&type1);
864 auto op2 = model->addOperand(&type17);
865 // Phase 2, operations
866 static int32_t axis_init[] = {-3};
867 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
868 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
869 // Phase 3, inputs and outputs
870 model->identifyInputsAndOutputs(
871 {op1},
872 {op2});
873 assert(model->isValid());
874 }
875
is_ignored_dim3_axis0_neg(int i)876 inline bool is_ignored_dim3_axis0_neg(int i) {
877 static std::set<int> ignore = {};
878 return ignore.find(i) != ignore.end();
879 }
880
CreateModel_dim3_axis0_neg_relaxed(Model * model)881 void CreateModel_dim3_axis0_neg_relaxed(Model *model) {
882 OperandType type1(Type::INT32, {});
883 OperandType type17(Type::TENSOR_FLOAT32, {3, 2, 2});
884 // Phase 1, operands
885 auto op1 = model->addOperand(&type17);
886 auto axis = model->addOperand(&type1);
887 auto op2 = model->addOperand(&type17);
888 // Phase 2, operations
889 static int32_t axis_init[] = {-3};
890 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
891 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
892 // Phase 3, inputs and outputs
893 model->identifyInputsAndOutputs(
894 {op1},
895 {op2});
896 // Phase 4: set relaxed execution
897 model->relaxComputationFloat32toFloat16(true);
898 assert(model->isValid());
899 }
900
is_ignored_dim3_axis0_neg_relaxed(int i)901 inline bool is_ignored_dim3_axis0_neg_relaxed(int i) {
902 static std::set<int> ignore = {};
903 return ignore.find(i) != ignore.end();
904 }
905
CreateModel_dim3_axis0_neg_float16(Model * model)906 void CreateModel_dim3_axis0_neg_float16(Model *model) {
907 OperandType type1(Type::INT32, {});
908 OperandType type18(Type::TENSOR_FLOAT16, {3, 2, 2});
909 // Phase 1, operands
910 auto op1 = model->addOperand(&type18);
911 auto axis = model->addOperand(&type1);
912 auto op2 = model->addOperand(&type18);
913 // Phase 2, operations
914 static int32_t axis_init[] = {-3};
915 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
916 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
917 // Phase 3, inputs and outputs
918 model->identifyInputsAndOutputs(
919 {op1},
920 {op2});
921 assert(model->isValid());
922 }
923
is_ignored_dim3_axis0_neg_float16(int i)924 inline bool is_ignored_dim3_axis0_neg_float16(int i) {
925 static std::set<int> ignore = {};
926 return ignore.find(i) != ignore.end();
927 }
928
CreateModel_dim3_axis0_neg_quant8(Model * model)929 void CreateModel_dim3_axis0_neg_quant8(Model *model) {
930 OperandType type1(Type::INT32, {});
931 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2}, 0.1f, 32);
932 OperandType type20(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2}, 0.0078125f, 128);
933 // Phase 1, operands
934 auto op1 = model->addOperand(&type19);
935 auto axis = model->addOperand(&type1);
936 auto op2 = model->addOperand(&type20);
937 // Phase 2, operations
938 static int32_t axis_init[] = {-3};
939 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
940 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
941 // Phase 3, inputs and outputs
942 model->identifyInputsAndOutputs(
943 {op1},
944 {op2});
945 assert(model->isValid());
946 }
947
is_ignored_dim3_axis0_neg_quant8(int i)948 inline bool is_ignored_dim3_axis0_neg_quant8(int i) {
949 static std::set<int> ignore = {};
950 return ignore.find(i) != ignore.end();
951 }
952
CreateModel_dim3_axis1(Model * model)953 void CreateModel_dim3_axis1(Model *model) {
954 OperandType type1(Type::INT32, {});
955 OperandType type21(Type::TENSOR_FLOAT32, {2, 3, 2});
956 // Phase 1, operands
957 auto op1 = model->addOperand(&type21);
958 auto axis = model->addOperand(&type1);
959 auto op2 = model->addOperand(&type21);
960 // Phase 2, operations
961 static int32_t axis_init[] = {1};
962 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
963 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
964 // Phase 3, inputs and outputs
965 model->identifyInputsAndOutputs(
966 {op1},
967 {op2});
968 assert(model->isValid());
969 }
970
is_ignored_dim3_axis1(int i)971 inline bool is_ignored_dim3_axis1(int i) {
972 static std::set<int> ignore = {};
973 return ignore.find(i) != ignore.end();
974 }
975
CreateModel_dim3_axis1_relaxed(Model * model)976 void CreateModel_dim3_axis1_relaxed(Model *model) {
977 OperandType type1(Type::INT32, {});
978 OperandType type21(Type::TENSOR_FLOAT32, {2, 3, 2});
979 // Phase 1, operands
980 auto op1 = model->addOperand(&type21);
981 auto axis = model->addOperand(&type1);
982 auto op2 = model->addOperand(&type21);
983 // Phase 2, operations
984 static int32_t axis_init[] = {1};
985 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
986 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
987 // Phase 3, inputs and outputs
988 model->identifyInputsAndOutputs(
989 {op1},
990 {op2});
991 // Phase 4: set relaxed execution
992 model->relaxComputationFloat32toFloat16(true);
993 assert(model->isValid());
994 }
995
is_ignored_dim3_axis1_relaxed(int i)996 inline bool is_ignored_dim3_axis1_relaxed(int i) {
997 static std::set<int> ignore = {};
998 return ignore.find(i) != ignore.end();
999 }
1000
CreateModel_dim3_axis1_float16(Model * model)1001 void CreateModel_dim3_axis1_float16(Model *model) {
1002 OperandType type1(Type::INT32, {});
1003 OperandType type22(Type::TENSOR_FLOAT16, {2, 3, 2});
1004 // Phase 1, operands
1005 auto op1 = model->addOperand(&type22);
1006 auto axis = model->addOperand(&type1);
1007 auto op2 = model->addOperand(&type22);
1008 // Phase 2, operations
1009 static int32_t axis_init[] = {1};
1010 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1011 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1012 // Phase 3, inputs and outputs
1013 model->identifyInputsAndOutputs(
1014 {op1},
1015 {op2});
1016 assert(model->isValid());
1017 }
1018
is_ignored_dim3_axis1_float16(int i)1019 inline bool is_ignored_dim3_axis1_float16(int i) {
1020 static std::set<int> ignore = {};
1021 return ignore.find(i) != ignore.end();
1022 }
1023
CreateModel_dim3_axis1_quant8(Model * model)1024 void CreateModel_dim3_axis1_quant8(Model *model) {
1025 OperandType type1(Type::INT32, {});
1026 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2}, 0.1f, 32);
1027 OperandType type24(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2}, 0.0078125f, 128);
1028 // Phase 1, operands
1029 auto op1 = model->addOperand(&type23);
1030 auto axis = model->addOperand(&type1);
1031 auto op2 = model->addOperand(&type24);
1032 // Phase 2, operations
1033 static int32_t axis_init[] = {1};
1034 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1035 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1036 // Phase 3, inputs and outputs
1037 model->identifyInputsAndOutputs(
1038 {op1},
1039 {op2});
1040 assert(model->isValid());
1041 }
1042
is_ignored_dim3_axis1_quant8(int i)1043 inline bool is_ignored_dim3_axis1_quant8(int i) {
1044 static std::set<int> ignore = {};
1045 return ignore.find(i) != ignore.end();
1046 }
1047
CreateModel_dim3_axis1_neg(Model * model)1048 void CreateModel_dim3_axis1_neg(Model *model) {
1049 OperandType type1(Type::INT32, {});
1050 OperandType type21(Type::TENSOR_FLOAT32, {2, 3, 2});
1051 // Phase 1, operands
1052 auto op1 = model->addOperand(&type21);
1053 auto axis = model->addOperand(&type1);
1054 auto op2 = model->addOperand(&type21);
1055 // Phase 2, operations
1056 static int32_t axis_init[] = {-2};
1057 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1058 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1059 // Phase 3, inputs and outputs
1060 model->identifyInputsAndOutputs(
1061 {op1},
1062 {op2});
1063 assert(model->isValid());
1064 }
1065
is_ignored_dim3_axis1_neg(int i)1066 inline bool is_ignored_dim3_axis1_neg(int i) {
1067 static std::set<int> ignore = {};
1068 return ignore.find(i) != ignore.end();
1069 }
1070
CreateModel_dim3_axis1_neg_relaxed(Model * model)1071 void CreateModel_dim3_axis1_neg_relaxed(Model *model) {
1072 OperandType type1(Type::INT32, {});
1073 OperandType type21(Type::TENSOR_FLOAT32, {2, 3, 2});
1074 // Phase 1, operands
1075 auto op1 = model->addOperand(&type21);
1076 auto axis = model->addOperand(&type1);
1077 auto op2 = model->addOperand(&type21);
1078 // Phase 2, operations
1079 static int32_t axis_init[] = {-2};
1080 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1081 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1082 // Phase 3, inputs and outputs
1083 model->identifyInputsAndOutputs(
1084 {op1},
1085 {op2});
1086 // Phase 4: set relaxed execution
1087 model->relaxComputationFloat32toFloat16(true);
1088 assert(model->isValid());
1089 }
1090
is_ignored_dim3_axis1_neg_relaxed(int i)1091 inline bool is_ignored_dim3_axis1_neg_relaxed(int i) {
1092 static std::set<int> ignore = {};
1093 return ignore.find(i) != ignore.end();
1094 }
1095
CreateModel_dim3_axis1_neg_float16(Model * model)1096 void CreateModel_dim3_axis1_neg_float16(Model *model) {
1097 OperandType type1(Type::INT32, {});
1098 OperandType type22(Type::TENSOR_FLOAT16, {2, 3, 2});
1099 // Phase 1, operands
1100 auto op1 = model->addOperand(&type22);
1101 auto axis = model->addOperand(&type1);
1102 auto op2 = model->addOperand(&type22);
1103 // Phase 2, operations
1104 static int32_t axis_init[] = {-2};
1105 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1106 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1107 // Phase 3, inputs and outputs
1108 model->identifyInputsAndOutputs(
1109 {op1},
1110 {op2});
1111 assert(model->isValid());
1112 }
1113
is_ignored_dim3_axis1_neg_float16(int i)1114 inline bool is_ignored_dim3_axis1_neg_float16(int i) {
1115 static std::set<int> ignore = {};
1116 return ignore.find(i) != ignore.end();
1117 }
1118
CreateModel_dim3_axis1_neg_quant8(Model * model)1119 void CreateModel_dim3_axis1_neg_quant8(Model *model) {
1120 OperandType type1(Type::INT32, {});
1121 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2}, 0.1f, 32);
1122 OperandType type24(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2}, 0.0078125f, 128);
1123 // Phase 1, operands
1124 auto op1 = model->addOperand(&type23);
1125 auto axis = model->addOperand(&type1);
1126 auto op2 = model->addOperand(&type24);
1127 // Phase 2, operations
1128 static int32_t axis_init[] = {-2};
1129 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1130 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1131 // Phase 3, inputs and outputs
1132 model->identifyInputsAndOutputs(
1133 {op1},
1134 {op2});
1135 assert(model->isValid());
1136 }
1137
is_ignored_dim3_axis1_neg_quant8(int i)1138 inline bool is_ignored_dim3_axis1_neg_quant8(int i) {
1139 static std::set<int> ignore = {};
1140 return ignore.find(i) != ignore.end();
1141 }
1142
CreateModel_dim3_axis2(Model * model)1143 void CreateModel_dim3_axis2(Model *model) {
1144 OperandType type1(Type::INT32, {});
1145 OperandType type25(Type::TENSOR_FLOAT32, {2, 2, 3});
1146 // Phase 1, operands
1147 auto op1 = model->addOperand(&type25);
1148 auto axis = model->addOperand(&type1);
1149 auto op2 = model->addOperand(&type25);
1150 // Phase 2, operations
1151 static int32_t axis_init[] = {2};
1152 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1153 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1154 // Phase 3, inputs and outputs
1155 model->identifyInputsAndOutputs(
1156 {op1},
1157 {op2});
1158 assert(model->isValid());
1159 }
1160
is_ignored_dim3_axis2(int i)1161 inline bool is_ignored_dim3_axis2(int i) {
1162 static std::set<int> ignore = {};
1163 return ignore.find(i) != ignore.end();
1164 }
1165
CreateModel_dim3_axis2_relaxed(Model * model)1166 void CreateModel_dim3_axis2_relaxed(Model *model) {
1167 OperandType type1(Type::INT32, {});
1168 OperandType type25(Type::TENSOR_FLOAT32, {2, 2, 3});
1169 // Phase 1, operands
1170 auto op1 = model->addOperand(&type25);
1171 auto axis = model->addOperand(&type1);
1172 auto op2 = model->addOperand(&type25);
1173 // Phase 2, operations
1174 static int32_t axis_init[] = {2};
1175 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1176 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1177 // Phase 3, inputs and outputs
1178 model->identifyInputsAndOutputs(
1179 {op1},
1180 {op2});
1181 // Phase 4: set relaxed execution
1182 model->relaxComputationFloat32toFloat16(true);
1183 assert(model->isValid());
1184 }
1185
is_ignored_dim3_axis2_relaxed(int i)1186 inline bool is_ignored_dim3_axis2_relaxed(int i) {
1187 static std::set<int> ignore = {};
1188 return ignore.find(i) != ignore.end();
1189 }
1190
CreateModel_dim3_axis2_float16(Model * model)1191 void CreateModel_dim3_axis2_float16(Model *model) {
1192 OperandType type1(Type::INT32, {});
1193 OperandType type26(Type::TENSOR_FLOAT16, {2, 2, 3});
1194 // Phase 1, operands
1195 auto op1 = model->addOperand(&type26);
1196 auto axis = model->addOperand(&type1);
1197 auto op2 = model->addOperand(&type26);
1198 // Phase 2, operations
1199 static int32_t axis_init[] = {2};
1200 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1201 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1202 // Phase 3, inputs and outputs
1203 model->identifyInputsAndOutputs(
1204 {op1},
1205 {op2});
1206 assert(model->isValid());
1207 }
1208
is_ignored_dim3_axis2_float16(int i)1209 inline bool is_ignored_dim3_axis2_float16(int i) {
1210 static std::set<int> ignore = {};
1211 return ignore.find(i) != ignore.end();
1212 }
1213
CreateModel_dim3_axis2_quant8(Model * model)1214 void CreateModel_dim3_axis2_quant8(Model *model) {
1215 OperandType type1(Type::INT32, {});
1216 OperandType type27(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3}, 0.1f, 32);
1217 OperandType type28(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3}, 0.0078125f, 128);
1218 // Phase 1, operands
1219 auto op1 = model->addOperand(&type27);
1220 auto axis = model->addOperand(&type1);
1221 auto op2 = model->addOperand(&type28);
1222 // Phase 2, operations
1223 static int32_t axis_init[] = {2};
1224 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1225 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1226 // Phase 3, inputs and outputs
1227 model->identifyInputsAndOutputs(
1228 {op1},
1229 {op2});
1230 assert(model->isValid());
1231 }
1232
is_ignored_dim3_axis2_quant8(int i)1233 inline bool is_ignored_dim3_axis2_quant8(int i) {
1234 static std::set<int> ignore = {};
1235 return ignore.find(i) != ignore.end();
1236 }
1237
CreateModel_dim3_axis2_neg(Model * model)1238 void CreateModel_dim3_axis2_neg(Model *model) {
1239 OperandType type1(Type::INT32, {});
1240 OperandType type25(Type::TENSOR_FLOAT32, {2, 2, 3});
1241 // Phase 1, operands
1242 auto op1 = model->addOperand(&type25);
1243 auto axis = model->addOperand(&type1);
1244 auto op2 = model->addOperand(&type25);
1245 // Phase 2, operations
1246 static int32_t axis_init[] = {-1};
1247 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1248 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1249 // Phase 3, inputs and outputs
1250 model->identifyInputsAndOutputs(
1251 {op1},
1252 {op2});
1253 assert(model->isValid());
1254 }
1255
is_ignored_dim3_axis2_neg(int i)1256 inline bool is_ignored_dim3_axis2_neg(int i) {
1257 static std::set<int> ignore = {};
1258 return ignore.find(i) != ignore.end();
1259 }
1260
CreateModel_dim3_axis2_neg_relaxed(Model * model)1261 void CreateModel_dim3_axis2_neg_relaxed(Model *model) {
1262 OperandType type1(Type::INT32, {});
1263 OperandType type25(Type::TENSOR_FLOAT32, {2, 2, 3});
1264 // Phase 1, operands
1265 auto op1 = model->addOperand(&type25);
1266 auto axis = model->addOperand(&type1);
1267 auto op2 = model->addOperand(&type25);
1268 // Phase 2, operations
1269 static int32_t axis_init[] = {-1};
1270 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1271 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1272 // Phase 3, inputs and outputs
1273 model->identifyInputsAndOutputs(
1274 {op1},
1275 {op2});
1276 // Phase 4: set relaxed execution
1277 model->relaxComputationFloat32toFloat16(true);
1278 assert(model->isValid());
1279 }
1280
is_ignored_dim3_axis2_neg_relaxed(int i)1281 inline bool is_ignored_dim3_axis2_neg_relaxed(int i) {
1282 static std::set<int> ignore = {};
1283 return ignore.find(i) != ignore.end();
1284 }
1285
CreateModel_dim3_axis2_neg_float16(Model * model)1286 void CreateModel_dim3_axis2_neg_float16(Model *model) {
1287 OperandType type1(Type::INT32, {});
1288 OperandType type26(Type::TENSOR_FLOAT16, {2, 2, 3});
1289 // Phase 1, operands
1290 auto op1 = model->addOperand(&type26);
1291 auto axis = model->addOperand(&type1);
1292 auto op2 = model->addOperand(&type26);
1293 // Phase 2, operations
1294 static int32_t axis_init[] = {-1};
1295 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1296 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1297 // Phase 3, inputs and outputs
1298 model->identifyInputsAndOutputs(
1299 {op1},
1300 {op2});
1301 assert(model->isValid());
1302 }
1303
is_ignored_dim3_axis2_neg_float16(int i)1304 inline bool is_ignored_dim3_axis2_neg_float16(int i) {
1305 static std::set<int> ignore = {};
1306 return ignore.find(i) != ignore.end();
1307 }
1308
CreateModel_dim3_axis2_neg_quant8(Model * model)1309 void CreateModel_dim3_axis2_neg_quant8(Model *model) {
1310 OperandType type1(Type::INT32, {});
1311 OperandType type27(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3}, 0.1f, 32);
1312 OperandType type28(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3}, 0.0078125f, 128);
1313 // Phase 1, operands
1314 auto op1 = model->addOperand(&type27);
1315 auto axis = model->addOperand(&type1);
1316 auto op2 = model->addOperand(&type28);
1317 // Phase 2, operations
1318 static int32_t axis_init[] = {-1};
1319 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1320 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1321 // Phase 3, inputs and outputs
1322 model->identifyInputsAndOutputs(
1323 {op1},
1324 {op2});
1325 assert(model->isValid());
1326 }
1327
is_ignored_dim3_axis2_neg_quant8(int i)1328 inline bool is_ignored_dim3_axis2_neg_quant8(int i) {
1329 static std::set<int> ignore = {};
1330 return ignore.find(i) != ignore.end();
1331 }
1332
CreateModel_dim2_axis0(Model * model)1333 void CreateModel_dim2_axis0(Model *model) {
1334 OperandType type1(Type::INT32, {});
1335 OperandType type29(Type::TENSOR_FLOAT32, {3, 2});
1336 // Phase 1, operands
1337 auto op1 = model->addOperand(&type29);
1338 auto axis = model->addOperand(&type1);
1339 auto op2 = model->addOperand(&type29);
1340 // Phase 2, operations
1341 static int32_t axis_init[] = {0};
1342 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1343 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1344 // Phase 3, inputs and outputs
1345 model->identifyInputsAndOutputs(
1346 {op1},
1347 {op2});
1348 assert(model->isValid());
1349 }
1350
is_ignored_dim2_axis0(int i)1351 inline bool is_ignored_dim2_axis0(int i) {
1352 static std::set<int> ignore = {};
1353 return ignore.find(i) != ignore.end();
1354 }
1355
CreateModel_dim2_axis0_relaxed(Model * model)1356 void CreateModel_dim2_axis0_relaxed(Model *model) {
1357 OperandType type1(Type::INT32, {});
1358 OperandType type29(Type::TENSOR_FLOAT32, {3, 2});
1359 // Phase 1, operands
1360 auto op1 = model->addOperand(&type29);
1361 auto axis = model->addOperand(&type1);
1362 auto op2 = model->addOperand(&type29);
1363 // Phase 2, operations
1364 static int32_t axis_init[] = {0};
1365 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1366 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1367 // Phase 3, inputs and outputs
1368 model->identifyInputsAndOutputs(
1369 {op1},
1370 {op2});
1371 // Phase 4: set relaxed execution
1372 model->relaxComputationFloat32toFloat16(true);
1373 assert(model->isValid());
1374 }
1375
is_ignored_dim2_axis0_relaxed(int i)1376 inline bool is_ignored_dim2_axis0_relaxed(int i) {
1377 static std::set<int> ignore = {};
1378 return ignore.find(i) != ignore.end();
1379 }
1380
CreateModel_dim2_axis0_float16(Model * model)1381 void CreateModel_dim2_axis0_float16(Model *model) {
1382 OperandType type1(Type::INT32, {});
1383 OperandType type30(Type::TENSOR_FLOAT16, {3, 2});
1384 // Phase 1, operands
1385 auto op1 = model->addOperand(&type30);
1386 auto axis = model->addOperand(&type1);
1387 auto op2 = model->addOperand(&type30);
1388 // Phase 2, operations
1389 static int32_t axis_init[] = {0};
1390 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1391 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1392 // Phase 3, inputs and outputs
1393 model->identifyInputsAndOutputs(
1394 {op1},
1395 {op2});
1396 assert(model->isValid());
1397 }
1398
is_ignored_dim2_axis0_float16(int i)1399 inline bool is_ignored_dim2_axis0_float16(int i) {
1400 static std::set<int> ignore = {};
1401 return ignore.find(i) != ignore.end();
1402 }
1403
CreateModel_dim2_axis0_quant8(Model * model)1404 void CreateModel_dim2_axis0_quant8(Model *model) {
1405 OperandType type1(Type::INT32, {});
1406 OperandType type31(Type::TENSOR_QUANT8_ASYMM, {3, 2}, 0.1f, 32);
1407 OperandType type32(Type::TENSOR_QUANT8_ASYMM, {3, 2}, 0.0078125f, 128);
1408 // Phase 1, operands
1409 auto op1 = model->addOperand(&type31);
1410 auto axis = model->addOperand(&type1);
1411 auto op2 = model->addOperand(&type32);
1412 // Phase 2, operations
1413 static int32_t axis_init[] = {0};
1414 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1415 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1416 // Phase 3, inputs and outputs
1417 model->identifyInputsAndOutputs(
1418 {op1},
1419 {op2});
1420 assert(model->isValid());
1421 }
1422
is_ignored_dim2_axis0_quant8(int i)1423 inline bool is_ignored_dim2_axis0_quant8(int i) {
1424 static std::set<int> ignore = {};
1425 return ignore.find(i) != ignore.end();
1426 }
1427
CreateModel_dim2_axis0_neg(Model * model)1428 void CreateModel_dim2_axis0_neg(Model *model) {
1429 OperandType type1(Type::INT32, {});
1430 OperandType type29(Type::TENSOR_FLOAT32, {3, 2});
1431 // Phase 1, operands
1432 auto op1 = model->addOperand(&type29);
1433 auto axis = model->addOperand(&type1);
1434 auto op2 = model->addOperand(&type29);
1435 // Phase 2, operations
1436 static int32_t axis_init[] = {-2};
1437 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1438 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1439 // Phase 3, inputs and outputs
1440 model->identifyInputsAndOutputs(
1441 {op1},
1442 {op2});
1443 assert(model->isValid());
1444 }
1445
is_ignored_dim2_axis0_neg(int i)1446 inline bool is_ignored_dim2_axis0_neg(int i) {
1447 static std::set<int> ignore = {};
1448 return ignore.find(i) != ignore.end();
1449 }
1450
CreateModel_dim2_axis0_neg_relaxed(Model * model)1451 void CreateModel_dim2_axis0_neg_relaxed(Model *model) {
1452 OperandType type1(Type::INT32, {});
1453 OperandType type29(Type::TENSOR_FLOAT32, {3, 2});
1454 // Phase 1, operands
1455 auto op1 = model->addOperand(&type29);
1456 auto axis = model->addOperand(&type1);
1457 auto op2 = model->addOperand(&type29);
1458 // Phase 2, operations
1459 static int32_t axis_init[] = {-2};
1460 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1461 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1462 // Phase 3, inputs and outputs
1463 model->identifyInputsAndOutputs(
1464 {op1},
1465 {op2});
1466 // Phase 4: set relaxed execution
1467 model->relaxComputationFloat32toFloat16(true);
1468 assert(model->isValid());
1469 }
1470
is_ignored_dim2_axis0_neg_relaxed(int i)1471 inline bool is_ignored_dim2_axis0_neg_relaxed(int i) {
1472 static std::set<int> ignore = {};
1473 return ignore.find(i) != ignore.end();
1474 }
1475
CreateModel_dim2_axis0_neg_float16(Model * model)1476 void CreateModel_dim2_axis0_neg_float16(Model *model) {
1477 OperandType type1(Type::INT32, {});
1478 OperandType type30(Type::TENSOR_FLOAT16, {3, 2});
1479 // Phase 1, operands
1480 auto op1 = model->addOperand(&type30);
1481 auto axis = model->addOperand(&type1);
1482 auto op2 = model->addOperand(&type30);
1483 // Phase 2, operations
1484 static int32_t axis_init[] = {-2};
1485 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1486 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1487 // Phase 3, inputs and outputs
1488 model->identifyInputsAndOutputs(
1489 {op1},
1490 {op2});
1491 assert(model->isValid());
1492 }
1493
is_ignored_dim2_axis0_neg_float16(int i)1494 inline bool is_ignored_dim2_axis0_neg_float16(int i) {
1495 static std::set<int> ignore = {};
1496 return ignore.find(i) != ignore.end();
1497 }
1498
CreateModel_dim2_axis0_neg_quant8(Model * model)1499 void CreateModel_dim2_axis0_neg_quant8(Model *model) {
1500 OperandType type1(Type::INT32, {});
1501 OperandType type31(Type::TENSOR_QUANT8_ASYMM, {3, 2}, 0.1f, 32);
1502 OperandType type32(Type::TENSOR_QUANT8_ASYMM, {3, 2}, 0.0078125f, 128);
1503 // Phase 1, operands
1504 auto op1 = model->addOperand(&type31);
1505 auto axis = model->addOperand(&type1);
1506 auto op2 = model->addOperand(&type32);
1507 // Phase 2, operations
1508 static int32_t axis_init[] = {-2};
1509 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1510 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1511 // Phase 3, inputs and outputs
1512 model->identifyInputsAndOutputs(
1513 {op1},
1514 {op2});
1515 assert(model->isValid());
1516 }
1517
is_ignored_dim2_axis0_neg_quant8(int i)1518 inline bool is_ignored_dim2_axis0_neg_quant8(int i) {
1519 static std::set<int> ignore = {};
1520 return ignore.find(i) != ignore.end();
1521 }
1522
CreateModel_dim2_axis1(Model * model)1523 void CreateModel_dim2_axis1(Model *model) {
1524 OperandType type1(Type::INT32, {});
1525 OperandType type33(Type::TENSOR_FLOAT32, {2, 3});
1526 // Phase 1, operands
1527 auto op1 = model->addOperand(&type33);
1528 auto axis = model->addOperand(&type1);
1529 auto op2 = model->addOperand(&type33);
1530 // Phase 2, operations
1531 static int32_t axis_init[] = {1};
1532 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1533 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1534 // Phase 3, inputs and outputs
1535 model->identifyInputsAndOutputs(
1536 {op1},
1537 {op2});
1538 assert(model->isValid());
1539 }
1540
is_ignored_dim2_axis1(int i)1541 inline bool is_ignored_dim2_axis1(int i) {
1542 static std::set<int> ignore = {};
1543 return ignore.find(i) != ignore.end();
1544 }
1545
CreateModel_dim2_axis1_relaxed(Model * model)1546 void CreateModel_dim2_axis1_relaxed(Model *model) {
1547 OperandType type1(Type::INT32, {});
1548 OperandType type33(Type::TENSOR_FLOAT32, {2, 3});
1549 // Phase 1, operands
1550 auto op1 = model->addOperand(&type33);
1551 auto axis = model->addOperand(&type1);
1552 auto op2 = model->addOperand(&type33);
1553 // Phase 2, operations
1554 static int32_t axis_init[] = {1};
1555 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1556 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1557 // Phase 3, inputs and outputs
1558 model->identifyInputsAndOutputs(
1559 {op1},
1560 {op2});
1561 // Phase 4: set relaxed execution
1562 model->relaxComputationFloat32toFloat16(true);
1563 assert(model->isValid());
1564 }
1565
is_ignored_dim2_axis1_relaxed(int i)1566 inline bool is_ignored_dim2_axis1_relaxed(int i) {
1567 static std::set<int> ignore = {};
1568 return ignore.find(i) != ignore.end();
1569 }
1570
CreateModel_dim2_axis1_float16(Model * model)1571 void CreateModel_dim2_axis1_float16(Model *model) {
1572 OperandType type1(Type::INT32, {});
1573 OperandType type34(Type::TENSOR_FLOAT16, {2, 3});
1574 // Phase 1, operands
1575 auto op1 = model->addOperand(&type34);
1576 auto axis = model->addOperand(&type1);
1577 auto op2 = model->addOperand(&type34);
1578 // Phase 2, operations
1579 static int32_t axis_init[] = {1};
1580 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1581 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1582 // Phase 3, inputs and outputs
1583 model->identifyInputsAndOutputs(
1584 {op1},
1585 {op2});
1586 assert(model->isValid());
1587 }
1588
is_ignored_dim2_axis1_float16(int i)1589 inline bool is_ignored_dim2_axis1_float16(int i) {
1590 static std::set<int> ignore = {};
1591 return ignore.find(i) != ignore.end();
1592 }
1593
CreateModel_dim2_axis1_quant8(Model * model)1594 void CreateModel_dim2_axis1_quant8(Model *model) {
1595 OperandType type1(Type::INT32, {});
1596 OperandType type35(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 0.1f, 32);
1597 OperandType type36(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 0.0078125f, 128);
1598 // Phase 1, operands
1599 auto op1 = model->addOperand(&type35);
1600 auto axis = model->addOperand(&type1);
1601 auto op2 = model->addOperand(&type36);
1602 // Phase 2, operations
1603 static int32_t axis_init[] = {1};
1604 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1605 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1606 // Phase 3, inputs and outputs
1607 model->identifyInputsAndOutputs(
1608 {op1},
1609 {op2});
1610 assert(model->isValid());
1611 }
1612
is_ignored_dim2_axis1_quant8(int i)1613 inline bool is_ignored_dim2_axis1_quant8(int i) {
1614 static std::set<int> ignore = {};
1615 return ignore.find(i) != ignore.end();
1616 }
1617
CreateModel_dim2_axis1_neg(Model * model)1618 void CreateModel_dim2_axis1_neg(Model *model) {
1619 OperandType type1(Type::INT32, {});
1620 OperandType type33(Type::TENSOR_FLOAT32, {2, 3});
1621 // Phase 1, operands
1622 auto op1 = model->addOperand(&type33);
1623 auto axis = model->addOperand(&type1);
1624 auto op2 = model->addOperand(&type33);
1625 // Phase 2, operations
1626 static int32_t axis_init[] = {-1};
1627 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1628 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1629 // Phase 3, inputs and outputs
1630 model->identifyInputsAndOutputs(
1631 {op1},
1632 {op2});
1633 assert(model->isValid());
1634 }
1635
is_ignored_dim2_axis1_neg(int i)1636 inline bool is_ignored_dim2_axis1_neg(int i) {
1637 static std::set<int> ignore = {};
1638 return ignore.find(i) != ignore.end();
1639 }
1640
CreateModel_dim2_axis1_neg_relaxed(Model * model)1641 void CreateModel_dim2_axis1_neg_relaxed(Model *model) {
1642 OperandType type1(Type::INT32, {});
1643 OperandType type33(Type::TENSOR_FLOAT32, {2, 3});
1644 // Phase 1, operands
1645 auto op1 = model->addOperand(&type33);
1646 auto axis = model->addOperand(&type1);
1647 auto op2 = model->addOperand(&type33);
1648 // Phase 2, operations
1649 static int32_t axis_init[] = {-1};
1650 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1651 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1652 // Phase 3, inputs and outputs
1653 model->identifyInputsAndOutputs(
1654 {op1},
1655 {op2});
1656 // Phase 4: set relaxed execution
1657 model->relaxComputationFloat32toFloat16(true);
1658 assert(model->isValid());
1659 }
1660
is_ignored_dim2_axis1_neg_relaxed(int i)1661 inline bool is_ignored_dim2_axis1_neg_relaxed(int i) {
1662 static std::set<int> ignore = {};
1663 return ignore.find(i) != ignore.end();
1664 }
1665
CreateModel_dim2_axis1_neg_float16(Model * model)1666 void CreateModel_dim2_axis1_neg_float16(Model *model) {
1667 OperandType type1(Type::INT32, {});
1668 OperandType type34(Type::TENSOR_FLOAT16, {2, 3});
1669 // Phase 1, operands
1670 auto op1 = model->addOperand(&type34);
1671 auto axis = model->addOperand(&type1);
1672 auto op2 = model->addOperand(&type34);
1673 // Phase 2, operations
1674 static int32_t axis_init[] = {-1};
1675 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1676 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1677 // Phase 3, inputs and outputs
1678 model->identifyInputsAndOutputs(
1679 {op1},
1680 {op2});
1681 assert(model->isValid());
1682 }
1683
is_ignored_dim2_axis1_neg_float16(int i)1684 inline bool is_ignored_dim2_axis1_neg_float16(int i) {
1685 static std::set<int> ignore = {};
1686 return ignore.find(i) != ignore.end();
1687 }
1688
CreateModel_dim2_axis1_neg_quant8(Model * model)1689 void CreateModel_dim2_axis1_neg_quant8(Model *model) {
1690 OperandType type1(Type::INT32, {});
1691 OperandType type35(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 0.1f, 32);
1692 OperandType type36(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 0.0078125f, 128);
1693 // Phase 1, operands
1694 auto op1 = model->addOperand(&type35);
1695 auto axis = model->addOperand(&type1);
1696 auto op2 = model->addOperand(&type36);
1697 // Phase 2, operations
1698 static int32_t axis_init[] = {-1};
1699 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1700 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1701 // Phase 3, inputs and outputs
1702 model->identifyInputsAndOutputs(
1703 {op1},
1704 {op2});
1705 assert(model->isValid());
1706 }
1707
is_ignored_dim2_axis1_neg_quant8(int i)1708 inline bool is_ignored_dim2_axis1_neg_quant8(int i) {
1709 static std::set<int> ignore = {};
1710 return ignore.find(i) != ignore.end();
1711 }
1712
CreateModel_dim1_axis0(Model * model)1713 void CreateModel_dim1_axis0(Model *model) {
1714 OperandType type1(Type::INT32, {});
1715 OperandType type37(Type::TENSOR_FLOAT32, {3});
1716 // Phase 1, operands
1717 auto op1 = model->addOperand(&type37);
1718 auto axis = model->addOperand(&type1);
1719 auto op2 = model->addOperand(&type37);
1720 // Phase 2, operations
1721 static int32_t axis_init[] = {0};
1722 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1723 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1724 // Phase 3, inputs and outputs
1725 model->identifyInputsAndOutputs(
1726 {op1},
1727 {op2});
1728 assert(model->isValid());
1729 }
1730
is_ignored_dim1_axis0(int i)1731 inline bool is_ignored_dim1_axis0(int i) {
1732 static std::set<int> ignore = {};
1733 return ignore.find(i) != ignore.end();
1734 }
1735
CreateModel_dim1_axis0_relaxed(Model * model)1736 void CreateModel_dim1_axis0_relaxed(Model *model) {
1737 OperandType type1(Type::INT32, {});
1738 OperandType type37(Type::TENSOR_FLOAT32, {3});
1739 // Phase 1, operands
1740 auto op1 = model->addOperand(&type37);
1741 auto axis = model->addOperand(&type1);
1742 auto op2 = model->addOperand(&type37);
1743 // Phase 2, operations
1744 static int32_t axis_init[] = {0};
1745 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1746 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1747 // Phase 3, inputs and outputs
1748 model->identifyInputsAndOutputs(
1749 {op1},
1750 {op2});
1751 // Phase 4: set relaxed execution
1752 model->relaxComputationFloat32toFloat16(true);
1753 assert(model->isValid());
1754 }
1755
is_ignored_dim1_axis0_relaxed(int i)1756 inline bool is_ignored_dim1_axis0_relaxed(int i) {
1757 static std::set<int> ignore = {};
1758 return ignore.find(i) != ignore.end();
1759 }
1760
CreateModel_dim1_axis0_float16(Model * model)1761 void CreateModel_dim1_axis0_float16(Model *model) {
1762 OperandType type1(Type::INT32, {});
1763 OperandType type38(Type::TENSOR_FLOAT16, {3});
1764 // Phase 1, operands
1765 auto op1 = model->addOperand(&type38);
1766 auto axis = model->addOperand(&type1);
1767 auto op2 = model->addOperand(&type38);
1768 // Phase 2, operations
1769 static int32_t axis_init[] = {0};
1770 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1771 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1772 // Phase 3, inputs and outputs
1773 model->identifyInputsAndOutputs(
1774 {op1},
1775 {op2});
1776 assert(model->isValid());
1777 }
1778
is_ignored_dim1_axis0_float16(int i)1779 inline bool is_ignored_dim1_axis0_float16(int i) {
1780 static std::set<int> ignore = {};
1781 return ignore.find(i) != ignore.end();
1782 }
1783
CreateModel_dim1_axis0_quant8(Model * model)1784 void CreateModel_dim1_axis0_quant8(Model *model) {
1785 OperandType type1(Type::INT32, {});
1786 OperandType type39(Type::TENSOR_QUANT8_ASYMM, {3}, 0.1f, 32);
1787 OperandType type40(Type::TENSOR_QUANT8_ASYMM, {3}, 0.0078125f, 128);
1788 // Phase 1, operands
1789 auto op1 = model->addOperand(&type39);
1790 auto axis = model->addOperand(&type1);
1791 auto op2 = model->addOperand(&type40);
1792 // Phase 2, operations
1793 static int32_t axis_init[] = {0};
1794 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1795 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1796 // Phase 3, inputs and outputs
1797 model->identifyInputsAndOutputs(
1798 {op1},
1799 {op2});
1800 assert(model->isValid());
1801 }
1802
is_ignored_dim1_axis0_quant8(int i)1803 inline bool is_ignored_dim1_axis0_quant8(int i) {
1804 static std::set<int> ignore = {};
1805 return ignore.find(i) != ignore.end();
1806 }
1807
CreateModel_dim1_axis0_neg(Model * model)1808 void CreateModel_dim1_axis0_neg(Model *model) {
1809 OperandType type1(Type::INT32, {});
1810 OperandType type37(Type::TENSOR_FLOAT32, {3});
1811 // Phase 1, operands
1812 auto op1 = model->addOperand(&type37);
1813 auto axis = model->addOperand(&type1);
1814 auto op2 = model->addOperand(&type37);
1815 // Phase 2, operations
1816 static int32_t axis_init[] = {-1};
1817 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1818 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1819 // Phase 3, inputs and outputs
1820 model->identifyInputsAndOutputs(
1821 {op1},
1822 {op2});
1823 assert(model->isValid());
1824 }
1825
is_ignored_dim1_axis0_neg(int i)1826 inline bool is_ignored_dim1_axis0_neg(int i) {
1827 static std::set<int> ignore = {};
1828 return ignore.find(i) != ignore.end();
1829 }
1830
CreateModel_dim1_axis0_neg_relaxed(Model * model)1831 void CreateModel_dim1_axis0_neg_relaxed(Model *model) {
1832 OperandType type1(Type::INT32, {});
1833 OperandType type37(Type::TENSOR_FLOAT32, {3});
1834 // Phase 1, operands
1835 auto op1 = model->addOperand(&type37);
1836 auto axis = model->addOperand(&type1);
1837 auto op2 = model->addOperand(&type37);
1838 // Phase 2, operations
1839 static int32_t axis_init[] = {-1};
1840 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1841 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1842 // Phase 3, inputs and outputs
1843 model->identifyInputsAndOutputs(
1844 {op1},
1845 {op2});
1846 // Phase 4: set relaxed execution
1847 model->relaxComputationFloat32toFloat16(true);
1848 assert(model->isValid());
1849 }
1850
is_ignored_dim1_axis0_neg_relaxed(int i)1851 inline bool is_ignored_dim1_axis0_neg_relaxed(int i) {
1852 static std::set<int> ignore = {};
1853 return ignore.find(i) != ignore.end();
1854 }
1855
CreateModel_dim1_axis0_neg_float16(Model * model)1856 void CreateModel_dim1_axis0_neg_float16(Model *model) {
1857 OperandType type1(Type::INT32, {});
1858 OperandType type38(Type::TENSOR_FLOAT16, {3});
1859 // Phase 1, operands
1860 auto op1 = model->addOperand(&type38);
1861 auto axis = model->addOperand(&type1);
1862 auto op2 = model->addOperand(&type38);
1863 // Phase 2, operations
1864 static int32_t axis_init[] = {-1};
1865 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1866 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1867 // Phase 3, inputs and outputs
1868 model->identifyInputsAndOutputs(
1869 {op1},
1870 {op2});
1871 assert(model->isValid());
1872 }
1873
is_ignored_dim1_axis0_neg_float16(int i)1874 inline bool is_ignored_dim1_axis0_neg_float16(int i) {
1875 static std::set<int> ignore = {};
1876 return ignore.find(i) != ignore.end();
1877 }
1878
CreateModel_dim1_axis0_neg_quant8(Model * model)1879 void CreateModel_dim1_axis0_neg_quant8(Model *model) {
1880 OperandType type1(Type::INT32, {});
1881 OperandType type39(Type::TENSOR_QUANT8_ASYMM, {3}, 0.1f, 32);
1882 OperandType type40(Type::TENSOR_QUANT8_ASYMM, {3}, 0.0078125f, 128);
1883 // Phase 1, operands
1884 auto op1 = model->addOperand(&type39);
1885 auto axis = model->addOperand(&type1);
1886 auto op2 = model->addOperand(&type40);
1887 // Phase 2, operations
1888 static int32_t axis_init[] = {-1};
1889 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1890 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1891 // Phase 3, inputs and outputs
1892 model->identifyInputsAndOutputs(
1893 {op1},
1894 {op2});
1895 assert(model->isValid());
1896 }
1897
is_ignored_dim1_axis0_neg_quant8(int i)1898 inline bool is_ignored_dim1_axis0_neg_quant8(int i) {
1899 static std::set<int> ignore = {};
1900 return ignore.find(i) != ignore.end();
1901 }
1902
CreateModel_relaxed_dim4_axis0(Model * model)1903 void CreateModel_relaxed_dim4_axis0(Model *model) {
1904 OperandType type1(Type::INT32, {});
1905 OperandType type2(Type::TENSOR_FLOAT32, {3, 2, 2, 2});
1906 // Phase 1, operands
1907 auto op1 = model->addOperand(&type2);
1908 auto axis = model->addOperand(&type1);
1909 auto op2 = model->addOperand(&type2);
1910 // Phase 2, operations
1911 static int32_t axis_init[] = {0};
1912 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1913 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1914 // Phase 3, inputs and outputs
1915 model->identifyInputsAndOutputs(
1916 {op1},
1917 {op2});
1918 // Phase 4: set relaxed execution
1919 model->relaxComputationFloat32toFloat16(true);
1920 assert(model->isValid());
1921 }
1922
is_ignored_relaxed_dim4_axis0(int i)1923 inline bool is_ignored_relaxed_dim4_axis0(int i) {
1924 static std::set<int> ignore = {};
1925 return ignore.find(i) != ignore.end();
1926 }
1927
CreateModel_relaxed_dim4_axis0_relaxed(Model * model)1928 void CreateModel_relaxed_dim4_axis0_relaxed(Model *model) {
1929 OperandType type1(Type::INT32, {});
1930 OperandType type2(Type::TENSOR_FLOAT32, {3, 2, 2, 2});
1931 // Phase 1, operands
1932 auto op1 = model->addOperand(&type2);
1933 auto axis = model->addOperand(&type1);
1934 auto op2 = model->addOperand(&type2);
1935 // Phase 2, operations
1936 static int32_t axis_init[] = {0};
1937 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1938 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1939 // Phase 3, inputs and outputs
1940 model->identifyInputsAndOutputs(
1941 {op1},
1942 {op2});
1943 // Phase 4: set relaxed execution
1944 model->relaxComputationFloat32toFloat16(true);
1945 assert(model->isValid());
1946 }
1947
is_ignored_relaxed_dim4_axis0_relaxed(int i)1948 inline bool is_ignored_relaxed_dim4_axis0_relaxed(int i) {
1949 static std::set<int> ignore = {};
1950 return ignore.find(i) != ignore.end();
1951 }
1952
CreateModel_relaxed_dim4_axis0_float16(Model * model)1953 void CreateModel_relaxed_dim4_axis0_float16(Model *model) {
1954 OperandType type1(Type::INT32, {});
1955 OperandType type3(Type::TENSOR_FLOAT16, {3, 2, 2, 2});
1956 // Phase 1, operands
1957 auto op1 = model->addOperand(&type3);
1958 auto axis = model->addOperand(&type1);
1959 auto op2 = model->addOperand(&type3);
1960 // Phase 2, operations
1961 static int32_t axis_init[] = {0};
1962 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1963 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1964 // Phase 3, inputs and outputs
1965 model->identifyInputsAndOutputs(
1966 {op1},
1967 {op2});
1968 // Phase 4: set relaxed execution
1969 model->relaxComputationFloat32toFloat16(true);
1970 assert(model->isValid());
1971 }
1972
is_ignored_relaxed_dim4_axis0_float16(int i)1973 inline bool is_ignored_relaxed_dim4_axis0_float16(int i) {
1974 static std::set<int> ignore = {};
1975 return ignore.find(i) != ignore.end();
1976 }
1977
CreateModel_relaxed_dim4_axis0_quant8(Model * model)1978 void CreateModel_relaxed_dim4_axis0_quant8(Model *model) {
1979 OperandType type1(Type::INT32, {});
1980 OperandType type4(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2, 2}, 0.1f, 32);
1981 OperandType type5(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2, 2}, 0.0078125f, 128);
1982 // Phase 1, operands
1983 auto op1 = model->addOperand(&type4);
1984 auto axis = model->addOperand(&type1);
1985 auto op2 = model->addOperand(&type5);
1986 // Phase 2, operations
1987 static int32_t axis_init[] = {0};
1988 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1989 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
1990 // Phase 3, inputs and outputs
1991 model->identifyInputsAndOutputs(
1992 {op1},
1993 {op2});
1994 // Phase 4: set relaxed execution
1995 model->relaxComputationFloat32toFloat16(true);
1996 assert(model->isValid());
1997 }
1998
is_ignored_relaxed_dim4_axis0_quant8(int i)1999 inline bool is_ignored_relaxed_dim4_axis0_quant8(int i) {
2000 static std::set<int> ignore = {};
2001 return ignore.find(i) != ignore.end();
2002 }
2003
CreateModel_relaxed_dim4_axis0_neg(Model * model)2004 void CreateModel_relaxed_dim4_axis0_neg(Model *model) {
2005 OperandType type1(Type::INT32, {});
2006 OperandType type2(Type::TENSOR_FLOAT32, {3, 2, 2, 2});
2007 // Phase 1, operands
2008 auto op1 = model->addOperand(&type2);
2009 auto axis = model->addOperand(&type1);
2010 auto op2 = model->addOperand(&type2);
2011 // Phase 2, operations
2012 static int32_t axis_init[] = {-4};
2013 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2014 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2015 // Phase 3, inputs and outputs
2016 model->identifyInputsAndOutputs(
2017 {op1},
2018 {op2});
2019 // Phase 4: set relaxed execution
2020 model->relaxComputationFloat32toFloat16(true);
2021 assert(model->isValid());
2022 }
2023
is_ignored_relaxed_dim4_axis0_neg(int i)2024 inline bool is_ignored_relaxed_dim4_axis0_neg(int i) {
2025 static std::set<int> ignore = {};
2026 return ignore.find(i) != ignore.end();
2027 }
2028
CreateModel_relaxed_dim4_axis0_neg_relaxed(Model * model)2029 void CreateModel_relaxed_dim4_axis0_neg_relaxed(Model *model) {
2030 OperandType type1(Type::INT32, {});
2031 OperandType type2(Type::TENSOR_FLOAT32, {3, 2, 2, 2});
2032 // Phase 1, operands
2033 auto op1 = model->addOperand(&type2);
2034 auto axis = model->addOperand(&type1);
2035 auto op2 = model->addOperand(&type2);
2036 // Phase 2, operations
2037 static int32_t axis_init[] = {-4};
2038 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2039 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2040 // Phase 3, inputs and outputs
2041 model->identifyInputsAndOutputs(
2042 {op1},
2043 {op2});
2044 // Phase 4: set relaxed execution
2045 model->relaxComputationFloat32toFloat16(true);
2046 assert(model->isValid());
2047 }
2048
is_ignored_relaxed_dim4_axis0_neg_relaxed(int i)2049 inline bool is_ignored_relaxed_dim4_axis0_neg_relaxed(int i) {
2050 static std::set<int> ignore = {};
2051 return ignore.find(i) != ignore.end();
2052 }
2053
CreateModel_relaxed_dim4_axis0_neg_float16(Model * model)2054 void CreateModel_relaxed_dim4_axis0_neg_float16(Model *model) {
2055 OperandType type1(Type::INT32, {});
2056 OperandType type3(Type::TENSOR_FLOAT16, {3, 2, 2, 2});
2057 // Phase 1, operands
2058 auto op1 = model->addOperand(&type3);
2059 auto axis = model->addOperand(&type1);
2060 auto op2 = model->addOperand(&type3);
2061 // Phase 2, operations
2062 static int32_t axis_init[] = {-4};
2063 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2064 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2065 // Phase 3, inputs and outputs
2066 model->identifyInputsAndOutputs(
2067 {op1},
2068 {op2});
2069 // Phase 4: set relaxed execution
2070 model->relaxComputationFloat32toFloat16(true);
2071 assert(model->isValid());
2072 }
2073
is_ignored_relaxed_dim4_axis0_neg_float16(int i)2074 inline bool is_ignored_relaxed_dim4_axis0_neg_float16(int i) {
2075 static std::set<int> ignore = {};
2076 return ignore.find(i) != ignore.end();
2077 }
2078
CreateModel_relaxed_dim4_axis0_neg_quant8(Model * model)2079 void CreateModel_relaxed_dim4_axis0_neg_quant8(Model *model) {
2080 OperandType type1(Type::INT32, {});
2081 OperandType type4(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2, 2}, 0.1f, 32);
2082 OperandType type5(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2, 2}, 0.0078125f, 128);
2083 // Phase 1, operands
2084 auto op1 = model->addOperand(&type4);
2085 auto axis = model->addOperand(&type1);
2086 auto op2 = model->addOperand(&type5);
2087 // Phase 2, operations
2088 static int32_t axis_init[] = {-4};
2089 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2090 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2091 // Phase 3, inputs and outputs
2092 model->identifyInputsAndOutputs(
2093 {op1},
2094 {op2});
2095 // Phase 4: set relaxed execution
2096 model->relaxComputationFloat32toFloat16(true);
2097 assert(model->isValid());
2098 }
2099
is_ignored_relaxed_dim4_axis0_neg_quant8(int i)2100 inline bool is_ignored_relaxed_dim4_axis0_neg_quant8(int i) {
2101 static std::set<int> ignore = {};
2102 return ignore.find(i) != ignore.end();
2103 }
2104
CreateModel_relaxed_dim4_axis1(Model * model)2105 void CreateModel_relaxed_dim4_axis1(Model *model) {
2106 OperandType type1(Type::INT32, {});
2107 OperandType type6(Type::TENSOR_FLOAT32, {2, 3, 2, 2});
2108 // Phase 1, operands
2109 auto op1 = model->addOperand(&type6);
2110 auto axis = model->addOperand(&type1);
2111 auto op2 = model->addOperand(&type6);
2112 // Phase 2, operations
2113 static int32_t axis_init[] = {1};
2114 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2115 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2116 // Phase 3, inputs and outputs
2117 model->identifyInputsAndOutputs(
2118 {op1},
2119 {op2});
2120 // Phase 4: set relaxed execution
2121 model->relaxComputationFloat32toFloat16(true);
2122 assert(model->isValid());
2123 }
2124
is_ignored_relaxed_dim4_axis1(int i)2125 inline bool is_ignored_relaxed_dim4_axis1(int i) {
2126 static std::set<int> ignore = {};
2127 return ignore.find(i) != ignore.end();
2128 }
2129
CreateModel_relaxed_dim4_axis1_relaxed(Model * model)2130 void CreateModel_relaxed_dim4_axis1_relaxed(Model *model) {
2131 OperandType type1(Type::INT32, {});
2132 OperandType type6(Type::TENSOR_FLOAT32, {2, 3, 2, 2});
2133 // Phase 1, operands
2134 auto op1 = model->addOperand(&type6);
2135 auto axis = model->addOperand(&type1);
2136 auto op2 = model->addOperand(&type6);
2137 // Phase 2, operations
2138 static int32_t axis_init[] = {1};
2139 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2140 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2141 // Phase 3, inputs and outputs
2142 model->identifyInputsAndOutputs(
2143 {op1},
2144 {op2});
2145 // Phase 4: set relaxed execution
2146 model->relaxComputationFloat32toFloat16(true);
2147 assert(model->isValid());
2148 }
2149
is_ignored_relaxed_dim4_axis1_relaxed(int i)2150 inline bool is_ignored_relaxed_dim4_axis1_relaxed(int i) {
2151 static std::set<int> ignore = {};
2152 return ignore.find(i) != ignore.end();
2153 }
2154
CreateModel_relaxed_dim4_axis1_float16(Model * model)2155 void CreateModel_relaxed_dim4_axis1_float16(Model *model) {
2156 OperandType type1(Type::INT32, {});
2157 OperandType type7(Type::TENSOR_FLOAT16, {2, 3, 2, 2});
2158 // Phase 1, operands
2159 auto op1 = model->addOperand(&type7);
2160 auto axis = model->addOperand(&type1);
2161 auto op2 = model->addOperand(&type7);
2162 // Phase 2, operations
2163 static int32_t axis_init[] = {1};
2164 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2165 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2166 // Phase 3, inputs and outputs
2167 model->identifyInputsAndOutputs(
2168 {op1},
2169 {op2});
2170 // Phase 4: set relaxed execution
2171 model->relaxComputationFloat32toFloat16(true);
2172 assert(model->isValid());
2173 }
2174
is_ignored_relaxed_dim4_axis1_float16(int i)2175 inline bool is_ignored_relaxed_dim4_axis1_float16(int i) {
2176 static std::set<int> ignore = {};
2177 return ignore.find(i) != ignore.end();
2178 }
2179
CreateModel_relaxed_dim4_axis1_quant8(Model * model)2180 void CreateModel_relaxed_dim4_axis1_quant8(Model *model) {
2181 OperandType type1(Type::INT32, {});
2182 OperandType type8(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2, 2}, 0.1f, 32);
2183 OperandType type9(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2, 2}, 0.0078125f, 128);
2184 // Phase 1, operands
2185 auto op1 = model->addOperand(&type8);
2186 auto axis = model->addOperand(&type1);
2187 auto op2 = model->addOperand(&type9);
2188 // Phase 2, operations
2189 static int32_t axis_init[] = {1};
2190 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2191 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2192 // Phase 3, inputs and outputs
2193 model->identifyInputsAndOutputs(
2194 {op1},
2195 {op2});
2196 // Phase 4: set relaxed execution
2197 model->relaxComputationFloat32toFloat16(true);
2198 assert(model->isValid());
2199 }
2200
is_ignored_relaxed_dim4_axis1_quant8(int i)2201 inline bool is_ignored_relaxed_dim4_axis1_quant8(int i) {
2202 static std::set<int> ignore = {};
2203 return ignore.find(i) != ignore.end();
2204 }
2205
CreateModel_relaxed_dim4_axis1_neg(Model * model)2206 void CreateModel_relaxed_dim4_axis1_neg(Model *model) {
2207 OperandType type1(Type::INT32, {});
2208 OperandType type6(Type::TENSOR_FLOAT32, {2, 3, 2, 2});
2209 // Phase 1, operands
2210 auto op1 = model->addOperand(&type6);
2211 auto axis = model->addOperand(&type1);
2212 auto op2 = model->addOperand(&type6);
2213 // Phase 2, operations
2214 static int32_t axis_init[] = {-3};
2215 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2216 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2217 // Phase 3, inputs and outputs
2218 model->identifyInputsAndOutputs(
2219 {op1},
2220 {op2});
2221 // Phase 4: set relaxed execution
2222 model->relaxComputationFloat32toFloat16(true);
2223 assert(model->isValid());
2224 }
2225
is_ignored_relaxed_dim4_axis1_neg(int i)2226 inline bool is_ignored_relaxed_dim4_axis1_neg(int i) {
2227 static std::set<int> ignore = {};
2228 return ignore.find(i) != ignore.end();
2229 }
2230
CreateModel_relaxed_dim4_axis1_neg_relaxed(Model * model)2231 void CreateModel_relaxed_dim4_axis1_neg_relaxed(Model *model) {
2232 OperandType type1(Type::INT32, {});
2233 OperandType type6(Type::TENSOR_FLOAT32, {2, 3, 2, 2});
2234 // Phase 1, operands
2235 auto op1 = model->addOperand(&type6);
2236 auto axis = model->addOperand(&type1);
2237 auto op2 = model->addOperand(&type6);
2238 // Phase 2, operations
2239 static int32_t axis_init[] = {-3};
2240 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2241 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2242 // Phase 3, inputs and outputs
2243 model->identifyInputsAndOutputs(
2244 {op1},
2245 {op2});
2246 // Phase 4: set relaxed execution
2247 model->relaxComputationFloat32toFloat16(true);
2248 assert(model->isValid());
2249 }
2250
is_ignored_relaxed_dim4_axis1_neg_relaxed(int i)2251 inline bool is_ignored_relaxed_dim4_axis1_neg_relaxed(int i) {
2252 static std::set<int> ignore = {};
2253 return ignore.find(i) != ignore.end();
2254 }
2255
CreateModel_relaxed_dim4_axis1_neg_float16(Model * model)2256 void CreateModel_relaxed_dim4_axis1_neg_float16(Model *model) {
2257 OperandType type1(Type::INT32, {});
2258 OperandType type7(Type::TENSOR_FLOAT16, {2, 3, 2, 2});
2259 // Phase 1, operands
2260 auto op1 = model->addOperand(&type7);
2261 auto axis = model->addOperand(&type1);
2262 auto op2 = model->addOperand(&type7);
2263 // Phase 2, operations
2264 static int32_t axis_init[] = {-3};
2265 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2266 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2267 // Phase 3, inputs and outputs
2268 model->identifyInputsAndOutputs(
2269 {op1},
2270 {op2});
2271 // Phase 4: set relaxed execution
2272 model->relaxComputationFloat32toFloat16(true);
2273 assert(model->isValid());
2274 }
2275
is_ignored_relaxed_dim4_axis1_neg_float16(int i)2276 inline bool is_ignored_relaxed_dim4_axis1_neg_float16(int i) {
2277 static std::set<int> ignore = {};
2278 return ignore.find(i) != ignore.end();
2279 }
2280
CreateModel_relaxed_dim4_axis1_neg_quant8(Model * model)2281 void CreateModel_relaxed_dim4_axis1_neg_quant8(Model *model) {
2282 OperandType type1(Type::INT32, {});
2283 OperandType type8(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2, 2}, 0.1f, 32);
2284 OperandType type9(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2, 2}, 0.0078125f, 128);
2285 // Phase 1, operands
2286 auto op1 = model->addOperand(&type8);
2287 auto axis = model->addOperand(&type1);
2288 auto op2 = model->addOperand(&type9);
2289 // Phase 2, operations
2290 static int32_t axis_init[] = {-3};
2291 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2292 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2293 // Phase 3, inputs and outputs
2294 model->identifyInputsAndOutputs(
2295 {op1},
2296 {op2});
2297 // Phase 4: set relaxed execution
2298 model->relaxComputationFloat32toFloat16(true);
2299 assert(model->isValid());
2300 }
2301
is_ignored_relaxed_dim4_axis1_neg_quant8(int i)2302 inline bool is_ignored_relaxed_dim4_axis1_neg_quant8(int i) {
2303 static std::set<int> ignore = {};
2304 return ignore.find(i) != ignore.end();
2305 }
2306
CreateModel_relaxed_dim4_axis2(Model * model)2307 void CreateModel_relaxed_dim4_axis2(Model *model) {
2308 OperandType type1(Type::INT32, {});
2309 OperandType type10(Type::TENSOR_FLOAT32, {2, 2, 3, 2});
2310 // Phase 1, operands
2311 auto op1 = model->addOperand(&type10);
2312 auto axis = model->addOperand(&type1);
2313 auto op2 = model->addOperand(&type10);
2314 // Phase 2, operations
2315 static int32_t axis_init[] = {2};
2316 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2317 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2318 // Phase 3, inputs and outputs
2319 model->identifyInputsAndOutputs(
2320 {op1},
2321 {op2});
2322 // Phase 4: set relaxed execution
2323 model->relaxComputationFloat32toFloat16(true);
2324 assert(model->isValid());
2325 }
2326
is_ignored_relaxed_dim4_axis2(int i)2327 inline bool is_ignored_relaxed_dim4_axis2(int i) {
2328 static std::set<int> ignore = {};
2329 return ignore.find(i) != ignore.end();
2330 }
2331
CreateModel_relaxed_dim4_axis2_relaxed(Model * model)2332 void CreateModel_relaxed_dim4_axis2_relaxed(Model *model) {
2333 OperandType type1(Type::INT32, {});
2334 OperandType type10(Type::TENSOR_FLOAT32, {2, 2, 3, 2});
2335 // Phase 1, operands
2336 auto op1 = model->addOperand(&type10);
2337 auto axis = model->addOperand(&type1);
2338 auto op2 = model->addOperand(&type10);
2339 // Phase 2, operations
2340 static int32_t axis_init[] = {2};
2341 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2342 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2343 // Phase 3, inputs and outputs
2344 model->identifyInputsAndOutputs(
2345 {op1},
2346 {op2});
2347 // Phase 4: set relaxed execution
2348 model->relaxComputationFloat32toFloat16(true);
2349 assert(model->isValid());
2350 }
2351
is_ignored_relaxed_dim4_axis2_relaxed(int i)2352 inline bool is_ignored_relaxed_dim4_axis2_relaxed(int i) {
2353 static std::set<int> ignore = {};
2354 return ignore.find(i) != ignore.end();
2355 }
2356
CreateModel_relaxed_dim4_axis2_float16(Model * model)2357 void CreateModel_relaxed_dim4_axis2_float16(Model *model) {
2358 OperandType type1(Type::INT32, {});
2359 OperandType type11(Type::TENSOR_FLOAT16, {2, 2, 3, 2});
2360 // Phase 1, operands
2361 auto op1 = model->addOperand(&type11);
2362 auto axis = model->addOperand(&type1);
2363 auto op2 = model->addOperand(&type11);
2364 // Phase 2, operations
2365 static int32_t axis_init[] = {2};
2366 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2367 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2368 // Phase 3, inputs and outputs
2369 model->identifyInputsAndOutputs(
2370 {op1},
2371 {op2});
2372 // Phase 4: set relaxed execution
2373 model->relaxComputationFloat32toFloat16(true);
2374 assert(model->isValid());
2375 }
2376
is_ignored_relaxed_dim4_axis2_float16(int i)2377 inline bool is_ignored_relaxed_dim4_axis2_float16(int i) {
2378 static std::set<int> ignore = {};
2379 return ignore.find(i) != ignore.end();
2380 }
2381
CreateModel_relaxed_dim4_axis2_quant8(Model * model)2382 void CreateModel_relaxed_dim4_axis2_quant8(Model *model) {
2383 OperandType type1(Type::INT32, {});
2384 OperandType type12(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3, 2}, 0.1f, 32);
2385 OperandType type13(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3, 2}, 0.0078125f, 128);
2386 // Phase 1, operands
2387 auto op1 = model->addOperand(&type12);
2388 auto axis = model->addOperand(&type1);
2389 auto op2 = model->addOperand(&type13);
2390 // Phase 2, operations
2391 static int32_t axis_init[] = {2};
2392 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2393 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2394 // Phase 3, inputs and outputs
2395 model->identifyInputsAndOutputs(
2396 {op1},
2397 {op2});
2398 // Phase 4: set relaxed execution
2399 model->relaxComputationFloat32toFloat16(true);
2400 assert(model->isValid());
2401 }
2402
is_ignored_relaxed_dim4_axis2_quant8(int i)2403 inline bool is_ignored_relaxed_dim4_axis2_quant8(int i) {
2404 static std::set<int> ignore = {};
2405 return ignore.find(i) != ignore.end();
2406 }
2407
CreateModel_relaxed_dim4_axis2_neg(Model * model)2408 void CreateModel_relaxed_dim4_axis2_neg(Model *model) {
2409 OperandType type1(Type::INT32, {});
2410 OperandType type10(Type::TENSOR_FLOAT32, {2, 2, 3, 2});
2411 // Phase 1, operands
2412 auto op1 = model->addOperand(&type10);
2413 auto axis = model->addOperand(&type1);
2414 auto op2 = model->addOperand(&type10);
2415 // Phase 2, operations
2416 static int32_t axis_init[] = {-2};
2417 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2418 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2419 // Phase 3, inputs and outputs
2420 model->identifyInputsAndOutputs(
2421 {op1},
2422 {op2});
2423 // Phase 4: set relaxed execution
2424 model->relaxComputationFloat32toFloat16(true);
2425 assert(model->isValid());
2426 }
2427
is_ignored_relaxed_dim4_axis2_neg(int i)2428 inline bool is_ignored_relaxed_dim4_axis2_neg(int i) {
2429 static std::set<int> ignore = {};
2430 return ignore.find(i) != ignore.end();
2431 }
2432
CreateModel_relaxed_dim4_axis2_neg_relaxed(Model * model)2433 void CreateModel_relaxed_dim4_axis2_neg_relaxed(Model *model) {
2434 OperandType type1(Type::INT32, {});
2435 OperandType type10(Type::TENSOR_FLOAT32, {2, 2, 3, 2});
2436 // Phase 1, operands
2437 auto op1 = model->addOperand(&type10);
2438 auto axis = model->addOperand(&type1);
2439 auto op2 = model->addOperand(&type10);
2440 // Phase 2, operations
2441 static int32_t axis_init[] = {-2};
2442 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2443 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2444 // Phase 3, inputs and outputs
2445 model->identifyInputsAndOutputs(
2446 {op1},
2447 {op2});
2448 // Phase 4: set relaxed execution
2449 model->relaxComputationFloat32toFloat16(true);
2450 assert(model->isValid());
2451 }
2452
is_ignored_relaxed_dim4_axis2_neg_relaxed(int i)2453 inline bool is_ignored_relaxed_dim4_axis2_neg_relaxed(int i) {
2454 static std::set<int> ignore = {};
2455 return ignore.find(i) != ignore.end();
2456 }
2457
CreateModel_relaxed_dim4_axis2_neg_float16(Model * model)2458 void CreateModel_relaxed_dim4_axis2_neg_float16(Model *model) {
2459 OperandType type1(Type::INT32, {});
2460 OperandType type11(Type::TENSOR_FLOAT16, {2, 2, 3, 2});
2461 // Phase 1, operands
2462 auto op1 = model->addOperand(&type11);
2463 auto axis = model->addOperand(&type1);
2464 auto op2 = model->addOperand(&type11);
2465 // Phase 2, operations
2466 static int32_t axis_init[] = {-2};
2467 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2468 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2469 // Phase 3, inputs and outputs
2470 model->identifyInputsAndOutputs(
2471 {op1},
2472 {op2});
2473 // Phase 4: set relaxed execution
2474 model->relaxComputationFloat32toFloat16(true);
2475 assert(model->isValid());
2476 }
2477
is_ignored_relaxed_dim4_axis2_neg_float16(int i)2478 inline bool is_ignored_relaxed_dim4_axis2_neg_float16(int i) {
2479 static std::set<int> ignore = {};
2480 return ignore.find(i) != ignore.end();
2481 }
2482
CreateModel_relaxed_dim4_axis2_neg_quant8(Model * model)2483 void CreateModel_relaxed_dim4_axis2_neg_quant8(Model *model) {
2484 OperandType type1(Type::INT32, {});
2485 OperandType type12(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3, 2}, 0.1f, 32);
2486 OperandType type13(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3, 2}, 0.0078125f, 128);
2487 // Phase 1, operands
2488 auto op1 = model->addOperand(&type12);
2489 auto axis = model->addOperand(&type1);
2490 auto op2 = model->addOperand(&type13);
2491 // Phase 2, operations
2492 static int32_t axis_init[] = {-2};
2493 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2494 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2495 // Phase 3, inputs and outputs
2496 model->identifyInputsAndOutputs(
2497 {op1},
2498 {op2});
2499 // Phase 4: set relaxed execution
2500 model->relaxComputationFloat32toFloat16(true);
2501 assert(model->isValid());
2502 }
2503
is_ignored_relaxed_dim4_axis2_neg_quant8(int i)2504 inline bool is_ignored_relaxed_dim4_axis2_neg_quant8(int i) {
2505 static std::set<int> ignore = {};
2506 return ignore.find(i) != ignore.end();
2507 }
2508
CreateModel_relaxed_dim4_axis3(Model * model)2509 void CreateModel_relaxed_dim4_axis3(Model *model) {
2510 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
2511 OperandType type1(Type::INT32, {});
2512 // Phase 1, operands
2513 auto op1 = model->addOperand(&type0);
2514 auto axis = model->addOperand(&type1);
2515 auto op2 = model->addOperand(&type0);
2516 // Phase 2, operations
2517 static int32_t axis_init[] = {3};
2518 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2519 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2520 // Phase 3, inputs and outputs
2521 model->identifyInputsAndOutputs(
2522 {op1},
2523 {op2});
2524 // Phase 4: set relaxed execution
2525 model->relaxComputationFloat32toFloat16(true);
2526 assert(model->isValid());
2527 }
2528
is_ignored_relaxed_dim4_axis3(int i)2529 inline bool is_ignored_relaxed_dim4_axis3(int i) {
2530 static std::set<int> ignore = {};
2531 return ignore.find(i) != ignore.end();
2532 }
2533
CreateModel_relaxed_dim4_axis3_relaxed(Model * model)2534 void CreateModel_relaxed_dim4_axis3_relaxed(Model *model) {
2535 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
2536 OperandType type1(Type::INT32, {});
2537 // Phase 1, operands
2538 auto op1 = model->addOperand(&type0);
2539 auto axis = model->addOperand(&type1);
2540 auto op2 = model->addOperand(&type0);
2541 // Phase 2, operations
2542 static int32_t axis_init[] = {3};
2543 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2544 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2545 // Phase 3, inputs and outputs
2546 model->identifyInputsAndOutputs(
2547 {op1},
2548 {op2});
2549 // Phase 4: set relaxed execution
2550 model->relaxComputationFloat32toFloat16(true);
2551 assert(model->isValid());
2552 }
2553
is_ignored_relaxed_dim4_axis3_relaxed(int i)2554 inline bool is_ignored_relaxed_dim4_axis3_relaxed(int i) {
2555 static std::set<int> ignore = {};
2556 return ignore.find(i) != ignore.end();
2557 }
2558
CreateModel_relaxed_dim4_axis3_float16(Model * model)2559 void CreateModel_relaxed_dim4_axis3_float16(Model *model) {
2560 OperandType type1(Type::INT32, {});
2561 OperandType type14(Type::TENSOR_FLOAT16, {2, 2, 2, 3});
2562 // Phase 1, operands
2563 auto op1 = model->addOperand(&type14);
2564 auto axis = model->addOperand(&type1);
2565 auto op2 = model->addOperand(&type14);
2566 // Phase 2, operations
2567 static int32_t axis_init[] = {3};
2568 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2569 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2570 // Phase 3, inputs and outputs
2571 model->identifyInputsAndOutputs(
2572 {op1},
2573 {op2});
2574 // Phase 4: set relaxed execution
2575 model->relaxComputationFloat32toFloat16(true);
2576 assert(model->isValid());
2577 }
2578
is_ignored_relaxed_dim4_axis3_float16(int i)2579 inline bool is_ignored_relaxed_dim4_axis3_float16(int i) {
2580 static std::set<int> ignore = {};
2581 return ignore.find(i) != ignore.end();
2582 }
2583
CreateModel_relaxed_dim4_axis3_quant8(Model * model)2584 void CreateModel_relaxed_dim4_axis3_quant8(Model *model) {
2585 OperandType type1(Type::INT32, {});
2586 OperandType type15(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 3}, 0.1f, 32);
2587 OperandType type16(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 3}, 0.0078125f, 128);
2588 // Phase 1, operands
2589 auto op1 = model->addOperand(&type15);
2590 auto axis = model->addOperand(&type1);
2591 auto op2 = model->addOperand(&type16);
2592 // Phase 2, operations
2593 static int32_t axis_init[] = {3};
2594 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2595 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2596 // Phase 3, inputs and outputs
2597 model->identifyInputsAndOutputs(
2598 {op1},
2599 {op2});
2600 // Phase 4: set relaxed execution
2601 model->relaxComputationFloat32toFloat16(true);
2602 assert(model->isValid());
2603 }
2604
is_ignored_relaxed_dim4_axis3_quant8(int i)2605 inline bool is_ignored_relaxed_dim4_axis3_quant8(int i) {
2606 static std::set<int> ignore = {};
2607 return ignore.find(i) != ignore.end();
2608 }
2609
CreateModel_relaxed_dim4_axis3_neg(Model * model)2610 void CreateModel_relaxed_dim4_axis3_neg(Model *model) {
2611 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
2612 OperandType type1(Type::INT32, {});
2613 // Phase 1, operands
2614 auto op1 = model->addOperand(&type0);
2615 auto axis = model->addOperand(&type1);
2616 auto op2 = model->addOperand(&type0);
2617 // Phase 2, operations
2618 static int32_t axis_init[] = {-1};
2619 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2620 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2621 // Phase 3, inputs and outputs
2622 model->identifyInputsAndOutputs(
2623 {op1},
2624 {op2});
2625 // Phase 4: set relaxed execution
2626 model->relaxComputationFloat32toFloat16(true);
2627 assert(model->isValid());
2628 }
2629
is_ignored_relaxed_dim4_axis3_neg(int i)2630 inline bool is_ignored_relaxed_dim4_axis3_neg(int i) {
2631 static std::set<int> ignore = {};
2632 return ignore.find(i) != ignore.end();
2633 }
2634
CreateModel_relaxed_dim4_axis3_neg_relaxed(Model * model)2635 void CreateModel_relaxed_dim4_axis3_neg_relaxed(Model *model) {
2636 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
2637 OperandType type1(Type::INT32, {});
2638 // Phase 1, operands
2639 auto op1 = model->addOperand(&type0);
2640 auto axis = model->addOperand(&type1);
2641 auto op2 = model->addOperand(&type0);
2642 // Phase 2, operations
2643 static int32_t axis_init[] = {-1};
2644 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2645 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2646 // Phase 3, inputs and outputs
2647 model->identifyInputsAndOutputs(
2648 {op1},
2649 {op2});
2650 // Phase 4: set relaxed execution
2651 model->relaxComputationFloat32toFloat16(true);
2652 assert(model->isValid());
2653 }
2654
is_ignored_relaxed_dim4_axis3_neg_relaxed(int i)2655 inline bool is_ignored_relaxed_dim4_axis3_neg_relaxed(int i) {
2656 static std::set<int> ignore = {};
2657 return ignore.find(i) != ignore.end();
2658 }
2659
CreateModel_relaxed_dim4_axis3_neg_float16(Model * model)2660 void CreateModel_relaxed_dim4_axis3_neg_float16(Model *model) {
2661 OperandType type1(Type::INT32, {});
2662 OperandType type14(Type::TENSOR_FLOAT16, {2, 2, 2, 3});
2663 // Phase 1, operands
2664 auto op1 = model->addOperand(&type14);
2665 auto axis = model->addOperand(&type1);
2666 auto op2 = model->addOperand(&type14);
2667 // Phase 2, operations
2668 static int32_t axis_init[] = {-1};
2669 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2670 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2671 // Phase 3, inputs and outputs
2672 model->identifyInputsAndOutputs(
2673 {op1},
2674 {op2});
2675 // Phase 4: set relaxed execution
2676 model->relaxComputationFloat32toFloat16(true);
2677 assert(model->isValid());
2678 }
2679
is_ignored_relaxed_dim4_axis3_neg_float16(int i)2680 inline bool is_ignored_relaxed_dim4_axis3_neg_float16(int i) {
2681 static std::set<int> ignore = {};
2682 return ignore.find(i) != ignore.end();
2683 }
2684
CreateModel_relaxed_dim4_axis3_neg_quant8(Model * model)2685 void CreateModel_relaxed_dim4_axis3_neg_quant8(Model *model) {
2686 OperandType type1(Type::INT32, {});
2687 OperandType type15(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 3}, 0.1f, 32);
2688 OperandType type16(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 3}, 0.0078125f, 128);
2689 // Phase 1, operands
2690 auto op1 = model->addOperand(&type15);
2691 auto axis = model->addOperand(&type1);
2692 auto op2 = model->addOperand(&type16);
2693 // Phase 2, operations
2694 static int32_t axis_init[] = {-1};
2695 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2696 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2697 // Phase 3, inputs and outputs
2698 model->identifyInputsAndOutputs(
2699 {op1},
2700 {op2});
2701 // Phase 4: set relaxed execution
2702 model->relaxComputationFloat32toFloat16(true);
2703 assert(model->isValid());
2704 }
2705
is_ignored_relaxed_dim4_axis3_neg_quant8(int i)2706 inline bool is_ignored_relaxed_dim4_axis3_neg_quant8(int i) {
2707 static std::set<int> ignore = {};
2708 return ignore.find(i) != ignore.end();
2709 }
2710
CreateModel_relaxed_dim3_axis0(Model * model)2711 void CreateModel_relaxed_dim3_axis0(Model *model) {
2712 OperandType type1(Type::INT32, {});
2713 OperandType type17(Type::TENSOR_FLOAT32, {3, 2, 2});
2714 // Phase 1, operands
2715 auto op1 = model->addOperand(&type17);
2716 auto axis = model->addOperand(&type1);
2717 auto op2 = model->addOperand(&type17);
2718 // Phase 2, operations
2719 static int32_t axis_init[] = {0};
2720 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2721 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2722 // Phase 3, inputs and outputs
2723 model->identifyInputsAndOutputs(
2724 {op1},
2725 {op2});
2726 // Phase 4: set relaxed execution
2727 model->relaxComputationFloat32toFloat16(true);
2728 assert(model->isValid());
2729 }
2730
is_ignored_relaxed_dim3_axis0(int i)2731 inline bool is_ignored_relaxed_dim3_axis0(int i) {
2732 static std::set<int> ignore = {};
2733 return ignore.find(i) != ignore.end();
2734 }
2735
CreateModel_relaxed_dim3_axis0_relaxed(Model * model)2736 void CreateModel_relaxed_dim3_axis0_relaxed(Model *model) {
2737 OperandType type1(Type::INT32, {});
2738 OperandType type17(Type::TENSOR_FLOAT32, {3, 2, 2});
2739 // Phase 1, operands
2740 auto op1 = model->addOperand(&type17);
2741 auto axis = model->addOperand(&type1);
2742 auto op2 = model->addOperand(&type17);
2743 // Phase 2, operations
2744 static int32_t axis_init[] = {0};
2745 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2746 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2747 // Phase 3, inputs and outputs
2748 model->identifyInputsAndOutputs(
2749 {op1},
2750 {op2});
2751 // Phase 4: set relaxed execution
2752 model->relaxComputationFloat32toFloat16(true);
2753 assert(model->isValid());
2754 }
2755
is_ignored_relaxed_dim3_axis0_relaxed(int i)2756 inline bool is_ignored_relaxed_dim3_axis0_relaxed(int i) {
2757 static std::set<int> ignore = {};
2758 return ignore.find(i) != ignore.end();
2759 }
2760
CreateModel_relaxed_dim3_axis0_float16(Model * model)2761 void CreateModel_relaxed_dim3_axis0_float16(Model *model) {
2762 OperandType type1(Type::INT32, {});
2763 OperandType type18(Type::TENSOR_FLOAT16, {3, 2, 2});
2764 // Phase 1, operands
2765 auto op1 = model->addOperand(&type18);
2766 auto axis = model->addOperand(&type1);
2767 auto op2 = model->addOperand(&type18);
2768 // Phase 2, operations
2769 static int32_t axis_init[] = {0};
2770 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2771 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2772 // Phase 3, inputs and outputs
2773 model->identifyInputsAndOutputs(
2774 {op1},
2775 {op2});
2776 // Phase 4: set relaxed execution
2777 model->relaxComputationFloat32toFloat16(true);
2778 assert(model->isValid());
2779 }
2780
is_ignored_relaxed_dim3_axis0_float16(int i)2781 inline bool is_ignored_relaxed_dim3_axis0_float16(int i) {
2782 static std::set<int> ignore = {};
2783 return ignore.find(i) != ignore.end();
2784 }
2785
CreateModel_relaxed_dim3_axis0_quant8(Model * model)2786 void CreateModel_relaxed_dim3_axis0_quant8(Model *model) {
2787 OperandType type1(Type::INT32, {});
2788 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2}, 0.1f, 32);
2789 OperandType type20(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2}, 0.0078125f, 128);
2790 // Phase 1, operands
2791 auto op1 = model->addOperand(&type19);
2792 auto axis = model->addOperand(&type1);
2793 auto op2 = model->addOperand(&type20);
2794 // Phase 2, operations
2795 static int32_t axis_init[] = {0};
2796 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2797 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2798 // Phase 3, inputs and outputs
2799 model->identifyInputsAndOutputs(
2800 {op1},
2801 {op2});
2802 // Phase 4: set relaxed execution
2803 model->relaxComputationFloat32toFloat16(true);
2804 assert(model->isValid());
2805 }
2806
is_ignored_relaxed_dim3_axis0_quant8(int i)2807 inline bool is_ignored_relaxed_dim3_axis0_quant8(int i) {
2808 static std::set<int> ignore = {};
2809 return ignore.find(i) != ignore.end();
2810 }
2811
CreateModel_relaxed_dim3_axis0_neg(Model * model)2812 void CreateModel_relaxed_dim3_axis0_neg(Model *model) {
2813 OperandType type1(Type::INT32, {});
2814 OperandType type17(Type::TENSOR_FLOAT32, {3, 2, 2});
2815 // Phase 1, operands
2816 auto op1 = model->addOperand(&type17);
2817 auto axis = model->addOperand(&type1);
2818 auto op2 = model->addOperand(&type17);
2819 // Phase 2, operations
2820 static int32_t axis_init[] = {-3};
2821 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2822 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2823 // Phase 3, inputs and outputs
2824 model->identifyInputsAndOutputs(
2825 {op1},
2826 {op2});
2827 // Phase 4: set relaxed execution
2828 model->relaxComputationFloat32toFloat16(true);
2829 assert(model->isValid());
2830 }
2831
is_ignored_relaxed_dim3_axis0_neg(int i)2832 inline bool is_ignored_relaxed_dim3_axis0_neg(int i) {
2833 static std::set<int> ignore = {};
2834 return ignore.find(i) != ignore.end();
2835 }
2836
CreateModel_relaxed_dim3_axis0_neg_relaxed(Model * model)2837 void CreateModel_relaxed_dim3_axis0_neg_relaxed(Model *model) {
2838 OperandType type1(Type::INT32, {});
2839 OperandType type17(Type::TENSOR_FLOAT32, {3, 2, 2});
2840 // Phase 1, operands
2841 auto op1 = model->addOperand(&type17);
2842 auto axis = model->addOperand(&type1);
2843 auto op2 = model->addOperand(&type17);
2844 // Phase 2, operations
2845 static int32_t axis_init[] = {-3};
2846 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2847 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2848 // Phase 3, inputs and outputs
2849 model->identifyInputsAndOutputs(
2850 {op1},
2851 {op2});
2852 // Phase 4: set relaxed execution
2853 model->relaxComputationFloat32toFloat16(true);
2854 assert(model->isValid());
2855 }
2856
is_ignored_relaxed_dim3_axis0_neg_relaxed(int i)2857 inline bool is_ignored_relaxed_dim3_axis0_neg_relaxed(int i) {
2858 static std::set<int> ignore = {};
2859 return ignore.find(i) != ignore.end();
2860 }
2861
CreateModel_relaxed_dim3_axis0_neg_float16(Model * model)2862 void CreateModel_relaxed_dim3_axis0_neg_float16(Model *model) {
2863 OperandType type1(Type::INT32, {});
2864 OperandType type18(Type::TENSOR_FLOAT16, {3, 2, 2});
2865 // Phase 1, operands
2866 auto op1 = model->addOperand(&type18);
2867 auto axis = model->addOperand(&type1);
2868 auto op2 = model->addOperand(&type18);
2869 // Phase 2, operations
2870 static int32_t axis_init[] = {-3};
2871 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2872 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2873 // Phase 3, inputs and outputs
2874 model->identifyInputsAndOutputs(
2875 {op1},
2876 {op2});
2877 // Phase 4: set relaxed execution
2878 model->relaxComputationFloat32toFloat16(true);
2879 assert(model->isValid());
2880 }
2881
is_ignored_relaxed_dim3_axis0_neg_float16(int i)2882 inline bool is_ignored_relaxed_dim3_axis0_neg_float16(int i) {
2883 static std::set<int> ignore = {};
2884 return ignore.find(i) != ignore.end();
2885 }
2886
CreateModel_relaxed_dim3_axis0_neg_quant8(Model * model)2887 void CreateModel_relaxed_dim3_axis0_neg_quant8(Model *model) {
2888 OperandType type1(Type::INT32, {});
2889 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2}, 0.1f, 32);
2890 OperandType type20(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2}, 0.0078125f, 128);
2891 // Phase 1, operands
2892 auto op1 = model->addOperand(&type19);
2893 auto axis = model->addOperand(&type1);
2894 auto op2 = model->addOperand(&type20);
2895 // Phase 2, operations
2896 static int32_t axis_init[] = {-3};
2897 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2898 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2899 // Phase 3, inputs and outputs
2900 model->identifyInputsAndOutputs(
2901 {op1},
2902 {op2});
2903 // Phase 4: set relaxed execution
2904 model->relaxComputationFloat32toFloat16(true);
2905 assert(model->isValid());
2906 }
2907
is_ignored_relaxed_dim3_axis0_neg_quant8(int i)2908 inline bool is_ignored_relaxed_dim3_axis0_neg_quant8(int i) {
2909 static std::set<int> ignore = {};
2910 return ignore.find(i) != ignore.end();
2911 }
2912
CreateModel_relaxed_dim3_axis1(Model * model)2913 void CreateModel_relaxed_dim3_axis1(Model *model) {
2914 OperandType type1(Type::INT32, {});
2915 OperandType type21(Type::TENSOR_FLOAT32, {2, 3, 2});
2916 // Phase 1, operands
2917 auto op1 = model->addOperand(&type21);
2918 auto axis = model->addOperand(&type1);
2919 auto op2 = model->addOperand(&type21);
2920 // Phase 2, operations
2921 static int32_t axis_init[] = {1};
2922 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2923 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2924 // Phase 3, inputs and outputs
2925 model->identifyInputsAndOutputs(
2926 {op1},
2927 {op2});
2928 // Phase 4: set relaxed execution
2929 model->relaxComputationFloat32toFloat16(true);
2930 assert(model->isValid());
2931 }
2932
is_ignored_relaxed_dim3_axis1(int i)2933 inline bool is_ignored_relaxed_dim3_axis1(int i) {
2934 static std::set<int> ignore = {};
2935 return ignore.find(i) != ignore.end();
2936 }
2937
CreateModel_relaxed_dim3_axis1_relaxed(Model * model)2938 void CreateModel_relaxed_dim3_axis1_relaxed(Model *model) {
2939 OperandType type1(Type::INT32, {});
2940 OperandType type21(Type::TENSOR_FLOAT32, {2, 3, 2});
2941 // Phase 1, operands
2942 auto op1 = model->addOperand(&type21);
2943 auto axis = model->addOperand(&type1);
2944 auto op2 = model->addOperand(&type21);
2945 // Phase 2, operations
2946 static int32_t axis_init[] = {1};
2947 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2948 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2949 // Phase 3, inputs and outputs
2950 model->identifyInputsAndOutputs(
2951 {op1},
2952 {op2});
2953 // Phase 4: set relaxed execution
2954 model->relaxComputationFloat32toFloat16(true);
2955 assert(model->isValid());
2956 }
2957
is_ignored_relaxed_dim3_axis1_relaxed(int i)2958 inline bool is_ignored_relaxed_dim3_axis1_relaxed(int i) {
2959 static std::set<int> ignore = {};
2960 return ignore.find(i) != ignore.end();
2961 }
2962
CreateModel_relaxed_dim3_axis1_float16(Model * model)2963 void CreateModel_relaxed_dim3_axis1_float16(Model *model) {
2964 OperandType type1(Type::INT32, {});
2965 OperandType type22(Type::TENSOR_FLOAT16, {2, 3, 2});
2966 // Phase 1, operands
2967 auto op1 = model->addOperand(&type22);
2968 auto axis = model->addOperand(&type1);
2969 auto op2 = model->addOperand(&type22);
2970 // Phase 2, operations
2971 static int32_t axis_init[] = {1};
2972 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2973 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
2974 // Phase 3, inputs and outputs
2975 model->identifyInputsAndOutputs(
2976 {op1},
2977 {op2});
2978 // Phase 4: set relaxed execution
2979 model->relaxComputationFloat32toFloat16(true);
2980 assert(model->isValid());
2981 }
2982
is_ignored_relaxed_dim3_axis1_float16(int i)2983 inline bool is_ignored_relaxed_dim3_axis1_float16(int i) {
2984 static std::set<int> ignore = {};
2985 return ignore.find(i) != ignore.end();
2986 }
2987
CreateModel_relaxed_dim3_axis1_quant8(Model * model)2988 void CreateModel_relaxed_dim3_axis1_quant8(Model *model) {
2989 OperandType type1(Type::INT32, {});
2990 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2}, 0.1f, 32);
2991 OperandType type24(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2}, 0.0078125f, 128);
2992 // Phase 1, operands
2993 auto op1 = model->addOperand(&type23);
2994 auto axis = model->addOperand(&type1);
2995 auto op2 = model->addOperand(&type24);
2996 // Phase 2, operations
2997 static int32_t axis_init[] = {1};
2998 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2999 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3000 // Phase 3, inputs and outputs
3001 model->identifyInputsAndOutputs(
3002 {op1},
3003 {op2});
3004 // Phase 4: set relaxed execution
3005 model->relaxComputationFloat32toFloat16(true);
3006 assert(model->isValid());
3007 }
3008
is_ignored_relaxed_dim3_axis1_quant8(int i)3009 inline bool is_ignored_relaxed_dim3_axis1_quant8(int i) {
3010 static std::set<int> ignore = {};
3011 return ignore.find(i) != ignore.end();
3012 }
3013
CreateModel_relaxed_dim3_axis1_neg(Model * model)3014 void CreateModel_relaxed_dim3_axis1_neg(Model *model) {
3015 OperandType type1(Type::INT32, {});
3016 OperandType type21(Type::TENSOR_FLOAT32, {2, 3, 2});
3017 // Phase 1, operands
3018 auto op1 = model->addOperand(&type21);
3019 auto axis = model->addOperand(&type1);
3020 auto op2 = model->addOperand(&type21);
3021 // Phase 2, operations
3022 static int32_t axis_init[] = {-2};
3023 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3024 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3025 // Phase 3, inputs and outputs
3026 model->identifyInputsAndOutputs(
3027 {op1},
3028 {op2});
3029 // Phase 4: set relaxed execution
3030 model->relaxComputationFloat32toFloat16(true);
3031 assert(model->isValid());
3032 }
3033
is_ignored_relaxed_dim3_axis1_neg(int i)3034 inline bool is_ignored_relaxed_dim3_axis1_neg(int i) {
3035 static std::set<int> ignore = {};
3036 return ignore.find(i) != ignore.end();
3037 }
3038
CreateModel_relaxed_dim3_axis1_neg_relaxed(Model * model)3039 void CreateModel_relaxed_dim3_axis1_neg_relaxed(Model *model) {
3040 OperandType type1(Type::INT32, {});
3041 OperandType type21(Type::TENSOR_FLOAT32, {2, 3, 2});
3042 // Phase 1, operands
3043 auto op1 = model->addOperand(&type21);
3044 auto axis = model->addOperand(&type1);
3045 auto op2 = model->addOperand(&type21);
3046 // Phase 2, operations
3047 static int32_t axis_init[] = {-2};
3048 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3049 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3050 // Phase 3, inputs and outputs
3051 model->identifyInputsAndOutputs(
3052 {op1},
3053 {op2});
3054 // Phase 4: set relaxed execution
3055 model->relaxComputationFloat32toFloat16(true);
3056 assert(model->isValid());
3057 }
3058
is_ignored_relaxed_dim3_axis1_neg_relaxed(int i)3059 inline bool is_ignored_relaxed_dim3_axis1_neg_relaxed(int i) {
3060 static std::set<int> ignore = {};
3061 return ignore.find(i) != ignore.end();
3062 }
3063
CreateModel_relaxed_dim3_axis1_neg_float16(Model * model)3064 void CreateModel_relaxed_dim3_axis1_neg_float16(Model *model) {
3065 OperandType type1(Type::INT32, {});
3066 OperandType type22(Type::TENSOR_FLOAT16, {2, 3, 2});
3067 // Phase 1, operands
3068 auto op1 = model->addOperand(&type22);
3069 auto axis = model->addOperand(&type1);
3070 auto op2 = model->addOperand(&type22);
3071 // Phase 2, operations
3072 static int32_t axis_init[] = {-2};
3073 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3074 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3075 // Phase 3, inputs and outputs
3076 model->identifyInputsAndOutputs(
3077 {op1},
3078 {op2});
3079 // Phase 4: set relaxed execution
3080 model->relaxComputationFloat32toFloat16(true);
3081 assert(model->isValid());
3082 }
3083
is_ignored_relaxed_dim3_axis1_neg_float16(int i)3084 inline bool is_ignored_relaxed_dim3_axis1_neg_float16(int i) {
3085 static std::set<int> ignore = {};
3086 return ignore.find(i) != ignore.end();
3087 }
3088
CreateModel_relaxed_dim3_axis1_neg_quant8(Model * model)3089 void CreateModel_relaxed_dim3_axis1_neg_quant8(Model *model) {
3090 OperandType type1(Type::INT32, {});
3091 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2}, 0.1f, 32);
3092 OperandType type24(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2}, 0.0078125f, 128);
3093 // Phase 1, operands
3094 auto op1 = model->addOperand(&type23);
3095 auto axis = model->addOperand(&type1);
3096 auto op2 = model->addOperand(&type24);
3097 // Phase 2, operations
3098 static int32_t axis_init[] = {-2};
3099 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3100 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3101 // Phase 3, inputs and outputs
3102 model->identifyInputsAndOutputs(
3103 {op1},
3104 {op2});
3105 // Phase 4: set relaxed execution
3106 model->relaxComputationFloat32toFloat16(true);
3107 assert(model->isValid());
3108 }
3109
is_ignored_relaxed_dim3_axis1_neg_quant8(int i)3110 inline bool is_ignored_relaxed_dim3_axis1_neg_quant8(int i) {
3111 static std::set<int> ignore = {};
3112 return ignore.find(i) != ignore.end();
3113 }
3114
CreateModel_relaxed_dim3_axis2(Model * model)3115 void CreateModel_relaxed_dim3_axis2(Model *model) {
3116 OperandType type1(Type::INT32, {});
3117 OperandType type25(Type::TENSOR_FLOAT32, {2, 2, 3});
3118 // Phase 1, operands
3119 auto op1 = model->addOperand(&type25);
3120 auto axis = model->addOperand(&type1);
3121 auto op2 = model->addOperand(&type25);
3122 // Phase 2, operations
3123 static int32_t axis_init[] = {2};
3124 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3125 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3126 // Phase 3, inputs and outputs
3127 model->identifyInputsAndOutputs(
3128 {op1},
3129 {op2});
3130 // Phase 4: set relaxed execution
3131 model->relaxComputationFloat32toFloat16(true);
3132 assert(model->isValid());
3133 }
3134
is_ignored_relaxed_dim3_axis2(int i)3135 inline bool is_ignored_relaxed_dim3_axis2(int i) {
3136 static std::set<int> ignore = {};
3137 return ignore.find(i) != ignore.end();
3138 }
3139
CreateModel_relaxed_dim3_axis2_relaxed(Model * model)3140 void CreateModel_relaxed_dim3_axis2_relaxed(Model *model) {
3141 OperandType type1(Type::INT32, {});
3142 OperandType type25(Type::TENSOR_FLOAT32, {2, 2, 3});
3143 // Phase 1, operands
3144 auto op1 = model->addOperand(&type25);
3145 auto axis = model->addOperand(&type1);
3146 auto op2 = model->addOperand(&type25);
3147 // Phase 2, operations
3148 static int32_t axis_init[] = {2};
3149 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3150 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3151 // Phase 3, inputs and outputs
3152 model->identifyInputsAndOutputs(
3153 {op1},
3154 {op2});
3155 // Phase 4: set relaxed execution
3156 model->relaxComputationFloat32toFloat16(true);
3157 assert(model->isValid());
3158 }
3159
is_ignored_relaxed_dim3_axis2_relaxed(int i)3160 inline bool is_ignored_relaxed_dim3_axis2_relaxed(int i) {
3161 static std::set<int> ignore = {};
3162 return ignore.find(i) != ignore.end();
3163 }
3164
CreateModel_relaxed_dim3_axis2_float16(Model * model)3165 void CreateModel_relaxed_dim3_axis2_float16(Model *model) {
3166 OperandType type1(Type::INT32, {});
3167 OperandType type26(Type::TENSOR_FLOAT16, {2, 2, 3});
3168 // Phase 1, operands
3169 auto op1 = model->addOperand(&type26);
3170 auto axis = model->addOperand(&type1);
3171 auto op2 = model->addOperand(&type26);
3172 // Phase 2, operations
3173 static int32_t axis_init[] = {2};
3174 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3175 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3176 // Phase 3, inputs and outputs
3177 model->identifyInputsAndOutputs(
3178 {op1},
3179 {op2});
3180 // Phase 4: set relaxed execution
3181 model->relaxComputationFloat32toFloat16(true);
3182 assert(model->isValid());
3183 }
3184
is_ignored_relaxed_dim3_axis2_float16(int i)3185 inline bool is_ignored_relaxed_dim3_axis2_float16(int i) {
3186 static std::set<int> ignore = {};
3187 return ignore.find(i) != ignore.end();
3188 }
3189
CreateModel_relaxed_dim3_axis2_quant8(Model * model)3190 void CreateModel_relaxed_dim3_axis2_quant8(Model *model) {
3191 OperandType type1(Type::INT32, {});
3192 OperandType type27(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3}, 0.1f, 32);
3193 OperandType type28(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3}, 0.0078125f, 128);
3194 // Phase 1, operands
3195 auto op1 = model->addOperand(&type27);
3196 auto axis = model->addOperand(&type1);
3197 auto op2 = model->addOperand(&type28);
3198 // Phase 2, operations
3199 static int32_t axis_init[] = {2};
3200 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3201 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3202 // Phase 3, inputs and outputs
3203 model->identifyInputsAndOutputs(
3204 {op1},
3205 {op2});
3206 // Phase 4: set relaxed execution
3207 model->relaxComputationFloat32toFloat16(true);
3208 assert(model->isValid());
3209 }
3210
is_ignored_relaxed_dim3_axis2_quant8(int i)3211 inline bool is_ignored_relaxed_dim3_axis2_quant8(int i) {
3212 static std::set<int> ignore = {};
3213 return ignore.find(i) != ignore.end();
3214 }
3215
CreateModel_relaxed_dim3_axis2_neg(Model * model)3216 void CreateModel_relaxed_dim3_axis2_neg(Model *model) {
3217 OperandType type1(Type::INT32, {});
3218 OperandType type25(Type::TENSOR_FLOAT32, {2, 2, 3});
3219 // Phase 1, operands
3220 auto op1 = model->addOperand(&type25);
3221 auto axis = model->addOperand(&type1);
3222 auto op2 = model->addOperand(&type25);
3223 // Phase 2, operations
3224 static int32_t axis_init[] = {-1};
3225 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3226 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3227 // Phase 3, inputs and outputs
3228 model->identifyInputsAndOutputs(
3229 {op1},
3230 {op2});
3231 // Phase 4: set relaxed execution
3232 model->relaxComputationFloat32toFloat16(true);
3233 assert(model->isValid());
3234 }
3235
is_ignored_relaxed_dim3_axis2_neg(int i)3236 inline bool is_ignored_relaxed_dim3_axis2_neg(int i) {
3237 static std::set<int> ignore = {};
3238 return ignore.find(i) != ignore.end();
3239 }
3240
CreateModel_relaxed_dim3_axis2_neg_relaxed(Model * model)3241 void CreateModel_relaxed_dim3_axis2_neg_relaxed(Model *model) {
3242 OperandType type1(Type::INT32, {});
3243 OperandType type25(Type::TENSOR_FLOAT32, {2, 2, 3});
3244 // Phase 1, operands
3245 auto op1 = model->addOperand(&type25);
3246 auto axis = model->addOperand(&type1);
3247 auto op2 = model->addOperand(&type25);
3248 // Phase 2, operations
3249 static int32_t axis_init[] = {-1};
3250 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3251 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3252 // Phase 3, inputs and outputs
3253 model->identifyInputsAndOutputs(
3254 {op1},
3255 {op2});
3256 // Phase 4: set relaxed execution
3257 model->relaxComputationFloat32toFloat16(true);
3258 assert(model->isValid());
3259 }
3260
is_ignored_relaxed_dim3_axis2_neg_relaxed(int i)3261 inline bool is_ignored_relaxed_dim3_axis2_neg_relaxed(int i) {
3262 static std::set<int> ignore = {};
3263 return ignore.find(i) != ignore.end();
3264 }
3265
CreateModel_relaxed_dim3_axis2_neg_float16(Model * model)3266 void CreateModel_relaxed_dim3_axis2_neg_float16(Model *model) {
3267 OperandType type1(Type::INT32, {});
3268 OperandType type26(Type::TENSOR_FLOAT16, {2, 2, 3});
3269 // Phase 1, operands
3270 auto op1 = model->addOperand(&type26);
3271 auto axis = model->addOperand(&type1);
3272 auto op2 = model->addOperand(&type26);
3273 // Phase 2, operations
3274 static int32_t axis_init[] = {-1};
3275 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3276 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3277 // Phase 3, inputs and outputs
3278 model->identifyInputsAndOutputs(
3279 {op1},
3280 {op2});
3281 // Phase 4: set relaxed execution
3282 model->relaxComputationFloat32toFloat16(true);
3283 assert(model->isValid());
3284 }
3285
is_ignored_relaxed_dim3_axis2_neg_float16(int i)3286 inline bool is_ignored_relaxed_dim3_axis2_neg_float16(int i) {
3287 static std::set<int> ignore = {};
3288 return ignore.find(i) != ignore.end();
3289 }
3290
CreateModel_relaxed_dim3_axis2_neg_quant8(Model * model)3291 void CreateModel_relaxed_dim3_axis2_neg_quant8(Model *model) {
3292 OperandType type1(Type::INT32, {});
3293 OperandType type27(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3}, 0.1f, 32);
3294 OperandType type28(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3}, 0.0078125f, 128);
3295 // Phase 1, operands
3296 auto op1 = model->addOperand(&type27);
3297 auto axis = model->addOperand(&type1);
3298 auto op2 = model->addOperand(&type28);
3299 // Phase 2, operations
3300 static int32_t axis_init[] = {-1};
3301 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3302 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3303 // Phase 3, inputs and outputs
3304 model->identifyInputsAndOutputs(
3305 {op1},
3306 {op2});
3307 // Phase 4: set relaxed execution
3308 model->relaxComputationFloat32toFloat16(true);
3309 assert(model->isValid());
3310 }
3311
is_ignored_relaxed_dim3_axis2_neg_quant8(int i)3312 inline bool is_ignored_relaxed_dim3_axis2_neg_quant8(int i) {
3313 static std::set<int> ignore = {};
3314 return ignore.find(i) != ignore.end();
3315 }
3316
CreateModel_relaxed_dim2_axis0(Model * model)3317 void CreateModel_relaxed_dim2_axis0(Model *model) {
3318 OperandType type1(Type::INT32, {});
3319 OperandType type29(Type::TENSOR_FLOAT32, {3, 2});
3320 // Phase 1, operands
3321 auto op1 = model->addOperand(&type29);
3322 auto axis = model->addOperand(&type1);
3323 auto op2 = model->addOperand(&type29);
3324 // Phase 2, operations
3325 static int32_t axis_init[] = {0};
3326 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3327 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3328 // Phase 3, inputs and outputs
3329 model->identifyInputsAndOutputs(
3330 {op1},
3331 {op2});
3332 // Phase 4: set relaxed execution
3333 model->relaxComputationFloat32toFloat16(true);
3334 assert(model->isValid());
3335 }
3336
is_ignored_relaxed_dim2_axis0(int i)3337 inline bool is_ignored_relaxed_dim2_axis0(int i) {
3338 static std::set<int> ignore = {};
3339 return ignore.find(i) != ignore.end();
3340 }
3341
CreateModel_relaxed_dim2_axis0_relaxed(Model * model)3342 void CreateModel_relaxed_dim2_axis0_relaxed(Model *model) {
3343 OperandType type1(Type::INT32, {});
3344 OperandType type29(Type::TENSOR_FLOAT32, {3, 2});
3345 // Phase 1, operands
3346 auto op1 = model->addOperand(&type29);
3347 auto axis = model->addOperand(&type1);
3348 auto op2 = model->addOperand(&type29);
3349 // Phase 2, operations
3350 static int32_t axis_init[] = {0};
3351 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3352 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3353 // Phase 3, inputs and outputs
3354 model->identifyInputsAndOutputs(
3355 {op1},
3356 {op2});
3357 // Phase 4: set relaxed execution
3358 model->relaxComputationFloat32toFloat16(true);
3359 assert(model->isValid());
3360 }
3361
is_ignored_relaxed_dim2_axis0_relaxed(int i)3362 inline bool is_ignored_relaxed_dim2_axis0_relaxed(int i) {
3363 static std::set<int> ignore = {};
3364 return ignore.find(i) != ignore.end();
3365 }
3366
CreateModel_relaxed_dim2_axis0_float16(Model * model)3367 void CreateModel_relaxed_dim2_axis0_float16(Model *model) {
3368 OperandType type1(Type::INT32, {});
3369 OperandType type30(Type::TENSOR_FLOAT16, {3, 2});
3370 // Phase 1, operands
3371 auto op1 = model->addOperand(&type30);
3372 auto axis = model->addOperand(&type1);
3373 auto op2 = model->addOperand(&type30);
3374 // Phase 2, operations
3375 static int32_t axis_init[] = {0};
3376 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3377 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3378 // Phase 3, inputs and outputs
3379 model->identifyInputsAndOutputs(
3380 {op1},
3381 {op2});
3382 // Phase 4: set relaxed execution
3383 model->relaxComputationFloat32toFloat16(true);
3384 assert(model->isValid());
3385 }
3386
is_ignored_relaxed_dim2_axis0_float16(int i)3387 inline bool is_ignored_relaxed_dim2_axis0_float16(int i) {
3388 static std::set<int> ignore = {};
3389 return ignore.find(i) != ignore.end();
3390 }
3391
CreateModel_relaxed_dim2_axis0_quant8(Model * model)3392 void CreateModel_relaxed_dim2_axis0_quant8(Model *model) {
3393 OperandType type1(Type::INT32, {});
3394 OperandType type31(Type::TENSOR_QUANT8_ASYMM, {3, 2}, 0.1f, 32);
3395 OperandType type32(Type::TENSOR_QUANT8_ASYMM, {3, 2}, 0.0078125f, 128);
3396 // Phase 1, operands
3397 auto op1 = model->addOperand(&type31);
3398 auto axis = model->addOperand(&type1);
3399 auto op2 = model->addOperand(&type32);
3400 // Phase 2, operations
3401 static int32_t axis_init[] = {0};
3402 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3403 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3404 // Phase 3, inputs and outputs
3405 model->identifyInputsAndOutputs(
3406 {op1},
3407 {op2});
3408 // Phase 4: set relaxed execution
3409 model->relaxComputationFloat32toFloat16(true);
3410 assert(model->isValid());
3411 }
3412
is_ignored_relaxed_dim2_axis0_quant8(int i)3413 inline bool is_ignored_relaxed_dim2_axis0_quant8(int i) {
3414 static std::set<int> ignore = {};
3415 return ignore.find(i) != ignore.end();
3416 }
3417
CreateModel_relaxed_dim2_axis0_neg(Model * model)3418 void CreateModel_relaxed_dim2_axis0_neg(Model *model) {
3419 OperandType type1(Type::INT32, {});
3420 OperandType type29(Type::TENSOR_FLOAT32, {3, 2});
3421 // Phase 1, operands
3422 auto op1 = model->addOperand(&type29);
3423 auto axis = model->addOperand(&type1);
3424 auto op2 = model->addOperand(&type29);
3425 // Phase 2, operations
3426 static int32_t axis_init[] = {-2};
3427 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3428 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3429 // Phase 3, inputs and outputs
3430 model->identifyInputsAndOutputs(
3431 {op1},
3432 {op2});
3433 // Phase 4: set relaxed execution
3434 model->relaxComputationFloat32toFloat16(true);
3435 assert(model->isValid());
3436 }
3437
is_ignored_relaxed_dim2_axis0_neg(int i)3438 inline bool is_ignored_relaxed_dim2_axis0_neg(int i) {
3439 static std::set<int> ignore = {};
3440 return ignore.find(i) != ignore.end();
3441 }
3442
CreateModel_relaxed_dim2_axis0_neg_relaxed(Model * model)3443 void CreateModel_relaxed_dim2_axis0_neg_relaxed(Model *model) {
3444 OperandType type1(Type::INT32, {});
3445 OperandType type29(Type::TENSOR_FLOAT32, {3, 2});
3446 // Phase 1, operands
3447 auto op1 = model->addOperand(&type29);
3448 auto axis = model->addOperand(&type1);
3449 auto op2 = model->addOperand(&type29);
3450 // Phase 2, operations
3451 static int32_t axis_init[] = {-2};
3452 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3453 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3454 // Phase 3, inputs and outputs
3455 model->identifyInputsAndOutputs(
3456 {op1},
3457 {op2});
3458 // Phase 4: set relaxed execution
3459 model->relaxComputationFloat32toFloat16(true);
3460 assert(model->isValid());
3461 }
3462
is_ignored_relaxed_dim2_axis0_neg_relaxed(int i)3463 inline bool is_ignored_relaxed_dim2_axis0_neg_relaxed(int i) {
3464 static std::set<int> ignore = {};
3465 return ignore.find(i) != ignore.end();
3466 }
3467
CreateModel_relaxed_dim2_axis0_neg_float16(Model * model)3468 void CreateModel_relaxed_dim2_axis0_neg_float16(Model *model) {
3469 OperandType type1(Type::INT32, {});
3470 OperandType type30(Type::TENSOR_FLOAT16, {3, 2});
3471 // Phase 1, operands
3472 auto op1 = model->addOperand(&type30);
3473 auto axis = model->addOperand(&type1);
3474 auto op2 = model->addOperand(&type30);
3475 // Phase 2, operations
3476 static int32_t axis_init[] = {-2};
3477 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3478 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3479 // Phase 3, inputs and outputs
3480 model->identifyInputsAndOutputs(
3481 {op1},
3482 {op2});
3483 // Phase 4: set relaxed execution
3484 model->relaxComputationFloat32toFloat16(true);
3485 assert(model->isValid());
3486 }
3487
is_ignored_relaxed_dim2_axis0_neg_float16(int i)3488 inline bool is_ignored_relaxed_dim2_axis0_neg_float16(int i) {
3489 static std::set<int> ignore = {};
3490 return ignore.find(i) != ignore.end();
3491 }
3492
CreateModel_relaxed_dim2_axis0_neg_quant8(Model * model)3493 void CreateModel_relaxed_dim2_axis0_neg_quant8(Model *model) {
3494 OperandType type1(Type::INT32, {});
3495 OperandType type31(Type::TENSOR_QUANT8_ASYMM, {3, 2}, 0.1f, 32);
3496 OperandType type32(Type::TENSOR_QUANT8_ASYMM, {3, 2}, 0.0078125f, 128);
3497 // Phase 1, operands
3498 auto op1 = model->addOperand(&type31);
3499 auto axis = model->addOperand(&type1);
3500 auto op2 = model->addOperand(&type32);
3501 // Phase 2, operations
3502 static int32_t axis_init[] = {-2};
3503 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3504 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3505 // Phase 3, inputs and outputs
3506 model->identifyInputsAndOutputs(
3507 {op1},
3508 {op2});
3509 // Phase 4: set relaxed execution
3510 model->relaxComputationFloat32toFloat16(true);
3511 assert(model->isValid());
3512 }
3513
is_ignored_relaxed_dim2_axis0_neg_quant8(int i)3514 inline bool is_ignored_relaxed_dim2_axis0_neg_quant8(int i) {
3515 static std::set<int> ignore = {};
3516 return ignore.find(i) != ignore.end();
3517 }
3518
CreateModel_relaxed_dim2_axis1(Model * model)3519 void CreateModel_relaxed_dim2_axis1(Model *model) {
3520 OperandType type1(Type::INT32, {});
3521 OperandType type33(Type::TENSOR_FLOAT32, {2, 3});
3522 // Phase 1, operands
3523 auto op1 = model->addOperand(&type33);
3524 auto axis = model->addOperand(&type1);
3525 auto op2 = model->addOperand(&type33);
3526 // Phase 2, operations
3527 static int32_t axis_init[] = {1};
3528 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3529 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3530 // Phase 3, inputs and outputs
3531 model->identifyInputsAndOutputs(
3532 {op1},
3533 {op2});
3534 // Phase 4: set relaxed execution
3535 model->relaxComputationFloat32toFloat16(true);
3536 assert(model->isValid());
3537 }
3538
is_ignored_relaxed_dim2_axis1(int i)3539 inline bool is_ignored_relaxed_dim2_axis1(int i) {
3540 static std::set<int> ignore = {};
3541 return ignore.find(i) != ignore.end();
3542 }
3543
CreateModel_relaxed_dim2_axis1_relaxed(Model * model)3544 void CreateModel_relaxed_dim2_axis1_relaxed(Model *model) {
3545 OperandType type1(Type::INT32, {});
3546 OperandType type33(Type::TENSOR_FLOAT32, {2, 3});
3547 // Phase 1, operands
3548 auto op1 = model->addOperand(&type33);
3549 auto axis = model->addOperand(&type1);
3550 auto op2 = model->addOperand(&type33);
3551 // Phase 2, operations
3552 static int32_t axis_init[] = {1};
3553 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3554 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3555 // Phase 3, inputs and outputs
3556 model->identifyInputsAndOutputs(
3557 {op1},
3558 {op2});
3559 // Phase 4: set relaxed execution
3560 model->relaxComputationFloat32toFloat16(true);
3561 assert(model->isValid());
3562 }
3563
is_ignored_relaxed_dim2_axis1_relaxed(int i)3564 inline bool is_ignored_relaxed_dim2_axis1_relaxed(int i) {
3565 static std::set<int> ignore = {};
3566 return ignore.find(i) != ignore.end();
3567 }
3568
CreateModel_relaxed_dim2_axis1_float16(Model * model)3569 void CreateModel_relaxed_dim2_axis1_float16(Model *model) {
3570 OperandType type1(Type::INT32, {});
3571 OperandType type34(Type::TENSOR_FLOAT16, {2, 3});
3572 // Phase 1, operands
3573 auto op1 = model->addOperand(&type34);
3574 auto axis = model->addOperand(&type1);
3575 auto op2 = model->addOperand(&type34);
3576 // Phase 2, operations
3577 static int32_t axis_init[] = {1};
3578 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3579 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3580 // Phase 3, inputs and outputs
3581 model->identifyInputsAndOutputs(
3582 {op1},
3583 {op2});
3584 // Phase 4: set relaxed execution
3585 model->relaxComputationFloat32toFloat16(true);
3586 assert(model->isValid());
3587 }
3588
is_ignored_relaxed_dim2_axis1_float16(int i)3589 inline bool is_ignored_relaxed_dim2_axis1_float16(int i) {
3590 static std::set<int> ignore = {};
3591 return ignore.find(i) != ignore.end();
3592 }
3593
CreateModel_relaxed_dim2_axis1_quant8(Model * model)3594 void CreateModel_relaxed_dim2_axis1_quant8(Model *model) {
3595 OperandType type1(Type::INT32, {});
3596 OperandType type35(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 0.1f, 32);
3597 OperandType type36(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 0.0078125f, 128);
3598 // Phase 1, operands
3599 auto op1 = model->addOperand(&type35);
3600 auto axis = model->addOperand(&type1);
3601 auto op2 = model->addOperand(&type36);
3602 // Phase 2, operations
3603 static int32_t axis_init[] = {1};
3604 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3605 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3606 // Phase 3, inputs and outputs
3607 model->identifyInputsAndOutputs(
3608 {op1},
3609 {op2});
3610 // Phase 4: set relaxed execution
3611 model->relaxComputationFloat32toFloat16(true);
3612 assert(model->isValid());
3613 }
3614
is_ignored_relaxed_dim2_axis1_quant8(int i)3615 inline bool is_ignored_relaxed_dim2_axis1_quant8(int i) {
3616 static std::set<int> ignore = {};
3617 return ignore.find(i) != ignore.end();
3618 }
3619
CreateModel_relaxed_dim2_axis1_neg(Model * model)3620 void CreateModel_relaxed_dim2_axis1_neg(Model *model) {
3621 OperandType type1(Type::INT32, {});
3622 OperandType type33(Type::TENSOR_FLOAT32, {2, 3});
3623 // Phase 1, operands
3624 auto op1 = model->addOperand(&type33);
3625 auto axis = model->addOperand(&type1);
3626 auto op2 = model->addOperand(&type33);
3627 // Phase 2, operations
3628 static int32_t axis_init[] = {-1};
3629 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3630 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3631 // Phase 3, inputs and outputs
3632 model->identifyInputsAndOutputs(
3633 {op1},
3634 {op2});
3635 // Phase 4: set relaxed execution
3636 model->relaxComputationFloat32toFloat16(true);
3637 assert(model->isValid());
3638 }
3639
is_ignored_relaxed_dim2_axis1_neg(int i)3640 inline bool is_ignored_relaxed_dim2_axis1_neg(int i) {
3641 static std::set<int> ignore = {};
3642 return ignore.find(i) != ignore.end();
3643 }
3644
CreateModel_relaxed_dim2_axis1_neg_relaxed(Model * model)3645 void CreateModel_relaxed_dim2_axis1_neg_relaxed(Model *model) {
3646 OperandType type1(Type::INT32, {});
3647 OperandType type33(Type::TENSOR_FLOAT32, {2, 3});
3648 // Phase 1, operands
3649 auto op1 = model->addOperand(&type33);
3650 auto axis = model->addOperand(&type1);
3651 auto op2 = model->addOperand(&type33);
3652 // Phase 2, operations
3653 static int32_t axis_init[] = {-1};
3654 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3655 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3656 // Phase 3, inputs and outputs
3657 model->identifyInputsAndOutputs(
3658 {op1},
3659 {op2});
3660 // Phase 4: set relaxed execution
3661 model->relaxComputationFloat32toFloat16(true);
3662 assert(model->isValid());
3663 }
3664
is_ignored_relaxed_dim2_axis1_neg_relaxed(int i)3665 inline bool is_ignored_relaxed_dim2_axis1_neg_relaxed(int i) {
3666 static std::set<int> ignore = {};
3667 return ignore.find(i) != ignore.end();
3668 }
3669
CreateModel_relaxed_dim2_axis1_neg_float16(Model * model)3670 void CreateModel_relaxed_dim2_axis1_neg_float16(Model *model) {
3671 OperandType type1(Type::INT32, {});
3672 OperandType type34(Type::TENSOR_FLOAT16, {2, 3});
3673 // Phase 1, operands
3674 auto op1 = model->addOperand(&type34);
3675 auto axis = model->addOperand(&type1);
3676 auto op2 = model->addOperand(&type34);
3677 // Phase 2, operations
3678 static int32_t axis_init[] = {-1};
3679 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3680 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3681 // Phase 3, inputs and outputs
3682 model->identifyInputsAndOutputs(
3683 {op1},
3684 {op2});
3685 // Phase 4: set relaxed execution
3686 model->relaxComputationFloat32toFloat16(true);
3687 assert(model->isValid());
3688 }
3689
is_ignored_relaxed_dim2_axis1_neg_float16(int i)3690 inline bool is_ignored_relaxed_dim2_axis1_neg_float16(int i) {
3691 static std::set<int> ignore = {};
3692 return ignore.find(i) != ignore.end();
3693 }
3694
CreateModel_relaxed_dim2_axis1_neg_quant8(Model * model)3695 void CreateModel_relaxed_dim2_axis1_neg_quant8(Model *model) {
3696 OperandType type1(Type::INT32, {});
3697 OperandType type35(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 0.1f, 32);
3698 OperandType type36(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 0.0078125f, 128);
3699 // Phase 1, operands
3700 auto op1 = model->addOperand(&type35);
3701 auto axis = model->addOperand(&type1);
3702 auto op2 = model->addOperand(&type36);
3703 // Phase 2, operations
3704 static int32_t axis_init[] = {-1};
3705 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3706 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3707 // Phase 3, inputs and outputs
3708 model->identifyInputsAndOutputs(
3709 {op1},
3710 {op2});
3711 // Phase 4: set relaxed execution
3712 model->relaxComputationFloat32toFloat16(true);
3713 assert(model->isValid());
3714 }
3715
is_ignored_relaxed_dim2_axis1_neg_quant8(int i)3716 inline bool is_ignored_relaxed_dim2_axis1_neg_quant8(int i) {
3717 static std::set<int> ignore = {};
3718 return ignore.find(i) != ignore.end();
3719 }
3720
CreateModel_relaxed_dim1_axis0(Model * model)3721 void CreateModel_relaxed_dim1_axis0(Model *model) {
3722 OperandType type1(Type::INT32, {});
3723 OperandType type37(Type::TENSOR_FLOAT32, {3});
3724 // Phase 1, operands
3725 auto op1 = model->addOperand(&type37);
3726 auto axis = model->addOperand(&type1);
3727 auto op2 = model->addOperand(&type37);
3728 // Phase 2, operations
3729 static int32_t axis_init[] = {0};
3730 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3731 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3732 // Phase 3, inputs and outputs
3733 model->identifyInputsAndOutputs(
3734 {op1},
3735 {op2});
3736 // Phase 4: set relaxed execution
3737 model->relaxComputationFloat32toFloat16(true);
3738 assert(model->isValid());
3739 }
3740
is_ignored_relaxed_dim1_axis0(int i)3741 inline bool is_ignored_relaxed_dim1_axis0(int i) {
3742 static std::set<int> ignore = {};
3743 return ignore.find(i) != ignore.end();
3744 }
3745
CreateModel_relaxed_dim1_axis0_relaxed(Model * model)3746 void CreateModel_relaxed_dim1_axis0_relaxed(Model *model) {
3747 OperandType type1(Type::INT32, {});
3748 OperandType type37(Type::TENSOR_FLOAT32, {3});
3749 // Phase 1, operands
3750 auto op1 = model->addOperand(&type37);
3751 auto axis = model->addOperand(&type1);
3752 auto op2 = model->addOperand(&type37);
3753 // Phase 2, operations
3754 static int32_t axis_init[] = {0};
3755 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3756 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3757 // Phase 3, inputs and outputs
3758 model->identifyInputsAndOutputs(
3759 {op1},
3760 {op2});
3761 // Phase 4: set relaxed execution
3762 model->relaxComputationFloat32toFloat16(true);
3763 assert(model->isValid());
3764 }
3765
is_ignored_relaxed_dim1_axis0_relaxed(int i)3766 inline bool is_ignored_relaxed_dim1_axis0_relaxed(int i) {
3767 static std::set<int> ignore = {};
3768 return ignore.find(i) != ignore.end();
3769 }
3770
CreateModel_relaxed_dim1_axis0_float16(Model * model)3771 void CreateModel_relaxed_dim1_axis0_float16(Model *model) {
3772 OperandType type1(Type::INT32, {});
3773 OperandType type38(Type::TENSOR_FLOAT16, {3});
3774 // Phase 1, operands
3775 auto op1 = model->addOperand(&type38);
3776 auto axis = model->addOperand(&type1);
3777 auto op2 = model->addOperand(&type38);
3778 // Phase 2, operations
3779 static int32_t axis_init[] = {0};
3780 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3781 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3782 // Phase 3, inputs and outputs
3783 model->identifyInputsAndOutputs(
3784 {op1},
3785 {op2});
3786 // Phase 4: set relaxed execution
3787 model->relaxComputationFloat32toFloat16(true);
3788 assert(model->isValid());
3789 }
3790
is_ignored_relaxed_dim1_axis0_float16(int i)3791 inline bool is_ignored_relaxed_dim1_axis0_float16(int i) {
3792 static std::set<int> ignore = {};
3793 return ignore.find(i) != ignore.end();
3794 }
3795
CreateModel_relaxed_dim1_axis0_quant8(Model * model)3796 void CreateModel_relaxed_dim1_axis0_quant8(Model *model) {
3797 OperandType type1(Type::INT32, {});
3798 OperandType type39(Type::TENSOR_QUANT8_ASYMM, {3}, 0.1f, 32);
3799 OperandType type40(Type::TENSOR_QUANT8_ASYMM, {3}, 0.0078125f, 128);
3800 // Phase 1, operands
3801 auto op1 = model->addOperand(&type39);
3802 auto axis = model->addOperand(&type1);
3803 auto op2 = model->addOperand(&type40);
3804 // Phase 2, operations
3805 static int32_t axis_init[] = {0};
3806 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3807 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3808 // Phase 3, inputs and outputs
3809 model->identifyInputsAndOutputs(
3810 {op1},
3811 {op2});
3812 // Phase 4: set relaxed execution
3813 model->relaxComputationFloat32toFloat16(true);
3814 assert(model->isValid());
3815 }
3816
is_ignored_relaxed_dim1_axis0_quant8(int i)3817 inline bool is_ignored_relaxed_dim1_axis0_quant8(int i) {
3818 static std::set<int> ignore = {};
3819 return ignore.find(i) != ignore.end();
3820 }
3821
CreateModel_relaxed_dim1_axis0_neg(Model * model)3822 void CreateModel_relaxed_dim1_axis0_neg(Model *model) {
3823 OperandType type1(Type::INT32, {});
3824 OperandType type37(Type::TENSOR_FLOAT32, {3});
3825 // Phase 1, operands
3826 auto op1 = model->addOperand(&type37);
3827 auto axis = model->addOperand(&type1);
3828 auto op2 = model->addOperand(&type37);
3829 // Phase 2, operations
3830 static int32_t axis_init[] = {-1};
3831 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3832 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3833 // Phase 3, inputs and outputs
3834 model->identifyInputsAndOutputs(
3835 {op1},
3836 {op2});
3837 // Phase 4: set relaxed execution
3838 model->relaxComputationFloat32toFloat16(true);
3839 assert(model->isValid());
3840 }
3841
is_ignored_relaxed_dim1_axis0_neg(int i)3842 inline bool is_ignored_relaxed_dim1_axis0_neg(int i) {
3843 static std::set<int> ignore = {};
3844 return ignore.find(i) != ignore.end();
3845 }
3846
CreateModel_relaxed_dim1_axis0_neg_relaxed(Model * model)3847 void CreateModel_relaxed_dim1_axis0_neg_relaxed(Model *model) {
3848 OperandType type1(Type::INT32, {});
3849 OperandType type37(Type::TENSOR_FLOAT32, {3});
3850 // Phase 1, operands
3851 auto op1 = model->addOperand(&type37);
3852 auto axis = model->addOperand(&type1);
3853 auto op2 = model->addOperand(&type37);
3854 // Phase 2, operations
3855 static int32_t axis_init[] = {-1};
3856 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3857 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3858 // Phase 3, inputs and outputs
3859 model->identifyInputsAndOutputs(
3860 {op1},
3861 {op2});
3862 // Phase 4: set relaxed execution
3863 model->relaxComputationFloat32toFloat16(true);
3864 assert(model->isValid());
3865 }
3866
is_ignored_relaxed_dim1_axis0_neg_relaxed(int i)3867 inline bool is_ignored_relaxed_dim1_axis0_neg_relaxed(int i) {
3868 static std::set<int> ignore = {};
3869 return ignore.find(i) != ignore.end();
3870 }
3871
CreateModel_relaxed_dim1_axis0_neg_float16(Model * model)3872 void CreateModel_relaxed_dim1_axis0_neg_float16(Model *model) {
3873 OperandType type1(Type::INT32, {});
3874 OperandType type38(Type::TENSOR_FLOAT16, {3});
3875 // Phase 1, operands
3876 auto op1 = model->addOperand(&type38);
3877 auto axis = model->addOperand(&type1);
3878 auto op2 = model->addOperand(&type38);
3879 // Phase 2, operations
3880 static int32_t axis_init[] = {-1};
3881 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3882 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3883 // Phase 3, inputs and outputs
3884 model->identifyInputsAndOutputs(
3885 {op1},
3886 {op2});
3887 // Phase 4: set relaxed execution
3888 model->relaxComputationFloat32toFloat16(true);
3889 assert(model->isValid());
3890 }
3891
is_ignored_relaxed_dim1_axis0_neg_float16(int i)3892 inline bool is_ignored_relaxed_dim1_axis0_neg_float16(int i) {
3893 static std::set<int> ignore = {};
3894 return ignore.find(i) != ignore.end();
3895 }
3896
CreateModel_relaxed_dim1_axis0_neg_quant8(Model * model)3897 void CreateModel_relaxed_dim1_axis0_neg_quant8(Model *model) {
3898 OperandType type1(Type::INT32, {});
3899 OperandType type39(Type::TENSOR_QUANT8_ASYMM, {3}, 0.1f, 32);
3900 OperandType type40(Type::TENSOR_QUANT8_ASYMM, {3}, 0.0078125f, 128);
3901 // Phase 1, operands
3902 auto op1 = model->addOperand(&type39);
3903 auto axis = model->addOperand(&type1);
3904 auto op2 = model->addOperand(&type40);
3905 // Phase 2, operations
3906 static int32_t axis_init[] = {-1};
3907 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3908 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3909 // Phase 3, inputs and outputs
3910 model->identifyInputsAndOutputs(
3911 {op1},
3912 {op2});
3913 // Phase 4: set relaxed execution
3914 model->relaxComputationFloat32toFloat16(true);
3915 assert(model->isValid());
3916 }
3917
is_ignored_relaxed_dim1_axis0_neg_quant8(int i)3918 inline bool is_ignored_relaxed_dim1_axis0_neg_quant8(int i) {
3919 static std::set<int> ignore = {};
3920 return ignore.find(i) != ignore.end();
3921 }
3922
CreateModel_dynamic_output_shape_dim4_axis0(Model * model)3923 void CreateModel_dynamic_output_shape_dim4_axis0(Model *model) {
3924 OperandType type1(Type::INT32, {});
3925 OperandType type2(Type::TENSOR_FLOAT32, {3, 2, 2, 2});
3926 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
3927 // Phase 1, operands
3928 auto op1 = model->addOperand(&type2);
3929 auto axis = model->addOperand(&type1);
3930 auto op2 = model->addOperand(&type41);
3931 // Phase 2, operations
3932 static int32_t axis_init[] = {0};
3933 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3934 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3935 // Phase 3, inputs and outputs
3936 model->identifyInputsAndOutputs(
3937 {op1},
3938 {op2});
3939 assert(model->isValid());
3940 }
3941
is_ignored_dynamic_output_shape_dim4_axis0(int i)3942 inline bool is_ignored_dynamic_output_shape_dim4_axis0(int i) {
3943 static std::set<int> ignore = {};
3944 return ignore.find(i) != ignore.end();
3945 }
3946
CreateModel_dynamic_output_shape_dim4_axis0_relaxed(Model * model)3947 void CreateModel_dynamic_output_shape_dim4_axis0_relaxed(Model *model) {
3948 OperandType type1(Type::INT32, {});
3949 OperandType type2(Type::TENSOR_FLOAT32, {3, 2, 2, 2});
3950 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
3951 // Phase 1, operands
3952 auto op1 = model->addOperand(&type2);
3953 auto axis = model->addOperand(&type1);
3954 auto op2 = model->addOperand(&type41);
3955 // Phase 2, operations
3956 static int32_t axis_init[] = {0};
3957 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3958 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3959 // Phase 3, inputs and outputs
3960 model->identifyInputsAndOutputs(
3961 {op1},
3962 {op2});
3963 // Phase 4: set relaxed execution
3964 model->relaxComputationFloat32toFloat16(true);
3965 assert(model->isValid());
3966 }
3967
is_ignored_dynamic_output_shape_dim4_axis0_relaxed(int i)3968 inline bool is_ignored_dynamic_output_shape_dim4_axis0_relaxed(int i) {
3969 static std::set<int> ignore = {};
3970 return ignore.find(i) != ignore.end();
3971 }
3972
CreateModel_dynamic_output_shape_dim4_axis0_float16(Model * model)3973 void CreateModel_dynamic_output_shape_dim4_axis0_float16(Model *model) {
3974 OperandType type1(Type::INT32, {});
3975 OperandType type3(Type::TENSOR_FLOAT16, {3, 2, 2, 2});
3976 OperandType type42(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
3977 // Phase 1, operands
3978 auto op1 = model->addOperand(&type3);
3979 auto axis = model->addOperand(&type1);
3980 auto op2 = model->addOperand(&type42);
3981 // Phase 2, operations
3982 static int32_t axis_init[] = {0};
3983 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3984 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
3985 // Phase 3, inputs and outputs
3986 model->identifyInputsAndOutputs(
3987 {op1},
3988 {op2});
3989 assert(model->isValid());
3990 }
3991
is_ignored_dynamic_output_shape_dim4_axis0_float16(int i)3992 inline bool is_ignored_dynamic_output_shape_dim4_axis0_float16(int i) {
3993 static std::set<int> ignore = {};
3994 return ignore.find(i) != ignore.end();
3995 }
3996
CreateModel_dynamic_output_shape_dim4_axis0_quant8(Model * model)3997 void CreateModel_dynamic_output_shape_dim4_axis0_quant8(Model *model) {
3998 OperandType type1(Type::INT32, {});
3999 OperandType type4(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2, 2}, 0.1f, 32);
4000 OperandType type43(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.0078125f, 128);
4001 // Phase 1, operands
4002 auto op1 = model->addOperand(&type4);
4003 auto axis = model->addOperand(&type1);
4004 auto op2 = model->addOperand(&type43);
4005 // Phase 2, operations
4006 static int32_t axis_init[] = {0};
4007 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4008 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4009 // Phase 3, inputs and outputs
4010 model->identifyInputsAndOutputs(
4011 {op1},
4012 {op2});
4013 assert(model->isValid());
4014 }
4015
is_ignored_dynamic_output_shape_dim4_axis0_quant8(int i)4016 inline bool is_ignored_dynamic_output_shape_dim4_axis0_quant8(int i) {
4017 static std::set<int> ignore = {};
4018 return ignore.find(i) != ignore.end();
4019 }
4020
CreateModel_dynamic_output_shape_dim4_axis0_neg(Model * model)4021 void CreateModel_dynamic_output_shape_dim4_axis0_neg(Model *model) {
4022 OperandType type1(Type::INT32, {});
4023 OperandType type2(Type::TENSOR_FLOAT32, {3, 2, 2, 2});
4024 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
4025 // Phase 1, operands
4026 auto op1 = model->addOperand(&type2);
4027 auto axis = model->addOperand(&type1);
4028 auto op2 = model->addOperand(&type41);
4029 // Phase 2, operations
4030 static int32_t axis_init[] = {-4};
4031 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4032 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4033 // Phase 3, inputs and outputs
4034 model->identifyInputsAndOutputs(
4035 {op1},
4036 {op2});
4037 assert(model->isValid());
4038 }
4039
is_ignored_dynamic_output_shape_dim4_axis0_neg(int i)4040 inline bool is_ignored_dynamic_output_shape_dim4_axis0_neg(int i) {
4041 static std::set<int> ignore = {};
4042 return ignore.find(i) != ignore.end();
4043 }
4044
CreateModel_dynamic_output_shape_dim4_axis0_neg_relaxed(Model * model)4045 void CreateModel_dynamic_output_shape_dim4_axis0_neg_relaxed(Model *model) {
4046 OperandType type1(Type::INT32, {});
4047 OperandType type2(Type::TENSOR_FLOAT32, {3, 2, 2, 2});
4048 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
4049 // Phase 1, operands
4050 auto op1 = model->addOperand(&type2);
4051 auto axis = model->addOperand(&type1);
4052 auto op2 = model->addOperand(&type41);
4053 // Phase 2, operations
4054 static int32_t axis_init[] = {-4};
4055 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4056 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4057 // Phase 3, inputs and outputs
4058 model->identifyInputsAndOutputs(
4059 {op1},
4060 {op2});
4061 // Phase 4: set relaxed execution
4062 model->relaxComputationFloat32toFloat16(true);
4063 assert(model->isValid());
4064 }
4065
is_ignored_dynamic_output_shape_dim4_axis0_neg_relaxed(int i)4066 inline bool is_ignored_dynamic_output_shape_dim4_axis0_neg_relaxed(int i) {
4067 static std::set<int> ignore = {};
4068 return ignore.find(i) != ignore.end();
4069 }
4070
CreateModel_dynamic_output_shape_dim4_axis0_neg_float16(Model * model)4071 void CreateModel_dynamic_output_shape_dim4_axis0_neg_float16(Model *model) {
4072 OperandType type1(Type::INT32, {});
4073 OperandType type3(Type::TENSOR_FLOAT16, {3, 2, 2, 2});
4074 OperandType type42(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
4075 // Phase 1, operands
4076 auto op1 = model->addOperand(&type3);
4077 auto axis = model->addOperand(&type1);
4078 auto op2 = model->addOperand(&type42);
4079 // Phase 2, operations
4080 static int32_t axis_init[] = {-4};
4081 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4082 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4083 // Phase 3, inputs and outputs
4084 model->identifyInputsAndOutputs(
4085 {op1},
4086 {op2});
4087 assert(model->isValid());
4088 }
4089
is_ignored_dynamic_output_shape_dim4_axis0_neg_float16(int i)4090 inline bool is_ignored_dynamic_output_shape_dim4_axis0_neg_float16(int i) {
4091 static std::set<int> ignore = {};
4092 return ignore.find(i) != ignore.end();
4093 }
4094
CreateModel_dynamic_output_shape_dim4_axis0_neg_quant8(Model * model)4095 void CreateModel_dynamic_output_shape_dim4_axis0_neg_quant8(Model *model) {
4096 OperandType type1(Type::INT32, {});
4097 OperandType type4(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2, 2}, 0.1f, 32);
4098 OperandType type43(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.0078125f, 128);
4099 // Phase 1, operands
4100 auto op1 = model->addOperand(&type4);
4101 auto axis = model->addOperand(&type1);
4102 auto op2 = model->addOperand(&type43);
4103 // Phase 2, operations
4104 static int32_t axis_init[] = {-4};
4105 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4106 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4107 // Phase 3, inputs and outputs
4108 model->identifyInputsAndOutputs(
4109 {op1},
4110 {op2});
4111 assert(model->isValid());
4112 }
4113
is_ignored_dynamic_output_shape_dim4_axis0_neg_quant8(int i)4114 inline bool is_ignored_dynamic_output_shape_dim4_axis0_neg_quant8(int i) {
4115 static std::set<int> ignore = {};
4116 return ignore.find(i) != ignore.end();
4117 }
4118
CreateModel_dynamic_output_shape_dim4_axis1(Model * model)4119 void CreateModel_dynamic_output_shape_dim4_axis1(Model *model) {
4120 OperandType type1(Type::INT32, {});
4121 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
4122 OperandType type6(Type::TENSOR_FLOAT32, {2, 3, 2, 2});
4123 // Phase 1, operands
4124 auto op1 = model->addOperand(&type6);
4125 auto axis = model->addOperand(&type1);
4126 auto op2 = model->addOperand(&type41);
4127 // Phase 2, operations
4128 static int32_t axis_init[] = {1};
4129 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4130 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4131 // Phase 3, inputs and outputs
4132 model->identifyInputsAndOutputs(
4133 {op1},
4134 {op2});
4135 assert(model->isValid());
4136 }
4137
is_ignored_dynamic_output_shape_dim4_axis1(int i)4138 inline bool is_ignored_dynamic_output_shape_dim4_axis1(int i) {
4139 static std::set<int> ignore = {};
4140 return ignore.find(i) != ignore.end();
4141 }
4142
CreateModel_dynamic_output_shape_dim4_axis1_relaxed(Model * model)4143 void CreateModel_dynamic_output_shape_dim4_axis1_relaxed(Model *model) {
4144 OperandType type1(Type::INT32, {});
4145 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
4146 OperandType type6(Type::TENSOR_FLOAT32, {2, 3, 2, 2});
4147 // Phase 1, operands
4148 auto op1 = model->addOperand(&type6);
4149 auto axis = model->addOperand(&type1);
4150 auto op2 = model->addOperand(&type41);
4151 // Phase 2, operations
4152 static int32_t axis_init[] = {1};
4153 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4154 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4155 // Phase 3, inputs and outputs
4156 model->identifyInputsAndOutputs(
4157 {op1},
4158 {op2});
4159 // Phase 4: set relaxed execution
4160 model->relaxComputationFloat32toFloat16(true);
4161 assert(model->isValid());
4162 }
4163
is_ignored_dynamic_output_shape_dim4_axis1_relaxed(int i)4164 inline bool is_ignored_dynamic_output_shape_dim4_axis1_relaxed(int i) {
4165 static std::set<int> ignore = {};
4166 return ignore.find(i) != ignore.end();
4167 }
4168
CreateModel_dynamic_output_shape_dim4_axis1_float16(Model * model)4169 void CreateModel_dynamic_output_shape_dim4_axis1_float16(Model *model) {
4170 OperandType type1(Type::INT32, {});
4171 OperandType type42(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
4172 OperandType type7(Type::TENSOR_FLOAT16, {2, 3, 2, 2});
4173 // Phase 1, operands
4174 auto op1 = model->addOperand(&type7);
4175 auto axis = model->addOperand(&type1);
4176 auto op2 = model->addOperand(&type42);
4177 // Phase 2, operations
4178 static int32_t axis_init[] = {1};
4179 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4180 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4181 // Phase 3, inputs and outputs
4182 model->identifyInputsAndOutputs(
4183 {op1},
4184 {op2});
4185 assert(model->isValid());
4186 }
4187
is_ignored_dynamic_output_shape_dim4_axis1_float16(int i)4188 inline bool is_ignored_dynamic_output_shape_dim4_axis1_float16(int i) {
4189 static std::set<int> ignore = {};
4190 return ignore.find(i) != ignore.end();
4191 }
4192
CreateModel_dynamic_output_shape_dim4_axis1_quant8(Model * model)4193 void CreateModel_dynamic_output_shape_dim4_axis1_quant8(Model *model) {
4194 OperandType type1(Type::INT32, {});
4195 OperandType type43(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.0078125f, 128);
4196 OperandType type8(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2, 2}, 0.1f, 32);
4197 // Phase 1, operands
4198 auto op1 = model->addOperand(&type8);
4199 auto axis = model->addOperand(&type1);
4200 auto op2 = model->addOperand(&type43);
4201 // Phase 2, operations
4202 static int32_t axis_init[] = {1};
4203 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4204 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4205 // Phase 3, inputs and outputs
4206 model->identifyInputsAndOutputs(
4207 {op1},
4208 {op2});
4209 assert(model->isValid());
4210 }
4211
is_ignored_dynamic_output_shape_dim4_axis1_quant8(int i)4212 inline bool is_ignored_dynamic_output_shape_dim4_axis1_quant8(int i) {
4213 static std::set<int> ignore = {};
4214 return ignore.find(i) != ignore.end();
4215 }
4216
CreateModel_dynamic_output_shape_dim4_axis1_neg(Model * model)4217 void CreateModel_dynamic_output_shape_dim4_axis1_neg(Model *model) {
4218 OperandType type1(Type::INT32, {});
4219 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
4220 OperandType type6(Type::TENSOR_FLOAT32, {2, 3, 2, 2});
4221 // Phase 1, operands
4222 auto op1 = model->addOperand(&type6);
4223 auto axis = model->addOperand(&type1);
4224 auto op2 = model->addOperand(&type41);
4225 // Phase 2, operations
4226 static int32_t axis_init[] = {-3};
4227 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4228 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4229 // Phase 3, inputs and outputs
4230 model->identifyInputsAndOutputs(
4231 {op1},
4232 {op2});
4233 assert(model->isValid());
4234 }
4235
is_ignored_dynamic_output_shape_dim4_axis1_neg(int i)4236 inline bool is_ignored_dynamic_output_shape_dim4_axis1_neg(int i) {
4237 static std::set<int> ignore = {};
4238 return ignore.find(i) != ignore.end();
4239 }
4240
CreateModel_dynamic_output_shape_dim4_axis1_neg_relaxed(Model * model)4241 void CreateModel_dynamic_output_shape_dim4_axis1_neg_relaxed(Model *model) {
4242 OperandType type1(Type::INT32, {});
4243 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
4244 OperandType type6(Type::TENSOR_FLOAT32, {2, 3, 2, 2});
4245 // Phase 1, operands
4246 auto op1 = model->addOperand(&type6);
4247 auto axis = model->addOperand(&type1);
4248 auto op2 = model->addOperand(&type41);
4249 // Phase 2, operations
4250 static int32_t axis_init[] = {-3};
4251 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4252 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4253 // Phase 3, inputs and outputs
4254 model->identifyInputsAndOutputs(
4255 {op1},
4256 {op2});
4257 // Phase 4: set relaxed execution
4258 model->relaxComputationFloat32toFloat16(true);
4259 assert(model->isValid());
4260 }
4261
is_ignored_dynamic_output_shape_dim4_axis1_neg_relaxed(int i)4262 inline bool is_ignored_dynamic_output_shape_dim4_axis1_neg_relaxed(int i) {
4263 static std::set<int> ignore = {};
4264 return ignore.find(i) != ignore.end();
4265 }
4266
CreateModel_dynamic_output_shape_dim4_axis1_neg_float16(Model * model)4267 void CreateModel_dynamic_output_shape_dim4_axis1_neg_float16(Model *model) {
4268 OperandType type1(Type::INT32, {});
4269 OperandType type42(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
4270 OperandType type7(Type::TENSOR_FLOAT16, {2, 3, 2, 2});
4271 // Phase 1, operands
4272 auto op1 = model->addOperand(&type7);
4273 auto axis = model->addOperand(&type1);
4274 auto op2 = model->addOperand(&type42);
4275 // Phase 2, operations
4276 static int32_t axis_init[] = {-3};
4277 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4278 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4279 // Phase 3, inputs and outputs
4280 model->identifyInputsAndOutputs(
4281 {op1},
4282 {op2});
4283 assert(model->isValid());
4284 }
4285
is_ignored_dynamic_output_shape_dim4_axis1_neg_float16(int i)4286 inline bool is_ignored_dynamic_output_shape_dim4_axis1_neg_float16(int i) {
4287 static std::set<int> ignore = {};
4288 return ignore.find(i) != ignore.end();
4289 }
4290
CreateModel_dynamic_output_shape_dim4_axis1_neg_quant8(Model * model)4291 void CreateModel_dynamic_output_shape_dim4_axis1_neg_quant8(Model *model) {
4292 OperandType type1(Type::INT32, {});
4293 OperandType type43(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.0078125f, 128);
4294 OperandType type8(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2, 2}, 0.1f, 32);
4295 // Phase 1, operands
4296 auto op1 = model->addOperand(&type8);
4297 auto axis = model->addOperand(&type1);
4298 auto op2 = model->addOperand(&type43);
4299 // Phase 2, operations
4300 static int32_t axis_init[] = {-3};
4301 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4302 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4303 // Phase 3, inputs and outputs
4304 model->identifyInputsAndOutputs(
4305 {op1},
4306 {op2});
4307 assert(model->isValid());
4308 }
4309
is_ignored_dynamic_output_shape_dim4_axis1_neg_quant8(int i)4310 inline bool is_ignored_dynamic_output_shape_dim4_axis1_neg_quant8(int i) {
4311 static std::set<int> ignore = {};
4312 return ignore.find(i) != ignore.end();
4313 }
4314
CreateModel_dynamic_output_shape_dim4_axis2(Model * model)4315 void CreateModel_dynamic_output_shape_dim4_axis2(Model *model) {
4316 OperandType type1(Type::INT32, {});
4317 OperandType type10(Type::TENSOR_FLOAT32, {2, 2, 3, 2});
4318 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
4319 // Phase 1, operands
4320 auto op1 = model->addOperand(&type10);
4321 auto axis = model->addOperand(&type1);
4322 auto op2 = model->addOperand(&type41);
4323 // Phase 2, operations
4324 static int32_t axis_init[] = {2};
4325 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4326 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4327 // Phase 3, inputs and outputs
4328 model->identifyInputsAndOutputs(
4329 {op1},
4330 {op2});
4331 assert(model->isValid());
4332 }
4333
is_ignored_dynamic_output_shape_dim4_axis2(int i)4334 inline bool is_ignored_dynamic_output_shape_dim4_axis2(int i) {
4335 static std::set<int> ignore = {};
4336 return ignore.find(i) != ignore.end();
4337 }
4338
CreateModel_dynamic_output_shape_dim4_axis2_relaxed(Model * model)4339 void CreateModel_dynamic_output_shape_dim4_axis2_relaxed(Model *model) {
4340 OperandType type1(Type::INT32, {});
4341 OperandType type10(Type::TENSOR_FLOAT32, {2, 2, 3, 2});
4342 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
4343 // Phase 1, operands
4344 auto op1 = model->addOperand(&type10);
4345 auto axis = model->addOperand(&type1);
4346 auto op2 = model->addOperand(&type41);
4347 // Phase 2, operations
4348 static int32_t axis_init[] = {2};
4349 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4350 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4351 // Phase 3, inputs and outputs
4352 model->identifyInputsAndOutputs(
4353 {op1},
4354 {op2});
4355 // Phase 4: set relaxed execution
4356 model->relaxComputationFloat32toFloat16(true);
4357 assert(model->isValid());
4358 }
4359
is_ignored_dynamic_output_shape_dim4_axis2_relaxed(int i)4360 inline bool is_ignored_dynamic_output_shape_dim4_axis2_relaxed(int i) {
4361 static std::set<int> ignore = {};
4362 return ignore.find(i) != ignore.end();
4363 }
4364
CreateModel_dynamic_output_shape_dim4_axis2_float16(Model * model)4365 void CreateModel_dynamic_output_shape_dim4_axis2_float16(Model *model) {
4366 OperandType type1(Type::INT32, {});
4367 OperandType type11(Type::TENSOR_FLOAT16, {2, 2, 3, 2});
4368 OperandType type42(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
4369 // Phase 1, operands
4370 auto op1 = model->addOperand(&type11);
4371 auto axis = model->addOperand(&type1);
4372 auto op2 = model->addOperand(&type42);
4373 // Phase 2, operations
4374 static int32_t axis_init[] = {2};
4375 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4376 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4377 // Phase 3, inputs and outputs
4378 model->identifyInputsAndOutputs(
4379 {op1},
4380 {op2});
4381 assert(model->isValid());
4382 }
4383
is_ignored_dynamic_output_shape_dim4_axis2_float16(int i)4384 inline bool is_ignored_dynamic_output_shape_dim4_axis2_float16(int i) {
4385 static std::set<int> ignore = {};
4386 return ignore.find(i) != ignore.end();
4387 }
4388
CreateModel_dynamic_output_shape_dim4_axis2_quant8(Model * model)4389 void CreateModel_dynamic_output_shape_dim4_axis2_quant8(Model *model) {
4390 OperandType type1(Type::INT32, {});
4391 OperandType type12(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3, 2}, 0.1f, 32);
4392 OperandType type43(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.0078125f, 128);
4393 // Phase 1, operands
4394 auto op1 = model->addOperand(&type12);
4395 auto axis = model->addOperand(&type1);
4396 auto op2 = model->addOperand(&type43);
4397 // Phase 2, operations
4398 static int32_t axis_init[] = {2};
4399 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4400 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4401 // Phase 3, inputs and outputs
4402 model->identifyInputsAndOutputs(
4403 {op1},
4404 {op2});
4405 assert(model->isValid());
4406 }
4407
is_ignored_dynamic_output_shape_dim4_axis2_quant8(int i)4408 inline bool is_ignored_dynamic_output_shape_dim4_axis2_quant8(int i) {
4409 static std::set<int> ignore = {};
4410 return ignore.find(i) != ignore.end();
4411 }
4412
CreateModel_dynamic_output_shape_dim4_axis2_neg(Model * model)4413 void CreateModel_dynamic_output_shape_dim4_axis2_neg(Model *model) {
4414 OperandType type1(Type::INT32, {});
4415 OperandType type10(Type::TENSOR_FLOAT32, {2, 2, 3, 2});
4416 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
4417 // Phase 1, operands
4418 auto op1 = model->addOperand(&type10);
4419 auto axis = model->addOperand(&type1);
4420 auto op2 = model->addOperand(&type41);
4421 // Phase 2, operations
4422 static int32_t axis_init[] = {-2};
4423 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4424 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4425 // Phase 3, inputs and outputs
4426 model->identifyInputsAndOutputs(
4427 {op1},
4428 {op2});
4429 assert(model->isValid());
4430 }
4431
is_ignored_dynamic_output_shape_dim4_axis2_neg(int i)4432 inline bool is_ignored_dynamic_output_shape_dim4_axis2_neg(int i) {
4433 static std::set<int> ignore = {};
4434 return ignore.find(i) != ignore.end();
4435 }
4436
CreateModel_dynamic_output_shape_dim4_axis2_neg_relaxed(Model * model)4437 void CreateModel_dynamic_output_shape_dim4_axis2_neg_relaxed(Model *model) {
4438 OperandType type1(Type::INT32, {});
4439 OperandType type10(Type::TENSOR_FLOAT32, {2, 2, 3, 2});
4440 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
4441 // Phase 1, operands
4442 auto op1 = model->addOperand(&type10);
4443 auto axis = model->addOperand(&type1);
4444 auto op2 = model->addOperand(&type41);
4445 // Phase 2, operations
4446 static int32_t axis_init[] = {-2};
4447 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4448 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4449 // Phase 3, inputs and outputs
4450 model->identifyInputsAndOutputs(
4451 {op1},
4452 {op2});
4453 // Phase 4: set relaxed execution
4454 model->relaxComputationFloat32toFloat16(true);
4455 assert(model->isValid());
4456 }
4457
is_ignored_dynamic_output_shape_dim4_axis2_neg_relaxed(int i)4458 inline bool is_ignored_dynamic_output_shape_dim4_axis2_neg_relaxed(int i) {
4459 static std::set<int> ignore = {};
4460 return ignore.find(i) != ignore.end();
4461 }
4462
CreateModel_dynamic_output_shape_dim4_axis2_neg_float16(Model * model)4463 void CreateModel_dynamic_output_shape_dim4_axis2_neg_float16(Model *model) {
4464 OperandType type1(Type::INT32, {});
4465 OperandType type11(Type::TENSOR_FLOAT16, {2, 2, 3, 2});
4466 OperandType type42(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
4467 // Phase 1, operands
4468 auto op1 = model->addOperand(&type11);
4469 auto axis = model->addOperand(&type1);
4470 auto op2 = model->addOperand(&type42);
4471 // Phase 2, operations
4472 static int32_t axis_init[] = {-2};
4473 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4474 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4475 // Phase 3, inputs and outputs
4476 model->identifyInputsAndOutputs(
4477 {op1},
4478 {op2});
4479 assert(model->isValid());
4480 }
4481
is_ignored_dynamic_output_shape_dim4_axis2_neg_float16(int i)4482 inline bool is_ignored_dynamic_output_shape_dim4_axis2_neg_float16(int i) {
4483 static std::set<int> ignore = {};
4484 return ignore.find(i) != ignore.end();
4485 }
4486
CreateModel_dynamic_output_shape_dim4_axis2_neg_quant8(Model * model)4487 void CreateModel_dynamic_output_shape_dim4_axis2_neg_quant8(Model *model) {
4488 OperandType type1(Type::INT32, {});
4489 OperandType type12(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3, 2}, 0.1f, 32);
4490 OperandType type43(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.0078125f, 128);
4491 // Phase 1, operands
4492 auto op1 = model->addOperand(&type12);
4493 auto axis = model->addOperand(&type1);
4494 auto op2 = model->addOperand(&type43);
4495 // Phase 2, operations
4496 static int32_t axis_init[] = {-2};
4497 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4498 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4499 // Phase 3, inputs and outputs
4500 model->identifyInputsAndOutputs(
4501 {op1},
4502 {op2});
4503 assert(model->isValid());
4504 }
4505
is_ignored_dynamic_output_shape_dim4_axis2_neg_quant8(int i)4506 inline bool is_ignored_dynamic_output_shape_dim4_axis2_neg_quant8(int i) {
4507 static std::set<int> ignore = {};
4508 return ignore.find(i) != ignore.end();
4509 }
4510
CreateModel_dynamic_output_shape_dim4_axis3(Model * model)4511 void CreateModel_dynamic_output_shape_dim4_axis3(Model *model) {
4512 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
4513 OperandType type1(Type::INT32, {});
4514 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
4515 // Phase 1, operands
4516 auto op1 = model->addOperand(&type0);
4517 auto axis = model->addOperand(&type1);
4518 auto op2 = model->addOperand(&type41);
4519 // Phase 2, operations
4520 static int32_t axis_init[] = {3};
4521 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4522 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4523 // Phase 3, inputs and outputs
4524 model->identifyInputsAndOutputs(
4525 {op1},
4526 {op2});
4527 assert(model->isValid());
4528 }
4529
is_ignored_dynamic_output_shape_dim4_axis3(int i)4530 inline bool is_ignored_dynamic_output_shape_dim4_axis3(int i) {
4531 static std::set<int> ignore = {};
4532 return ignore.find(i) != ignore.end();
4533 }
4534
CreateModel_dynamic_output_shape_dim4_axis3_relaxed(Model * model)4535 void CreateModel_dynamic_output_shape_dim4_axis3_relaxed(Model *model) {
4536 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
4537 OperandType type1(Type::INT32, {});
4538 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
4539 // Phase 1, operands
4540 auto op1 = model->addOperand(&type0);
4541 auto axis = model->addOperand(&type1);
4542 auto op2 = model->addOperand(&type41);
4543 // Phase 2, operations
4544 static int32_t axis_init[] = {3};
4545 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4546 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4547 // Phase 3, inputs and outputs
4548 model->identifyInputsAndOutputs(
4549 {op1},
4550 {op2});
4551 // Phase 4: set relaxed execution
4552 model->relaxComputationFloat32toFloat16(true);
4553 assert(model->isValid());
4554 }
4555
is_ignored_dynamic_output_shape_dim4_axis3_relaxed(int i)4556 inline bool is_ignored_dynamic_output_shape_dim4_axis3_relaxed(int i) {
4557 static std::set<int> ignore = {};
4558 return ignore.find(i) != ignore.end();
4559 }
4560
CreateModel_dynamic_output_shape_dim4_axis3_float16(Model * model)4561 void CreateModel_dynamic_output_shape_dim4_axis3_float16(Model *model) {
4562 OperandType type1(Type::INT32, {});
4563 OperandType type14(Type::TENSOR_FLOAT16, {2, 2, 2, 3});
4564 OperandType type42(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
4565 // Phase 1, operands
4566 auto op1 = model->addOperand(&type14);
4567 auto axis = model->addOperand(&type1);
4568 auto op2 = model->addOperand(&type42);
4569 // Phase 2, operations
4570 static int32_t axis_init[] = {3};
4571 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4572 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4573 // Phase 3, inputs and outputs
4574 model->identifyInputsAndOutputs(
4575 {op1},
4576 {op2});
4577 assert(model->isValid());
4578 }
4579
is_ignored_dynamic_output_shape_dim4_axis3_float16(int i)4580 inline bool is_ignored_dynamic_output_shape_dim4_axis3_float16(int i) {
4581 static std::set<int> ignore = {};
4582 return ignore.find(i) != ignore.end();
4583 }
4584
CreateModel_dynamic_output_shape_dim4_axis3_quant8(Model * model)4585 void CreateModel_dynamic_output_shape_dim4_axis3_quant8(Model *model) {
4586 OperandType type1(Type::INT32, {});
4587 OperandType type15(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 3}, 0.1f, 32);
4588 OperandType type43(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.0078125f, 128);
4589 // Phase 1, operands
4590 auto op1 = model->addOperand(&type15);
4591 auto axis = model->addOperand(&type1);
4592 auto op2 = model->addOperand(&type43);
4593 // Phase 2, operations
4594 static int32_t axis_init[] = {3};
4595 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4596 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4597 // Phase 3, inputs and outputs
4598 model->identifyInputsAndOutputs(
4599 {op1},
4600 {op2});
4601 assert(model->isValid());
4602 }
4603
is_ignored_dynamic_output_shape_dim4_axis3_quant8(int i)4604 inline bool is_ignored_dynamic_output_shape_dim4_axis3_quant8(int i) {
4605 static std::set<int> ignore = {};
4606 return ignore.find(i) != ignore.end();
4607 }
4608
CreateModel_dynamic_output_shape_dim4_axis3_neg(Model * model)4609 void CreateModel_dynamic_output_shape_dim4_axis3_neg(Model *model) {
4610 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
4611 OperandType type1(Type::INT32, {});
4612 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
4613 // Phase 1, operands
4614 auto op1 = model->addOperand(&type0);
4615 auto axis = model->addOperand(&type1);
4616 auto op2 = model->addOperand(&type41);
4617 // Phase 2, operations
4618 static int32_t axis_init[] = {-1};
4619 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4620 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4621 // Phase 3, inputs and outputs
4622 model->identifyInputsAndOutputs(
4623 {op1},
4624 {op2});
4625 assert(model->isValid());
4626 }
4627
is_ignored_dynamic_output_shape_dim4_axis3_neg(int i)4628 inline bool is_ignored_dynamic_output_shape_dim4_axis3_neg(int i) {
4629 static std::set<int> ignore = {};
4630 return ignore.find(i) != ignore.end();
4631 }
4632
CreateModel_dynamic_output_shape_dim4_axis3_neg_relaxed(Model * model)4633 void CreateModel_dynamic_output_shape_dim4_axis3_neg_relaxed(Model *model) {
4634 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
4635 OperandType type1(Type::INT32, {});
4636 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
4637 // Phase 1, operands
4638 auto op1 = model->addOperand(&type0);
4639 auto axis = model->addOperand(&type1);
4640 auto op2 = model->addOperand(&type41);
4641 // Phase 2, operations
4642 static int32_t axis_init[] = {-1};
4643 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4644 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4645 // Phase 3, inputs and outputs
4646 model->identifyInputsAndOutputs(
4647 {op1},
4648 {op2});
4649 // Phase 4: set relaxed execution
4650 model->relaxComputationFloat32toFloat16(true);
4651 assert(model->isValid());
4652 }
4653
is_ignored_dynamic_output_shape_dim4_axis3_neg_relaxed(int i)4654 inline bool is_ignored_dynamic_output_shape_dim4_axis3_neg_relaxed(int i) {
4655 static std::set<int> ignore = {};
4656 return ignore.find(i) != ignore.end();
4657 }
4658
CreateModel_dynamic_output_shape_dim4_axis3_neg_float16(Model * model)4659 void CreateModel_dynamic_output_shape_dim4_axis3_neg_float16(Model *model) {
4660 OperandType type1(Type::INT32, {});
4661 OperandType type14(Type::TENSOR_FLOAT16, {2, 2, 2, 3});
4662 OperandType type42(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
4663 // Phase 1, operands
4664 auto op1 = model->addOperand(&type14);
4665 auto axis = model->addOperand(&type1);
4666 auto op2 = model->addOperand(&type42);
4667 // Phase 2, operations
4668 static int32_t axis_init[] = {-1};
4669 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4670 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4671 // Phase 3, inputs and outputs
4672 model->identifyInputsAndOutputs(
4673 {op1},
4674 {op2});
4675 assert(model->isValid());
4676 }
4677
is_ignored_dynamic_output_shape_dim4_axis3_neg_float16(int i)4678 inline bool is_ignored_dynamic_output_shape_dim4_axis3_neg_float16(int i) {
4679 static std::set<int> ignore = {};
4680 return ignore.find(i) != ignore.end();
4681 }
4682
CreateModel_dynamic_output_shape_dim4_axis3_neg_quant8(Model * model)4683 void CreateModel_dynamic_output_shape_dim4_axis3_neg_quant8(Model *model) {
4684 OperandType type1(Type::INT32, {});
4685 OperandType type15(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 3}, 0.1f, 32);
4686 OperandType type43(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.0078125f, 128);
4687 // Phase 1, operands
4688 auto op1 = model->addOperand(&type15);
4689 auto axis = model->addOperand(&type1);
4690 auto op2 = model->addOperand(&type43);
4691 // Phase 2, operations
4692 static int32_t axis_init[] = {-1};
4693 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4694 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4695 // Phase 3, inputs and outputs
4696 model->identifyInputsAndOutputs(
4697 {op1},
4698 {op2});
4699 assert(model->isValid());
4700 }
4701
is_ignored_dynamic_output_shape_dim4_axis3_neg_quant8(int i)4702 inline bool is_ignored_dynamic_output_shape_dim4_axis3_neg_quant8(int i) {
4703 static std::set<int> ignore = {};
4704 return ignore.find(i) != ignore.end();
4705 }
4706
CreateModel_dynamic_output_shape_dim3_axis0(Model * model)4707 void CreateModel_dynamic_output_shape_dim3_axis0(Model *model) {
4708 OperandType type1(Type::INT32, {});
4709 OperandType type17(Type::TENSOR_FLOAT32, {3, 2, 2});
4710 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
4711 // Phase 1, operands
4712 auto op1 = model->addOperand(&type17);
4713 auto axis = model->addOperand(&type1);
4714 auto op2 = model->addOperand(&type44);
4715 // Phase 2, operations
4716 static int32_t axis_init[] = {0};
4717 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4718 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4719 // Phase 3, inputs and outputs
4720 model->identifyInputsAndOutputs(
4721 {op1},
4722 {op2});
4723 assert(model->isValid());
4724 }
4725
is_ignored_dynamic_output_shape_dim3_axis0(int i)4726 inline bool is_ignored_dynamic_output_shape_dim3_axis0(int i) {
4727 static std::set<int> ignore = {};
4728 return ignore.find(i) != ignore.end();
4729 }
4730
CreateModel_dynamic_output_shape_dim3_axis0_relaxed(Model * model)4731 void CreateModel_dynamic_output_shape_dim3_axis0_relaxed(Model *model) {
4732 OperandType type1(Type::INT32, {});
4733 OperandType type17(Type::TENSOR_FLOAT32, {3, 2, 2});
4734 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
4735 // Phase 1, operands
4736 auto op1 = model->addOperand(&type17);
4737 auto axis = model->addOperand(&type1);
4738 auto op2 = model->addOperand(&type44);
4739 // Phase 2, operations
4740 static int32_t axis_init[] = {0};
4741 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4742 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4743 // Phase 3, inputs and outputs
4744 model->identifyInputsAndOutputs(
4745 {op1},
4746 {op2});
4747 // Phase 4: set relaxed execution
4748 model->relaxComputationFloat32toFloat16(true);
4749 assert(model->isValid());
4750 }
4751
is_ignored_dynamic_output_shape_dim3_axis0_relaxed(int i)4752 inline bool is_ignored_dynamic_output_shape_dim3_axis0_relaxed(int i) {
4753 static std::set<int> ignore = {};
4754 return ignore.find(i) != ignore.end();
4755 }
4756
CreateModel_dynamic_output_shape_dim3_axis0_float16(Model * model)4757 void CreateModel_dynamic_output_shape_dim3_axis0_float16(Model *model) {
4758 OperandType type1(Type::INT32, {});
4759 OperandType type18(Type::TENSOR_FLOAT16, {3, 2, 2});
4760 OperandType type45(Type::TENSOR_FLOAT16, {0, 0, 0});
4761 // Phase 1, operands
4762 auto op1 = model->addOperand(&type18);
4763 auto axis = model->addOperand(&type1);
4764 auto op2 = model->addOperand(&type45);
4765 // Phase 2, operations
4766 static int32_t axis_init[] = {0};
4767 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4768 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4769 // Phase 3, inputs and outputs
4770 model->identifyInputsAndOutputs(
4771 {op1},
4772 {op2});
4773 assert(model->isValid());
4774 }
4775
is_ignored_dynamic_output_shape_dim3_axis0_float16(int i)4776 inline bool is_ignored_dynamic_output_shape_dim3_axis0_float16(int i) {
4777 static std::set<int> ignore = {};
4778 return ignore.find(i) != ignore.end();
4779 }
4780
CreateModel_dynamic_output_shape_dim3_axis0_quant8(Model * model)4781 void CreateModel_dynamic_output_shape_dim3_axis0_quant8(Model *model) {
4782 OperandType type1(Type::INT32, {});
4783 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2}, 0.1f, 32);
4784 OperandType type46(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.0078125f, 128);
4785 // Phase 1, operands
4786 auto op1 = model->addOperand(&type19);
4787 auto axis = model->addOperand(&type1);
4788 auto op2 = model->addOperand(&type46);
4789 // Phase 2, operations
4790 static int32_t axis_init[] = {0};
4791 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4792 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4793 // Phase 3, inputs and outputs
4794 model->identifyInputsAndOutputs(
4795 {op1},
4796 {op2});
4797 assert(model->isValid());
4798 }
4799
is_ignored_dynamic_output_shape_dim3_axis0_quant8(int i)4800 inline bool is_ignored_dynamic_output_shape_dim3_axis0_quant8(int i) {
4801 static std::set<int> ignore = {};
4802 return ignore.find(i) != ignore.end();
4803 }
4804
CreateModel_dynamic_output_shape_dim3_axis0_neg(Model * model)4805 void CreateModel_dynamic_output_shape_dim3_axis0_neg(Model *model) {
4806 OperandType type1(Type::INT32, {});
4807 OperandType type17(Type::TENSOR_FLOAT32, {3, 2, 2});
4808 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
4809 // Phase 1, operands
4810 auto op1 = model->addOperand(&type17);
4811 auto axis = model->addOperand(&type1);
4812 auto op2 = model->addOperand(&type44);
4813 // Phase 2, operations
4814 static int32_t axis_init[] = {-3};
4815 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4816 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4817 // Phase 3, inputs and outputs
4818 model->identifyInputsAndOutputs(
4819 {op1},
4820 {op2});
4821 assert(model->isValid());
4822 }
4823
is_ignored_dynamic_output_shape_dim3_axis0_neg(int i)4824 inline bool is_ignored_dynamic_output_shape_dim3_axis0_neg(int i) {
4825 static std::set<int> ignore = {};
4826 return ignore.find(i) != ignore.end();
4827 }
4828
CreateModel_dynamic_output_shape_dim3_axis0_neg_relaxed(Model * model)4829 void CreateModel_dynamic_output_shape_dim3_axis0_neg_relaxed(Model *model) {
4830 OperandType type1(Type::INT32, {});
4831 OperandType type17(Type::TENSOR_FLOAT32, {3, 2, 2});
4832 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
4833 // Phase 1, operands
4834 auto op1 = model->addOperand(&type17);
4835 auto axis = model->addOperand(&type1);
4836 auto op2 = model->addOperand(&type44);
4837 // Phase 2, operations
4838 static int32_t axis_init[] = {-3};
4839 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4840 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4841 // Phase 3, inputs and outputs
4842 model->identifyInputsAndOutputs(
4843 {op1},
4844 {op2});
4845 // Phase 4: set relaxed execution
4846 model->relaxComputationFloat32toFloat16(true);
4847 assert(model->isValid());
4848 }
4849
is_ignored_dynamic_output_shape_dim3_axis0_neg_relaxed(int i)4850 inline bool is_ignored_dynamic_output_shape_dim3_axis0_neg_relaxed(int i) {
4851 static std::set<int> ignore = {};
4852 return ignore.find(i) != ignore.end();
4853 }
4854
CreateModel_dynamic_output_shape_dim3_axis0_neg_float16(Model * model)4855 void CreateModel_dynamic_output_shape_dim3_axis0_neg_float16(Model *model) {
4856 OperandType type1(Type::INT32, {});
4857 OperandType type18(Type::TENSOR_FLOAT16, {3, 2, 2});
4858 OperandType type45(Type::TENSOR_FLOAT16, {0, 0, 0});
4859 // Phase 1, operands
4860 auto op1 = model->addOperand(&type18);
4861 auto axis = model->addOperand(&type1);
4862 auto op2 = model->addOperand(&type45);
4863 // Phase 2, operations
4864 static int32_t axis_init[] = {-3};
4865 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4866 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4867 // Phase 3, inputs and outputs
4868 model->identifyInputsAndOutputs(
4869 {op1},
4870 {op2});
4871 assert(model->isValid());
4872 }
4873
is_ignored_dynamic_output_shape_dim3_axis0_neg_float16(int i)4874 inline bool is_ignored_dynamic_output_shape_dim3_axis0_neg_float16(int i) {
4875 static std::set<int> ignore = {};
4876 return ignore.find(i) != ignore.end();
4877 }
4878
CreateModel_dynamic_output_shape_dim3_axis0_neg_quant8(Model * model)4879 void CreateModel_dynamic_output_shape_dim3_axis0_neg_quant8(Model *model) {
4880 OperandType type1(Type::INT32, {});
4881 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2}, 0.1f, 32);
4882 OperandType type46(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.0078125f, 128);
4883 // Phase 1, operands
4884 auto op1 = model->addOperand(&type19);
4885 auto axis = model->addOperand(&type1);
4886 auto op2 = model->addOperand(&type46);
4887 // Phase 2, operations
4888 static int32_t axis_init[] = {-3};
4889 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4890 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4891 // Phase 3, inputs and outputs
4892 model->identifyInputsAndOutputs(
4893 {op1},
4894 {op2});
4895 assert(model->isValid());
4896 }
4897
is_ignored_dynamic_output_shape_dim3_axis0_neg_quant8(int i)4898 inline bool is_ignored_dynamic_output_shape_dim3_axis0_neg_quant8(int i) {
4899 static std::set<int> ignore = {};
4900 return ignore.find(i) != ignore.end();
4901 }
4902
CreateModel_dynamic_output_shape_dim3_axis1(Model * model)4903 void CreateModel_dynamic_output_shape_dim3_axis1(Model *model) {
4904 OperandType type1(Type::INT32, {});
4905 OperandType type21(Type::TENSOR_FLOAT32, {2, 3, 2});
4906 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
4907 // Phase 1, operands
4908 auto op1 = model->addOperand(&type21);
4909 auto axis = model->addOperand(&type1);
4910 auto op2 = model->addOperand(&type44);
4911 // Phase 2, operations
4912 static int32_t axis_init[] = {1};
4913 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4914 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4915 // Phase 3, inputs and outputs
4916 model->identifyInputsAndOutputs(
4917 {op1},
4918 {op2});
4919 assert(model->isValid());
4920 }
4921
is_ignored_dynamic_output_shape_dim3_axis1(int i)4922 inline bool is_ignored_dynamic_output_shape_dim3_axis1(int i) {
4923 static std::set<int> ignore = {};
4924 return ignore.find(i) != ignore.end();
4925 }
4926
CreateModel_dynamic_output_shape_dim3_axis1_relaxed(Model * model)4927 void CreateModel_dynamic_output_shape_dim3_axis1_relaxed(Model *model) {
4928 OperandType type1(Type::INT32, {});
4929 OperandType type21(Type::TENSOR_FLOAT32, {2, 3, 2});
4930 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
4931 // Phase 1, operands
4932 auto op1 = model->addOperand(&type21);
4933 auto axis = model->addOperand(&type1);
4934 auto op2 = model->addOperand(&type44);
4935 // Phase 2, operations
4936 static int32_t axis_init[] = {1};
4937 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4938 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4939 // Phase 3, inputs and outputs
4940 model->identifyInputsAndOutputs(
4941 {op1},
4942 {op2});
4943 // Phase 4: set relaxed execution
4944 model->relaxComputationFloat32toFloat16(true);
4945 assert(model->isValid());
4946 }
4947
is_ignored_dynamic_output_shape_dim3_axis1_relaxed(int i)4948 inline bool is_ignored_dynamic_output_shape_dim3_axis1_relaxed(int i) {
4949 static std::set<int> ignore = {};
4950 return ignore.find(i) != ignore.end();
4951 }
4952
CreateModel_dynamic_output_shape_dim3_axis1_float16(Model * model)4953 void CreateModel_dynamic_output_shape_dim3_axis1_float16(Model *model) {
4954 OperandType type1(Type::INT32, {});
4955 OperandType type22(Type::TENSOR_FLOAT16, {2, 3, 2});
4956 OperandType type45(Type::TENSOR_FLOAT16, {0, 0, 0});
4957 // Phase 1, operands
4958 auto op1 = model->addOperand(&type22);
4959 auto axis = model->addOperand(&type1);
4960 auto op2 = model->addOperand(&type45);
4961 // Phase 2, operations
4962 static int32_t axis_init[] = {1};
4963 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4964 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4965 // Phase 3, inputs and outputs
4966 model->identifyInputsAndOutputs(
4967 {op1},
4968 {op2});
4969 assert(model->isValid());
4970 }
4971
is_ignored_dynamic_output_shape_dim3_axis1_float16(int i)4972 inline bool is_ignored_dynamic_output_shape_dim3_axis1_float16(int i) {
4973 static std::set<int> ignore = {};
4974 return ignore.find(i) != ignore.end();
4975 }
4976
CreateModel_dynamic_output_shape_dim3_axis1_quant8(Model * model)4977 void CreateModel_dynamic_output_shape_dim3_axis1_quant8(Model *model) {
4978 OperandType type1(Type::INT32, {});
4979 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2}, 0.1f, 32);
4980 OperandType type46(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.0078125f, 128);
4981 // Phase 1, operands
4982 auto op1 = model->addOperand(&type23);
4983 auto axis = model->addOperand(&type1);
4984 auto op2 = model->addOperand(&type46);
4985 // Phase 2, operations
4986 static int32_t axis_init[] = {1};
4987 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4988 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
4989 // Phase 3, inputs and outputs
4990 model->identifyInputsAndOutputs(
4991 {op1},
4992 {op2});
4993 assert(model->isValid());
4994 }
4995
is_ignored_dynamic_output_shape_dim3_axis1_quant8(int i)4996 inline bool is_ignored_dynamic_output_shape_dim3_axis1_quant8(int i) {
4997 static std::set<int> ignore = {};
4998 return ignore.find(i) != ignore.end();
4999 }
5000
CreateModel_dynamic_output_shape_dim3_axis1_neg(Model * model)5001 void CreateModel_dynamic_output_shape_dim3_axis1_neg(Model *model) {
5002 OperandType type1(Type::INT32, {});
5003 OperandType type21(Type::TENSOR_FLOAT32, {2, 3, 2});
5004 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
5005 // Phase 1, operands
5006 auto op1 = model->addOperand(&type21);
5007 auto axis = model->addOperand(&type1);
5008 auto op2 = model->addOperand(&type44);
5009 // Phase 2, operations
5010 static int32_t axis_init[] = {-2};
5011 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5012 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5013 // Phase 3, inputs and outputs
5014 model->identifyInputsAndOutputs(
5015 {op1},
5016 {op2});
5017 assert(model->isValid());
5018 }
5019
is_ignored_dynamic_output_shape_dim3_axis1_neg(int i)5020 inline bool is_ignored_dynamic_output_shape_dim3_axis1_neg(int i) {
5021 static std::set<int> ignore = {};
5022 return ignore.find(i) != ignore.end();
5023 }
5024
CreateModel_dynamic_output_shape_dim3_axis1_neg_relaxed(Model * model)5025 void CreateModel_dynamic_output_shape_dim3_axis1_neg_relaxed(Model *model) {
5026 OperandType type1(Type::INT32, {});
5027 OperandType type21(Type::TENSOR_FLOAT32, {2, 3, 2});
5028 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
5029 // Phase 1, operands
5030 auto op1 = model->addOperand(&type21);
5031 auto axis = model->addOperand(&type1);
5032 auto op2 = model->addOperand(&type44);
5033 // Phase 2, operations
5034 static int32_t axis_init[] = {-2};
5035 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5036 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5037 // Phase 3, inputs and outputs
5038 model->identifyInputsAndOutputs(
5039 {op1},
5040 {op2});
5041 // Phase 4: set relaxed execution
5042 model->relaxComputationFloat32toFloat16(true);
5043 assert(model->isValid());
5044 }
5045
is_ignored_dynamic_output_shape_dim3_axis1_neg_relaxed(int i)5046 inline bool is_ignored_dynamic_output_shape_dim3_axis1_neg_relaxed(int i) {
5047 static std::set<int> ignore = {};
5048 return ignore.find(i) != ignore.end();
5049 }
5050
CreateModel_dynamic_output_shape_dim3_axis1_neg_float16(Model * model)5051 void CreateModel_dynamic_output_shape_dim3_axis1_neg_float16(Model *model) {
5052 OperandType type1(Type::INT32, {});
5053 OperandType type22(Type::TENSOR_FLOAT16, {2, 3, 2});
5054 OperandType type45(Type::TENSOR_FLOAT16, {0, 0, 0});
5055 // Phase 1, operands
5056 auto op1 = model->addOperand(&type22);
5057 auto axis = model->addOperand(&type1);
5058 auto op2 = model->addOperand(&type45);
5059 // Phase 2, operations
5060 static int32_t axis_init[] = {-2};
5061 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5062 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5063 // Phase 3, inputs and outputs
5064 model->identifyInputsAndOutputs(
5065 {op1},
5066 {op2});
5067 assert(model->isValid());
5068 }
5069
is_ignored_dynamic_output_shape_dim3_axis1_neg_float16(int i)5070 inline bool is_ignored_dynamic_output_shape_dim3_axis1_neg_float16(int i) {
5071 static std::set<int> ignore = {};
5072 return ignore.find(i) != ignore.end();
5073 }
5074
CreateModel_dynamic_output_shape_dim3_axis1_neg_quant8(Model * model)5075 void CreateModel_dynamic_output_shape_dim3_axis1_neg_quant8(Model *model) {
5076 OperandType type1(Type::INT32, {});
5077 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2}, 0.1f, 32);
5078 OperandType type46(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.0078125f, 128);
5079 // Phase 1, operands
5080 auto op1 = model->addOperand(&type23);
5081 auto axis = model->addOperand(&type1);
5082 auto op2 = model->addOperand(&type46);
5083 // Phase 2, operations
5084 static int32_t axis_init[] = {-2};
5085 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5086 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5087 // Phase 3, inputs and outputs
5088 model->identifyInputsAndOutputs(
5089 {op1},
5090 {op2});
5091 assert(model->isValid());
5092 }
5093
is_ignored_dynamic_output_shape_dim3_axis1_neg_quant8(int i)5094 inline bool is_ignored_dynamic_output_shape_dim3_axis1_neg_quant8(int i) {
5095 static std::set<int> ignore = {};
5096 return ignore.find(i) != ignore.end();
5097 }
5098
CreateModel_dynamic_output_shape_dim3_axis2(Model * model)5099 void CreateModel_dynamic_output_shape_dim3_axis2(Model *model) {
5100 OperandType type1(Type::INT32, {});
5101 OperandType type25(Type::TENSOR_FLOAT32, {2, 2, 3});
5102 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
5103 // Phase 1, operands
5104 auto op1 = model->addOperand(&type25);
5105 auto axis = model->addOperand(&type1);
5106 auto op2 = model->addOperand(&type44);
5107 // Phase 2, operations
5108 static int32_t axis_init[] = {2};
5109 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5110 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5111 // Phase 3, inputs and outputs
5112 model->identifyInputsAndOutputs(
5113 {op1},
5114 {op2});
5115 assert(model->isValid());
5116 }
5117
is_ignored_dynamic_output_shape_dim3_axis2(int i)5118 inline bool is_ignored_dynamic_output_shape_dim3_axis2(int i) {
5119 static std::set<int> ignore = {};
5120 return ignore.find(i) != ignore.end();
5121 }
5122
CreateModel_dynamic_output_shape_dim3_axis2_relaxed(Model * model)5123 void CreateModel_dynamic_output_shape_dim3_axis2_relaxed(Model *model) {
5124 OperandType type1(Type::INT32, {});
5125 OperandType type25(Type::TENSOR_FLOAT32, {2, 2, 3});
5126 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
5127 // Phase 1, operands
5128 auto op1 = model->addOperand(&type25);
5129 auto axis = model->addOperand(&type1);
5130 auto op2 = model->addOperand(&type44);
5131 // Phase 2, operations
5132 static int32_t axis_init[] = {2};
5133 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5134 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5135 // Phase 3, inputs and outputs
5136 model->identifyInputsAndOutputs(
5137 {op1},
5138 {op2});
5139 // Phase 4: set relaxed execution
5140 model->relaxComputationFloat32toFloat16(true);
5141 assert(model->isValid());
5142 }
5143
is_ignored_dynamic_output_shape_dim3_axis2_relaxed(int i)5144 inline bool is_ignored_dynamic_output_shape_dim3_axis2_relaxed(int i) {
5145 static std::set<int> ignore = {};
5146 return ignore.find(i) != ignore.end();
5147 }
5148
CreateModel_dynamic_output_shape_dim3_axis2_float16(Model * model)5149 void CreateModel_dynamic_output_shape_dim3_axis2_float16(Model *model) {
5150 OperandType type1(Type::INT32, {});
5151 OperandType type26(Type::TENSOR_FLOAT16, {2, 2, 3});
5152 OperandType type45(Type::TENSOR_FLOAT16, {0, 0, 0});
5153 // Phase 1, operands
5154 auto op1 = model->addOperand(&type26);
5155 auto axis = model->addOperand(&type1);
5156 auto op2 = model->addOperand(&type45);
5157 // Phase 2, operations
5158 static int32_t axis_init[] = {2};
5159 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5160 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5161 // Phase 3, inputs and outputs
5162 model->identifyInputsAndOutputs(
5163 {op1},
5164 {op2});
5165 assert(model->isValid());
5166 }
5167
is_ignored_dynamic_output_shape_dim3_axis2_float16(int i)5168 inline bool is_ignored_dynamic_output_shape_dim3_axis2_float16(int i) {
5169 static std::set<int> ignore = {};
5170 return ignore.find(i) != ignore.end();
5171 }
5172
CreateModel_dynamic_output_shape_dim3_axis2_quant8(Model * model)5173 void CreateModel_dynamic_output_shape_dim3_axis2_quant8(Model *model) {
5174 OperandType type1(Type::INT32, {});
5175 OperandType type27(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3}, 0.1f, 32);
5176 OperandType type46(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.0078125f, 128);
5177 // Phase 1, operands
5178 auto op1 = model->addOperand(&type27);
5179 auto axis = model->addOperand(&type1);
5180 auto op2 = model->addOperand(&type46);
5181 // Phase 2, operations
5182 static int32_t axis_init[] = {2};
5183 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5184 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5185 // Phase 3, inputs and outputs
5186 model->identifyInputsAndOutputs(
5187 {op1},
5188 {op2});
5189 assert(model->isValid());
5190 }
5191
is_ignored_dynamic_output_shape_dim3_axis2_quant8(int i)5192 inline bool is_ignored_dynamic_output_shape_dim3_axis2_quant8(int i) {
5193 static std::set<int> ignore = {};
5194 return ignore.find(i) != ignore.end();
5195 }
5196
CreateModel_dynamic_output_shape_dim3_axis2_neg(Model * model)5197 void CreateModel_dynamic_output_shape_dim3_axis2_neg(Model *model) {
5198 OperandType type1(Type::INT32, {});
5199 OperandType type25(Type::TENSOR_FLOAT32, {2, 2, 3});
5200 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
5201 // Phase 1, operands
5202 auto op1 = model->addOperand(&type25);
5203 auto axis = model->addOperand(&type1);
5204 auto op2 = model->addOperand(&type44);
5205 // Phase 2, operations
5206 static int32_t axis_init[] = {-1};
5207 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5208 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5209 // Phase 3, inputs and outputs
5210 model->identifyInputsAndOutputs(
5211 {op1},
5212 {op2});
5213 assert(model->isValid());
5214 }
5215
is_ignored_dynamic_output_shape_dim3_axis2_neg(int i)5216 inline bool is_ignored_dynamic_output_shape_dim3_axis2_neg(int i) {
5217 static std::set<int> ignore = {};
5218 return ignore.find(i) != ignore.end();
5219 }
5220
CreateModel_dynamic_output_shape_dim3_axis2_neg_relaxed(Model * model)5221 void CreateModel_dynamic_output_shape_dim3_axis2_neg_relaxed(Model *model) {
5222 OperandType type1(Type::INT32, {});
5223 OperandType type25(Type::TENSOR_FLOAT32, {2, 2, 3});
5224 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
5225 // Phase 1, operands
5226 auto op1 = model->addOperand(&type25);
5227 auto axis = model->addOperand(&type1);
5228 auto op2 = model->addOperand(&type44);
5229 // Phase 2, operations
5230 static int32_t axis_init[] = {-1};
5231 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5232 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5233 // Phase 3, inputs and outputs
5234 model->identifyInputsAndOutputs(
5235 {op1},
5236 {op2});
5237 // Phase 4: set relaxed execution
5238 model->relaxComputationFloat32toFloat16(true);
5239 assert(model->isValid());
5240 }
5241
is_ignored_dynamic_output_shape_dim3_axis2_neg_relaxed(int i)5242 inline bool is_ignored_dynamic_output_shape_dim3_axis2_neg_relaxed(int i) {
5243 static std::set<int> ignore = {};
5244 return ignore.find(i) != ignore.end();
5245 }
5246
CreateModel_dynamic_output_shape_dim3_axis2_neg_float16(Model * model)5247 void CreateModel_dynamic_output_shape_dim3_axis2_neg_float16(Model *model) {
5248 OperandType type1(Type::INT32, {});
5249 OperandType type26(Type::TENSOR_FLOAT16, {2, 2, 3});
5250 OperandType type45(Type::TENSOR_FLOAT16, {0, 0, 0});
5251 // Phase 1, operands
5252 auto op1 = model->addOperand(&type26);
5253 auto axis = model->addOperand(&type1);
5254 auto op2 = model->addOperand(&type45);
5255 // Phase 2, operations
5256 static int32_t axis_init[] = {-1};
5257 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5258 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5259 // Phase 3, inputs and outputs
5260 model->identifyInputsAndOutputs(
5261 {op1},
5262 {op2});
5263 assert(model->isValid());
5264 }
5265
is_ignored_dynamic_output_shape_dim3_axis2_neg_float16(int i)5266 inline bool is_ignored_dynamic_output_shape_dim3_axis2_neg_float16(int i) {
5267 static std::set<int> ignore = {};
5268 return ignore.find(i) != ignore.end();
5269 }
5270
CreateModel_dynamic_output_shape_dim3_axis2_neg_quant8(Model * model)5271 void CreateModel_dynamic_output_shape_dim3_axis2_neg_quant8(Model *model) {
5272 OperandType type1(Type::INT32, {});
5273 OperandType type27(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3}, 0.1f, 32);
5274 OperandType type46(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.0078125f, 128);
5275 // Phase 1, operands
5276 auto op1 = model->addOperand(&type27);
5277 auto axis = model->addOperand(&type1);
5278 auto op2 = model->addOperand(&type46);
5279 // Phase 2, operations
5280 static int32_t axis_init[] = {-1};
5281 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5282 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5283 // Phase 3, inputs and outputs
5284 model->identifyInputsAndOutputs(
5285 {op1},
5286 {op2});
5287 assert(model->isValid());
5288 }
5289
is_ignored_dynamic_output_shape_dim3_axis2_neg_quant8(int i)5290 inline bool is_ignored_dynamic_output_shape_dim3_axis2_neg_quant8(int i) {
5291 static std::set<int> ignore = {};
5292 return ignore.find(i) != ignore.end();
5293 }
5294
CreateModel_dynamic_output_shape_dim2_axis0(Model * model)5295 void CreateModel_dynamic_output_shape_dim2_axis0(Model *model) {
5296 OperandType type1(Type::INT32, {});
5297 OperandType type29(Type::TENSOR_FLOAT32, {3, 2});
5298 OperandType type47(Type::TENSOR_FLOAT32, {0, 0});
5299 // Phase 1, operands
5300 auto op1 = model->addOperand(&type29);
5301 auto axis = model->addOperand(&type1);
5302 auto op2 = model->addOperand(&type47);
5303 // Phase 2, operations
5304 static int32_t axis_init[] = {0};
5305 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5306 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5307 // Phase 3, inputs and outputs
5308 model->identifyInputsAndOutputs(
5309 {op1},
5310 {op2});
5311 assert(model->isValid());
5312 }
5313
is_ignored_dynamic_output_shape_dim2_axis0(int i)5314 inline bool is_ignored_dynamic_output_shape_dim2_axis0(int i) {
5315 static std::set<int> ignore = {};
5316 return ignore.find(i) != ignore.end();
5317 }
5318
CreateModel_dynamic_output_shape_dim2_axis0_relaxed(Model * model)5319 void CreateModel_dynamic_output_shape_dim2_axis0_relaxed(Model *model) {
5320 OperandType type1(Type::INT32, {});
5321 OperandType type29(Type::TENSOR_FLOAT32, {3, 2});
5322 OperandType type47(Type::TENSOR_FLOAT32, {0, 0});
5323 // Phase 1, operands
5324 auto op1 = model->addOperand(&type29);
5325 auto axis = model->addOperand(&type1);
5326 auto op2 = model->addOperand(&type47);
5327 // Phase 2, operations
5328 static int32_t axis_init[] = {0};
5329 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5330 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5331 // Phase 3, inputs and outputs
5332 model->identifyInputsAndOutputs(
5333 {op1},
5334 {op2});
5335 // Phase 4: set relaxed execution
5336 model->relaxComputationFloat32toFloat16(true);
5337 assert(model->isValid());
5338 }
5339
is_ignored_dynamic_output_shape_dim2_axis0_relaxed(int i)5340 inline bool is_ignored_dynamic_output_shape_dim2_axis0_relaxed(int i) {
5341 static std::set<int> ignore = {};
5342 return ignore.find(i) != ignore.end();
5343 }
5344
CreateModel_dynamic_output_shape_dim2_axis0_float16(Model * model)5345 void CreateModel_dynamic_output_shape_dim2_axis0_float16(Model *model) {
5346 OperandType type1(Type::INT32, {});
5347 OperandType type30(Type::TENSOR_FLOAT16, {3, 2});
5348 OperandType type48(Type::TENSOR_FLOAT16, {0, 0});
5349 // Phase 1, operands
5350 auto op1 = model->addOperand(&type30);
5351 auto axis = model->addOperand(&type1);
5352 auto op2 = model->addOperand(&type48);
5353 // Phase 2, operations
5354 static int32_t axis_init[] = {0};
5355 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5356 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5357 // Phase 3, inputs and outputs
5358 model->identifyInputsAndOutputs(
5359 {op1},
5360 {op2});
5361 assert(model->isValid());
5362 }
5363
is_ignored_dynamic_output_shape_dim2_axis0_float16(int i)5364 inline bool is_ignored_dynamic_output_shape_dim2_axis0_float16(int i) {
5365 static std::set<int> ignore = {};
5366 return ignore.find(i) != ignore.end();
5367 }
5368
CreateModel_dynamic_output_shape_dim2_axis0_quant8(Model * model)5369 void CreateModel_dynamic_output_shape_dim2_axis0_quant8(Model *model) {
5370 OperandType type1(Type::INT32, {});
5371 OperandType type31(Type::TENSOR_QUANT8_ASYMM, {3, 2}, 0.1f, 32);
5372 OperandType type49(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 0.0078125f, 128);
5373 // Phase 1, operands
5374 auto op1 = model->addOperand(&type31);
5375 auto axis = model->addOperand(&type1);
5376 auto op2 = model->addOperand(&type49);
5377 // Phase 2, operations
5378 static int32_t axis_init[] = {0};
5379 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5380 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5381 // Phase 3, inputs and outputs
5382 model->identifyInputsAndOutputs(
5383 {op1},
5384 {op2});
5385 assert(model->isValid());
5386 }
5387
is_ignored_dynamic_output_shape_dim2_axis0_quant8(int i)5388 inline bool is_ignored_dynamic_output_shape_dim2_axis0_quant8(int i) {
5389 static std::set<int> ignore = {};
5390 return ignore.find(i) != ignore.end();
5391 }
5392
CreateModel_dynamic_output_shape_dim2_axis0_neg(Model * model)5393 void CreateModel_dynamic_output_shape_dim2_axis0_neg(Model *model) {
5394 OperandType type1(Type::INT32, {});
5395 OperandType type29(Type::TENSOR_FLOAT32, {3, 2});
5396 OperandType type47(Type::TENSOR_FLOAT32, {0, 0});
5397 // Phase 1, operands
5398 auto op1 = model->addOperand(&type29);
5399 auto axis = model->addOperand(&type1);
5400 auto op2 = model->addOperand(&type47);
5401 // Phase 2, operations
5402 static int32_t axis_init[] = {-2};
5403 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5404 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5405 // Phase 3, inputs and outputs
5406 model->identifyInputsAndOutputs(
5407 {op1},
5408 {op2});
5409 assert(model->isValid());
5410 }
5411
is_ignored_dynamic_output_shape_dim2_axis0_neg(int i)5412 inline bool is_ignored_dynamic_output_shape_dim2_axis0_neg(int i) {
5413 static std::set<int> ignore = {};
5414 return ignore.find(i) != ignore.end();
5415 }
5416
CreateModel_dynamic_output_shape_dim2_axis0_neg_relaxed(Model * model)5417 void CreateModel_dynamic_output_shape_dim2_axis0_neg_relaxed(Model *model) {
5418 OperandType type1(Type::INT32, {});
5419 OperandType type29(Type::TENSOR_FLOAT32, {3, 2});
5420 OperandType type47(Type::TENSOR_FLOAT32, {0, 0});
5421 // Phase 1, operands
5422 auto op1 = model->addOperand(&type29);
5423 auto axis = model->addOperand(&type1);
5424 auto op2 = model->addOperand(&type47);
5425 // Phase 2, operations
5426 static int32_t axis_init[] = {-2};
5427 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5428 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5429 // Phase 3, inputs and outputs
5430 model->identifyInputsAndOutputs(
5431 {op1},
5432 {op2});
5433 // Phase 4: set relaxed execution
5434 model->relaxComputationFloat32toFloat16(true);
5435 assert(model->isValid());
5436 }
5437
is_ignored_dynamic_output_shape_dim2_axis0_neg_relaxed(int i)5438 inline bool is_ignored_dynamic_output_shape_dim2_axis0_neg_relaxed(int i) {
5439 static std::set<int> ignore = {};
5440 return ignore.find(i) != ignore.end();
5441 }
5442
CreateModel_dynamic_output_shape_dim2_axis0_neg_float16(Model * model)5443 void CreateModel_dynamic_output_shape_dim2_axis0_neg_float16(Model *model) {
5444 OperandType type1(Type::INT32, {});
5445 OperandType type30(Type::TENSOR_FLOAT16, {3, 2});
5446 OperandType type48(Type::TENSOR_FLOAT16, {0, 0});
5447 // Phase 1, operands
5448 auto op1 = model->addOperand(&type30);
5449 auto axis = model->addOperand(&type1);
5450 auto op2 = model->addOperand(&type48);
5451 // Phase 2, operations
5452 static int32_t axis_init[] = {-2};
5453 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5454 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5455 // Phase 3, inputs and outputs
5456 model->identifyInputsAndOutputs(
5457 {op1},
5458 {op2});
5459 assert(model->isValid());
5460 }
5461
is_ignored_dynamic_output_shape_dim2_axis0_neg_float16(int i)5462 inline bool is_ignored_dynamic_output_shape_dim2_axis0_neg_float16(int i) {
5463 static std::set<int> ignore = {};
5464 return ignore.find(i) != ignore.end();
5465 }
5466
CreateModel_dynamic_output_shape_dim2_axis0_neg_quant8(Model * model)5467 void CreateModel_dynamic_output_shape_dim2_axis0_neg_quant8(Model *model) {
5468 OperandType type1(Type::INT32, {});
5469 OperandType type31(Type::TENSOR_QUANT8_ASYMM, {3, 2}, 0.1f, 32);
5470 OperandType type49(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 0.0078125f, 128);
5471 // Phase 1, operands
5472 auto op1 = model->addOperand(&type31);
5473 auto axis = model->addOperand(&type1);
5474 auto op2 = model->addOperand(&type49);
5475 // Phase 2, operations
5476 static int32_t axis_init[] = {-2};
5477 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5478 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5479 // Phase 3, inputs and outputs
5480 model->identifyInputsAndOutputs(
5481 {op1},
5482 {op2});
5483 assert(model->isValid());
5484 }
5485
is_ignored_dynamic_output_shape_dim2_axis0_neg_quant8(int i)5486 inline bool is_ignored_dynamic_output_shape_dim2_axis0_neg_quant8(int i) {
5487 static std::set<int> ignore = {};
5488 return ignore.find(i) != ignore.end();
5489 }
5490
CreateModel_dynamic_output_shape_dim2_axis1(Model * model)5491 void CreateModel_dynamic_output_shape_dim2_axis1(Model *model) {
5492 OperandType type1(Type::INT32, {});
5493 OperandType type33(Type::TENSOR_FLOAT32, {2, 3});
5494 OperandType type47(Type::TENSOR_FLOAT32, {0, 0});
5495 // Phase 1, operands
5496 auto op1 = model->addOperand(&type33);
5497 auto axis = model->addOperand(&type1);
5498 auto op2 = model->addOperand(&type47);
5499 // Phase 2, operations
5500 static int32_t axis_init[] = {1};
5501 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5502 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5503 // Phase 3, inputs and outputs
5504 model->identifyInputsAndOutputs(
5505 {op1},
5506 {op2});
5507 assert(model->isValid());
5508 }
5509
is_ignored_dynamic_output_shape_dim2_axis1(int i)5510 inline bool is_ignored_dynamic_output_shape_dim2_axis1(int i) {
5511 static std::set<int> ignore = {};
5512 return ignore.find(i) != ignore.end();
5513 }
5514
CreateModel_dynamic_output_shape_dim2_axis1_relaxed(Model * model)5515 void CreateModel_dynamic_output_shape_dim2_axis1_relaxed(Model *model) {
5516 OperandType type1(Type::INT32, {});
5517 OperandType type33(Type::TENSOR_FLOAT32, {2, 3});
5518 OperandType type47(Type::TENSOR_FLOAT32, {0, 0});
5519 // Phase 1, operands
5520 auto op1 = model->addOperand(&type33);
5521 auto axis = model->addOperand(&type1);
5522 auto op2 = model->addOperand(&type47);
5523 // Phase 2, operations
5524 static int32_t axis_init[] = {1};
5525 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5526 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5527 // Phase 3, inputs and outputs
5528 model->identifyInputsAndOutputs(
5529 {op1},
5530 {op2});
5531 // Phase 4: set relaxed execution
5532 model->relaxComputationFloat32toFloat16(true);
5533 assert(model->isValid());
5534 }
5535
is_ignored_dynamic_output_shape_dim2_axis1_relaxed(int i)5536 inline bool is_ignored_dynamic_output_shape_dim2_axis1_relaxed(int i) {
5537 static std::set<int> ignore = {};
5538 return ignore.find(i) != ignore.end();
5539 }
5540
CreateModel_dynamic_output_shape_dim2_axis1_float16(Model * model)5541 void CreateModel_dynamic_output_shape_dim2_axis1_float16(Model *model) {
5542 OperandType type1(Type::INT32, {});
5543 OperandType type34(Type::TENSOR_FLOAT16, {2, 3});
5544 OperandType type48(Type::TENSOR_FLOAT16, {0, 0});
5545 // Phase 1, operands
5546 auto op1 = model->addOperand(&type34);
5547 auto axis = model->addOperand(&type1);
5548 auto op2 = model->addOperand(&type48);
5549 // Phase 2, operations
5550 static int32_t axis_init[] = {1};
5551 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5552 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5553 // Phase 3, inputs and outputs
5554 model->identifyInputsAndOutputs(
5555 {op1},
5556 {op2});
5557 assert(model->isValid());
5558 }
5559
is_ignored_dynamic_output_shape_dim2_axis1_float16(int i)5560 inline bool is_ignored_dynamic_output_shape_dim2_axis1_float16(int i) {
5561 static std::set<int> ignore = {};
5562 return ignore.find(i) != ignore.end();
5563 }
5564
CreateModel_dynamic_output_shape_dim2_axis1_quant8(Model * model)5565 void CreateModel_dynamic_output_shape_dim2_axis1_quant8(Model *model) {
5566 OperandType type1(Type::INT32, {});
5567 OperandType type35(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 0.1f, 32);
5568 OperandType type49(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 0.0078125f, 128);
5569 // Phase 1, operands
5570 auto op1 = model->addOperand(&type35);
5571 auto axis = model->addOperand(&type1);
5572 auto op2 = model->addOperand(&type49);
5573 // Phase 2, operations
5574 static int32_t axis_init[] = {1};
5575 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5576 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5577 // Phase 3, inputs and outputs
5578 model->identifyInputsAndOutputs(
5579 {op1},
5580 {op2});
5581 assert(model->isValid());
5582 }
5583
is_ignored_dynamic_output_shape_dim2_axis1_quant8(int i)5584 inline bool is_ignored_dynamic_output_shape_dim2_axis1_quant8(int i) {
5585 static std::set<int> ignore = {};
5586 return ignore.find(i) != ignore.end();
5587 }
5588
CreateModel_dynamic_output_shape_dim2_axis1_neg(Model * model)5589 void CreateModel_dynamic_output_shape_dim2_axis1_neg(Model *model) {
5590 OperandType type1(Type::INT32, {});
5591 OperandType type33(Type::TENSOR_FLOAT32, {2, 3});
5592 OperandType type47(Type::TENSOR_FLOAT32, {0, 0});
5593 // Phase 1, operands
5594 auto op1 = model->addOperand(&type33);
5595 auto axis = model->addOperand(&type1);
5596 auto op2 = model->addOperand(&type47);
5597 // Phase 2, operations
5598 static int32_t axis_init[] = {-1};
5599 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5600 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5601 // Phase 3, inputs and outputs
5602 model->identifyInputsAndOutputs(
5603 {op1},
5604 {op2});
5605 assert(model->isValid());
5606 }
5607
is_ignored_dynamic_output_shape_dim2_axis1_neg(int i)5608 inline bool is_ignored_dynamic_output_shape_dim2_axis1_neg(int i) {
5609 static std::set<int> ignore = {};
5610 return ignore.find(i) != ignore.end();
5611 }
5612
CreateModel_dynamic_output_shape_dim2_axis1_neg_relaxed(Model * model)5613 void CreateModel_dynamic_output_shape_dim2_axis1_neg_relaxed(Model *model) {
5614 OperandType type1(Type::INT32, {});
5615 OperandType type33(Type::TENSOR_FLOAT32, {2, 3});
5616 OperandType type47(Type::TENSOR_FLOAT32, {0, 0});
5617 // Phase 1, operands
5618 auto op1 = model->addOperand(&type33);
5619 auto axis = model->addOperand(&type1);
5620 auto op2 = model->addOperand(&type47);
5621 // Phase 2, operations
5622 static int32_t axis_init[] = {-1};
5623 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5624 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5625 // Phase 3, inputs and outputs
5626 model->identifyInputsAndOutputs(
5627 {op1},
5628 {op2});
5629 // Phase 4: set relaxed execution
5630 model->relaxComputationFloat32toFloat16(true);
5631 assert(model->isValid());
5632 }
5633
is_ignored_dynamic_output_shape_dim2_axis1_neg_relaxed(int i)5634 inline bool is_ignored_dynamic_output_shape_dim2_axis1_neg_relaxed(int i) {
5635 static std::set<int> ignore = {};
5636 return ignore.find(i) != ignore.end();
5637 }
5638
CreateModel_dynamic_output_shape_dim2_axis1_neg_float16(Model * model)5639 void CreateModel_dynamic_output_shape_dim2_axis1_neg_float16(Model *model) {
5640 OperandType type1(Type::INT32, {});
5641 OperandType type34(Type::TENSOR_FLOAT16, {2, 3});
5642 OperandType type48(Type::TENSOR_FLOAT16, {0, 0});
5643 // Phase 1, operands
5644 auto op1 = model->addOperand(&type34);
5645 auto axis = model->addOperand(&type1);
5646 auto op2 = model->addOperand(&type48);
5647 // Phase 2, operations
5648 static int32_t axis_init[] = {-1};
5649 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5650 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5651 // Phase 3, inputs and outputs
5652 model->identifyInputsAndOutputs(
5653 {op1},
5654 {op2});
5655 assert(model->isValid());
5656 }
5657
is_ignored_dynamic_output_shape_dim2_axis1_neg_float16(int i)5658 inline bool is_ignored_dynamic_output_shape_dim2_axis1_neg_float16(int i) {
5659 static std::set<int> ignore = {};
5660 return ignore.find(i) != ignore.end();
5661 }
5662
CreateModel_dynamic_output_shape_dim2_axis1_neg_quant8(Model * model)5663 void CreateModel_dynamic_output_shape_dim2_axis1_neg_quant8(Model *model) {
5664 OperandType type1(Type::INT32, {});
5665 OperandType type35(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 0.1f, 32);
5666 OperandType type49(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 0.0078125f, 128);
5667 // Phase 1, operands
5668 auto op1 = model->addOperand(&type35);
5669 auto axis = model->addOperand(&type1);
5670 auto op2 = model->addOperand(&type49);
5671 // Phase 2, operations
5672 static int32_t axis_init[] = {-1};
5673 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5674 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5675 // Phase 3, inputs and outputs
5676 model->identifyInputsAndOutputs(
5677 {op1},
5678 {op2});
5679 assert(model->isValid());
5680 }
5681
is_ignored_dynamic_output_shape_dim2_axis1_neg_quant8(int i)5682 inline bool is_ignored_dynamic_output_shape_dim2_axis1_neg_quant8(int i) {
5683 static std::set<int> ignore = {};
5684 return ignore.find(i) != ignore.end();
5685 }
5686
CreateModel_dynamic_output_shape_dim1_axis0(Model * model)5687 void CreateModel_dynamic_output_shape_dim1_axis0(Model *model) {
5688 OperandType type1(Type::INT32, {});
5689 OperandType type37(Type::TENSOR_FLOAT32, {3});
5690 OperandType type50(Type::TENSOR_FLOAT32, {0});
5691 // Phase 1, operands
5692 auto op1 = model->addOperand(&type37);
5693 auto axis = model->addOperand(&type1);
5694 auto op2 = model->addOperand(&type50);
5695 // Phase 2, operations
5696 static int32_t axis_init[] = {0};
5697 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5698 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5699 // Phase 3, inputs and outputs
5700 model->identifyInputsAndOutputs(
5701 {op1},
5702 {op2});
5703 assert(model->isValid());
5704 }
5705
is_ignored_dynamic_output_shape_dim1_axis0(int i)5706 inline bool is_ignored_dynamic_output_shape_dim1_axis0(int i) {
5707 static std::set<int> ignore = {};
5708 return ignore.find(i) != ignore.end();
5709 }
5710
CreateModel_dynamic_output_shape_dim1_axis0_relaxed(Model * model)5711 void CreateModel_dynamic_output_shape_dim1_axis0_relaxed(Model *model) {
5712 OperandType type1(Type::INT32, {});
5713 OperandType type37(Type::TENSOR_FLOAT32, {3});
5714 OperandType type50(Type::TENSOR_FLOAT32, {0});
5715 // Phase 1, operands
5716 auto op1 = model->addOperand(&type37);
5717 auto axis = model->addOperand(&type1);
5718 auto op2 = model->addOperand(&type50);
5719 // Phase 2, operations
5720 static int32_t axis_init[] = {0};
5721 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5722 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5723 // Phase 3, inputs and outputs
5724 model->identifyInputsAndOutputs(
5725 {op1},
5726 {op2});
5727 // Phase 4: set relaxed execution
5728 model->relaxComputationFloat32toFloat16(true);
5729 assert(model->isValid());
5730 }
5731
is_ignored_dynamic_output_shape_dim1_axis0_relaxed(int i)5732 inline bool is_ignored_dynamic_output_shape_dim1_axis0_relaxed(int i) {
5733 static std::set<int> ignore = {};
5734 return ignore.find(i) != ignore.end();
5735 }
5736
CreateModel_dynamic_output_shape_dim1_axis0_float16(Model * model)5737 void CreateModel_dynamic_output_shape_dim1_axis0_float16(Model *model) {
5738 OperandType type1(Type::INT32, {});
5739 OperandType type38(Type::TENSOR_FLOAT16, {3});
5740 OperandType type51(Type::TENSOR_FLOAT16, {0});
5741 // Phase 1, operands
5742 auto op1 = model->addOperand(&type38);
5743 auto axis = model->addOperand(&type1);
5744 auto op2 = model->addOperand(&type51);
5745 // Phase 2, operations
5746 static int32_t axis_init[] = {0};
5747 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5748 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5749 // Phase 3, inputs and outputs
5750 model->identifyInputsAndOutputs(
5751 {op1},
5752 {op2});
5753 assert(model->isValid());
5754 }
5755
is_ignored_dynamic_output_shape_dim1_axis0_float16(int i)5756 inline bool is_ignored_dynamic_output_shape_dim1_axis0_float16(int i) {
5757 static std::set<int> ignore = {};
5758 return ignore.find(i) != ignore.end();
5759 }
5760
CreateModel_dynamic_output_shape_dim1_axis0_quant8(Model * model)5761 void CreateModel_dynamic_output_shape_dim1_axis0_quant8(Model *model) {
5762 OperandType type1(Type::INT32, {});
5763 OperandType type39(Type::TENSOR_QUANT8_ASYMM, {3}, 0.1f, 32);
5764 OperandType type52(Type::TENSOR_QUANT8_ASYMM, {0}, 0.0078125f, 128);
5765 // Phase 1, operands
5766 auto op1 = model->addOperand(&type39);
5767 auto axis = model->addOperand(&type1);
5768 auto op2 = model->addOperand(&type52);
5769 // Phase 2, operations
5770 static int32_t axis_init[] = {0};
5771 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5772 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5773 // Phase 3, inputs and outputs
5774 model->identifyInputsAndOutputs(
5775 {op1},
5776 {op2});
5777 assert(model->isValid());
5778 }
5779
is_ignored_dynamic_output_shape_dim1_axis0_quant8(int i)5780 inline bool is_ignored_dynamic_output_shape_dim1_axis0_quant8(int i) {
5781 static std::set<int> ignore = {};
5782 return ignore.find(i) != ignore.end();
5783 }
5784
CreateModel_dynamic_output_shape_dim1_axis0_neg(Model * model)5785 void CreateModel_dynamic_output_shape_dim1_axis0_neg(Model *model) {
5786 OperandType type1(Type::INT32, {});
5787 OperandType type37(Type::TENSOR_FLOAT32, {3});
5788 OperandType type50(Type::TENSOR_FLOAT32, {0});
5789 // Phase 1, operands
5790 auto op1 = model->addOperand(&type37);
5791 auto axis = model->addOperand(&type1);
5792 auto op2 = model->addOperand(&type50);
5793 // Phase 2, operations
5794 static int32_t axis_init[] = {-1};
5795 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5796 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5797 // Phase 3, inputs and outputs
5798 model->identifyInputsAndOutputs(
5799 {op1},
5800 {op2});
5801 assert(model->isValid());
5802 }
5803
is_ignored_dynamic_output_shape_dim1_axis0_neg(int i)5804 inline bool is_ignored_dynamic_output_shape_dim1_axis0_neg(int i) {
5805 static std::set<int> ignore = {};
5806 return ignore.find(i) != ignore.end();
5807 }
5808
CreateModel_dynamic_output_shape_dim1_axis0_neg_relaxed(Model * model)5809 void CreateModel_dynamic_output_shape_dim1_axis0_neg_relaxed(Model *model) {
5810 OperandType type1(Type::INT32, {});
5811 OperandType type37(Type::TENSOR_FLOAT32, {3});
5812 OperandType type50(Type::TENSOR_FLOAT32, {0});
5813 // Phase 1, operands
5814 auto op1 = model->addOperand(&type37);
5815 auto axis = model->addOperand(&type1);
5816 auto op2 = model->addOperand(&type50);
5817 // Phase 2, operations
5818 static int32_t axis_init[] = {-1};
5819 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5820 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5821 // Phase 3, inputs and outputs
5822 model->identifyInputsAndOutputs(
5823 {op1},
5824 {op2});
5825 // Phase 4: set relaxed execution
5826 model->relaxComputationFloat32toFloat16(true);
5827 assert(model->isValid());
5828 }
5829
is_ignored_dynamic_output_shape_dim1_axis0_neg_relaxed(int i)5830 inline bool is_ignored_dynamic_output_shape_dim1_axis0_neg_relaxed(int i) {
5831 static std::set<int> ignore = {};
5832 return ignore.find(i) != ignore.end();
5833 }
5834
CreateModel_dynamic_output_shape_dim1_axis0_neg_float16(Model * model)5835 void CreateModel_dynamic_output_shape_dim1_axis0_neg_float16(Model *model) {
5836 OperandType type1(Type::INT32, {});
5837 OperandType type38(Type::TENSOR_FLOAT16, {3});
5838 OperandType type51(Type::TENSOR_FLOAT16, {0});
5839 // Phase 1, operands
5840 auto op1 = model->addOperand(&type38);
5841 auto axis = model->addOperand(&type1);
5842 auto op2 = model->addOperand(&type51);
5843 // Phase 2, operations
5844 static int32_t axis_init[] = {-1};
5845 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5846 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5847 // Phase 3, inputs and outputs
5848 model->identifyInputsAndOutputs(
5849 {op1},
5850 {op2});
5851 assert(model->isValid());
5852 }
5853
is_ignored_dynamic_output_shape_dim1_axis0_neg_float16(int i)5854 inline bool is_ignored_dynamic_output_shape_dim1_axis0_neg_float16(int i) {
5855 static std::set<int> ignore = {};
5856 return ignore.find(i) != ignore.end();
5857 }
5858
CreateModel_dynamic_output_shape_dim1_axis0_neg_quant8(Model * model)5859 void CreateModel_dynamic_output_shape_dim1_axis0_neg_quant8(Model *model) {
5860 OperandType type1(Type::INT32, {});
5861 OperandType type39(Type::TENSOR_QUANT8_ASYMM, {3}, 0.1f, 32);
5862 OperandType type52(Type::TENSOR_QUANT8_ASYMM, {0}, 0.0078125f, 128);
5863 // Phase 1, operands
5864 auto op1 = model->addOperand(&type39);
5865 auto axis = model->addOperand(&type1);
5866 auto op2 = model->addOperand(&type52);
5867 // Phase 2, operations
5868 static int32_t axis_init[] = {-1};
5869 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5870 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5871 // Phase 3, inputs and outputs
5872 model->identifyInputsAndOutputs(
5873 {op1},
5874 {op2});
5875 assert(model->isValid());
5876 }
5877
is_ignored_dynamic_output_shape_dim1_axis0_neg_quant8(int i)5878 inline bool is_ignored_dynamic_output_shape_dim1_axis0_neg_quant8(int i) {
5879 static std::set<int> ignore = {};
5880 return ignore.find(i) != ignore.end();
5881 }
5882
CreateModel_dynamic_output_shape_relaxed_dim4_axis0(Model * model)5883 void CreateModel_dynamic_output_shape_relaxed_dim4_axis0(Model *model) {
5884 OperandType type1(Type::INT32, {});
5885 OperandType type2(Type::TENSOR_FLOAT32, {3, 2, 2, 2});
5886 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
5887 // Phase 1, operands
5888 auto op1 = model->addOperand(&type2);
5889 auto axis = model->addOperand(&type1);
5890 auto op2 = model->addOperand(&type41);
5891 // Phase 2, operations
5892 static int32_t axis_init[] = {0};
5893 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5894 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5895 // Phase 3, inputs and outputs
5896 model->identifyInputsAndOutputs(
5897 {op1},
5898 {op2});
5899 // Phase 4: set relaxed execution
5900 model->relaxComputationFloat32toFloat16(true);
5901 assert(model->isValid());
5902 }
5903
is_ignored_dynamic_output_shape_relaxed_dim4_axis0(int i)5904 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis0(int i) {
5905 static std::set<int> ignore = {};
5906 return ignore.find(i) != ignore.end();
5907 }
5908
CreateModel_dynamic_output_shape_relaxed_dim4_axis0_relaxed(Model * model)5909 void CreateModel_dynamic_output_shape_relaxed_dim4_axis0_relaxed(Model *model) {
5910 OperandType type1(Type::INT32, {});
5911 OperandType type2(Type::TENSOR_FLOAT32, {3, 2, 2, 2});
5912 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
5913 // Phase 1, operands
5914 auto op1 = model->addOperand(&type2);
5915 auto axis = model->addOperand(&type1);
5916 auto op2 = model->addOperand(&type41);
5917 // Phase 2, operations
5918 static int32_t axis_init[] = {0};
5919 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5920 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5921 // Phase 3, inputs and outputs
5922 model->identifyInputsAndOutputs(
5923 {op1},
5924 {op2});
5925 // Phase 4: set relaxed execution
5926 model->relaxComputationFloat32toFloat16(true);
5927 assert(model->isValid());
5928 }
5929
is_ignored_dynamic_output_shape_relaxed_dim4_axis0_relaxed(int i)5930 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis0_relaxed(int i) {
5931 static std::set<int> ignore = {};
5932 return ignore.find(i) != ignore.end();
5933 }
5934
CreateModel_dynamic_output_shape_relaxed_dim4_axis0_float16(Model * model)5935 void CreateModel_dynamic_output_shape_relaxed_dim4_axis0_float16(Model *model) {
5936 OperandType type1(Type::INT32, {});
5937 OperandType type3(Type::TENSOR_FLOAT16, {3, 2, 2, 2});
5938 OperandType type42(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
5939 // Phase 1, operands
5940 auto op1 = model->addOperand(&type3);
5941 auto axis = model->addOperand(&type1);
5942 auto op2 = model->addOperand(&type42);
5943 // Phase 2, operations
5944 static int32_t axis_init[] = {0};
5945 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5946 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5947 // Phase 3, inputs and outputs
5948 model->identifyInputsAndOutputs(
5949 {op1},
5950 {op2});
5951 // Phase 4: set relaxed execution
5952 model->relaxComputationFloat32toFloat16(true);
5953 assert(model->isValid());
5954 }
5955
is_ignored_dynamic_output_shape_relaxed_dim4_axis0_float16(int i)5956 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis0_float16(int i) {
5957 static std::set<int> ignore = {};
5958 return ignore.find(i) != ignore.end();
5959 }
5960
CreateModel_dynamic_output_shape_relaxed_dim4_axis0_quant8(Model * model)5961 void CreateModel_dynamic_output_shape_relaxed_dim4_axis0_quant8(Model *model) {
5962 OperandType type1(Type::INT32, {});
5963 OperandType type4(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2, 2}, 0.1f, 32);
5964 OperandType type43(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.0078125f, 128);
5965 // Phase 1, operands
5966 auto op1 = model->addOperand(&type4);
5967 auto axis = model->addOperand(&type1);
5968 auto op2 = model->addOperand(&type43);
5969 // Phase 2, operations
5970 static int32_t axis_init[] = {0};
5971 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5972 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5973 // Phase 3, inputs and outputs
5974 model->identifyInputsAndOutputs(
5975 {op1},
5976 {op2});
5977 // Phase 4: set relaxed execution
5978 model->relaxComputationFloat32toFloat16(true);
5979 assert(model->isValid());
5980 }
5981
is_ignored_dynamic_output_shape_relaxed_dim4_axis0_quant8(int i)5982 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis0_quant8(int i) {
5983 static std::set<int> ignore = {};
5984 return ignore.find(i) != ignore.end();
5985 }
5986
CreateModel_dynamic_output_shape_relaxed_dim4_axis0_neg(Model * model)5987 void CreateModel_dynamic_output_shape_relaxed_dim4_axis0_neg(Model *model) {
5988 OperandType type1(Type::INT32, {});
5989 OperandType type2(Type::TENSOR_FLOAT32, {3, 2, 2, 2});
5990 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
5991 // Phase 1, operands
5992 auto op1 = model->addOperand(&type2);
5993 auto axis = model->addOperand(&type1);
5994 auto op2 = model->addOperand(&type41);
5995 // Phase 2, operations
5996 static int32_t axis_init[] = {-4};
5997 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5998 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
5999 // Phase 3, inputs and outputs
6000 model->identifyInputsAndOutputs(
6001 {op1},
6002 {op2});
6003 // Phase 4: set relaxed execution
6004 model->relaxComputationFloat32toFloat16(true);
6005 assert(model->isValid());
6006 }
6007
is_ignored_dynamic_output_shape_relaxed_dim4_axis0_neg(int i)6008 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis0_neg(int i) {
6009 static std::set<int> ignore = {};
6010 return ignore.find(i) != ignore.end();
6011 }
6012
CreateModel_dynamic_output_shape_relaxed_dim4_axis0_neg_relaxed(Model * model)6013 void CreateModel_dynamic_output_shape_relaxed_dim4_axis0_neg_relaxed(Model *model) {
6014 OperandType type1(Type::INT32, {});
6015 OperandType type2(Type::TENSOR_FLOAT32, {3, 2, 2, 2});
6016 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
6017 // Phase 1, operands
6018 auto op1 = model->addOperand(&type2);
6019 auto axis = model->addOperand(&type1);
6020 auto op2 = model->addOperand(&type41);
6021 // Phase 2, operations
6022 static int32_t axis_init[] = {-4};
6023 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6024 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6025 // Phase 3, inputs and outputs
6026 model->identifyInputsAndOutputs(
6027 {op1},
6028 {op2});
6029 // Phase 4: set relaxed execution
6030 model->relaxComputationFloat32toFloat16(true);
6031 assert(model->isValid());
6032 }
6033
is_ignored_dynamic_output_shape_relaxed_dim4_axis0_neg_relaxed(int i)6034 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis0_neg_relaxed(int i) {
6035 static std::set<int> ignore = {};
6036 return ignore.find(i) != ignore.end();
6037 }
6038
CreateModel_dynamic_output_shape_relaxed_dim4_axis0_neg_float16(Model * model)6039 void CreateModel_dynamic_output_shape_relaxed_dim4_axis0_neg_float16(Model *model) {
6040 OperandType type1(Type::INT32, {});
6041 OperandType type3(Type::TENSOR_FLOAT16, {3, 2, 2, 2});
6042 OperandType type42(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
6043 // Phase 1, operands
6044 auto op1 = model->addOperand(&type3);
6045 auto axis = model->addOperand(&type1);
6046 auto op2 = model->addOperand(&type42);
6047 // Phase 2, operations
6048 static int32_t axis_init[] = {-4};
6049 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6050 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6051 // Phase 3, inputs and outputs
6052 model->identifyInputsAndOutputs(
6053 {op1},
6054 {op2});
6055 // Phase 4: set relaxed execution
6056 model->relaxComputationFloat32toFloat16(true);
6057 assert(model->isValid());
6058 }
6059
is_ignored_dynamic_output_shape_relaxed_dim4_axis0_neg_float16(int i)6060 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis0_neg_float16(int i) {
6061 static std::set<int> ignore = {};
6062 return ignore.find(i) != ignore.end();
6063 }
6064
CreateModel_dynamic_output_shape_relaxed_dim4_axis0_neg_quant8(Model * model)6065 void CreateModel_dynamic_output_shape_relaxed_dim4_axis0_neg_quant8(Model *model) {
6066 OperandType type1(Type::INT32, {});
6067 OperandType type4(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2, 2}, 0.1f, 32);
6068 OperandType type43(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.0078125f, 128);
6069 // Phase 1, operands
6070 auto op1 = model->addOperand(&type4);
6071 auto axis = model->addOperand(&type1);
6072 auto op2 = model->addOperand(&type43);
6073 // Phase 2, operations
6074 static int32_t axis_init[] = {-4};
6075 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6076 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6077 // Phase 3, inputs and outputs
6078 model->identifyInputsAndOutputs(
6079 {op1},
6080 {op2});
6081 // Phase 4: set relaxed execution
6082 model->relaxComputationFloat32toFloat16(true);
6083 assert(model->isValid());
6084 }
6085
is_ignored_dynamic_output_shape_relaxed_dim4_axis0_neg_quant8(int i)6086 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis0_neg_quant8(int i) {
6087 static std::set<int> ignore = {};
6088 return ignore.find(i) != ignore.end();
6089 }
6090
CreateModel_dynamic_output_shape_relaxed_dim4_axis1(Model * model)6091 void CreateModel_dynamic_output_shape_relaxed_dim4_axis1(Model *model) {
6092 OperandType type1(Type::INT32, {});
6093 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
6094 OperandType type6(Type::TENSOR_FLOAT32, {2, 3, 2, 2});
6095 // Phase 1, operands
6096 auto op1 = model->addOperand(&type6);
6097 auto axis = model->addOperand(&type1);
6098 auto op2 = model->addOperand(&type41);
6099 // Phase 2, operations
6100 static int32_t axis_init[] = {1};
6101 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6102 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6103 // Phase 3, inputs and outputs
6104 model->identifyInputsAndOutputs(
6105 {op1},
6106 {op2});
6107 // Phase 4: set relaxed execution
6108 model->relaxComputationFloat32toFloat16(true);
6109 assert(model->isValid());
6110 }
6111
is_ignored_dynamic_output_shape_relaxed_dim4_axis1(int i)6112 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis1(int i) {
6113 static std::set<int> ignore = {};
6114 return ignore.find(i) != ignore.end();
6115 }
6116
CreateModel_dynamic_output_shape_relaxed_dim4_axis1_relaxed(Model * model)6117 void CreateModel_dynamic_output_shape_relaxed_dim4_axis1_relaxed(Model *model) {
6118 OperandType type1(Type::INT32, {});
6119 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
6120 OperandType type6(Type::TENSOR_FLOAT32, {2, 3, 2, 2});
6121 // Phase 1, operands
6122 auto op1 = model->addOperand(&type6);
6123 auto axis = model->addOperand(&type1);
6124 auto op2 = model->addOperand(&type41);
6125 // Phase 2, operations
6126 static int32_t axis_init[] = {1};
6127 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6128 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6129 // Phase 3, inputs and outputs
6130 model->identifyInputsAndOutputs(
6131 {op1},
6132 {op2});
6133 // Phase 4: set relaxed execution
6134 model->relaxComputationFloat32toFloat16(true);
6135 assert(model->isValid());
6136 }
6137
is_ignored_dynamic_output_shape_relaxed_dim4_axis1_relaxed(int i)6138 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis1_relaxed(int i) {
6139 static std::set<int> ignore = {};
6140 return ignore.find(i) != ignore.end();
6141 }
6142
CreateModel_dynamic_output_shape_relaxed_dim4_axis1_float16(Model * model)6143 void CreateModel_dynamic_output_shape_relaxed_dim4_axis1_float16(Model *model) {
6144 OperandType type1(Type::INT32, {});
6145 OperandType type42(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
6146 OperandType type7(Type::TENSOR_FLOAT16, {2, 3, 2, 2});
6147 // Phase 1, operands
6148 auto op1 = model->addOperand(&type7);
6149 auto axis = model->addOperand(&type1);
6150 auto op2 = model->addOperand(&type42);
6151 // Phase 2, operations
6152 static int32_t axis_init[] = {1};
6153 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6154 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6155 // Phase 3, inputs and outputs
6156 model->identifyInputsAndOutputs(
6157 {op1},
6158 {op2});
6159 // Phase 4: set relaxed execution
6160 model->relaxComputationFloat32toFloat16(true);
6161 assert(model->isValid());
6162 }
6163
is_ignored_dynamic_output_shape_relaxed_dim4_axis1_float16(int i)6164 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis1_float16(int i) {
6165 static std::set<int> ignore = {};
6166 return ignore.find(i) != ignore.end();
6167 }
6168
CreateModel_dynamic_output_shape_relaxed_dim4_axis1_quant8(Model * model)6169 void CreateModel_dynamic_output_shape_relaxed_dim4_axis1_quant8(Model *model) {
6170 OperandType type1(Type::INT32, {});
6171 OperandType type43(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.0078125f, 128);
6172 OperandType type8(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2, 2}, 0.1f, 32);
6173 // Phase 1, operands
6174 auto op1 = model->addOperand(&type8);
6175 auto axis = model->addOperand(&type1);
6176 auto op2 = model->addOperand(&type43);
6177 // Phase 2, operations
6178 static int32_t axis_init[] = {1};
6179 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6180 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6181 // Phase 3, inputs and outputs
6182 model->identifyInputsAndOutputs(
6183 {op1},
6184 {op2});
6185 // Phase 4: set relaxed execution
6186 model->relaxComputationFloat32toFloat16(true);
6187 assert(model->isValid());
6188 }
6189
is_ignored_dynamic_output_shape_relaxed_dim4_axis1_quant8(int i)6190 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis1_quant8(int i) {
6191 static std::set<int> ignore = {};
6192 return ignore.find(i) != ignore.end();
6193 }
6194
CreateModel_dynamic_output_shape_relaxed_dim4_axis1_neg(Model * model)6195 void CreateModel_dynamic_output_shape_relaxed_dim4_axis1_neg(Model *model) {
6196 OperandType type1(Type::INT32, {});
6197 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
6198 OperandType type6(Type::TENSOR_FLOAT32, {2, 3, 2, 2});
6199 // Phase 1, operands
6200 auto op1 = model->addOperand(&type6);
6201 auto axis = model->addOperand(&type1);
6202 auto op2 = model->addOperand(&type41);
6203 // Phase 2, operations
6204 static int32_t axis_init[] = {-3};
6205 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6206 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6207 // Phase 3, inputs and outputs
6208 model->identifyInputsAndOutputs(
6209 {op1},
6210 {op2});
6211 // Phase 4: set relaxed execution
6212 model->relaxComputationFloat32toFloat16(true);
6213 assert(model->isValid());
6214 }
6215
is_ignored_dynamic_output_shape_relaxed_dim4_axis1_neg(int i)6216 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis1_neg(int i) {
6217 static std::set<int> ignore = {};
6218 return ignore.find(i) != ignore.end();
6219 }
6220
CreateModel_dynamic_output_shape_relaxed_dim4_axis1_neg_relaxed(Model * model)6221 void CreateModel_dynamic_output_shape_relaxed_dim4_axis1_neg_relaxed(Model *model) {
6222 OperandType type1(Type::INT32, {});
6223 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
6224 OperandType type6(Type::TENSOR_FLOAT32, {2, 3, 2, 2});
6225 // Phase 1, operands
6226 auto op1 = model->addOperand(&type6);
6227 auto axis = model->addOperand(&type1);
6228 auto op2 = model->addOperand(&type41);
6229 // Phase 2, operations
6230 static int32_t axis_init[] = {-3};
6231 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6232 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6233 // Phase 3, inputs and outputs
6234 model->identifyInputsAndOutputs(
6235 {op1},
6236 {op2});
6237 // Phase 4: set relaxed execution
6238 model->relaxComputationFloat32toFloat16(true);
6239 assert(model->isValid());
6240 }
6241
is_ignored_dynamic_output_shape_relaxed_dim4_axis1_neg_relaxed(int i)6242 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis1_neg_relaxed(int i) {
6243 static std::set<int> ignore = {};
6244 return ignore.find(i) != ignore.end();
6245 }
6246
CreateModel_dynamic_output_shape_relaxed_dim4_axis1_neg_float16(Model * model)6247 void CreateModel_dynamic_output_shape_relaxed_dim4_axis1_neg_float16(Model *model) {
6248 OperandType type1(Type::INT32, {});
6249 OperandType type42(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
6250 OperandType type7(Type::TENSOR_FLOAT16, {2, 3, 2, 2});
6251 // Phase 1, operands
6252 auto op1 = model->addOperand(&type7);
6253 auto axis = model->addOperand(&type1);
6254 auto op2 = model->addOperand(&type42);
6255 // Phase 2, operations
6256 static int32_t axis_init[] = {-3};
6257 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6258 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6259 // Phase 3, inputs and outputs
6260 model->identifyInputsAndOutputs(
6261 {op1},
6262 {op2});
6263 // Phase 4: set relaxed execution
6264 model->relaxComputationFloat32toFloat16(true);
6265 assert(model->isValid());
6266 }
6267
is_ignored_dynamic_output_shape_relaxed_dim4_axis1_neg_float16(int i)6268 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis1_neg_float16(int i) {
6269 static std::set<int> ignore = {};
6270 return ignore.find(i) != ignore.end();
6271 }
6272
CreateModel_dynamic_output_shape_relaxed_dim4_axis1_neg_quant8(Model * model)6273 void CreateModel_dynamic_output_shape_relaxed_dim4_axis1_neg_quant8(Model *model) {
6274 OperandType type1(Type::INT32, {});
6275 OperandType type43(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.0078125f, 128);
6276 OperandType type8(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2, 2}, 0.1f, 32);
6277 // Phase 1, operands
6278 auto op1 = model->addOperand(&type8);
6279 auto axis = model->addOperand(&type1);
6280 auto op2 = model->addOperand(&type43);
6281 // Phase 2, operations
6282 static int32_t axis_init[] = {-3};
6283 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6284 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6285 // Phase 3, inputs and outputs
6286 model->identifyInputsAndOutputs(
6287 {op1},
6288 {op2});
6289 // Phase 4: set relaxed execution
6290 model->relaxComputationFloat32toFloat16(true);
6291 assert(model->isValid());
6292 }
6293
is_ignored_dynamic_output_shape_relaxed_dim4_axis1_neg_quant8(int i)6294 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis1_neg_quant8(int i) {
6295 static std::set<int> ignore = {};
6296 return ignore.find(i) != ignore.end();
6297 }
6298
CreateModel_dynamic_output_shape_relaxed_dim4_axis2(Model * model)6299 void CreateModel_dynamic_output_shape_relaxed_dim4_axis2(Model *model) {
6300 OperandType type1(Type::INT32, {});
6301 OperandType type10(Type::TENSOR_FLOAT32, {2, 2, 3, 2});
6302 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
6303 // Phase 1, operands
6304 auto op1 = model->addOperand(&type10);
6305 auto axis = model->addOperand(&type1);
6306 auto op2 = model->addOperand(&type41);
6307 // Phase 2, operations
6308 static int32_t axis_init[] = {2};
6309 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6310 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6311 // Phase 3, inputs and outputs
6312 model->identifyInputsAndOutputs(
6313 {op1},
6314 {op2});
6315 // Phase 4: set relaxed execution
6316 model->relaxComputationFloat32toFloat16(true);
6317 assert(model->isValid());
6318 }
6319
is_ignored_dynamic_output_shape_relaxed_dim4_axis2(int i)6320 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis2(int i) {
6321 static std::set<int> ignore = {};
6322 return ignore.find(i) != ignore.end();
6323 }
6324
CreateModel_dynamic_output_shape_relaxed_dim4_axis2_relaxed(Model * model)6325 void CreateModel_dynamic_output_shape_relaxed_dim4_axis2_relaxed(Model *model) {
6326 OperandType type1(Type::INT32, {});
6327 OperandType type10(Type::TENSOR_FLOAT32, {2, 2, 3, 2});
6328 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
6329 // Phase 1, operands
6330 auto op1 = model->addOperand(&type10);
6331 auto axis = model->addOperand(&type1);
6332 auto op2 = model->addOperand(&type41);
6333 // Phase 2, operations
6334 static int32_t axis_init[] = {2};
6335 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6336 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6337 // Phase 3, inputs and outputs
6338 model->identifyInputsAndOutputs(
6339 {op1},
6340 {op2});
6341 // Phase 4: set relaxed execution
6342 model->relaxComputationFloat32toFloat16(true);
6343 assert(model->isValid());
6344 }
6345
is_ignored_dynamic_output_shape_relaxed_dim4_axis2_relaxed(int i)6346 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis2_relaxed(int i) {
6347 static std::set<int> ignore = {};
6348 return ignore.find(i) != ignore.end();
6349 }
6350
CreateModel_dynamic_output_shape_relaxed_dim4_axis2_float16(Model * model)6351 void CreateModel_dynamic_output_shape_relaxed_dim4_axis2_float16(Model *model) {
6352 OperandType type1(Type::INT32, {});
6353 OperandType type11(Type::TENSOR_FLOAT16, {2, 2, 3, 2});
6354 OperandType type42(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
6355 // Phase 1, operands
6356 auto op1 = model->addOperand(&type11);
6357 auto axis = model->addOperand(&type1);
6358 auto op2 = model->addOperand(&type42);
6359 // Phase 2, operations
6360 static int32_t axis_init[] = {2};
6361 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6362 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6363 // Phase 3, inputs and outputs
6364 model->identifyInputsAndOutputs(
6365 {op1},
6366 {op2});
6367 // Phase 4: set relaxed execution
6368 model->relaxComputationFloat32toFloat16(true);
6369 assert(model->isValid());
6370 }
6371
is_ignored_dynamic_output_shape_relaxed_dim4_axis2_float16(int i)6372 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis2_float16(int i) {
6373 static std::set<int> ignore = {};
6374 return ignore.find(i) != ignore.end();
6375 }
6376
CreateModel_dynamic_output_shape_relaxed_dim4_axis2_quant8(Model * model)6377 void CreateModel_dynamic_output_shape_relaxed_dim4_axis2_quant8(Model *model) {
6378 OperandType type1(Type::INT32, {});
6379 OperandType type12(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3, 2}, 0.1f, 32);
6380 OperandType type43(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.0078125f, 128);
6381 // Phase 1, operands
6382 auto op1 = model->addOperand(&type12);
6383 auto axis = model->addOperand(&type1);
6384 auto op2 = model->addOperand(&type43);
6385 // Phase 2, operations
6386 static int32_t axis_init[] = {2};
6387 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6388 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6389 // Phase 3, inputs and outputs
6390 model->identifyInputsAndOutputs(
6391 {op1},
6392 {op2});
6393 // Phase 4: set relaxed execution
6394 model->relaxComputationFloat32toFloat16(true);
6395 assert(model->isValid());
6396 }
6397
is_ignored_dynamic_output_shape_relaxed_dim4_axis2_quant8(int i)6398 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis2_quant8(int i) {
6399 static std::set<int> ignore = {};
6400 return ignore.find(i) != ignore.end();
6401 }
6402
CreateModel_dynamic_output_shape_relaxed_dim4_axis2_neg(Model * model)6403 void CreateModel_dynamic_output_shape_relaxed_dim4_axis2_neg(Model *model) {
6404 OperandType type1(Type::INT32, {});
6405 OperandType type10(Type::TENSOR_FLOAT32, {2, 2, 3, 2});
6406 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
6407 // Phase 1, operands
6408 auto op1 = model->addOperand(&type10);
6409 auto axis = model->addOperand(&type1);
6410 auto op2 = model->addOperand(&type41);
6411 // Phase 2, operations
6412 static int32_t axis_init[] = {-2};
6413 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6414 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6415 // Phase 3, inputs and outputs
6416 model->identifyInputsAndOutputs(
6417 {op1},
6418 {op2});
6419 // Phase 4: set relaxed execution
6420 model->relaxComputationFloat32toFloat16(true);
6421 assert(model->isValid());
6422 }
6423
is_ignored_dynamic_output_shape_relaxed_dim4_axis2_neg(int i)6424 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis2_neg(int i) {
6425 static std::set<int> ignore = {};
6426 return ignore.find(i) != ignore.end();
6427 }
6428
CreateModel_dynamic_output_shape_relaxed_dim4_axis2_neg_relaxed(Model * model)6429 void CreateModel_dynamic_output_shape_relaxed_dim4_axis2_neg_relaxed(Model *model) {
6430 OperandType type1(Type::INT32, {});
6431 OperandType type10(Type::TENSOR_FLOAT32, {2, 2, 3, 2});
6432 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
6433 // Phase 1, operands
6434 auto op1 = model->addOperand(&type10);
6435 auto axis = model->addOperand(&type1);
6436 auto op2 = model->addOperand(&type41);
6437 // Phase 2, operations
6438 static int32_t axis_init[] = {-2};
6439 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6440 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6441 // Phase 3, inputs and outputs
6442 model->identifyInputsAndOutputs(
6443 {op1},
6444 {op2});
6445 // Phase 4: set relaxed execution
6446 model->relaxComputationFloat32toFloat16(true);
6447 assert(model->isValid());
6448 }
6449
is_ignored_dynamic_output_shape_relaxed_dim4_axis2_neg_relaxed(int i)6450 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis2_neg_relaxed(int i) {
6451 static std::set<int> ignore = {};
6452 return ignore.find(i) != ignore.end();
6453 }
6454
CreateModel_dynamic_output_shape_relaxed_dim4_axis2_neg_float16(Model * model)6455 void CreateModel_dynamic_output_shape_relaxed_dim4_axis2_neg_float16(Model *model) {
6456 OperandType type1(Type::INT32, {});
6457 OperandType type11(Type::TENSOR_FLOAT16, {2, 2, 3, 2});
6458 OperandType type42(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
6459 // Phase 1, operands
6460 auto op1 = model->addOperand(&type11);
6461 auto axis = model->addOperand(&type1);
6462 auto op2 = model->addOperand(&type42);
6463 // Phase 2, operations
6464 static int32_t axis_init[] = {-2};
6465 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6466 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6467 // Phase 3, inputs and outputs
6468 model->identifyInputsAndOutputs(
6469 {op1},
6470 {op2});
6471 // Phase 4: set relaxed execution
6472 model->relaxComputationFloat32toFloat16(true);
6473 assert(model->isValid());
6474 }
6475
is_ignored_dynamic_output_shape_relaxed_dim4_axis2_neg_float16(int i)6476 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis2_neg_float16(int i) {
6477 static std::set<int> ignore = {};
6478 return ignore.find(i) != ignore.end();
6479 }
6480
CreateModel_dynamic_output_shape_relaxed_dim4_axis2_neg_quant8(Model * model)6481 void CreateModel_dynamic_output_shape_relaxed_dim4_axis2_neg_quant8(Model *model) {
6482 OperandType type1(Type::INT32, {});
6483 OperandType type12(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3, 2}, 0.1f, 32);
6484 OperandType type43(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.0078125f, 128);
6485 // Phase 1, operands
6486 auto op1 = model->addOperand(&type12);
6487 auto axis = model->addOperand(&type1);
6488 auto op2 = model->addOperand(&type43);
6489 // Phase 2, operations
6490 static int32_t axis_init[] = {-2};
6491 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6492 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6493 // Phase 3, inputs and outputs
6494 model->identifyInputsAndOutputs(
6495 {op1},
6496 {op2});
6497 // Phase 4: set relaxed execution
6498 model->relaxComputationFloat32toFloat16(true);
6499 assert(model->isValid());
6500 }
6501
is_ignored_dynamic_output_shape_relaxed_dim4_axis2_neg_quant8(int i)6502 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis2_neg_quant8(int i) {
6503 static std::set<int> ignore = {};
6504 return ignore.find(i) != ignore.end();
6505 }
6506
CreateModel_dynamic_output_shape_relaxed_dim4_axis3(Model * model)6507 void CreateModel_dynamic_output_shape_relaxed_dim4_axis3(Model *model) {
6508 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
6509 OperandType type1(Type::INT32, {});
6510 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
6511 // Phase 1, operands
6512 auto op1 = model->addOperand(&type0);
6513 auto axis = model->addOperand(&type1);
6514 auto op2 = model->addOperand(&type41);
6515 // Phase 2, operations
6516 static int32_t axis_init[] = {3};
6517 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6518 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6519 // Phase 3, inputs and outputs
6520 model->identifyInputsAndOutputs(
6521 {op1},
6522 {op2});
6523 // Phase 4: set relaxed execution
6524 model->relaxComputationFloat32toFloat16(true);
6525 assert(model->isValid());
6526 }
6527
is_ignored_dynamic_output_shape_relaxed_dim4_axis3(int i)6528 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis3(int i) {
6529 static std::set<int> ignore = {};
6530 return ignore.find(i) != ignore.end();
6531 }
6532
CreateModel_dynamic_output_shape_relaxed_dim4_axis3_relaxed(Model * model)6533 void CreateModel_dynamic_output_shape_relaxed_dim4_axis3_relaxed(Model *model) {
6534 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
6535 OperandType type1(Type::INT32, {});
6536 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
6537 // Phase 1, operands
6538 auto op1 = model->addOperand(&type0);
6539 auto axis = model->addOperand(&type1);
6540 auto op2 = model->addOperand(&type41);
6541 // Phase 2, operations
6542 static int32_t axis_init[] = {3};
6543 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6544 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6545 // Phase 3, inputs and outputs
6546 model->identifyInputsAndOutputs(
6547 {op1},
6548 {op2});
6549 // Phase 4: set relaxed execution
6550 model->relaxComputationFloat32toFloat16(true);
6551 assert(model->isValid());
6552 }
6553
is_ignored_dynamic_output_shape_relaxed_dim4_axis3_relaxed(int i)6554 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis3_relaxed(int i) {
6555 static std::set<int> ignore = {};
6556 return ignore.find(i) != ignore.end();
6557 }
6558
CreateModel_dynamic_output_shape_relaxed_dim4_axis3_float16(Model * model)6559 void CreateModel_dynamic_output_shape_relaxed_dim4_axis3_float16(Model *model) {
6560 OperandType type1(Type::INT32, {});
6561 OperandType type14(Type::TENSOR_FLOAT16, {2, 2, 2, 3});
6562 OperandType type42(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
6563 // Phase 1, operands
6564 auto op1 = model->addOperand(&type14);
6565 auto axis = model->addOperand(&type1);
6566 auto op2 = model->addOperand(&type42);
6567 // Phase 2, operations
6568 static int32_t axis_init[] = {3};
6569 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6570 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6571 // Phase 3, inputs and outputs
6572 model->identifyInputsAndOutputs(
6573 {op1},
6574 {op2});
6575 // Phase 4: set relaxed execution
6576 model->relaxComputationFloat32toFloat16(true);
6577 assert(model->isValid());
6578 }
6579
is_ignored_dynamic_output_shape_relaxed_dim4_axis3_float16(int i)6580 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis3_float16(int i) {
6581 static std::set<int> ignore = {};
6582 return ignore.find(i) != ignore.end();
6583 }
6584
CreateModel_dynamic_output_shape_relaxed_dim4_axis3_quant8(Model * model)6585 void CreateModel_dynamic_output_shape_relaxed_dim4_axis3_quant8(Model *model) {
6586 OperandType type1(Type::INT32, {});
6587 OperandType type15(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 3}, 0.1f, 32);
6588 OperandType type43(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.0078125f, 128);
6589 // Phase 1, operands
6590 auto op1 = model->addOperand(&type15);
6591 auto axis = model->addOperand(&type1);
6592 auto op2 = model->addOperand(&type43);
6593 // Phase 2, operations
6594 static int32_t axis_init[] = {3};
6595 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6596 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6597 // Phase 3, inputs and outputs
6598 model->identifyInputsAndOutputs(
6599 {op1},
6600 {op2});
6601 // Phase 4: set relaxed execution
6602 model->relaxComputationFloat32toFloat16(true);
6603 assert(model->isValid());
6604 }
6605
is_ignored_dynamic_output_shape_relaxed_dim4_axis3_quant8(int i)6606 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis3_quant8(int i) {
6607 static std::set<int> ignore = {};
6608 return ignore.find(i) != ignore.end();
6609 }
6610
CreateModel_dynamic_output_shape_relaxed_dim4_axis3_neg(Model * model)6611 void CreateModel_dynamic_output_shape_relaxed_dim4_axis3_neg(Model *model) {
6612 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
6613 OperandType type1(Type::INT32, {});
6614 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
6615 // Phase 1, operands
6616 auto op1 = model->addOperand(&type0);
6617 auto axis = model->addOperand(&type1);
6618 auto op2 = model->addOperand(&type41);
6619 // Phase 2, operations
6620 static int32_t axis_init[] = {-1};
6621 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6622 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6623 // Phase 3, inputs and outputs
6624 model->identifyInputsAndOutputs(
6625 {op1},
6626 {op2});
6627 // Phase 4: set relaxed execution
6628 model->relaxComputationFloat32toFloat16(true);
6629 assert(model->isValid());
6630 }
6631
is_ignored_dynamic_output_shape_relaxed_dim4_axis3_neg(int i)6632 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis3_neg(int i) {
6633 static std::set<int> ignore = {};
6634 return ignore.find(i) != ignore.end();
6635 }
6636
CreateModel_dynamic_output_shape_relaxed_dim4_axis3_neg_relaxed(Model * model)6637 void CreateModel_dynamic_output_shape_relaxed_dim4_axis3_neg_relaxed(Model *model) {
6638 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
6639 OperandType type1(Type::INT32, {});
6640 OperandType type41(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
6641 // Phase 1, operands
6642 auto op1 = model->addOperand(&type0);
6643 auto axis = model->addOperand(&type1);
6644 auto op2 = model->addOperand(&type41);
6645 // Phase 2, operations
6646 static int32_t axis_init[] = {-1};
6647 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6648 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6649 // Phase 3, inputs and outputs
6650 model->identifyInputsAndOutputs(
6651 {op1},
6652 {op2});
6653 // Phase 4: set relaxed execution
6654 model->relaxComputationFloat32toFloat16(true);
6655 assert(model->isValid());
6656 }
6657
is_ignored_dynamic_output_shape_relaxed_dim4_axis3_neg_relaxed(int i)6658 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis3_neg_relaxed(int i) {
6659 static std::set<int> ignore = {};
6660 return ignore.find(i) != ignore.end();
6661 }
6662
CreateModel_dynamic_output_shape_relaxed_dim4_axis3_neg_float16(Model * model)6663 void CreateModel_dynamic_output_shape_relaxed_dim4_axis3_neg_float16(Model *model) {
6664 OperandType type1(Type::INT32, {});
6665 OperandType type14(Type::TENSOR_FLOAT16, {2, 2, 2, 3});
6666 OperandType type42(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
6667 // Phase 1, operands
6668 auto op1 = model->addOperand(&type14);
6669 auto axis = model->addOperand(&type1);
6670 auto op2 = model->addOperand(&type42);
6671 // Phase 2, operations
6672 static int32_t axis_init[] = {-1};
6673 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6674 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6675 // Phase 3, inputs and outputs
6676 model->identifyInputsAndOutputs(
6677 {op1},
6678 {op2});
6679 // Phase 4: set relaxed execution
6680 model->relaxComputationFloat32toFloat16(true);
6681 assert(model->isValid());
6682 }
6683
is_ignored_dynamic_output_shape_relaxed_dim4_axis3_neg_float16(int i)6684 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis3_neg_float16(int i) {
6685 static std::set<int> ignore = {};
6686 return ignore.find(i) != ignore.end();
6687 }
6688
CreateModel_dynamic_output_shape_relaxed_dim4_axis3_neg_quant8(Model * model)6689 void CreateModel_dynamic_output_shape_relaxed_dim4_axis3_neg_quant8(Model *model) {
6690 OperandType type1(Type::INT32, {});
6691 OperandType type15(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 3}, 0.1f, 32);
6692 OperandType type43(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.0078125f, 128);
6693 // Phase 1, operands
6694 auto op1 = model->addOperand(&type15);
6695 auto axis = model->addOperand(&type1);
6696 auto op2 = model->addOperand(&type43);
6697 // Phase 2, operations
6698 static int32_t axis_init[] = {-1};
6699 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6700 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6701 // Phase 3, inputs and outputs
6702 model->identifyInputsAndOutputs(
6703 {op1},
6704 {op2});
6705 // Phase 4: set relaxed execution
6706 model->relaxComputationFloat32toFloat16(true);
6707 assert(model->isValid());
6708 }
6709
is_ignored_dynamic_output_shape_relaxed_dim4_axis3_neg_quant8(int i)6710 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis3_neg_quant8(int i) {
6711 static std::set<int> ignore = {};
6712 return ignore.find(i) != ignore.end();
6713 }
6714
CreateModel_dynamic_output_shape_relaxed_dim3_axis0(Model * model)6715 void CreateModel_dynamic_output_shape_relaxed_dim3_axis0(Model *model) {
6716 OperandType type1(Type::INT32, {});
6717 OperandType type17(Type::TENSOR_FLOAT32, {3, 2, 2});
6718 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
6719 // Phase 1, operands
6720 auto op1 = model->addOperand(&type17);
6721 auto axis = model->addOperand(&type1);
6722 auto op2 = model->addOperand(&type44);
6723 // Phase 2, operations
6724 static int32_t axis_init[] = {0};
6725 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6726 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6727 // Phase 3, inputs and outputs
6728 model->identifyInputsAndOutputs(
6729 {op1},
6730 {op2});
6731 // Phase 4: set relaxed execution
6732 model->relaxComputationFloat32toFloat16(true);
6733 assert(model->isValid());
6734 }
6735
is_ignored_dynamic_output_shape_relaxed_dim3_axis0(int i)6736 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis0(int i) {
6737 static std::set<int> ignore = {};
6738 return ignore.find(i) != ignore.end();
6739 }
6740
CreateModel_dynamic_output_shape_relaxed_dim3_axis0_relaxed(Model * model)6741 void CreateModel_dynamic_output_shape_relaxed_dim3_axis0_relaxed(Model *model) {
6742 OperandType type1(Type::INT32, {});
6743 OperandType type17(Type::TENSOR_FLOAT32, {3, 2, 2});
6744 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
6745 // Phase 1, operands
6746 auto op1 = model->addOperand(&type17);
6747 auto axis = model->addOperand(&type1);
6748 auto op2 = model->addOperand(&type44);
6749 // Phase 2, operations
6750 static int32_t axis_init[] = {0};
6751 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6752 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6753 // Phase 3, inputs and outputs
6754 model->identifyInputsAndOutputs(
6755 {op1},
6756 {op2});
6757 // Phase 4: set relaxed execution
6758 model->relaxComputationFloat32toFloat16(true);
6759 assert(model->isValid());
6760 }
6761
is_ignored_dynamic_output_shape_relaxed_dim3_axis0_relaxed(int i)6762 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis0_relaxed(int i) {
6763 static std::set<int> ignore = {};
6764 return ignore.find(i) != ignore.end();
6765 }
6766
CreateModel_dynamic_output_shape_relaxed_dim3_axis0_float16(Model * model)6767 void CreateModel_dynamic_output_shape_relaxed_dim3_axis0_float16(Model *model) {
6768 OperandType type1(Type::INT32, {});
6769 OperandType type18(Type::TENSOR_FLOAT16, {3, 2, 2});
6770 OperandType type45(Type::TENSOR_FLOAT16, {0, 0, 0});
6771 // Phase 1, operands
6772 auto op1 = model->addOperand(&type18);
6773 auto axis = model->addOperand(&type1);
6774 auto op2 = model->addOperand(&type45);
6775 // Phase 2, operations
6776 static int32_t axis_init[] = {0};
6777 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6778 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6779 // Phase 3, inputs and outputs
6780 model->identifyInputsAndOutputs(
6781 {op1},
6782 {op2});
6783 // Phase 4: set relaxed execution
6784 model->relaxComputationFloat32toFloat16(true);
6785 assert(model->isValid());
6786 }
6787
is_ignored_dynamic_output_shape_relaxed_dim3_axis0_float16(int i)6788 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis0_float16(int i) {
6789 static std::set<int> ignore = {};
6790 return ignore.find(i) != ignore.end();
6791 }
6792
CreateModel_dynamic_output_shape_relaxed_dim3_axis0_quant8(Model * model)6793 void CreateModel_dynamic_output_shape_relaxed_dim3_axis0_quant8(Model *model) {
6794 OperandType type1(Type::INT32, {});
6795 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2}, 0.1f, 32);
6796 OperandType type46(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.0078125f, 128);
6797 // Phase 1, operands
6798 auto op1 = model->addOperand(&type19);
6799 auto axis = model->addOperand(&type1);
6800 auto op2 = model->addOperand(&type46);
6801 // Phase 2, operations
6802 static int32_t axis_init[] = {0};
6803 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6804 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6805 // Phase 3, inputs and outputs
6806 model->identifyInputsAndOutputs(
6807 {op1},
6808 {op2});
6809 // Phase 4: set relaxed execution
6810 model->relaxComputationFloat32toFloat16(true);
6811 assert(model->isValid());
6812 }
6813
is_ignored_dynamic_output_shape_relaxed_dim3_axis0_quant8(int i)6814 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis0_quant8(int i) {
6815 static std::set<int> ignore = {};
6816 return ignore.find(i) != ignore.end();
6817 }
6818
CreateModel_dynamic_output_shape_relaxed_dim3_axis0_neg(Model * model)6819 void CreateModel_dynamic_output_shape_relaxed_dim3_axis0_neg(Model *model) {
6820 OperandType type1(Type::INT32, {});
6821 OperandType type17(Type::TENSOR_FLOAT32, {3, 2, 2});
6822 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
6823 // Phase 1, operands
6824 auto op1 = model->addOperand(&type17);
6825 auto axis = model->addOperand(&type1);
6826 auto op2 = model->addOperand(&type44);
6827 // Phase 2, operations
6828 static int32_t axis_init[] = {-3};
6829 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6830 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6831 // Phase 3, inputs and outputs
6832 model->identifyInputsAndOutputs(
6833 {op1},
6834 {op2});
6835 // Phase 4: set relaxed execution
6836 model->relaxComputationFloat32toFloat16(true);
6837 assert(model->isValid());
6838 }
6839
is_ignored_dynamic_output_shape_relaxed_dim3_axis0_neg(int i)6840 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis0_neg(int i) {
6841 static std::set<int> ignore = {};
6842 return ignore.find(i) != ignore.end();
6843 }
6844
CreateModel_dynamic_output_shape_relaxed_dim3_axis0_neg_relaxed(Model * model)6845 void CreateModel_dynamic_output_shape_relaxed_dim3_axis0_neg_relaxed(Model *model) {
6846 OperandType type1(Type::INT32, {});
6847 OperandType type17(Type::TENSOR_FLOAT32, {3, 2, 2});
6848 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
6849 // Phase 1, operands
6850 auto op1 = model->addOperand(&type17);
6851 auto axis = model->addOperand(&type1);
6852 auto op2 = model->addOperand(&type44);
6853 // Phase 2, operations
6854 static int32_t axis_init[] = {-3};
6855 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6856 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6857 // Phase 3, inputs and outputs
6858 model->identifyInputsAndOutputs(
6859 {op1},
6860 {op2});
6861 // Phase 4: set relaxed execution
6862 model->relaxComputationFloat32toFloat16(true);
6863 assert(model->isValid());
6864 }
6865
is_ignored_dynamic_output_shape_relaxed_dim3_axis0_neg_relaxed(int i)6866 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis0_neg_relaxed(int i) {
6867 static std::set<int> ignore = {};
6868 return ignore.find(i) != ignore.end();
6869 }
6870
CreateModel_dynamic_output_shape_relaxed_dim3_axis0_neg_float16(Model * model)6871 void CreateModel_dynamic_output_shape_relaxed_dim3_axis0_neg_float16(Model *model) {
6872 OperandType type1(Type::INT32, {});
6873 OperandType type18(Type::TENSOR_FLOAT16, {3, 2, 2});
6874 OperandType type45(Type::TENSOR_FLOAT16, {0, 0, 0});
6875 // Phase 1, operands
6876 auto op1 = model->addOperand(&type18);
6877 auto axis = model->addOperand(&type1);
6878 auto op2 = model->addOperand(&type45);
6879 // Phase 2, operations
6880 static int32_t axis_init[] = {-3};
6881 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6882 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6883 // Phase 3, inputs and outputs
6884 model->identifyInputsAndOutputs(
6885 {op1},
6886 {op2});
6887 // Phase 4: set relaxed execution
6888 model->relaxComputationFloat32toFloat16(true);
6889 assert(model->isValid());
6890 }
6891
is_ignored_dynamic_output_shape_relaxed_dim3_axis0_neg_float16(int i)6892 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis0_neg_float16(int i) {
6893 static std::set<int> ignore = {};
6894 return ignore.find(i) != ignore.end();
6895 }
6896
CreateModel_dynamic_output_shape_relaxed_dim3_axis0_neg_quant8(Model * model)6897 void CreateModel_dynamic_output_shape_relaxed_dim3_axis0_neg_quant8(Model *model) {
6898 OperandType type1(Type::INT32, {});
6899 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {3, 2, 2}, 0.1f, 32);
6900 OperandType type46(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.0078125f, 128);
6901 // Phase 1, operands
6902 auto op1 = model->addOperand(&type19);
6903 auto axis = model->addOperand(&type1);
6904 auto op2 = model->addOperand(&type46);
6905 // Phase 2, operations
6906 static int32_t axis_init[] = {-3};
6907 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6908 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6909 // Phase 3, inputs and outputs
6910 model->identifyInputsAndOutputs(
6911 {op1},
6912 {op2});
6913 // Phase 4: set relaxed execution
6914 model->relaxComputationFloat32toFloat16(true);
6915 assert(model->isValid());
6916 }
6917
is_ignored_dynamic_output_shape_relaxed_dim3_axis0_neg_quant8(int i)6918 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis0_neg_quant8(int i) {
6919 static std::set<int> ignore = {};
6920 return ignore.find(i) != ignore.end();
6921 }
6922
CreateModel_dynamic_output_shape_relaxed_dim3_axis1(Model * model)6923 void CreateModel_dynamic_output_shape_relaxed_dim3_axis1(Model *model) {
6924 OperandType type1(Type::INT32, {});
6925 OperandType type21(Type::TENSOR_FLOAT32, {2, 3, 2});
6926 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
6927 // Phase 1, operands
6928 auto op1 = model->addOperand(&type21);
6929 auto axis = model->addOperand(&type1);
6930 auto op2 = model->addOperand(&type44);
6931 // Phase 2, operations
6932 static int32_t axis_init[] = {1};
6933 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6934 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6935 // Phase 3, inputs and outputs
6936 model->identifyInputsAndOutputs(
6937 {op1},
6938 {op2});
6939 // Phase 4: set relaxed execution
6940 model->relaxComputationFloat32toFloat16(true);
6941 assert(model->isValid());
6942 }
6943
is_ignored_dynamic_output_shape_relaxed_dim3_axis1(int i)6944 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis1(int i) {
6945 static std::set<int> ignore = {};
6946 return ignore.find(i) != ignore.end();
6947 }
6948
CreateModel_dynamic_output_shape_relaxed_dim3_axis1_relaxed(Model * model)6949 void CreateModel_dynamic_output_shape_relaxed_dim3_axis1_relaxed(Model *model) {
6950 OperandType type1(Type::INT32, {});
6951 OperandType type21(Type::TENSOR_FLOAT32, {2, 3, 2});
6952 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
6953 // Phase 1, operands
6954 auto op1 = model->addOperand(&type21);
6955 auto axis = model->addOperand(&type1);
6956 auto op2 = model->addOperand(&type44);
6957 // Phase 2, operations
6958 static int32_t axis_init[] = {1};
6959 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6960 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6961 // Phase 3, inputs and outputs
6962 model->identifyInputsAndOutputs(
6963 {op1},
6964 {op2});
6965 // Phase 4: set relaxed execution
6966 model->relaxComputationFloat32toFloat16(true);
6967 assert(model->isValid());
6968 }
6969
is_ignored_dynamic_output_shape_relaxed_dim3_axis1_relaxed(int i)6970 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis1_relaxed(int i) {
6971 static std::set<int> ignore = {};
6972 return ignore.find(i) != ignore.end();
6973 }
6974
CreateModel_dynamic_output_shape_relaxed_dim3_axis1_float16(Model * model)6975 void CreateModel_dynamic_output_shape_relaxed_dim3_axis1_float16(Model *model) {
6976 OperandType type1(Type::INT32, {});
6977 OperandType type22(Type::TENSOR_FLOAT16, {2, 3, 2});
6978 OperandType type45(Type::TENSOR_FLOAT16, {0, 0, 0});
6979 // Phase 1, operands
6980 auto op1 = model->addOperand(&type22);
6981 auto axis = model->addOperand(&type1);
6982 auto op2 = model->addOperand(&type45);
6983 // Phase 2, operations
6984 static int32_t axis_init[] = {1};
6985 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6986 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
6987 // Phase 3, inputs and outputs
6988 model->identifyInputsAndOutputs(
6989 {op1},
6990 {op2});
6991 // Phase 4: set relaxed execution
6992 model->relaxComputationFloat32toFloat16(true);
6993 assert(model->isValid());
6994 }
6995
is_ignored_dynamic_output_shape_relaxed_dim3_axis1_float16(int i)6996 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis1_float16(int i) {
6997 static std::set<int> ignore = {};
6998 return ignore.find(i) != ignore.end();
6999 }
7000
CreateModel_dynamic_output_shape_relaxed_dim3_axis1_quant8(Model * model)7001 void CreateModel_dynamic_output_shape_relaxed_dim3_axis1_quant8(Model *model) {
7002 OperandType type1(Type::INT32, {});
7003 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2}, 0.1f, 32);
7004 OperandType type46(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.0078125f, 128);
7005 // Phase 1, operands
7006 auto op1 = model->addOperand(&type23);
7007 auto axis = model->addOperand(&type1);
7008 auto op2 = model->addOperand(&type46);
7009 // Phase 2, operations
7010 static int32_t axis_init[] = {1};
7011 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7012 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7013 // Phase 3, inputs and outputs
7014 model->identifyInputsAndOutputs(
7015 {op1},
7016 {op2});
7017 // Phase 4: set relaxed execution
7018 model->relaxComputationFloat32toFloat16(true);
7019 assert(model->isValid());
7020 }
7021
is_ignored_dynamic_output_shape_relaxed_dim3_axis1_quant8(int i)7022 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis1_quant8(int i) {
7023 static std::set<int> ignore = {};
7024 return ignore.find(i) != ignore.end();
7025 }
7026
CreateModel_dynamic_output_shape_relaxed_dim3_axis1_neg(Model * model)7027 void CreateModel_dynamic_output_shape_relaxed_dim3_axis1_neg(Model *model) {
7028 OperandType type1(Type::INT32, {});
7029 OperandType type21(Type::TENSOR_FLOAT32, {2, 3, 2});
7030 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
7031 // Phase 1, operands
7032 auto op1 = model->addOperand(&type21);
7033 auto axis = model->addOperand(&type1);
7034 auto op2 = model->addOperand(&type44);
7035 // Phase 2, operations
7036 static int32_t axis_init[] = {-2};
7037 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7038 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7039 // Phase 3, inputs and outputs
7040 model->identifyInputsAndOutputs(
7041 {op1},
7042 {op2});
7043 // Phase 4: set relaxed execution
7044 model->relaxComputationFloat32toFloat16(true);
7045 assert(model->isValid());
7046 }
7047
is_ignored_dynamic_output_shape_relaxed_dim3_axis1_neg(int i)7048 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis1_neg(int i) {
7049 static std::set<int> ignore = {};
7050 return ignore.find(i) != ignore.end();
7051 }
7052
CreateModel_dynamic_output_shape_relaxed_dim3_axis1_neg_relaxed(Model * model)7053 void CreateModel_dynamic_output_shape_relaxed_dim3_axis1_neg_relaxed(Model *model) {
7054 OperandType type1(Type::INT32, {});
7055 OperandType type21(Type::TENSOR_FLOAT32, {2, 3, 2});
7056 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
7057 // Phase 1, operands
7058 auto op1 = model->addOperand(&type21);
7059 auto axis = model->addOperand(&type1);
7060 auto op2 = model->addOperand(&type44);
7061 // Phase 2, operations
7062 static int32_t axis_init[] = {-2};
7063 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7064 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7065 // Phase 3, inputs and outputs
7066 model->identifyInputsAndOutputs(
7067 {op1},
7068 {op2});
7069 // Phase 4: set relaxed execution
7070 model->relaxComputationFloat32toFloat16(true);
7071 assert(model->isValid());
7072 }
7073
is_ignored_dynamic_output_shape_relaxed_dim3_axis1_neg_relaxed(int i)7074 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis1_neg_relaxed(int i) {
7075 static std::set<int> ignore = {};
7076 return ignore.find(i) != ignore.end();
7077 }
7078
CreateModel_dynamic_output_shape_relaxed_dim3_axis1_neg_float16(Model * model)7079 void CreateModel_dynamic_output_shape_relaxed_dim3_axis1_neg_float16(Model *model) {
7080 OperandType type1(Type::INT32, {});
7081 OperandType type22(Type::TENSOR_FLOAT16, {2, 3, 2});
7082 OperandType type45(Type::TENSOR_FLOAT16, {0, 0, 0});
7083 // Phase 1, operands
7084 auto op1 = model->addOperand(&type22);
7085 auto axis = model->addOperand(&type1);
7086 auto op2 = model->addOperand(&type45);
7087 // Phase 2, operations
7088 static int32_t axis_init[] = {-2};
7089 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7090 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7091 // Phase 3, inputs and outputs
7092 model->identifyInputsAndOutputs(
7093 {op1},
7094 {op2});
7095 // Phase 4: set relaxed execution
7096 model->relaxComputationFloat32toFloat16(true);
7097 assert(model->isValid());
7098 }
7099
is_ignored_dynamic_output_shape_relaxed_dim3_axis1_neg_float16(int i)7100 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis1_neg_float16(int i) {
7101 static std::set<int> ignore = {};
7102 return ignore.find(i) != ignore.end();
7103 }
7104
CreateModel_dynamic_output_shape_relaxed_dim3_axis1_neg_quant8(Model * model)7105 void CreateModel_dynamic_output_shape_relaxed_dim3_axis1_neg_quant8(Model *model) {
7106 OperandType type1(Type::INT32, {});
7107 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {2, 3, 2}, 0.1f, 32);
7108 OperandType type46(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.0078125f, 128);
7109 // Phase 1, operands
7110 auto op1 = model->addOperand(&type23);
7111 auto axis = model->addOperand(&type1);
7112 auto op2 = model->addOperand(&type46);
7113 // Phase 2, operations
7114 static int32_t axis_init[] = {-2};
7115 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7116 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7117 // Phase 3, inputs and outputs
7118 model->identifyInputsAndOutputs(
7119 {op1},
7120 {op2});
7121 // Phase 4: set relaxed execution
7122 model->relaxComputationFloat32toFloat16(true);
7123 assert(model->isValid());
7124 }
7125
is_ignored_dynamic_output_shape_relaxed_dim3_axis1_neg_quant8(int i)7126 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis1_neg_quant8(int i) {
7127 static std::set<int> ignore = {};
7128 return ignore.find(i) != ignore.end();
7129 }
7130
CreateModel_dynamic_output_shape_relaxed_dim3_axis2(Model * model)7131 void CreateModel_dynamic_output_shape_relaxed_dim3_axis2(Model *model) {
7132 OperandType type1(Type::INT32, {});
7133 OperandType type25(Type::TENSOR_FLOAT32, {2, 2, 3});
7134 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
7135 // Phase 1, operands
7136 auto op1 = model->addOperand(&type25);
7137 auto axis = model->addOperand(&type1);
7138 auto op2 = model->addOperand(&type44);
7139 // Phase 2, operations
7140 static int32_t axis_init[] = {2};
7141 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7142 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7143 // Phase 3, inputs and outputs
7144 model->identifyInputsAndOutputs(
7145 {op1},
7146 {op2});
7147 // Phase 4: set relaxed execution
7148 model->relaxComputationFloat32toFloat16(true);
7149 assert(model->isValid());
7150 }
7151
is_ignored_dynamic_output_shape_relaxed_dim3_axis2(int i)7152 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis2(int i) {
7153 static std::set<int> ignore = {};
7154 return ignore.find(i) != ignore.end();
7155 }
7156
CreateModel_dynamic_output_shape_relaxed_dim3_axis2_relaxed(Model * model)7157 void CreateModel_dynamic_output_shape_relaxed_dim3_axis2_relaxed(Model *model) {
7158 OperandType type1(Type::INT32, {});
7159 OperandType type25(Type::TENSOR_FLOAT32, {2, 2, 3});
7160 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
7161 // Phase 1, operands
7162 auto op1 = model->addOperand(&type25);
7163 auto axis = model->addOperand(&type1);
7164 auto op2 = model->addOperand(&type44);
7165 // Phase 2, operations
7166 static int32_t axis_init[] = {2};
7167 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7168 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7169 // Phase 3, inputs and outputs
7170 model->identifyInputsAndOutputs(
7171 {op1},
7172 {op2});
7173 // Phase 4: set relaxed execution
7174 model->relaxComputationFloat32toFloat16(true);
7175 assert(model->isValid());
7176 }
7177
is_ignored_dynamic_output_shape_relaxed_dim3_axis2_relaxed(int i)7178 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis2_relaxed(int i) {
7179 static std::set<int> ignore = {};
7180 return ignore.find(i) != ignore.end();
7181 }
7182
CreateModel_dynamic_output_shape_relaxed_dim3_axis2_float16(Model * model)7183 void CreateModel_dynamic_output_shape_relaxed_dim3_axis2_float16(Model *model) {
7184 OperandType type1(Type::INT32, {});
7185 OperandType type26(Type::TENSOR_FLOAT16, {2, 2, 3});
7186 OperandType type45(Type::TENSOR_FLOAT16, {0, 0, 0});
7187 // Phase 1, operands
7188 auto op1 = model->addOperand(&type26);
7189 auto axis = model->addOperand(&type1);
7190 auto op2 = model->addOperand(&type45);
7191 // Phase 2, operations
7192 static int32_t axis_init[] = {2};
7193 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7194 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7195 // Phase 3, inputs and outputs
7196 model->identifyInputsAndOutputs(
7197 {op1},
7198 {op2});
7199 // Phase 4: set relaxed execution
7200 model->relaxComputationFloat32toFloat16(true);
7201 assert(model->isValid());
7202 }
7203
is_ignored_dynamic_output_shape_relaxed_dim3_axis2_float16(int i)7204 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis2_float16(int i) {
7205 static std::set<int> ignore = {};
7206 return ignore.find(i) != ignore.end();
7207 }
7208
CreateModel_dynamic_output_shape_relaxed_dim3_axis2_quant8(Model * model)7209 void CreateModel_dynamic_output_shape_relaxed_dim3_axis2_quant8(Model *model) {
7210 OperandType type1(Type::INT32, {});
7211 OperandType type27(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3}, 0.1f, 32);
7212 OperandType type46(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.0078125f, 128);
7213 // Phase 1, operands
7214 auto op1 = model->addOperand(&type27);
7215 auto axis = model->addOperand(&type1);
7216 auto op2 = model->addOperand(&type46);
7217 // Phase 2, operations
7218 static int32_t axis_init[] = {2};
7219 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7220 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7221 // Phase 3, inputs and outputs
7222 model->identifyInputsAndOutputs(
7223 {op1},
7224 {op2});
7225 // Phase 4: set relaxed execution
7226 model->relaxComputationFloat32toFloat16(true);
7227 assert(model->isValid());
7228 }
7229
is_ignored_dynamic_output_shape_relaxed_dim3_axis2_quant8(int i)7230 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis2_quant8(int i) {
7231 static std::set<int> ignore = {};
7232 return ignore.find(i) != ignore.end();
7233 }
7234
CreateModel_dynamic_output_shape_relaxed_dim3_axis2_neg(Model * model)7235 void CreateModel_dynamic_output_shape_relaxed_dim3_axis2_neg(Model *model) {
7236 OperandType type1(Type::INT32, {});
7237 OperandType type25(Type::TENSOR_FLOAT32, {2, 2, 3});
7238 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
7239 // Phase 1, operands
7240 auto op1 = model->addOperand(&type25);
7241 auto axis = model->addOperand(&type1);
7242 auto op2 = model->addOperand(&type44);
7243 // Phase 2, operations
7244 static int32_t axis_init[] = {-1};
7245 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7246 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7247 // Phase 3, inputs and outputs
7248 model->identifyInputsAndOutputs(
7249 {op1},
7250 {op2});
7251 // Phase 4: set relaxed execution
7252 model->relaxComputationFloat32toFloat16(true);
7253 assert(model->isValid());
7254 }
7255
is_ignored_dynamic_output_shape_relaxed_dim3_axis2_neg(int i)7256 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis2_neg(int i) {
7257 static std::set<int> ignore = {};
7258 return ignore.find(i) != ignore.end();
7259 }
7260
CreateModel_dynamic_output_shape_relaxed_dim3_axis2_neg_relaxed(Model * model)7261 void CreateModel_dynamic_output_shape_relaxed_dim3_axis2_neg_relaxed(Model *model) {
7262 OperandType type1(Type::INT32, {});
7263 OperandType type25(Type::TENSOR_FLOAT32, {2, 2, 3});
7264 OperandType type44(Type::TENSOR_FLOAT32, {0, 0, 0});
7265 // Phase 1, operands
7266 auto op1 = model->addOperand(&type25);
7267 auto axis = model->addOperand(&type1);
7268 auto op2 = model->addOperand(&type44);
7269 // Phase 2, operations
7270 static int32_t axis_init[] = {-1};
7271 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7272 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7273 // Phase 3, inputs and outputs
7274 model->identifyInputsAndOutputs(
7275 {op1},
7276 {op2});
7277 // Phase 4: set relaxed execution
7278 model->relaxComputationFloat32toFloat16(true);
7279 assert(model->isValid());
7280 }
7281
is_ignored_dynamic_output_shape_relaxed_dim3_axis2_neg_relaxed(int i)7282 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis2_neg_relaxed(int i) {
7283 static std::set<int> ignore = {};
7284 return ignore.find(i) != ignore.end();
7285 }
7286
CreateModel_dynamic_output_shape_relaxed_dim3_axis2_neg_float16(Model * model)7287 void CreateModel_dynamic_output_shape_relaxed_dim3_axis2_neg_float16(Model *model) {
7288 OperandType type1(Type::INT32, {});
7289 OperandType type26(Type::TENSOR_FLOAT16, {2, 2, 3});
7290 OperandType type45(Type::TENSOR_FLOAT16, {0, 0, 0});
7291 // Phase 1, operands
7292 auto op1 = model->addOperand(&type26);
7293 auto axis = model->addOperand(&type1);
7294 auto op2 = model->addOperand(&type45);
7295 // Phase 2, operations
7296 static int32_t axis_init[] = {-1};
7297 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7298 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7299 // Phase 3, inputs and outputs
7300 model->identifyInputsAndOutputs(
7301 {op1},
7302 {op2});
7303 // Phase 4: set relaxed execution
7304 model->relaxComputationFloat32toFloat16(true);
7305 assert(model->isValid());
7306 }
7307
is_ignored_dynamic_output_shape_relaxed_dim3_axis2_neg_float16(int i)7308 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis2_neg_float16(int i) {
7309 static std::set<int> ignore = {};
7310 return ignore.find(i) != ignore.end();
7311 }
7312
CreateModel_dynamic_output_shape_relaxed_dim3_axis2_neg_quant8(Model * model)7313 void CreateModel_dynamic_output_shape_relaxed_dim3_axis2_neg_quant8(Model *model) {
7314 OperandType type1(Type::INT32, {});
7315 OperandType type27(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3}, 0.1f, 32);
7316 OperandType type46(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.0078125f, 128);
7317 // Phase 1, operands
7318 auto op1 = model->addOperand(&type27);
7319 auto axis = model->addOperand(&type1);
7320 auto op2 = model->addOperand(&type46);
7321 // Phase 2, operations
7322 static int32_t axis_init[] = {-1};
7323 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7324 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7325 // Phase 3, inputs and outputs
7326 model->identifyInputsAndOutputs(
7327 {op1},
7328 {op2});
7329 // Phase 4: set relaxed execution
7330 model->relaxComputationFloat32toFloat16(true);
7331 assert(model->isValid());
7332 }
7333
is_ignored_dynamic_output_shape_relaxed_dim3_axis2_neg_quant8(int i)7334 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis2_neg_quant8(int i) {
7335 static std::set<int> ignore = {};
7336 return ignore.find(i) != ignore.end();
7337 }
7338
CreateModel_dynamic_output_shape_relaxed_dim2_axis0(Model * model)7339 void CreateModel_dynamic_output_shape_relaxed_dim2_axis0(Model *model) {
7340 OperandType type1(Type::INT32, {});
7341 OperandType type29(Type::TENSOR_FLOAT32, {3, 2});
7342 OperandType type47(Type::TENSOR_FLOAT32, {0, 0});
7343 // Phase 1, operands
7344 auto op1 = model->addOperand(&type29);
7345 auto axis = model->addOperand(&type1);
7346 auto op2 = model->addOperand(&type47);
7347 // Phase 2, operations
7348 static int32_t axis_init[] = {0};
7349 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7350 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7351 // Phase 3, inputs and outputs
7352 model->identifyInputsAndOutputs(
7353 {op1},
7354 {op2});
7355 // Phase 4: set relaxed execution
7356 model->relaxComputationFloat32toFloat16(true);
7357 assert(model->isValid());
7358 }
7359
is_ignored_dynamic_output_shape_relaxed_dim2_axis0(int i)7360 inline bool is_ignored_dynamic_output_shape_relaxed_dim2_axis0(int i) {
7361 static std::set<int> ignore = {};
7362 return ignore.find(i) != ignore.end();
7363 }
7364
CreateModel_dynamic_output_shape_relaxed_dim2_axis0_relaxed(Model * model)7365 void CreateModel_dynamic_output_shape_relaxed_dim2_axis0_relaxed(Model *model) {
7366 OperandType type1(Type::INT32, {});
7367 OperandType type29(Type::TENSOR_FLOAT32, {3, 2});
7368 OperandType type47(Type::TENSOR_FLOAT32, {0, 0});
7369 // Phase 1, operands
7370 auto op1 = model->addOperand(&type29);
7371 auto axis = model->addOperand(&type1);
7372 auto op2 = model->addOperand(&type47);
7373 // Phase 2, operations
7374 static int32_t axis_init[] = {0};
7375 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7376 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7377 // Phase 3, inputs and outputs
7378 model->identifyInputsAndOutputs(
7379 {op1},
7380 {op2});
7381 // Phase 4: set relaxed execution
7382 model->relaxComputationFloat32toFloat16(true);
7383 assert(model->isValid());
7384 }
7385
is_ignored_dynamic_output_shape_relaxed_dim2_axis0_relaxed(int i)7386 inline bool is_ignored_dynamic_output_shape_relaxed_dim2_axis0_relaxed(int i) {
7387 static std::set<int> ignore = {};
7388 return ignore.find(i) != ignore.end();
7389 }
7390
CreateModel_dynamic_output_shape_relaxed_dim2_axis0_float16(Model * model)7391 void CreateModel_dynamic_output_shape_relaxed_dim2_axis0_float16(Model *model) {
7392 OperandType type1(Type::INT32, {});
7393 OperandType type30(Type::TENSOR_FLOAT16, {3, 2});
7394 OperandType type48(Type::TENSOR_FLOAT16, {0, 0});
7395 // Phase 1, operands
7396 auto op1 = model->addOperand(&type30);
7397 auto axis = model->addOperand(&type1);
7398 auto op2 = model->addOperand(&type48);
7399 // Phase 2, operations
7400 static int32_t axis_init[] = {0};
7401 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7402 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7403 // Phase 3, inputs and outputs
7404 model->identifyInputsAndOutputs(
7405 {op1},
7406 {op2});
7407 // Phase 4: set relaxed execution
7408 model->relaxComputationFloat32toFloat16(true);
7409 assert(model->isValid());
7410 }
7411
is_ignored_dynamic_output_shape_relaxed_dim2_axis0_float16(int i)7412 inline bool is_ignored_dynamic_output_shape_relaxed_dim2_axis0_float16(int i) {
7413 static std::set<int> ignore = {};
7414 return ignore.find(i) != ignore.end();
7415 }
7416
CreateModel_dynamic_output_shape_relaxed_dim2_axis0_quant8(Model * model)7417 void CreateModel_dynamic_output_shape_relaxed_dim2_axis0_quant8(Model *model) {
7418 OperandType type1(Type::INT32, {});
7419 OperandType type31(Type::TENSOR_QUANT8_ASYMM, {3, 2}, 0.1f, 32);
7420 OperandType type49(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 0.0078125f, 128);
7421 // Phase 1, operands
7422 auto op1 = model->addOperand(&type31);
7423 auto axis = model->addOperand(&type1);
7424 auto op2 = model->addOperand(&type49);
7425 // Phase 2, operations
7426 static int32_t axis_init[] = {0};
7427 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7428 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7429 // Phase 3, inputs and outputs
7430 model->identifyInputsAndOutputs(
7431 {op1},
7432 {op2});
7433 // Phase 4: set relaxed execution
7434 model->relaxComputationFloat32toFloat16(true);
7435 assert(model->isValid());
7436 }
7437
is_ignored_dynamic_output_shape_relaxed_dim2_axis0_quant8(int i)7438 inline bool is_ignored_dynamic_output_shape_relaxed_dim2_axis0_quant8(int i) {
7439 static std::set<int> ignore = {};
7440 return ignore.find(i) != ignore.end();
7441 }
7442
CreateModel_dynamic_output_shape_relaxed_dim2_axis0_neg(Model * model)7443 void CreateModel_dynamic_output_shape_relaxed_dim2_axis0_neg(Model *model) {
7444 OperandType type1(Type::INT32, {});
7445 OperandType type29(Type::TENSOR_FLOAT32, {3, 2});
7446 OperandType type47(Type::TENSOR_FLOAT32, {0, 0});
7447 // Phase 1, operands
7448 auto op1 = model->addOperand(&type29);
7449 auto axis = model->addOperand(&type1);
7450 auto op2 = model->addOperand(&type47);
7451 // Phase 2, operations
7452 static int32_t axis_init[] = {-2};
7453 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7454 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7455 // Phase 3, inputs and outputs
7456 model->identifyInputsAndOutputs(
7457 {op1},
7458 {op2});
7459 // Phase 4: set relaxed execution
7460 model->relaxComputationFloat32toFloat16(true);
7461 assert(model->isValid());
7462 }
7463
is_ignored_dynamic_output_shape_relaxed_dim2_axis0_neg(int i)7464 inline bool is_ignored_dynamic_output_shape_relaxed_dim2_axis0_neg(int i) {
7465 static std::set<int> ignore = {};
7466 return ignore.find(i) != ignore.end();
7467 }
7468
CreateModel_dynamic_output_shape_relaxed_dim2_axis0_neg_relaxed(Model * model)7469 void CreateModel_dynamic_output_shape_relaxed_dim2_axis0_neg_relaxed(Model *model) {
7470 OperandType type1(Type::INT32, {});
7471 OperandType type29(Type::TENSOR_FLOAT32, {3, 2});
7472 OperandType type47(Type::TENSOR_FLOAT32, {0, 0});
7473 // Phase 1, operands
7474 auto op1 = model->addOperand(&type29);
7475 auto axis = model->addOperand(&type1);
7476 auto op2 = model->addOperand(&type47);
7477 // Phase 2, operations
7478 static int32_t axis_init[] = {-2};
7479 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7480 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7481 // Phase 3, inputs and outputs
7482 model->identifyInputsAndOutputs(
7483 {op1},
7484 {op2});
7485 // Phase 4: set relaxed execution
7486 model->relaxComputationFloat32toFloat16(true);
7487 assert(model->isValid());
7488 }
7489
is_ignored_dynamic_output_shape_relaxed_dim2_axis0_neg_relaxed(int i)7490 inline bool is_ignored_dynamic_output_shape_relaxed_dim2_axis0_neg_relaxed(int i) {
7491 static std::set<int> ignore = {};
7492 return ignore.find(i) != ignore.end();
7493 }
7494
CreateModel_dynamic_output_shape_relaxed_dim2_axis0_neg_float16(Model * model)7495 void CreateModel_dynamic_output_shape_relaxed_dim2_axis0_neg_float16(Model *model) {
7496 OperandType type1(Type::INT32, {});
7497 OperandType type30(Type::TENSOR_FLOAT16, {3, 2});
7498 OperandType type48(Type::TENSOR_FLOAT16, {0, 0});
7499 // Phase 1, operands
7500 auto op1 = model->addOperand(&type30);
7501 auto axis = model->addOperand(&type1);
7502 auto op2 = model->addOperand(&type48);
7503 // Phase 2, operations
7504 static int32_t axis_init[] = {-2};
7505 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7506 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7507 // Phase 3, inputs and outputs
7508 model->identifyInputsAndOutputs(
7509 {op1},
7510 {op2});
7511 // Phase 4: set relaxed execution
7512 model->relaxComputationFloat32toFloat16(true);
7513 assert(model->isValid());
7514 }
7515
is_ignored_dynamic_output_shape_relaxed_dim2_axis0_neg_float16(int i)7516 inline bool is_ignored_dynamic_output_shape_relaxed_dim2_axis0_neg_float16(int i) {
7517 static std::set<int> ignore = {};
7518 return ignore.find(i) != ignore.end();
7519 }
7520
CreateModel_dynamic_output_shape_relaxed_dim2_axis0_neg_quant8(Model * model)7521 void CreateModel_dynamic_output_shape_relaxed_dim2_axis0_neg_quant8(Model *model) {
7522 OperandType type1(Type::INT32, {});
7523 OperandType type31(Type::TENSOR_QUANT8_ASYMM, {3, 2}, 0.1f, 32);
7524 OperandType type49(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 0.0078125f, 128);
7525 // Phase 1, operands
7526 auto op1 = model->addOperand(&type31);
7527 auto axis = model->addOperand(&type1);
7528 auto op2 = model->addOperand(&type49);
7529 // Phase 2, operations
7530 static int32_t axis_init[] = {-2};
7531 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7532 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7533 // Phase 3, inputs and outputs
7534 model->identifyInputsAndOutputs(
7535 {op1},
7536 {op2});
7537 // Phase 4: set relaxed execution
7538 model->relaxComputationFloat32toFloat16(true);
7539 assert(model->isValid());
7540 }
7541
is_ignored_dynamic_output_shape_relaxed_dim2_axis0_neg_quant8(int i)7542 inline bool is_ignored_dynamic_output_shape_relaxed_dim2_axis0_neg_quant8(int i) {
7543 static std::set<int> ignore = {};
7544 return ignore.find(i) != ignore.end();
7545 }
7546
CreateModel_dynamic_output_shape_relaxed_dim2_axis1(Model * model)7547 void CreateModel_dynamic_output_shape_relaxed_dim2_axis1(Model *model) {
7548 OperandType type1(Type::INT32, {});
7549 OperandType type33(Type::TENSOR_FLOAT32, {2, 3});
7550 OperandType type47(Type::TENSOR_FLOAT32, {0, 0});
7551 // Phase 1, operands
7552 auto op1 = model->addOperand(&type33);
7553 auto axis = model->addOperand(&type1);
7554 auto op2 = model->addOperand(&type47);
7555 // Phase 2, operations
7556 static int32_t axis_init[] = {1};
7557 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7558 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7559 // Phase 3, inputs and outputs
7560 model->identifyInputsAndOutputs(
7561 {op1},
7562 {op2});
7563 // Phase 4: set relaxed execution
7564 model->relaxComputationFloat32toFloat16(true);
7565 assert(model->isValid());
7566 }
7567
is_ignored_dynamic_output_shape_relaxed_dim2_axis1(int i)7568 inline bool is_ignored_dynamic_output_shape_relaxed_dim2_axis1(int i) {
7569 static std::set<int> ignore = {};
7570 return ignore.find(i) != ignore.end();
7571 }
7572
CreateModel_dynamic_output_shape_relaxed_dim2_axis1_relaxed(Model * model)7573 void CreateModel_dynamic_output_shape_relaxed_dim2_axis1_relaxed(Model *model) {
7574 OperandType type1(Type::INT32, {});
7575 OperandType type33(Type::TENSOR_FLOAT32, {2, 3});
7576 OperandType type47(Type::TENSOR_FLOAT32, {0, 0});
7577 // Phase 1, operands
7578 auto op1 = model->addOperand(&type33);
7579 auto axis = model->addOperand(&type1);
7580 auto op2 = model->addOperand(&type47);
7581 // Phase 2, operations
7582 static int32_t axis_init[] = {1};
7583 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7584 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7585 // Phase 3, inputs and outputs
7586 model->identifyInputsAndOutputs(
7587 {op1},
7588 {op2});
7589 // Phase 4: set relaxed execution
7590 model->relaxComputationFloat32toFloat16(true);
7591 assert(model->isValid());
7592 }
7593
is_ignored_dynamic_output_shape_relaxed_dim2_axis1_relaxed(int i)7594 inline bool is_ignored_dynamic_output_shape_relaxed_dim2_axis1_relaxed(int i) {
7595 static std::set<int> ignore = {};
7596 return ignore.find(i) != ignore.end();
7597 }
7598
CreateModel_dynamic_output_shape_relaxed_dim2_axis1_float16(Model * model)7599 void CreateModel_dynamic_output_shape_relaxed_dim2_axis1_float16(Model *model) {
7600 OperandType type1(Type::INT32, {});
7601 OperandType type34(Type::TENSOR_FLOAT16, {2, 3});
7602 OperandType type48(Type::TENSOR_FLOAT16, {0, 0});
7603 // Phase 1, operands
7604 auto op1 = model->addOperand(&type34);
7605 auto axis = model->addOperand(&type1);
7606 auto op2 = model->addOperand(&type48);
7607 // Phase 2, operations
7608 static int32_t axis_init[] = {1};
7609 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7610 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7611 // Phase 3, inputs and outputs
7612 model->identifyInputsAndOutputs(
7613 {op1},
7614 {op2});
7615 // Phase 4: set relaxed execution
7616 model->relaxComputationFloat32toFloat16(true);
7617 assert(model->isValid());
7618 }
7619
is_ignored_dynamic_output_shape_relaxed_dim2_axis1_float16(int i)7620 inline bool is_ignored_dynamic_output_shape_relaxed_dim2_axis1_float16(int i) {
7621 static std::set<int> ignore = {};
7622 return ignore.find(i) != ignore.end();
7623 }
7624
CreateModel_dynamic_output_shape_relaxed_dim2_axis1_quant8(Model * model)7625 void CreateModel_dynamic_output_shape_relaxed_dim2_axis1_quant8(Model *model) {
7626 OperandType type1(Type::INT32, {});
7627 OperandType type35(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 0.1f, 32);
7628 OperandType type49(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 0.0078125f, 128);
7629 // Phase 1, operands
7630 auto op1 = model->addOperand(&type35);
7631 auto axis = model->addOperand(&type1);
7632 auto op2 = model->addOperand(&type49);
7633 // Phase 2, operations
7634 static int32_t axis_init[] = {1};
7635 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7636 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7637 // Phase 3, inputs and outputs
7638 model->identifyInputsAndOutputs(
7639 {op1},
7640 {op2});
7641 // Phase 4: set relaxed execution
7642 model->relaxComputationFloat32toFloat16(true);
7643 assert(model->isValid());
7644 }
7645
is_ignored_dynamic_output_shape_relaxed_dim2_axis1_quant8(int i)7646 inline bool is_ignored_dynamic_output_shape_relaxed_dim2_axis1_quant8(int i) {
7647 static std::set<int> ignore = {};
7648 return ignore.find(i) != ignore.end();
7649 }
7650
CreateModel_dynamic_output_shape_relaxed_dim2_axis1_neg(Model * model)7651 void CreateModel_dynamic_output_shape_relaxed_dim2_axis1_neg(Model *model) {
7652 OperandType type1(Type::INT32, {});
7653 OperandType type33(Type::TENSOR_FLOAT32, {2, 3});
7654 OperandType type47(Type::TENSOR_FLOAT32, {0, 0});
7655 // Phase 1, operands
7656 auto op1 = model->addOperand(&type33);
7657 auto axis = model->addOperand(&type1);
7658 auto op2 = model->addOperand(&type47);
7659 // Phase 2, operations
7660 static int32_t axis_init[] = {-1};
7661 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7662 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7663 // Phase 3, inputs and outputs
7664 model->identifyInputsAndOutputs(
7665 {op1},
7666 {op2});
7667 // Phase 4: set relaxed execution
7668 model->relaxComputationFloat32toFloat16(true);
7669 assert(model->isValid());
7670 }
7671
is_ignored_dynamic_output_shape_relaxed_dim2_axis1_neg(int i)7672 inline bool is_ignored_dynamic_output_shape_relaxed_dim2_axis1_neg(int i) {
7673 static std::set<int> ignore = {};
7674 return ignore.find(i) != ignore.end();
7675 }
7676
CreateModel_dynamic_output_shape_relaxed_dim2_axis1_neg_relaxed(Model * model)7677 void CreateModel_dynamic_output_shape_relaxed_dim2_axis1_neg_relaxed(Model *model) {
7678 OperandType type1(Type::INT32, {});
7679 OperandType type33(Type::TENSOR_FLOAT32, {2, 3});
7680 OperandType type47(Type::TENSOR_FLOAT32, {0, 0});
7681 // Phase 1, operands
7682 auto op1 = model->addOperand(&type33);
7683 auto axis = model->addOperand(&type1);
7684 auto op2 = model->addOperand(&type47);
7685 // Phase 2, operations
7686 static int32_t axis_init[] = {-1};
7687 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7688 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7689 // Phase 3, inputs and outputs
7690 model->identifyInputsAndOutputs(
7691 {op1},
7692 {op2});
7693 // Phase 4: set relaxed execution
7694 model->relaxComputationFloat32toFloat16(true);
7695 assert(model->isValid());
7696 }
7697
is_ignored_dynamic_output_shape_relaxed_dim2_axis1_neg_relaxed(int i)7698 inline bool is_ignored_dynamic_output_shape_relaxed_dim2_axis1_neg_relaxed(int i) {
7699 static std::set<int> ignore = {};
7700 return ignore.find(i) != ignore.end();
7701 }
7702
CreateModel_dynamic_output_shape_relaxed_dim2_axis1_neg_float16(Model * model)7703 void CreateModel_dynamic_output_shape_relaxed_dim2_axis1_neg_float16(Model *model) {
7704 OperandType type1(Type::INT32, {});
7705 OperandType type34(Type::TENSOR_FLOAT16, {2, 3});
7706 OperandType type48(Type::TENSOR_FLOAT16, {0, 0});
7707 // Phase 1, operands
7708 auto op1 = model->addOperand(&type34);
7709 auto axis = model->addOperand(&type1);
7710 auto op2 = model->addOperand(&type48);
7711 // Phase 2, operations
7712 static int32_t axis_init[] = {-1};
7713 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7714 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7715 // Phase 3, inputs and outputs
7716 model->identifyInputsAndOutputs(
7717 {op1},
7718 {op2});
7719 // Phase 4: set relaxed execution
7720 model->relaxComputationFloat32toFloat16(true);
7721 assert(model->isValid());
7722 }
7723
is_ignored_dynamic_output_shape_relaxed_dim2_axis1_neg_float16(int i)7724 inline bool is_ignored_dynamic_output_shape_relaxed_dim2_axis1_neg_float16(int i) {
7725 static std::set<int> ignore = {};
7726 return ignore.find(i) != ignore.end();
7727 }
7728
CreateModel_dynamic_output_shape_relaxed_dim2_axis1_neg_quant8(Model * model)7729 void CreateModel_dynamic_output_shape_relaxed_dim2_axis1_neg_quant8(Model *model) {
7730 OperandType type1(Type::INT32, {});
7731 OperandType type35(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 0.1f, 32);
7732 OperandType type49(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 0.0078125f, 128);
7733 // Phase 1, operands
7734 auto op1 = model->addOperand(&type35);
7735 auto axis = model->addOperand(&type1);
7736 auto op2 = model->addOperand(&type49);
7737 // Phase 2, operations
7738 static int32_t axis_init[] = {-1};
7739 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7740 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7741 // Phase 3, inputs and outputs
7742 model->identifyInputsAndOutputs(
7743 {op1},
7744 {op2});
7745 // Phase 4: set relaxed execution
7746 model->relaxComputationFloat32toFloat16(true);
7747 assert(model->isValid());
7748 }
7749
is_ignored_dynamic_output_shape_relaxed_dim2_axis1_neg_quant8(int i)7750 inline bool is_ignored_dynamic_output_shape_relaxed_dim2_axis1_neg_quant8(int i) {
7751 static std::set<int> ignore = {};
7752 return ignore.find(i) != ignore.end();
7753 }
7754
CreateModel_dynamic_output_shape_relaxed_dim1_axis0(Model * model)7755 void CreateModel_dynamic_output_shape_relaxed_dim1_axis0(Model *model) {
7756 OperandType type1(Type::INT32, {});
7757 OperandType type37(Type::TENSOR_FLOAT32, {3});
7758 OperandType type50(Type::TENSOR_FLOAT32, {0});
7759 // Phase 1, operands
7760 auto op1 = model->addOperand(&type37);
7761 auto axis = model->addOperand(&type1);
7762 auto op2 = model->addOperand(&type50);
7763 // Phase 2, operations
7764 static int32_t axis_init[] = {0};
7765 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7766 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7767 // Phase 3, inputs and outputs
7768 model->identifyInputsAndOutputs(
7769 {op1},
7770 {op2});
7771 // Phase 4: set relaxed execution
7772 model->relaxComputationFloat32toFloat16(true);
7773 assert(model->isValid());
7774 }
7775
is_ignored_dynamic_output_shape_relaxed_dim1_axis0(int i)7776 inline bool is_ignored_dynamic_output_shape_relaxed_dim1_axis0(int i) {
7777 static std::set<int> ignore = {};
7778 return ignore.find(i) != ignore.end();
7779 }
7780
CreateModel_dynamic_output_shape_relaxed_dim1_axis0_relaxed(Model * model)7781 void CreateModel_dynamic_output_shape_relaxed_dim1_axis0_relaxed(Model *model) {
7782 OperandType type1(Type::INT32, {});
7783 OperandType type37(Type::TENSOR_FLOAT32, {3});
7784 OperandType type50(Type::TENSOR_FLOAT32, {0});
7785 // Phase 1, operands
7786 auto op1 = model->addOperand(&type37);
7787 auto axis = model->addOperand(&type1);
7788 auto op2 = model->addOperand(&type50);
7789 // Phase 2, operations
7790 static int32_t axis_init[] = {0};
7791 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7792 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7793 // Phase 3, inputs and outputs
7794 model->identifyInputsAndOutputs(
7795 {op1},
7796 {op2});
7797 // Phase 4: set relaxed execution
7798 model->relaxComputationFloat32toFloat16(true);
7799 assert(model->isValid());
7800 }
7801
is_ignored_dynamic_output_shape_relaxed_dim1_axis0_relaxed(int i)7802 inline bool is_ignored_dynamic_output_shape_relaxed_dim1_axis0_relaxed(int i) {
7803 static std::set<int> ignore = {};
7804 return ignore.find(i) != ignore.end();
7805 }
7806
CreateModel_dynamic_output_shape_relaxed_dim1_axis0_float16(Model * model)7807 void CreateModel_dynamic_output_shape_relaxed_dim1_axis0_float16(Model *model) {
7808 OperandType type1(Type::INT32, {});
7809 OperandType type38(Type::TENSOR_FLOAT16, {3});
7810 OperandType type51(Type::TENSOR_FLOAT16, {0});
7811 // Phase 1, operands
7812 auto op1 = model->addOperand(&type38);
7813 auto axis = model->addOperand(&type1);
7814 auto op2 = model->addOperand(&type51);
7815 // Phase 2, operations
7816 static int32_t axis_init[] = {0};
7817 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7818 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7819 // Phase 3, inputs and outputs
7820 model->identifyInputsAndOutputs(
7821 {op1},
7822 {op2});
7823 // Phase 4: set relaxed execution
7824 model->relaxComputationFloat32toFloat16(true);
7825 assert(model->isValid());
7826 }
7827
is_ignored_dynamic_output_shape_relaxed_dim1_axis0_float16(int i)7828 inline bool is_ignored_dynamic_output_shape_relaxed_dim1_axis0_float16(int i) {
7829 static std::set<int> ignore = {};
7830 return ignore.find(i) != ignore.end();
7831 }
7832
CreateModel_dynamic_output_shape_relaxed_dim1_axis0_quant8(Model * model)7833 void CreateModel_dynamic_output_shape_relaxed_dim1_axis0_quant8(Model *model) {
7834 OperandType type1(Type::INT32, {});
7835 OperandType type39(Type::TENSOR_QUANT8_ASYMM, {3}, 0.1f, 32);
7836 OperandType type52(Type::TENSOR_QUANT8_ASYMM, {0}, 0.0078125f, 128);
7837 // Phase 1, operands
7838 auto op1 = model->addOperand(&type39);
7839 auto axis = model->addOperand(&type1);
7840 auto op2 = model->addOperand(&type52);
7841 // Phase 2, operations
7842 static int32_t axis_init[] = {0};
7843 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7844 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7845 // Phase 3, inputs and outputs
7846 model->identifyInputsAndOutputs(
7847 {op1},
7848 {op2});
7849 // Phase 4: set relaxed execution
7850 model->relaxComputationFloat32toFloat16(true);
7851 assert(model->isValid());
7852 }
7853
is_ignored_dynamic_output_shape_relaxed_dim1_axis0_quant8(int i)7854 inline bool is_ignored_dynamic_output_shape_relaxed_dim1_axis0_quant8(int i) {
7855 static std::set<int> ignore = {};
7856 return ignore.find(i) != ignore.end();
7857 }
7858
CreateModel_dynamic_output_shape_relaxed_dim1_axis0_neg(Model * model)7859 void CreateModel_dynamic_output_shape_relaxed_dim1_axis0_neg(Model *model) {
7860 OperandType type1(Type::INT32, {});
7861 OperandType type37(Type::TENSOR_FLOAT32, {3});
7862 OperandType type50(Type::TENSOR_FLOAT32, {0});
7863 // Phase 1, operands
7864 auto op1 = model->addOperand(&type37);
7865 auto axis = model->addOperand(&type1);
7866 auto op2 = model->addOperand(&type50);
7867 // Phase 2, operations
7868 static int32_t axis_init[] = {-1};
7869 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7870 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7871 // Phase 3, inputs and outputs
7872 model->identifyInputsAndOutputs(
7873 {op1},
7874 {op2});
7875 // Phase 4: set relaxed execution
7876 model->relaxComputationFloat32toFloat16(true);
7877 assert(model->isValid());
7878 }
7879
is_ignored_dynamic_output_shape_relaxed_dim1_axis0_neg(int i)7880 inline bool is_ignored_dynamic_output_shape_relaxed_dim1_axis0_neg(int i) {
7881 static std::set<int> ignore = {};
7882 return ignore.find(i) != ignore.end();
7883 }
7884
CreateModel_dynamic_output_shape_relaxed_dim1_axis0_neg_relaxed(Model * model)7885 void CreateModel_dynamic_output_shape_relaxed_dim1_axis0_neg_relaxed(Model *model) {
7886 OperandType type1(Type::INT32, {});
7887 OperandType type37(Type::TENSOR_FLOAT32, {3});
7888 OperandType type50(Type::TENSOR_FLOAT32, {0});
7889 // Phase 1, operands
7890 auto op1 = model->addOperand(&type37);
7891 auto axis = model->addOperand(&type1);
7892 auto op2 = model->addOperand(&type50);
7893 // Phase 2, operations
7894 static int32_t axis_init[] = {-1};
7895 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7896 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7897 // Phase 3, inputs and outputs
7898 model->identifyInputsAndOutputs(
7899 {op1},
7900 {op2});
7901 // Phase 4: set relaxed execution
7902 model->relaxComputationFloat32toFloat16(true);
7903 assert(model->isValid());
7904 }
7905
is_ignored_dynamic_output_shape_relaxed_dim1_axis0_neg_relaxed(int i)7906 inline bool is_ignored_dynamic_output_shape_relaxed_dim1_axis0_neg_relaxed(int i) {
7907 static std::set<int> ignore = {};
7908 return ignore.find(i) != ignore.end();
7909 }
7910
CreateModel_dynamic_output_shape_relaxed_dim1_axis0_neg_float16(Model * model)7911 void CreateModel_dynamic_output_shape_relaxed_dim1_axis0_neg_float16(Model *model) {
7912 OperandType type1(Type::INT32, {});
7913 OperandType type38(Type::TENSOR_FLOAT16, {3});
7914 OperandType type51(Type::TENSOR_FLOAT16, {0});
7915 // Phase 1, operands
7916 auto op1 = model->addOperand(&type38);
7917 auto axis = model->addOperand(&type1);
7918 auto op2 = model->addOperand(&type51);
7919 // Phase 2, operations
7920 static int32_t axis_init[] = {-1};
7921 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7922 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7923 // Phase 3, inputs and outputs
7924 model->identifyInputsAndOutputs(
7925 {op1},
7926 {op2});
7927 // Phase 4: set relaxed execution
7928 model->relaxComputationFloat32toFloat16(true);
7929 assert(model->isValid());
7930 }
7931
is_ignored_dynamic_output_shape_relaxed_dim1_axis0_neg_float16(int i)7932 inline bool is_ignored_dynamic_output_shape_relaxed_dim1_axis0_neg_float16(int i) {
7933 static std::set<int> ignore = {};
7934 return ignore.find(i) != ignore.end();
7935 }
7936
CreateModel_dynamic_output_shape_relaxed_dim1_axis0_neg_quant8(Model * model)7937 void CreateModel_dynamic_output_shape_relaxed_dim1_axis0_neg_quant8(Model *model) {
7938 OperandType type1(Type::INT32, {});
7939 OperandType type39(Type::TENSOR_QUANT8_ASYMM, {3}, 0.1f, 32);
7940 OperandType type52(Type::TENSOR_QUANT8_ASYMM, {0}, 0.0078125f, 128);
7941 // Phase 1, operands
7942 auto op1 = model->addOperand(&type39);
7943 auto axis = model->addOperand(&type1);
7944 auto op2 = model->addOperand(&type52);
7945 // Phase 2, operations
7946 static int32_t axis_init[] = {-1};
7947 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7948 model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1, axis}, {op2});
7949 // Phase 3, inputs and outputs
7950 model->identifyInputsAndOutputs(
7951 {op1},
7952 {op2});
7953 // Phase 4: set relaxed execution
7954 model->relaxComputationFloat32toFloat16(true);
7955 assert(model->isValid());
7956 }
7957
is_ignored_dynamic_output_shape_relaxed_dim1_axis0_neg_quant8(int i)7958 inline bool is_ignored_dynamic_output_shape_relaxed_dim1_axis0_neg_quant8(int i) {
7959 static std::set<int> ignore = {};
7960 return ignore.find(i) != ignore.end();
7961 }
7962
7963