1 // clang-format off
2 // Generated file (from: l2_normalization_v1_2.mod.py). Do not edit
CreateModel_dim4_axis3(Model * model)3 void CreateModel_dim4_axis3(Model *model) {
4   OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
5   // Phase 1, operands
6   auto op1 = model->addOperand(&type0);
7   auto op2 = model->addOperand(&type0);
8   // Phase 2, operations
9   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
10   // Phase 3, inputs and outputs
11   model->identifyInputsAndOutputs(
12     {op1},
13     {op2});
14   assert(model->isValid());
15 }
16 
is_ignored_dim4_axis3(int i)17 inline bool is_ignored_dim4_axis3(int i) {
18   static std::set<int> ignore = {};
19   return ignore.find(i) != ignore.end();
20 }
21 
CreateModel_dim4_axis3_relaxed(Model * model)22 void CreateModel_dim4_axis3_relaxed(Model *model) {
23   OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
24   // Phase 1, operands
25   auto op1 = model->addOperand(&type0);
26   auto op2 = model->addOperand(&type0);
27   // Phase 2, operations
28   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
29   // Phase 3, inputs and outputs
30   model->identifyInputsAndOutputs(
31     {op1},
32     {op2});
33   // Phase 4: set relaxed execution
34   model->relaxComputationFloat32toFloat16(true);
35   assert(model->isValid());
36 }
37 
is_ignored_dim4_axis3_relaxed(int i)38 inline bool is_ignored_dim4_axis3_relaxed(int i) {
39   static std::set<int> ignore = {};
40   return ignore.find(i) != ignore.end();
41 }
42 
CreateModel_dim4_axis3_float16(Model * model)43 void CreateModel_dim4_axis3_float16(Model *model) {
44   OperandType type2(Type::TENSOR_FLOAT16, {2, 2, 2, 3});
45   // Phase 1, operands
46   auto op1 = model->addOperand(&type2);
47   auto op2 = model->addOperand(&type2);
48   // Phase 2, operations
49   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
50   // Phase 3, inputs and outputs
51   model->identifyInputsAndOutputs(
52     {op1},
53     {op2});
54   assert(model->isValid());
55 }
56 
is_ignored_dim4_axis3_float16(int i)57 inline bool is_ignored_dim4_axis3_float16(int i) {
58   static std::set<int> ignore = {};
59   return ignore.find(i) != ignore.end();
60 }
61 
CreateModel_dim4_axis3_quant8(Model * model)62 void CreateModel_dim4_axis3_quant8(Model *model) {
63   OperandType type3(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 3}, 0.1f, 32);
64   OperandType type4(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 3}, 0.0078125f, 128);
65   // Phase 1, operands
66   auto op1 = model->addOperand(&type3);
67   auto op2 = model->addOperand(&type4);
68   // Phase 2, operations
69   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
70   // Phase 3, inputs and outputs
71   model->identifyInputsAndOutputs(
72     {op1},
73     {op2});
74   assert(model->isValid());
75 }
76 
is_ignored_dim4_axis3_quant8(int i)77 inline bool is_ignored_dim4_axis3_quant8(int i) {
78   static std::set<int> ignore = {};
79   return ignore.find(i) != ignore.end();
80 }
81 
CreateModel_dim3_axis2(Model * model)82 void CreateModel_dim3_axis2(Model *model) {
83   OperandType type5(Type::TENSOR_FLOAT32, {2, 2, 3});
84   // Phase 1, operands
85   auto op1 = model->addOperand(&type5);
86   auto op2 = model->addOperand(&type5);
87   // Phase 2, operations
88   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
89   // Phase 3, inputs and outputs
90   model->identifyInputsAndOutputs(
91     {op1},
92     {op2});
93   assert(model->isValid());
94 }
95 
is_ignored_dim3_axis2(int i)96 inline bool is_ignored_dim3_axis2(int i) {
97   static std::set<int> ignore = {};
98   return ignore.find(i) != ignore.end();
99 }
100 
CreateModel_dim3_axis2_relaxed(Model * model)101 void CreateModel_dim3_axis2_relaxed(Model *model) {
102   OperandType type5(Type::TENSOR_FLOAT32, {2, 2, 3});
103   // Phase 1, operands
104   auto op1 = model->addOperand(&type5);
105   auto op2 = model->addOperand(&type5);
106   // Phase 2, operations
107   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
108   // Phase 3, inputs and outputs
109   model->identifyInputsAndOutputs(
110     {op1},
111     {op2});
112   // Phase 4: set relaxed execution
113   model->relaxComputationFloat32toFloat16(true);
114   assert(model->isValid());
115 }
116 
is_ignored_dim3_axis2_relaxed(int i)117 inline bool is_ignored_dim3_axis2_relaxed(int i) {
118   static std::set<int> ignore = {};
119   return ignore.find(i) != ignore.end();
120 }
121 
CreateModel_dim3_axis2_float16(Model * model)122 void CreateModel_dim3_axis2_float16(Model *model) {
123   OperandType type6(Type::TENSOR_FLOAT16, {2, 2, 3});
124   // Phase 1, operands
125   auto op1 = model->addOperand(&type6);
126   auto op2 = model->addOperand(&type6);
127   // Phase 2, operations
128   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
129   // Phase 3, inputs and outputs
130   model->identifyInputsAndOutputs(
131     {op1},
132     {op2});
133   assert(model->isValid());
134 }
135 
is_ignored_dim3_axis2_float16(int i)136 inline bool is_ignored_dim3_axis2_float16(int i) {
137   static std::set<int> ignore = {};
138   return ignore.find(i) != ignore.end();
139 }
140 
CreateModel_dim3_axis2_quant8(Model * model)141 void CreateModel_dim3_axis2_quant8(Model *model) {
142   OperandType type7(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3}, 0.1f, 32);
143   OperandType type8(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3}, 0.0078125f, 128);
144   // Phase 1, operands
145   auto op1 = model->addOperand(&type7);
146   auto op2 = model->addOperand(&type8);
147   // Phase 2, operations
148   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
149   // Phase 3, inputs and outputs
150   model->identifyInputsAndOutputs(
151     {op1},
152     {op2});
153   assert(model->isValid());
154 }
155 
is_ignored_dim3_axis2_quant8(int i)156 inline bool is_ignored_dim3_axis2_quant8(int i) {
157   static std::set<int> ignore = {};
158   return ignore.find(i) != ignore.end();
159 }
160 
CreateModel_dim2_axis1(Model * model)161 void CreateModel_dim2_axis1(Model *model) {
162   OperandType type9(Type::TENSOR_FLOAT32, {2, 3});
163   // Phase 1, operands
164   auto op1 = model->addOperand(&type9);
165   auto op2 = model->addOperand(&type9);
166   // Phase 2, operations
167   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
168   // Phase 3, inputs and outputs
169   model->identifyInputsAndOutputs(
170     {op1},
171     {op2});
172   assert(model->isValid());
173 }
174 
is_ignored_dim2_axis1(int i)175 inline bool is_ignored_dim2_axis1(int i) {
176   static std::set<int> ignore = {};
177   return ignore.find(i) != ignore.end();
178 }
179 
CreateModel_dim2_axis1_relaxed(Model * model)180 void CreateModel_dim2_axis1_relaxed(Model *model) {
181   OperandType type9(Type::TENSOR_FLOAT32, {2, 3});
182   // Phase 1, operands
183   auto op1 = model->addOperand(&type9);
184   auto op2 = model->addOperand(&type9);
185   // Phase 2, operations
186   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
187   // Phase 3, inputs and outputs
188   model->identifyInputsAndOutputs(
189     {op1},
190     {op2});
191   // Phase 4: set relaxed execution
192   model->relaxComputationFloat32toFloat16(true);
193   assert(model->isValid());
194 }
195 
is_ignored_dim2_axis1_relaxed(int i)196 inline bool is_ignored_dim2_axis1_relaxed(int i) {
197   static std::set<int> ignore = {};
198   return ignore.find(i) != ignore.end();
199 }
200 
CreateModel_dim2_axis1_float16(Model * model)201 void CreateModel_dim2_axis1_float16(Model *model) {
202   OperandType type10(Type::TENSOR_FLOAT16, {2, 3});
203   // Phase 1, operands
204   auto op1 = model->addOperand(&type10);
205   auto op2 = model->addOperand(&type10);
206   // Phase 2, operations
207   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
208   // Phase 3, inputs and outputs
209   model->identifyInputsAndOutputs(
210     {op1},
211     {op2});
212   assert(model->isValid());
213 }
214 
is_ignored_dim2_axis1_float16(int i)215 inline bool is_ignored_dim2_axis1_float16(int i) {
216   static std::set<int> ignore = {};
217   return ignore.find(i) != ignore.end();
218 }
219 
CreateModel_dim2_axis1_quant8(Model * model)220 void CreateModel_dim2_axis1_quant8(Model *model) {
221   OperandType type11(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 0.1f, 32);
222   OperandType type12(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 0.0078125f, 128);
223   // Phase 1, operands
224   auto op1 = model->addOperand(&type11);
225   auto op2 = model->addOperand(&type12);
226   // Phase 2, operations
227   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
228   // Phase 3, inputs and outputs
229   model->identifyInputsAndOutputs(
230     {op1},
231     {op2});
232   assert(model->isValid());
233 }
234 
is_ignored_dim2_axis1_quant8(int i)235 inline bool is_ignored_dim2_axis1_quant8(int i) {
236   static std::set<int> ignore = {};
237   return ignore.find(i) != ignore.end();
238 }
239 
CreateModel_dim1_axis0(Model * model)240 void CreateModel_dim1_axis0(Model *model) {
241   OperandType type13(Type::TENSOR_FLOAT32, {3});
242   // Phase 1, operands
243   auto op1 = model->addOperand(&type13);
244   auto op2 = model->addOperand(&type13);
245   // Phase 2, operations
246   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
247   // Phase 3, inputs and outputs
248   model->identifyInputsAndOutputs(
249     {op1},
250     {op2});
251   assert(model->isValid());
252 }
253 
is_ignored_dim1_axis0(int i)254 inline bool is_ignored_dim1_axis0(int i) {
255   static std::set<int> ignore = {};
256   return ignore.find(i) != ignore.end();
257 }
258 
CreateModel_dim1_axis0_relaxed(Model * model)259 void CreateModel_dim1_axis0_relaxed(Model *model) {
260   OperandType type13(Type::TENSOR_FLOAT32, {3});
261   // Phase 1, operands
262   auto op1 = model->addOperand(&type13);
263   auto op2 = model->addOperand(&type13);
264   // Phase 2, operations
265   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
266   // Phase 3, inputs and outputs
267   model->identifyInputsAndOutputs(
268     {op1},
269     {op2});
270   // Phase 4: set relaxed execution
271   model->relaxComputationFloat32toFloat16(true);
272   assert(model->isValid());
273 }
274 
is_ignored_dim1_axis0_relaxed(int i)275 inline bool is_ignored_dim1_axis0_relaxed(int i) {
276   static std::set<int> ignore = {};
277   return ignore.find(i) != ignore.end();
278 }
279 
CreateModel_dim1_axis0_float16(Model * model)280 void CreateModel_dim1_axis0_float16(Model *model) {
281   OperandType type14(Type::TENSOR_FLOAT16, {3});
282   // Phase 1, operands
283   auto op1 = model->addOperand(&type14);
284   auto op2 = model->addOperand(&type14);
285   // Phase 2, operations
286   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
287   // Phase 3, inputs and outputs
288   model->identifyInputsAndOutputs(
289     {op1},
290     {op2});
291   assert(model->isValid());
292 }
293 
is_ignored_dim1_axis0_float16(int i)294 inline bool is_ignored_dim1_axis0_float16(int i) {
295   static std::set<int> ignore = {};
296   return ignore.find(i) != ignore.end();
297 }
298 
CreateModel_dim1_axis0_quant8(Model * model)299 void CreateModel_dim1_axis0_quant8(Model *model) {
300   OperandType type15(Type::TENSOR_QUANT8_ASYMM, {3}, 0.1f, 32);
301   OperandType type16(Type::TENSOR_QUANT8_ASYMM, {3}, 0.0078125f, 128);
302   // Phase 1, operands
303   auto op1 = model->addOperand(&type15);
304   auto op2 = model->addOperand(&type16);
305   // Phase 2, operations
306   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
307   // Phase 3, inputs and outputs
308   model->identifyInputsAndOutputs(
309     {op1},
310     {op2});
311   assert(model->isValid());
312 }
313 
is_ignored_dim1_axis0_quant8(int i)314 inline bool is_ignored_dim1_axis0_quant8(int i) {
315   static std::set<int> ignore = {};
316   return ignore.find(i) != ignore.end();
317 }
318 
CreateModel_relaxed_dim4_axis3(Model * model)319 void CreateModel_relaxed_dim4_axis3(Model *model) {
320   OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
321   // Phase 1, operands
322   auto op1 = model->addOperand(&type0);
323   auto op2 = model->addOperand(&type0);
324   // Phase 2, operations
325   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
326   // Phase 3, inputs and outputs
327   model->identifyInputsAndOutputs(
328     {op1},
329     {op2});
330   // Phase 4: set relaxed execution
331   model->relaxComputationFloat32toFloat16(true);
332   assert(model->isValid());
333 }
334 
is_ignored_relaxed_dim4_axis3(int i)335 inline bool is_ignored_relaxed_dim4_axis3(int i) {
336   static std::set<int> ignore = {};
337   return ignore.find(i) != ignore.end();
338 }
339 
CreateModel_relaxed_dim4_axis3_relaxed(Model * model)340 void CreateModel_relaxed_dim4_axis3_relaxed(Model *model) {
341   OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
342   // Phase 1, operands
343   auto op1 = model->addOperand(&type0);
344   auto op2 = model->addOperand(&type0);
345   // Phase 2, operations
346   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
347   // Phase 3, inputs and outputs
348   model->identifyInputsAndOutputs(
349     {op1},
350     {op2});
351   // Phase 4: set relaxed execution
352   model->relaxComputationFloat32toFloat16(true);
353   assert(model->isValid());
354 }
355 
is_ignored_relaxed_dim4_axis3_relaxed(int i)356 inline bool is_ignored_relaxed_dim4_axis3_relaxed(int i) {
357   static std::set<int> ignore = {};
358   return ignore.find(i) != ignore.end();
359 }
360 
CreateModel_relaxed_dim4_axis3_float16(Model * model)361 void CreateModel_relaxed_dim4_axis3_float16(Model *model) {
362   OperandType type2(Type::TENSOR_FLOAT16, {2, 2, 2, 3});
363   // Phase 1, operands
364   auto op1 = model->addOperand(&type2);
365   auto op2 = model->addOperand(&type2);
366   // Phase 2, operations
367   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
368   // Phase 3, inputs and outputs
369   model->identifyInputsAndOutputs(
370     {op1},
371     {op2});
372   // Phase 4: set relaxed execution
373   model->relaxComputationFloat32toFloat16(true);
374   assert(model->isValid());
375 }
376 
is_ignored_relaxed_dim4_axis3_float16(int i)377 inline bool is_ignored_relaxed_dim4_axis3_float16(int i) {
378   static std::set<int> ignore = {};
379   return ignore.find(i) != ignore.end();
380 }
381 
CreateModel_relaxed_dim4_axis3_quant8(Model * model)382 void CreateModel_relaxed_dim4_axis3_quant8(Model *model) {
383   OperandType type3(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 3}, 0.1f, 32);
384   OperandType type4(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 3}, 0.0078125f, 128);
385   // Phase 1, operands
386   auto op1 = model->addOperand(&type3);
387   auto op2 = model->addOperand(&type4);
388   // Phase 2, operations
389   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
390   // Phase 3, inputs and outputs
391   model->identifyInputsAndOutputs(
392     {op1},
393     {op2});
394   // Phase 4: set relaxed execution
395   model->relaxComputationFloat32toFloat16(true);
396   assert(model->isValid());
397 }
398 
is_ignored_relaxed_dim4_axis3_quant8(int i)399 inline bool is_ignored_relaxed_dim4_axis3_quant8(int i) {
400   static std::set<int> ignore = {};
401   return ignore.find(i) != ignore.end();
402 }
403 
CreateModel_relaxed_dim3_axis2(Model * model)404 void CreateModel_relaxed_dim3_axis2(Model *model) {
405   OperandType type5(Type::TENSOR_FLOAT32, {2, 2, 3});
406   // Phase 1, operands
407   auto op1 = model->addOperand(&type5);
408   auto op2 = model->addOperand(&type5);
409   // Phase 2, operations
410   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
411   // Phase 3, inputs and outputs
412   model->identifyInputsAndOutputs(
413     {op1},
414     {op2});
415   // Phase 4: set relaxed execution
416   model->relaxComputationFloat32toFloat16(true);
417   assert(model->isValid());
418 }
419 
is_ignored_relaxed_dim3_axis2(int i)420 inline bool is_ignored_relaxed_dim3_axis2(int i) {
421   static std::set<int> ignore = {};
422   return ignore.find(i) != ignore.end();
423 }
424 
CreateModel_relaxed_dim3_axis2_relaxed(Model * model)425 void CreateModel_relaxed_dim3_axis2_relaxed(Model *model) {
426   OperandType type5(Type::TENSOR_FLOAT32, {2, 2, 3});
427   // Phase 1, operands
428   auto op1 = model->addOperand(&type5);
429   auto op2 = model->addOperand(&type5);
430   // Phase 2, operations
431   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
432   // Phase 3, inputs and outputs
433   model->identifyInputsAndOutputs(
434     {op1},
435     {op2});
436   // Phase 4: set relaxed execution
437   model->relaxComputationFloat32toFloat16(true);
438   assert(model->isValid());
439 }
440 
is_ignored_relaxed_dim3_axis2_relaxed(int i)441 inline bool is_ignored_relaxed_dim3_axis2_relaxed(int i) {
442   static std::set<int> ignore = {};
443   return ignore.find(i) != ignore.end();
444 }
445 
CreateModel_relaxed_dim3_axis2_float16(Model * model)446 void CreateModel_relaxed_dim3_axis2_float16(Model *model) {
447   OperandType type6(Type::TENSOR_FLOAT16, {2, 2, 3});
448   // Phase 1, operands
449   auto op1 = model->addOperand(&type6);
450   auto op2 = model->addOperand(&type6);
451   // Phase 2, operations
452   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
453   // Phase 3, inputs and outputs
454   model->identifyInputsAndOutputs(
455     {op1},
456     {op2});
457   // Phase 4: set relaxed execution
458   model->relaxComputationFloat32toFloat16(true);
459   assert(model->isValid());
460 }
461 
is_ignored_relaxed_dim3_axis2_float16(int i)462 inline bool is_ignored_relaxed_dim3_axis2_float16(int i) {
463   static std::set<int> ignore = {};
464   return ignore.find(i) != ignore.end();
465 }
466 
CreateModel_relaxed_dim3_axis2_quant8(Model * model)467 void CreateModel_relaxed_dim3_axis2_quant8(Model *model) {
468   OperandType type7(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3}, 0.1f, 32);
469   OperandType type8(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3}, 0.0078125f, 128);
470   // Phase 1, operands
471   auto op1 = model->addOperand(&type7);
472   auto op2 = model->addOperand(&type8);
473   // Phase 2, operations
474   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
475   // Phase 3, inputs and outputs
476   model->identifyInputsAndOutputs(
477     {op1},
478     {op2});
479   // Phase 4: set relaxed execution
480   model->relaxComputationFloat32toFloat16(true);
481   assert(model->isValid());
482 }
483 
is_ignored_relaxed_dim3_axis2_quant8(int i)484 inline bool is_ignored_relaxed_dim3_axis2_quant8(int i) {
485   static std::set<int> ignore = {};
486   return ignore.find(i) != ignore.end();
487 }
488 
CreateModel_relaxed_dim2_axis1(Model * model)489 void CreateModel_relaxed_dim2_axis1(Model *model) {
490   OperandType type9(Type::TENSOR_FLOAT32, {2, 3});
491   // Phase 1, operands
492   auto op1 = model->addOperand(&type9);
493   auto op2 = model->addOperand(&type9);
494   // Phase 2, operations
495   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
496   // Phase 3, inputs and outputs
497   model->identifyInputsAndOutputs(
498     {op1},
499     {op2});
500   // Phase 4: set relaxed execution
501   model->relaxComputationFloat32toFloat16(true);
502   assert(model->isValid());
503 }
504 
is_ignored_relaxed_dim2_axis1(int i)505 inline bool is_ignored_relaxed_dim2_axis1(int i) {
506   static std::set<int> ignore = {};
507   return ignore.find(i) != ignore.end();
508 }
509 
CreateModel_relaxed_dim2_axis1_relaxed(Model * model)510 void CreateModel_relaxed_dim2_axis1_relaxed(Model *model) {
511   OperandType type9(Type::TENSOR_FLOAT32, {2, 3});
512   // Phase 1, operands
513   auto op1 = model->addOperand(&type9);
514   auto op2 = model->addOperand(&type9);
515   // Phase 2, operations
516   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
517   // Phase 3, inputs and outputs
518   model->identifyInputsAndOutputs(
519     {op1},
520     {op2});
521   // Phase 4: set relaxed execution
522   model->relaxComputationFloat32toFloat16(true);
523   assert(model->isValid());
524 }
525 
is_ignored_relaxed_dim2_axis1_relaxed(int i)526 inline bool is_ignored_relaxed_dim2_axis1_relaxed(int i) {
527   static std::set<int> ignore = {};
528   return ignore.find(i) != ignore.end();
529 }
530 
CreateModel_relaxed_dim2_axis1_float16(Model * model)531 void CreateModel_relaxed_dim2_axis1_float16(Model *model) {
532   OperandType type10(Type::TENSOR_FLOAT16, {2, 3});
533   // Phase 1, operands
534   auto op1 = model->addOperand(&type10);
535   auto op2 = model->addOperand(&type10);
536   // Phase 2, operations
537   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
538   // Phase 3, inputs and outputs
539   model->identifyInputsAndOutputs(
540     {op1},
541     {op2});
542   // Phase 4: set relaxed execution
543   model->relaxComputationFloat32toFloat16(true);
544   assert(model->isValid());
545 }
546 
is_ignored_relaxed_dim2_axis1_float16(int i)547 inline bool is_ignored_relaxed_dim2_axis1_float16(int i) {
548   static std::set<int> ignore = {};
549   return ignore.find(i) != ignore.end();
550 }
551 
CreateModel_relaxed_dim2_axis1_quant8(Model * model)552 void CreateModel_relaxed_dim2_axis1_quant8(Model *model) {
553   OperandType type11(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 0.1f, 32);
554   OperandType type12(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 0.0078125f, 128);
555   // Phase 1, operands
556   auto op1 = model->addOperand(&type11);
557   auto op2 = model->addOperand(&type12);
558   // Phase 2, operations
559   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
560   // Phase 3, inputs and outputs
561   model->identifyInputsAndOutputs(
562     {op1},
563     {op2});
564   // Phase 4: set relaxed execution
565   model->relaxComputationFloat32toFloat16(true);
566   assert(model->isValid());
567 }
568 
is_ignored_relaxed_dim2_axis1_quant8(int i)569 inline bool is_ignored_relaxed_dim2_axis1_quant8(int i) {
570   static std::set<int> ignore = {};
571   return ignore.find(i) != ignore.end();
572 }
573 
CreateModel_relaxed_dim1_axis0(Model * model)574 void CreateModel_relaxed_dim1_axis0(Model *model) {
575   OperandType type13(Type::TENSOR_FLOAT32, {3});
576   // Phase 1, operands
577   auto op1 = model->addOperand(&type13);
578   auto op2 = model->addOperand(&type13);
579   // Phase 2, operations
580   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
581   // Phase 3, inputs and outputs
582   model->identifyInputsAndOutputs(
583     {op1},
584     {op2});
585   // Phase 4: set relaxed execution
586   model->relaxComputationFloat32toFloat16(true);
587   assert(model->isValid());
588 }
589 
is_ignored_relaxed_dim1_axis0(int i)590 inline bool is_ignored_relaxed_dim1_axis0(int i) {
591   static std::set<int> ignore = {};
592   return ignore.find(i) != ignore.end();
593 }
594 
CreateModel_relaxed_dim1_axis0_relaxed(Model * model)595 void CreateModel_relaxed_dim1_axis0_relaxed(Model *model) {
596   OperandType type13(Type::TENSOR_FLOAT32, {3});
597   // Phase 1, operands
598   auto op1 = model->addOperand(&type13);
599   auto op2 = model->addOperand(&type13);
600   // Phase 2, operations
601   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
602   // Phase 3, inputs and outputs
603   model->identifyInputsAndOutputs(
604     {op1},
605     {op2});
606   // Phase 4: set relaxed execution
607   model->relaxComputationFloat32toFloat16(true);
608   assert(model->isValid());
609 }
610 
is_ignored_relaxed_dim1_axis0_relaxed(int i)611 inline bool is_ignored_relaxed_dim1_axis0_relaxed(int i) {
612   static std::set<int> ignore = {};
613   return ignore.find(i) != ignore.end();
614 }
615 
CreateModel_relaxed_dim1_axis0_float16(Model * model)616 void CreateModel_relaxed_dim1_axis0_float16(Model *model) {
617   OperandType type14(Type::TENSOR_FLOAT16, {3});
618   // Phase 1, operands
619   auto op1 = model->addOperand(&type14);
620   auto op2 = model->addOperand(&type14);
621   // Phase 2, operations
622   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
623   // Phase 3, inputs and outputs
624   model->identifyInputsAndOutputs(
625     {op1},
626     {op2});
627   // Phase 4: set relaxed execution
628   model->relaxComputationFloat32toFloat16(true);
629   assert(model->isValid());
630 }
631 
is_ignored_relaxed_dim1_axis0_float16(int i)632 inline bool is_ignored_relaxed_dim1_axis0_float16(int i) {
633   static std::set<int> ignore = {};
634   return ignore.find(i) != ignore.end();
635 }
636 
CreateModel_relaxed_dim1_axis0_quant8(Model * model)637 void CreateModel_relaxed_dim1_axis0_quant8(Model *model) {
638   OperandType type15(Type::TENSOR_QUANT8_ASYMM, {3}, 0.1f, 32);
639   OperandType type16(Type::TENSOR_QUANT8_ASYMM, {3}, 0.0078125f, 128);
640   // Phase 1, operands
641   auto op1 = model->addOperand(&type15);
642   auto op2 = model->addOperand(&type16);
643   // Phase 2, operations
644   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
645   // Phase 3, inputs and outputs
646   model->identifyInputsAndOutputs(
647     {op1},
648     {op2});
649   // Phase 4: set relaxed execution
650   model->relaxComputationFloat32toFloat16(true);
651   assert(model->isValid());
652 }
653 
is_ignored_relaxed_dim1_axis0_quant8(int i)654 inline bool is_ignored_relaxed_dim1_axis0_quant8(int i) {
655   static std::set<int> ignore = {};
656   return ignore.find(i) != ignore.end();
657 }
658 
CreateModel_dynamic_output_shape_dim4_axis3(Model * model)659 void CreateModel_dynamic_output_shape_dim4_axis3(Model *model) {
660   OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
661   OperandType type17(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
662   // Phase 1, operands
663   auto op1 = model->addOperand(&type0);
664   auto op2 = model->addOperand(&type17);
665   // Phase 2, operations
666   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
667   // Phase 3, inputs and outputs
668   model->identifyInputsAndOutputs(
669     {op1},
670     {op2});
671   assert(model->isValid());
672 }
673 
is_ignored_dynamic_output_shape_dim4_axis3(int i)674 inline bool is_ignored_dynamic_output_shape_dim4_axis3(int i) {
675   static std::set<int> ignore = {};
676   return ignore.find(i) != ignore.end();
677 }
678 
CreateModel_dynamic_output_shape_dim4_axis3_relaxed(Model * model)679 void CreateModel_dynamic_output_shape_dim4_axis3_relaxed(Model *model) {
680   OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
681   OperandType type17(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
682   // Phase 1, operands
683   auto op1 = model->addOperand(&type0);
684   auto op2 = model->addOperand(&type17);
685   // Phase 2, operations
686   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
687   // Phase 3, inputs and outputs
688   model->identifyInputsAndOutputs(
689     {op1},
690     {op2});
691   // Phase 4: set relaxed execution
692   model->relaxComputationFloat32toFloat16(true);
693   assert(model->isValid());
694 }
695 
is_ignored_dynamic_output_shape_dim4_axis3_relaxed(int i)696 inline bool is_ignored_dynamic_output_shape_dim4_axis3_relaxed(int i) {
697   static std::set<int> ignore = {};
698   return ignore.find(i) != ignore.end();
699 }
700 
CreateModel_dynamic_output_shape_dim4_axis3_float16(Model * model)701 void CreateModel_dynamic_output_shape_dim4_axis3_float16(Model *model) {
702   OperandType type18(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
703   OperandType type2(Type::TENSOR_FLOAT16, {2, 2, 2, 3});
704   // Phase 1, operands
705   auto op1 = model->addOperand(&type2);
706   auto op2 = model->addOperand(&type18);
707   // Phase 2, operations
708   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
709   // Phase 3, inputs and outputs
710   model->identifyInputsAndOutputs(
711     {op1},
712     {op2});
713   assert(model->isValid());
714 }
715 
is_ignored_dynamic_output_shape_dim4_axis3_float16(int i)716 inline bool is_ignored_dynamic_output_shape_dim4_axis3_float16(int i) {
717   static std::set<int> ignore = {};
718   return ignore.find(i) != ignore.end();
719 }
720 
CreateModel_dynamic_output_shape_dim4_axis3_quant8(Model * model)721 void CreateModel_dynamic_output_shape_dim4_axis3_quant8(Model *model) {
722   OperandType type19(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.0078125f, 128);
723   OperandType type3(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 3}, 0.1f, 32);
724   // Phase 1, operands
725   auto op1 = model->addOperand(&type3);
726   auto op2 = model->addOperand(&type19);
727   // Phase 2, operations
728   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
729   // Phase 3, inputs and outputs
730   model->identifyInputsAndOutputs(
731     {op1},
732     {op2});
733   assert(model->isValid());
734 }
735 
is_ignored_dynamic_output_shape_dim4_axis3_quant8(int i)736 inline bool is_ignored_dynamic_output_shape_dim4_axis3_quant8(int i) {
737   static std::set<int> ignore = {};
738   return ignore.find(i) != ignore.end();
739 }
740 
CreateModel_dynamic_output_shape_dim3_axis2(Model * model)741 void CreateModel_dynamic_output_shape_dim3_axis2(Model *model) {
742   OperandType type20(Type::TENSOR_FLOAT32, {0, 0, 0});
743   OperandType type5(Type::TENSOR_FLOAT32, {2, 2, 3});
744   // Phase 1, operands
745   auto op1 = model->addOperand(&type5);
746   auto op2 = model->addOperand(&type20);
747   // Phase 2, operations
748   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
749   // Phase 3, inputs and outputs
750   model->identifyInputsAndOutputs(
751     {op1},
752     {op2});
753   assert(model->isValid());
754 }
755 
is_ignored_dynamic_output_shape_dim3_axis2(int i)756 inline bool is_ignored_dynamic_output_shape_dim3_axis2(int i) {
757   static std::set<int> ignore = {};
758   return ignore.find(i) != ignore.end();
759 }
760 
CreateModel_dynamic_output_shape_dim3_axis2_relaxed(Model * model)761 void CreateModel_dynamic_output_shape_dim3_axis2_relaxed(Model *model) {
762   OperandType type20(Type::TENSOR_FLOAT32, {0, 0, 0});
763   OperandType type5(Type::TENSOR_FLOAT32, {2, 2, 3});
764   // Phase 1, operands
765   auto op1 = model->addOperand(&type5);
766   auto op2 = model->addOperand(&type20);
767   // Phase 2, operations
768   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
769   // Phase 3, inputs and outputs
770   model->identifyInputsAndOutputs(
771     {op1},
772     {op2});
773   // Phase 4: set relaxed execution
774   model->relaxComputationFloat32toFloat16(true);
775   assert(model->isValid());
776 }
777 
is_ignored_dynamic_output_shape_dim3_axis2_relaxed(int i)778 inline bool is_ignored_dynamic_output_shape_dim3_axis2_relaxed(int i) {
779   static std::set<int> ignore = {};
780   return ignore.find(i) != ignore.end();
781 }
782 
CreateModel_dynamic_output_shape_dim3_axis2_float16(Model * model)783 void CreateModel_dynamic_output_shape_dim3_axis2_float16(Model *model) {
784   OperandType type21(Type::TENSOR_FLOAT16, {0, 0, 0});
785   OperandType type6(Type::TENSOR_FLOAT16, {2, 2, 3});
786   // Phase 1, operands
787   auto op1 = model->addOperand(&type6);
788   auto op2 = model->addOperand(&type21);
789   // Phase 2, operations
790   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
791   // Phase 3, inputs and outputs
792   model->identifyInputsAndOutputs(
793     {op1},
794     {op2});
795   assert(model->isValid());
796 }
797 
is_ignored_dynamic_output_shape_dim3_axis2_float16(int i)798 inline bool is_ignored_dynamic_output_shape_dim3_axis2_float16(int i) {
799   static std::set<int> ignore = {};
800   return ignore.find(i) != ignore.end();
801 }
802 
CreateModel_dynamic_output_shape_dim3_axis2_quant8(Model * model)803 void CreateModel_dynamic_output_shape_dim3_axis2_quant8(Model *model) {
804   OperandType type22(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.0078125f, 128);
805   OperandType type7(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3}, 0.1f, 32);
806   // Phase 1, operands
807   auto op1 = model->addOperand(&type7);
808   auto op2 = model->addOperand(&type22);
809   // Phase 2, operations
810   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
811   // Phase 3, inputs and outputs
812   model->identifyInputsAndOutputs(
813     {op1},
814     {op2});
815   assert(model->isValid());
816 }
817 
is_ignored_dynamic_output_shape_dim3_axis2_quant8(int i)818 inline bool is_ignored_dynamic_output_shape_dim3_axis2_quant8(int i) {
819   static std::set<int> ignore = {};
820   return ignore.find(i) != ignore.end();
821 }
822 
CreateModel_dynamic_output_shape_dim2_axis1(Model * model)823 void CreateModel_dynamic_output_shape_dim2_axis1(Model *model) {
824   OperandType type23(Type::TENSOR_FLOAT32, {0, 0});
825   OperandType type9(Type::TENSOR_FLOAT32, {2, 3});
826   // Phase 1, operands
827   auto op1 = model->addOperand(&type9);
828   auto op2 = model->addOperand(&type23);
829   // Phase 2, operations
830   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
831   // Phase 3, inputs and outputs
832   model->identifyInputsAndOutputs(
833     {op1},
834     {op2});
835   assert(model->isValid());
836 }
837 
is_ignored_dynamic_output_shape_dim2_axis1(int i)838 inline bool is_ignored_dynamic_output_shape_dim2_axis1(int i) {
839   static std::set<int> ignore = {};
840   return ignore.find(i) != ignore.end();
841 }
842 
CreateModel_dynamic_output_shape_dim2_axis1_relaxed(Model * model)843 void CreateModel_dynamic_output_shape_dim2_axis1_relaxed(Model *model) {
844   OperandType type23(Type::TENSOR_FLOAT32, {0, 0});
845   OperandType type9(Type::TENSOR_FLOAT32, {2, 3});
846   // Phase 1, operands
847   auto op1 = model->addOperand(&type9);
848   auto op2 = model->addOperand(&type23);
849   // Phase 2, operations
850   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
851   // Phase 3, inputs and outputs
852   model->identifyInputsAndOutputs(
853     {op1},
854     {op2});
855   // Phase 4: set relaxed execution
856   model->relaxComputationFloat32toFloat16(true);
857   assert(model->isValid());
858 }
859 
is_ignored_dynamic_output_shape_dim2_axis1_relaxed(int i)860 inline bool is_ignored_dynamic_output_shape_dim2_axis1_relaxed(int i) {
861   static std::set<int> ignore = {};
862   return ignore.find(i) != ignore.end();
863 }
864 
CreateModel_dynamic_output_shape_dim2_axis1_float16(Model * model)865 void CreateModel_dynamic_output_shape_dim2_axis1_float16(Model *model) {
866   OperandType type10(Type::TENSOR_FLOAT16, {2, 3});
867   OperandType type24(Type::TENSOR_FLOAT16, {0, 0});
868   // Phase 1, operands
869   auto op1 = model->addOperand(&type10);
870   auto op2 = model->addOperand(&type24);
871   // Phase 2, operations
872   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
873   // Phase 3, inputs and outputs
874   model->identifyInputsAndOutputs(
875     {op1},
876     {op2});
877   assert(model->isValid());
878 }
879 
is_ignored_dynamic_output_shape_dim2_axis1_float16(int i)880 inline bool is_ignored_dynamic_output_shape_dim2_axis1_float16(int i) {
881   static std::set<int> ignore = {};
882   return ignore.find(i) != ignore.end();
883 }
884 
CreateModel_dynamic_output_shape_dim2_axis1_quant8(Model * model)885 void CreateModel_dynamic_output_shape_dim2_axis1_quant8(Model *model) {
886   OperandType type11(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 0.1f, 32);
887   OperandType type25(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 0.0078125f, 128);
888   // Phase 1, operands
889   auto op1 = model->addOperand(&type11);
890   auto op2 = model->addOperand(&type25);
891   // Phase 2, operations
892   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
893   // Phase 3, inputs and outputs
894   model->identifyInputsAndOutputs(
895     {op1},
896     {op2});
897   assert(model->isValid());
898 }
899 
is_ignored_dynamic_output_shape_dim2_axis1_quant8(int i)900 inline bool is_ignored_dynamic_output_shape_dim2_axis1_quant8(int i) {
901   static std::set<int> ignore = {};
902   return ignore.find(i) != ignore.end();
903 }
904 
CreateModel_dynamic_output_shape_dim1_axis0(Model * model)905 void CreateModel_dynamic_output_shape_dim1_axis0(Model *model) {
906   OperandType type13(Type::TENSOR_FLOAT32, {3});
907   OperandType type26(Type::TENSOR_FLOAT32, {0});
908   // Phase 1, operands
909   auto op1 = model->addOperand(&type13);
910   auto op2 = model->addOperand(&type26);
911   // Phase 2, operations
912   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
913   // Phase 3, inputs and outputs
914   model->identifyInputsAndOutputs(
915     {op1},
916     {op2});
917   assert(model->isValid());
918 }
919 
is_ignored_dynamic_output_shape_dim1_axis0(int i)920 inline bool is_ignored_dynamic_output_shape_dim1_axis0(int i) {
921   static std::set<int> ignore = {};
922   return ignore.find(i) != ignore.end();
923 }
924 
CreateModel_dynamic_output_shape_dim1_axis0_relaxed(Model * model)925 void CreateModel_dynamic_output_shape_dim1_axis0_relaxed(Model *model) {
926   OperandType type13(Type::TENSOR_FLOAT32, {3});
927   OperandType type26(Type::TENSOR_FLOAT32, {0});
928   // Phase 1, operands
929   auto op1 = model->addOperand(&type13);
930   auto op2 = model->addOperand(&type26);
931   // Phase 2, operations
932   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
933   // Phase 3, inputs and outputs
934   model->identifyInputsAndOutputs(
935     {op1},
936     {op2});
937   // Phase 4: set relaxed execution
938   model->relaxComputationFloat32toFloat16(true);
939   assert(model->isValid());
940 }
941 
is_ignored_dynamic_output_shape_dim1_axis0_relaxed(int i)942 inline bool is_ignored_dynamic_output_shape_dim1_axis0_relaxed(int i) {
943   static std::set<int> ignore = {};
944   return ignore.find(i) != ignore.end();
945 }
946 
CreateModel_dynamic_output_shape_dim1_axis0_float16(Model * model)947 void CreateModel_dynamic_output_shape_dim1_axis0_float16(Model *model) {
948   OperandType type14(Type::TENSOR_FLOAT16, {3});
949   OperandType type27(Type::TENSOR_FLOAT16, {0});
950   // Phase 1, operands
951   auto op1 = model->addOperand(&type14);
952   auto op2 = model->addOperand(&type27);
953   // Phase 2, operations
954   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
955   // Phase 3, inputs and outputs
956   model->identifyInputsAndOutputs(
957     {op1},
958     {op2});
959   assert(model->isValid());
960 }
961 
is_ignored_dynamic_output_shape_dim1_axis0_float16(int i)962 inline bool is_ignored_dynamic_output_shape_dim1_axis0_float16(int i) {
963   static std::set<int> ignore = {};
964   return ignore.find(i) != ignore.end();
965 }
966 
CreateModel_dynamic_output_shape_dim1_axis0_quant8(Model * model)967 void CreateModel_dynamic_output_shape_dim1_axis0_quant8(Model *model) {
968   OperandType type15(Type::TENSOR_QUANT8_ASYMM, {3}, 0.1f, 32);
969   OperandType type28(Type::TENSOR_QUANT8_ASYMM, {0}, 0.0078125f, 128);
970   // Phase 1, operands
971   auto op1 = model->addOperand(&type15);
972   auto op2 = model->addOperand(&type28);
973   // Phase 2, operations
974   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
975   // Phase 3, inputs and outputs
976   model->identifyInputsAndOutputs(
977     {op1},
978     {op2});
979   assert(model->isValid());
980 }
981 
is_ignored_dynamic_output_shape_dim1_axis0_quant8(int i)982 inline bool is_ignored_dynamic_output_shape_dim1_axis0_quant8(int i) {
983   static std::set<int> ignore = {};
984   return ignore.find(i) != ignore.end();
985 }
986 
CreateModel_dynamic_output_shape_relaxed_dim4_axis3(Model * model)987 void CreateModel_dynamic_output_shape_relaxed_dim4_axis3(Model *model) {
988   OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
989   OperandType type17(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
990   // Phase 1, operands
991   auto op1 = model->addOperand(&type0);
992   auto op2 = model->addOperand(&type17);
993   // Phase 2, operations
994   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
995   // Phase 3, inputs and outputs
996   model->identifyInputsAndOutputs(
997     {op1},
998     {op2});
999   // Phase 4: set relaxed execution
1000   model->relaxComputationFloat32toFloat16(true);
1001   assert(model->isValid());
1002 }
1003 
is_ignored_dynamic_output_shape_relaxed_dim4_axis3(int i)1004 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis3(int i) {
1005   static std::set<int> ignore = {};
1006   return ignore.find(i) != ignore.end();
1007 }
1008 
CreateModel_dynamic_output_shape_relaxed_dim4_axis3_relaxed(Model * model)1009 void CreateModel_dynamic_output_shape_relaxed_dim4_axis3_relaxed(Model *model) {
1010   OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 3});
1011   OperandType type17(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
1012   // Phase 1, operands
1013   auto op1 = model->addOperand(&type0);
1014   auto op2 = model->addOperand(&type17);
1015   // Phase 2, operations
1016   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
1017   // Phase 3, inputs and outputs
1018   model->identifyInputsAndOutputs(
1019     {op1},
1020     {op2});
1021   // Phase 4: set relaxed execution
1022   model->relaxComputationFloat32toFloat16(true);
1023   assert(model->isValid());
1024 }
1025 
is_ignored_dynamic_output_shape_relaxed_dim4_axis3_relaxed(int i)1026 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis3_relaxed(int i) {
1027   static std::set<int> ignore = {};
1028   return ignore.find(i) != ignore.end();
1029 }
1030 
CreateModel_dynamic_output_shape_relaxed_dim4_axis3_float16(Model * model)1031 void CreateModel_dynamic_output_shape_relaxed_dim4_axis3_float16(Model *model) {
1032   OperandType type18(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
1033   OperandType type2(Type::TENSOR_FLOAT16, {2, 2, 2, 3});
1034   // Phase 1, operands
1035   auto op1 = model->addOperand(&type2);
1036   auto op2 = model->addOperand(&type18);
1037   // Phase 2, operations
1038   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
1039   // Phase 3, inputs and outputs
1040   model->identifyInputsAndOutputs(
1041     {op1},
1042     {op2});
1043   // Phase 4: set relaxed execution
1044   model->relaxComputationFloat32toFloat16(true);
1045   assert(model->isValid());
1046 }
1047 
is_ignored_dynamic_output_shape_relaxed_dim4_axis3_float16(int i)1048 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis3_float16(int i) {
1049   static std::set<int> ignore = {};
1050   return ignore.find(i) != ignore.end();
1051 }
1052 
CreateModel_dynamic_output_shape_relaxed_dim4_axis3_quant8(Model * model)1053 void CreateModel_dynamic_output_shape_relaxed_dim4_axis3_quant8(Model *model) {
1054   OperandType type19(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.0078125f, 128);
1055   OperandType type3(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 3}, 0.1f, 32);
1056   // Phase 1, operands
1057   auto op1 = model->addOperand(&type3);
1058   auto op2 = model->addOperand(&type19);
1059   // Phase 2, operations
1060   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
1061   // Phase 3, inputs and outputs
1062   model->identifyInputsAndOutputs(
1063     {op1},
1064     {op2});
1065   // Phase 4: set relaxed execution
1066   model->relaxComputationFloat32toFloat16(true);
1067   assert(model->isValid());
1068 }
1069 
is_ignored_dynamic_output_shape_relaxed_dim4_axis3_quant8(int i)1070 inline bool is_ignored_dynamic_output_shape_relaxed_dim4_axis3_quant8(int i) {
1071   static std::set<int> ignore = {};
1072   return ignore.find(i) != ignore.end();
1073 }
1074 
CreateModel_dynamic_output_shape_relaxed_dim3_axis2(Model * model)1075 void CreateModel_dynamic_output_shape_relaxed_dim3_axis2(Model *model) {
1076   OperandType type20(Type::TENSOR_FLOAT32, {0, 0, 0});
1077   OperandType type5(Type::TENSOR_FLOAT32, {2, 2, 3});
1078   // Phase 1, operands
1079   auto op1 = model->addOperand(&type5);
1080   auto op2 = model->addOperand(&type20);
1081   // Phase 2, operations
1082   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
1083   // Phase 3, inputs and outputs
1084   model->identifyInputsAndOutputs(
1085     {op1},
1086     {op2});
1087   // Phase 4: set relaxed execution
1088   model->relaxComputationFloat32toFloat16(true);
1089   assert(model->isValid());
1090 }
1091 
is_ignored_dynamic_output_shape_relaxed_dim3_axis2(int i)1092 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis2(int i) {
1093   static std::set<int> ignore = {};
1094   return ignore.find(i) != ignore.end();
1095 }
1096 
CreateModel_dynamic_output_shape_relaxed_dim3_axis2_relaxed(Model * model)1097 void CreateModel_dynamic_output_shape_relaxed_dim3_axis2_relaxed(Model *model) {
1098   OperandType type20(Type::TENSOR_FLOAT32, {0, 0, 0});
1099   OperandType type5(Type::TENSOR_FLOAT32, {2, 2, 3});
1100   // Phase 1, operands
1101   auto op1 = model->addOperand(&type5);
1102   auto op2 = model->addOperand(&type20);
1103   // Phase 2, operations
1104   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
1105   // Phase 3, inputs and outputs
1106   model->identifyInputsAndOutputs(
1107     {op1},
1108     {op2});
1109   // Phase 4: set relaxed execution
1110   model->relaxComputationFloat32toFloat16(true);
1111   assert(model->isValid());
1112 }
1113 
is_ignored_dynamic_output_shape_relaxed_dim3_axis2_relaxed(int i)1114 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis2_relaxed(int i) {
1115   static std::set<int> ignore = {};
1116   return ignore.find(i) != ignore.end();
1117 }
1118 
CreateModel_dynamic_output_shape_relaxed_dim3_axis2_float16(Model * model)1119 void CreateModel_dynamic_output_shape_relaxed_dim3_axis2_float16(Model *model) {
1120   OperandType type21(Type::TENSOR_FLOAT16, {0, 0, 0});
1121   OperandType type6(Type::TENSOR_FLOAT16, {2, 2, 3});
1122   // Phase 1, operands
1123   auto op1 = model->addOperand(&type6);
1124   auto op2 = model->addOperand(&type21);
1125   // Phase 2, operations
1126   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
1127   // Phase 3, inputs and outputs
1128   model->identifyInputsAndOutputs(
1129     {op1},
1130     {op2});
1131   // Phase 4: set relaxed execution
1132   model->relaxComputationFloat32toFloat16(true);
1133   assert(model->isValid());
1134 }
1135 
is_ignored_dynamic_output_shape_relaxed_dim3_axis2_float16(int i)1136 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis2_float16(int i) {
1137   static std::set<int> ignore = {};
1138   return ignore.find(i) != ignore.end();
1139 }
1140 
CreateModel_dynamic_output_shape_relaxed_dim3_axis2_quant8(Model * model)1141 void CreateModel_dynamic_output_shape_relaxed_dim3_axis2_quant8(Model *model) {
1142   OperandType type22(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.0078125f, 128);
1143   OperandType type7(Type::TENSOR_QUANT8_ASYMM, {2, 2, 3}, 0.1f, 32);
1144   // Phase 1, operands
1145   auto op1 = model->addOperand(&type7);
1146   auto op2 = model->addOperand(&type22);
1147   // Phase 2, operations
1148   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
1149   // Phase 3, inputs and outputs
1150   model->identifyInputsAndOutputs(
1151     {op1},
1152     {op2});
1153   // Phase 4: set relaxed execution
1154   model->relaxComputationFloat32toFloat16(true);
1155   assert(model->isValid());
1156 }
1157 
is_ignored_dynamic_output_shape_relaxed_dim3_axis2_quant8(int i)1158 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis2_quant8(int i) {
1159   static std::set<int> ignore = {};
1160   return ignore.find(i) != ignore.end();
1161 }
1162 
CreateModel_dynamic_output_shape_relaxed_dim2_axis1(Model * model)1163 void CreateModel_dynamic_output_shape_relaxed_dim2_axis1(Model *model) {
1164   OperandType type23(Type::TENSOR_FLOAT32, {0, 0});
1165   OperandType type9(Type::TENSOR_FLOAT32, {2, 3});
1166   // Phase 1, operands
1167   auto op1 = model->addOperand(&type9);
1168   auto op2 = model->addOperand(&type23);
1169   // Phase 2, operations
1170   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
1171   // Phase 3, inputs and outputs
1172   model->identifyInputsAndOutputs(
1173     {op1},
1174     {op2});
1175   // Phase 4: set relaxed execution
1176   model->relaxComputationFloat32toFloat16(true);
1177   assert(model->isValid());
1178 }
1179 
is_ignored_dynamic_output_shape_relaxed_dim2_axis1(int i)1180 inline bool is_ignored_dynamic_output_shape_relaxed_dim2_axis1(int i) {
1181   static std::set<int> ignore = {};
1182   return ignore.find(i) != ignore.end();
1183 }
1184 
CreateModel_dynamic_output_shape_relaxed_dim2_axis1_relaxed(Model * model)1185 void CreateModel_dynamic_output_shape_relaxed_dim2_axis1_relaxed(Model *model) {
1186   OperandType type23(Type::TENSOR_FLOAT32, {0, 0});
1187   OperandType type9(Type::TENSOR_FLOAT32, {2, 3});
1188   // Phase 1, operands
1189   auto op1 = model->addOperand(&type9);
1190   auto op2 = model->addOperand(&type23);
1191   // Phase 2, operations
1192   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
1193   // Phase 3, inputs and outputs
1194   model->identifyInputsAndOutputs(
1195     {op1},
1196     {op2});
1197   // Phase 4: set relaxed execution
1198   model->relaxComputationFloat32toFloat16(true);
1199   assert(model->isValid());
1200 }
1201 
is_ignored_dynamic_output_shape_relaxed_dim2_axis1_relaxed(int i)1202 inline bool is_ignored_dynamic_output_shape_relaxed_dim2_axis1_relaxed(int i) {
1203   static std::set<int> ignore = {};
1204   return ignore.find(i) != ignore.end();
1205 }
1206 
CreateModel_dynamic_output_shape_relaxed_dim2_axis1_float16(Model * model)1207 void CreateModel_dynamic_output_shape_relaxed_dim2_axis1_float16(Model *model) {
1208   OperandType type10(Type::TENSOR_FLOAT16, {2, 3});
1209   OperandType type24(Type::TENSOR_FLOAT16, {0, 0});
1210   // Phase 1, operands
1211   auto op1 = model->addOperand(&type10);
1212   auto op2 = model->addOperand(&type24);
1213   // Phase 2, operations
1214   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
1215   // Phase 3, inputs and outputs
1216   model->identifyInputsAndOutputs(
1217     {op1},
1218     {op2});
1219   // Phase 4: set relaxed execution
1220   model->relaxComputationFloat32toFloat16(true);
1221   assert(model->isValid());
1222 }
1223 
is_ignored_dynamic_output_shape_relaxed_dim2_axis1_float16(int i)1224 inline bool is_ignored_dynamic_output_shape_relaxed_dim2_axis1_float16(int i) {
1225   static std::set<int> ignore = {};
1226   return ignore.find(i) != ignore.end();
1227 }
1228 
CreateModel_dynamic_output_shape_relaxed_dim2_axis1_quant8(Model * model)1229 void CreateModel_dynamic_output_shape_relaxed_dim2_axis1_quant8(Model *model) {
1230   OperandType type11(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 0.1f, 32);
1231   OperandType type25(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 0.0078125f, 128);
1232   // Phase 1, operands
1233   auto op1 = model->addOperand(&type11);
1234   auto op2 = model->addOperand(&type25);
1235   // Phase 2, operations
1236   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
1237   // Phase 3, inputs and outputs
1238   model->identifyInputsAndOutputs(
1239     {op1},
1240     {op2});
1241   // Phase 4: set relaxed execution
1242   model->relaxComputationFloat32toFloat16(true);
1243   assert(model->isValid());
1244 }
1245 
is_ignored_dynamic_output_shape_relaxed_dim2_axis1_quant8(int i)1246 inline bool is_ignored_dynamic_output_shape_relaxed_dim2_axis1_quant8(int i) {
1247   static std::set<int> ignore = {};
1248   return ignore.find(i) != ignore.end();
1249 }
1250 
CreateModel_dynamic_output_shape_relaxed_dim1_axis0(Model * model)1251 void CreateModel_dynamic_output_shape_relaxed_dim1_axis0(Model *model) {
1252   OperandType type13(Type::TENSOR_FLOAT32, {3});
1253   OperandType type26(Type::TENSOR_FLOAT32, {0});
1254   // Phase 1, operands
1255   auto op1 = model->addOperand(&type13);
1256   auto op2 = model->addOperand(&type26);
1257   // Phase 2, operations
1258   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
1259   // Phase 3, inputs and outputs
1260   model->identifyInputsAndOutputs(
1261     {op1},
1262     {op2});
1263   // Phase 4: set relaxed execution
1264   model->relaxComputationFloat32toFloat16(true);
1265   assert(model->isValid());
1266 }
1267 
is_ignored_dynamic_output_shape_relaxed_dim1_axis0(int i)1268 inline bool is_ignored_dynamic_output_shape_relaxed_dim1_axis0(int i) {
1269   static std::set<int> ignore = {};
1270   return ignore.find(i) != ignore.end();
1271 }
1272 
CreateModel_dynamic_output_shape_relaxed_dim1_axis0_relaxed(Model * model)1273 void CreateModel_dynamic_output_shape_relaxed_dim1_axis0_relaxed(Model *model) {
1274   OperandType type13(Type::TENSOR_FLOAT32, {3});
1275   OperandType type26(Type::TENSOR_FLOAT32, {0});
1276   // Phase 1, operands
1277   auto op1 = model->addOperand(&type13);
1278   auto op2 = model->addOperand(&type26);
1279   // Phase 2, operations
1280   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
1281   // Phase 3, inputs and outputs
1282   model->identifyInputsAndOutputs(
1283     {op1},
1284     {op2});
1285   // Phase 4: set relaxed execution
1286   model->relaxComputationFloat32toFloat16(true);
1287   assert(model->isValid());
1288 }
1289 
is_ignored_dynamic_output_shape_relaxed_dim1_axis0_relaxed(int i)1290 inline bool is_ignored_dynamic_output_shape_relaxed_dim1_axis0_relaxed(int i) {
1291   static std::set<int> ignore = {};
1292   return ignore.find(i) != ignore.end();
1293 }
1294 
CreateModel_dynamic_output_shape_relaxed_dim1_axis0_float16(Model * model)1295 void CreateModel_dynamic_output_shape_relaxed_dim1_axis0_float16(Model *model) {
1296   OperandType type14(Type::TENSOR_FLOAT16, {3});
1297   OperandType type27(Type::TENSOR_FLOAT16, {0});
1298   // Phase 1, operands
1299   auto op1 = model->addOperand(&type14);
1300   auto op2 = model->addOperand(&type27);
1301   // Phase 2, operations
1302   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
1303   // Phase 3, inputs and outputs
1304   model->identifyInputsAndOutputs(
1305     {op1},
1306     {op2});
1307   // Phase 4: set relaxed execution
1308   model->relaxComputationFloat32toFloat16(true);
1309   assert(model->isValid());
1310 }
1311 
is_ignored_dynamic_output_shape_relaxed_dim1_axis0_float16(int i)1312 inline bool is_ignored_dynamic_output_shape_relaxed_dim1_axis0_float16(int i) {
1313   static std::set<int> ignore = {};
1314   return ignore.find(i) != ignore.end();
1315 }
1316 
CreateModel_dynamic_output_shape_relaxed_dim1_axis0_quant8(Model * model)1317 void CreateModel_dynamic_output_shape_relaxed_dim1_axis0_quant8(Model *model) {
1318   OperandType type15(Type::TENSOR_QUANT8_ASYMM, {3}, 0.1f, 32);
1319   OperandType type28(Type::TENSOR_QUANT8_ASYMM, {0}, 0.0078125f, 128);
1320   // Phase 1, operands
1321   auto op1 = model->addOperand(&type15);
1322   auto op2 = model->addOperand(&type28);
1323   // Phase 2, operations
1324   model->addOperation(ANEURALNETWORKS_L2_NORMALIZATION, {op1}, {op2});
1325   // Phase 3, inputs and outputs
1326   model->identifyInputsAndOutputs(
1327     {op1},
1328     {op2});
1329   // Phase 4: set relaxed execution
1330   model->relaxComputationFloat32toFloat16(true);
1331   assert(model->isValid());
1332 }
1333 
is_ignored_dynamic_output_shape_relaxed_dim1_axis0_quant8(int i)1334 inline bool is_ignored_dynamic_output_shape_relaxed_dim1_axis0_quant8(int i) {
1335   static std::set<int> ignore = {};
1336   return ignore.find(i) != ignore.end();
1337 }
1338 
1339