1 // clang-format off
2 // Generated file (from: softmax_v1_2.mod.py). Do not edit
CreateModel(Model * model)3 void CreateModel(Model *model) {
4 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
5 OperandType type2(Type::FLOAT32, {});
6 // Phase 1, operands
7 auto op1 = model->addOperand(&type0);
8 auto param = model->addOperand(&type2);
9 auto op2 = model->addOperand(&type0);
10 // Phase 2, operations
11 static float param_init[] = {1.0f};
12 model->setOperandValue(param, param_init, sizeof(float) * 1);
13 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
14 // Phase 3, inputs and outputs
15 model->identifyInputsAndOutputs(
16 {op1},
17 {op2});
18 assert(model->isValid());
19 }
20
is_ignored(int i)21 inline bool is_ignored(int i) {
22 static std::set<int> ignore = {};
23 return ignore.find(i) != ignore.end();
24 }
25
CreateModel_dim1_axis0(Model * model)26 void CreateModel_dim1_axis0(Model *model) {
27 OperandType type12(Type::TENSOR_FLOAT32, {5});
28 OperandType type2(Type::FLOAT32, {});
29 // Phase 1, operands
30 auto op1 = model->addOperand(&type12);
31 auto param = model->addOperand(&type2);
32 auto op2 = model->addOperand(&type12);
33 // Phase 2, operations
34 static float param_init[] = {1.0f};
35 model->setOperandValue(param, param_init, sizeof(float) * 1);
36 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
37 // Phase 3, inputs and outputs
38 model->identifyInputsAndOutputs(
39 {op1},
40 {op2});
41 assert(model->isValid());
42 }
43
is_ignored_dim1_axis0(int i)44 inline bool is_ignored_dim1_axis0(int i) {
45 static std::set<int> ignore = {};
46 return ignore.find(i) != ignore.end();
47 }
48
CreateModel_dim3_axis2(Model * model)49 void CreateModel_dim3_axis2(Model *model) {
50 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
51 OperandType type2(Type::FLOAT32, {});
52 // Phase 1, operands
53 auto op1 = model->addOperand(&type13);
54 auto param = model->addOperand(&type2);
55 auto op2 = model->addOperand(&type13);
56 // Phase 2, operations
57 static float param_init[] = {1.0f};
58 model->setOperandValue(param, param_init, sizeof(float) * 1);
59 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
60 // Phase 3, inputs and outputs
61 model->identifyInputsAndOutputs(
62 {op1},
63 {op2});
64 assert(model->isValid());
65 }
66
is_ignored_dim3_axis2(int i)67 inline bool is_ignored_dim3_axis2(int i) {
68 static std::set<int> ignore = {};
69 return ignore.find(i) != ignore.end();
70 }
71
CreateModel_relaxed(Model * model)72 void CreateModel_relaxed(Model *model) {
73 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
74 OperandType type2(Type::FLOAT32, {});
75 // Phase 1, operands
76 auto op1 = model->addOperand(&type0);
77 auto param = model->addOperand(&type2);
78 auto op2 = model->addOperand(&type0);
79 // Phase 2, operations
80 static float param_init[] = {1.0f};
81 model->setOperandValue(param, param_init, sizeof(float) * 1);
82 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
83 // Phase 3, inputs and outputs
84 model->identifyInputsAndOutputs(
85 {op1},
86 {op2});
87 // Phase 4: set relaxed execution
88 model->relaxComputationFloat32toFloat16(true);
89 assert(model->isValid());
90 }
91
is_ignored_relaxed(int i)92 inline bool is_ignored_relaxed(int i) {
93 static std::set<int> ignore = {};
94 return ignore.find(i) != ignore.end();
95 }
96
CreateModel_relaxed_dim1_axis0(Model * model)97 void CreateModel_relaxed_dim1_axis0(Model *model) {
98 OperandType type12(Type::TENSOR_FLOAT32, {5});
99 OperandType type2(Type::FLOAT32, {});
100 // Phase 1, operands
101 auto op1 = model->addOperand(&type12);
102 auto param = model->addOperand(&type2);
103 auto op2 = model->addOperand(&type12);
104 // Phase 2, operations
105 static float param_init[] = {1.0f};
106 model->setOperandValue(param, param_init, sizeof(float) * 1);
107 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {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_relaxed_dim1_axis0(int i)117 inline bool is_ignored_relaxed_dim1_axis0(int i) {
118 static std::set<int> ignore = {};
119 return ignore.find(i) != ignore.end();
120 }
121
CreateModel_relaxed_dim3_axis2(Model * model)122 void CreateModel_relaxed_dim3_axis2(Model *model) {
123 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
124 OperandType type2(Type::FLOAT32, {});
125 // Phase 1, operands
126 auto op1 = model->addOperand(&type13);
127 auto param = model->addOperand(&type2);
128 auto op2 = model->addOperand(&type13);
129 // Phase 2, operations
130 static float param_init[] = {1.0f};
131 model->setOperandValue(param, param_init, sizeof(float) * 1);
132 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
133 // Phase 3, inputs and outputs
134 model->identifyInputsAndOutputs(
135 {op1},
136 {op2});
137 // Phase 4: set relaxed execution
138 model->relaxComputationFloat32toFloat16(true);
139 assert(model->isValid());
140 }
141
is_ignored_relaxed_dim3_axis2(int i)142 inline bool is_ignored_relaxed_dim3_axis2(int i) {
143 static std::set<int> ignore = {};
144 return ignore.find(i) != ignore.end();
145 }
146
CreateModel_float16(Model * model)147 void CreateModel_float16(Model *model) {
148 OperandType type14(Type::TENSOR_FLOAT16, {2, 2, 2, 5});
149 OperandType type15(Type::FLOAT16, {});
150 // Phase 1, operands
151 auto op1 = model->addOperand(&type14);
152 auto param = model->addOperand(&type15);
153 auto op2 = model->addOperand(&type14);
154 // Phase 2, operations
155 static _Float16 param_init[] = {1.0f};
156 model->setOperandValue(param, param_init, sizeof(_Float16) * 1);
157 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
158 // Phase 3, inputs and outputs
159 model->identifyInputsAndOutputs(
160 {op1},
161 {op2});
162 assert(model->isValid());
163 }
164
is_ignored_float16(int i)165 inline bool is_ignored_float16(int i) {
166 static std::set<int> ignore = {};
167 return ignore.find(i) != ignore.end();
168 }
169
CreateModel_float16_dim1_axis0(Model * model)170 void CreateModel_float16_dim1_axis0(Model *model) {
171 OperandType type15(Type::FLOAT16, {});
172 OperandType type17(Type::TENSOR_FLOAT16, {5});
173 // Phase 1, operands
174 auto op1 = model->addOperand(&type17);
175 auto param = model->addOperand(&type15);
176 auto op2 = model->addOperand(&type17);
177 // Phase 2, operations
178 static _Float16 param_init[] = {1.0f};
179 model->setOperandValue(param, param_init, sizeof(_Float16) * 1);
180 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
181 // Phase 3, inputs and outputs
182 model->identifyInputsAndOutputs(
183 {op1},
184 {op2});
185 assert(model->isValid());
186 }
187
is_ignored_float16_dim1_axis0(int i)188 inline bool is_ignored_float16_dim1_axis0(int i) {
189 static std::set<int> ignore = {};
190 return ignore.find(i) != ignore.end();
191 }
192
CreateModel_float16_dim3_axis2(Model * model)193 void CreateModel_float16_dim3_axis2(Model *model) {
194 OperandType type15(Type::FLOAT16, {});
195 OperandType type18(Type::TENSOR_FLOAT16, {2, 2, 5});
196 // Phase 1, operands
197 auto op1 = model->addOperand(&type18);
198 auto param = model->addOperand(&type15);
199 auto op2 = model->addOperand(&type18);
200 // Phase 2, operations
201 static _Float16 param_init[] = {1.0f};
202 model->setOperandValue(param, param_init, sizeof(_Float16) * 1);
203 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
204 // Phase 3, inputs and outputs
205 model->identifyInputsAndOutputs(
206 {op1},
207 {op2});
208 assert(model->isValid());
209 }
210
is_ignored_float16_dim3_axis2(int i)211 inline bool is_ignored_float16_dim3_axis2(int i) {
212 static std::set<int> ignore = {};
213 return ignore.find(i) != ignore.end();
214 }
215
CreateModel_quant8(Model * model)216 void CreateModel_quant8(Model *model) {
217 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 5}, 0.25f, 128);
218 OperandType type2(Type::FLOAT32, {});
219 OperandType type20(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 5}, 0.00390625f, 0);
220 // Phase 1, operands
221 auto op1 = model->addOperand(&type19);
222 auto param = model->addOperand(&type2);
223 auto op2 = model->addOperand(&type20);
224 // Phase 2, operations
225 static float param_init[] = {1.0f};
226 model->setOperandValue(param, param_init, sizeof(float) * 1);
227 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
228 // Phase 3, inputs and outputs
229 model->identifyInputsAndOutputs(
230 {op1},
231 {op2});
232 assert(model->isValid());
233 }
234
is_ignored_quant8(int i)235 inline bool is_ignored_quant8(int i) {
236 static std::set<int> ignore = {};
237 return ignore.find(i) != ignore.end();
238 }
239
CreateModel_quant8_dim1_axis0(Model * model)240 void CreateModel_quant8_dim1_axis0(Model *model) {
241 OperandType type2(Type::FLOAT32, {});
242 OperandType type21(Type::TENSOR_QUANT8_ASYMM, {5}, 0.25f, 128);
243 OperandType type22(Type::TENSOR_QUANT8_ASYMM, {5}, 0.00390625f, 0);
244 // Phase 1, operands
245 auto op1 = model->addOperand(&type21);
246 auto param = model->addOperand(&type2);
247 auto op2 = model->addOperand(&type22);
248 // Phase 2, operations
249 static float param_init[] = {1.0f};
250 model->setOperandValue(param, param_init, sizeof(float) * 1);
251 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
252 // Phase 3, inputs and outputs
253 model->identifyInputsAndOutputs(
254 {op1},
255 {op2});
256 assert(model->isValid());
257 }
258
is_ignored_quant8_dim1_axis0(int i)259 inline bool is_ignored_quant8_dim1_axis0(int i) {
260 static std::set<int> ignore = {};
261 return ignore.find(i) != ignore.end();
262 }
263
CreateModel_quant8_dim3_axis2(Model * model)264 void CreateModel_quant8_dim3_axis2(Model *model) {
265 OperandType type2(Type::FLOAT32, {});
266 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5}, 0.25f, 128);
267 OperandType type24(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5}, 0.00390625f, 0);
268 // Phase 1, operands
269 auto op1 = model->addOperand(&type23);
270 auto param = model->addOperand(&type2);
271 auto op2 = model->addOperand(&type24);
272 // Phase 2, operations
273 static float param_init[] = {1.0f};
274 model->setOperandValue(param, param_init, sizeof(float) * 1);
275 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
276 // Phase 3, inputs and outputs
277 model->identifyInputsAndOutputs(
278 {op1},
279 {op2});
280 assert(model->isValid());
281 }
282
is_ignored_quant8_dim3_axis2(int i)283 inline bool is_ignored_quant8_dim3_axis2(int i) {
284 static std::set<int> ignore = {};
285 return ignore.find(i) != ignore.end();
286 }
287
CreateModel_dynamic_output_shape(Model * model)288 void CreateModel_dynamic_output_shape(Model *model) {
289 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
290 OperandType type2(Type::FLOAT32, {});
291 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
292 // Phase 1, operands
293 auto op1 = model->addOperand(&type0);
294 auto param = model->addOperand(&type2);
295 auto op2 = model->addOperand(&type25);
296 // Phase 2, operations
297 static float param_init[] = {1.0f};
298 model->setOperandValue(param, param_init, sizeof(float) * 1);
299 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
300 // Phase 3, inputs and outputs
301 model->identifyInputsAndOutputs(
302 {op1},
303 {op2});
304 assert(model->isValid());
305 }
306
is_ignored_dynamic_output_shape(int i)307 inline bool is_ignored_dynamic_output_shape(int i) {
308 static std::set<int> ignore = {};
309 return ignore.find(i) != ignore.end();
310 }
311
CreateModel_dynamic_output_shape_dim1_axis0(Model * model)312 void CreateModel_dynamic_output_shape_dim1_axis0(Model *model) {
313 OperandType type12(Type::TENSOR_FLOAT32, {5});
314 OperandType type2(Type::FLOAT32, {});
315 OperandType type5(Type::TENSOR_FLOAT32, {0});
316 // Phase 1, operands
317 auto op1 = model->addOperand(&type12);
318 auto param = model->addOperand(&type2);
319 auto op2 = model->addOperand(&type5);
320 // Phase 2, operations
321 static float param_init[] = {1.0f};
322 model->setOperandValue(param, param_init, sizeof(float) * 1);
323 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
324 // Phase 3, inputs and outputs
325 model->identifyInputsAndOutputs(
326 {op1},
327 {op2});
328 assert(model->isValid());
329 }
330
is_ignored_dynamic_output_shape_dim1_axis0(int i)331 inline bool is_ignored_dynamic_output_shape_dim1_axis0(int i) {
332 static std::set<int> ignore = {};
333 return ignore.find(i) != ignore.end();
334 }
335
CreateModel_dynamic_output_shape_dim3_axis2(Model * model)336 void CreateModel_dynamic_output_shape_dim3_axis2(Model *model) {
337 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
338 OperandType type2(Type::FLOAT32, {});
339 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
340 // Phase 1, operands
341 auto op1 = model->addOperand(&type13);
342 auto param = model->addOperand(&type2);
343 auto op2 = model->addOperand(&type26);
344 // Phase 2, operations
345 static float param_init[] = {1.0f};
346 model->setOperandValue(param, param_init, sizeof(float) * 1);
347 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
348 // Phase 3, inputs and outputs
349 model->identifyInputsAndOutputs(
350 {op1},
351 {op2});
352 assert(model->isValid());
353 }
354
is_ignored_dynamic_output_shape_dim3_axis2(int i)355 inline bool is_ignored_dynamic_output_shape_dim3_axis2(int i) {
356 static std::set<int> ignore = {};
357 return ignore.find(i) != ignore.end();
358 }
359
CreateModel_dynamic_output_shape_relaxed(Model * model)360 void CreateModel_dynamic_output_shape_relaxed(Model *model) {
361 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
362 OperandType type2(Type::FLOAT32, {});
363 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
364 // Phase 1, operands
365 auto op1 = model->addOperand(&type0);
366 auto param = model->addOperand(&type2);
367 auto op2 = model->addOperand(&type25);
368 // Phase 2, operations
369 static float param_init[] = {1.0f};
370 model->setOperandValue(param, param_init, sizeof(float) * 1);
371 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
372 // Phase 3, inputs and outputs
373 model->identifyInputsAndOutputs(
374 {op1},
375 {op2});
376 // Phase 4: set relaxed execution
377 model->relaxComputationFloat32toFloat16(true);
378 assert(model->isValid());
379 }
380
is_ignored_dynamic_output_shape_relaxed(int i)381 inline bool is_ignored_dynamic_output_shape_relaxed(int i) {
382 static std::set<int> ignore = {};
383 return ignore.find(i) != ignore.end();
384 }
385
CreateModel_dynamic_output_shape_relaxed_dim1_axis0(Model * model)386 void CreateModel_dynamic_output_shape_relaxed_dim1_axis0(Model *model) {
387 OperandType type12(Type::TENSOR_FLOAT32, {5});
388 OperandType type2(Type::FLOAT32, {});
389 OperandType type5(Type::TENSOR_FLOAT32, {0});
390 // Phase 1, operands
391 auto op1 = model->addOperand(&type12);
392 auto param = model->addOperand(&type2);
393 auto op2 = model->addOperand(&type5);
394 // Phase 2, operations
395 static float param_init[] = {1.0f};
396 model->setOperandValue(param, param_init, sizeof(float) * 1);
397 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
398 // Phase 3, inputs and outputs
399 model->identifyInputsAndOutputs(
400 {op1},
401 {op2});
402 // Phase 4: set relaxed execution
403 model->relaxComputationFloat32toFloat16(true);
404 assert(model->isValid());
405 }
406
is_ignored_dynamic_output_shape_relaxed_dim1_axis0(int i)407 inline bool is_ignored_dynamic_output_shape_relaxed_dim1_axis0(int i) {
408 static std::set<int> ignore = {};
409 return ignore.find(i) != ignore.end();
410 }
411
CreateModel_dynamic_output_shape_relaxed_dim3_axis2(Model * model)412 void CreateModel_dynamic_output_shape_relaxed_dim3_axis2(Model *model) {
413 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
414 OperandType type2(Type::FLOAT32, {});
415 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
416 // Phase 1, operands
417 auto op1 = model->addOperand(&type13);
418 auto param = model->addOperand(&type2);
419 auto op2 = model->addOperand(&type26);
420 // Phase 2, operations
421 static float param_init[] = {1.0f};
422 model->setOperandValue(param, param_init, sizeof(float) * 1);
423 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
424 // Phase 3, inputs and outputs
425 model->identifyInputsAndOutputs(
426 {op1},
427 {op2});
428 // Phase 4: set relaxed execution
429 model->relaxComputationFloat32toFloat16(true);
430 assert(model->isValid());
431 }
432
is_ignored_dynamic_output_shape_relaxed_dim3_axis2(int i)433 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis2(int i) {
434 static std::set<int> ignore = {};
435 return ignore.find(i) != ignore.end();
436 }
437
CreateModel_dynamic_output_shape_float16(Model * model)438 void CreateModel_dynamic_output_shape_float16(Model *model) {
439 OperandType type14(Type::TENSOR_FLOAT16, {2, 2, 2, 5});
440 OperandType type15(Type::FLOAT16, {});
441 OperandType type27(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
442 // Phase 1, operands
443 auto op1 = model->addOperand(&type14);
444 auto param = model->addOperand(&type15);
445 auto op2 = model->addOperand(&type27);
446 // Phase 2, operations
447 static _Float16 param_init[] = {1.0f};
448 model->setOperandValue(param, param_init, sizeof(_Float16) * 1);
449 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
450 // Phase 3, inputs and outputs
451 model->identifyInputsAndOutputs(
452 {op1},
453 {op2});
454 assert(model->isValid());
455 }
456
is_ignored_dynamic_output_shape_float16(int i)457 inline bool is_ignored_dynamic_output_shape_float16(int i) {
458 static std::set<int> ignore = {};
459 return ignore.find(i) != ignore.end();
460 }
461
CreateModel_dynamic_output_shape_float16_dim1_axis0(Model * model)462 void CreateModel_dynamic_output_shape_float16_dim1_axis0(Model *model) {
463 OperandType type15(Type::FLOAT16, {});
464 OperandType type17(Type::TENSOR_FLOAT16, {5});
465 OperandType type28(Type::TENSOR_FLOAT16, {0});
466 // Phase 1, operands
467 auto op1 = model->addOperand(&type17);
468 auto param = model->addOperand(&type15);
469 auto op2 = model->addOperand(&type28);
470 // Phase 2, operations
471 static _Float16 param_init[] = {1.0f};
472 model->setOperandValue(param, param_init, sizeof(_Float16) * 1);
473 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
474 // Phase 3, inputs and outputs
475 model->identifyInputsAndOutputs(
476 {op1},
477 {op2});
478 assert(model->isValid());
479 }
480
is_ignored_dynamic_output_shape_float16_dim1_axis0(int i)481 inline bool is_ignored_dynamic_output_shape_float16_dim1_axis0(int i) {
482 static std::set<int> ignore = {};
483 return ignore.find(i) != ignore.end();
484 }
485
CreateModel_dynamic_output_shape_float16_dim3_axis2(Model * model)486 void CreateModel_dynamic_output_shape_float16_dim3_axis2(Model *model) {
487 OperandType type15(Type::FLOAT16, {});
488 OperandType type18(Type::TENSOR_FLOAT16, {2, 2, 5});
489 OperandType type29(Type::TENSOR_FLOAT16, {0, 0, 0});
490 // Phase 1, operands
491 auto op1 = model->addOperand(&type18);
492 auto param = model->addOperand(&type15);
493 auto op2 = model->addOperand(&type29);
494 // Phase 2, operations
495 static _Float16 param_init[] = {1.0f};
496 model->setOperandValue(param, param_init, sizeof(_Float16) * 1);
497 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
498 // Phase 3, inputs and outputs
499 model->identifyInputsAndOutputs(
500 {op1},
501 {op2});
502 assert(model->isValid());
503 }
504
is_ignored_dynamic_output_shape_float16_dim3_axis2(int i)505 inline bool is_ignored_dynamic_output_shape_float16_dim3_axis2(int i) {
506 static std::set<int> ignore = {};
507 return ignore.find(i) != ignore.end();
508 }
509
CreateModel_dynamic_output_shape_quant8(Model * model)510 void CreateModel_dynamic_output_shape_quant8(Model *model) {
511 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 5}, 0.25f, 128);
512 OperandType type2(Type::FLOAT32, {});
513 OperandType type30(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.00390625f, 0);
514 // Phase 1, operands
515 auto op1 = model->addOperand(&type19);
516 auto param = model->addOperand(&type2);
517 auto op2 = model->addOperand(&type30);
518 // Phase 2, operations
519 static float param_init[] = {1.0f};
520 model->setOperandValue(param, param_init, sizeof(float) * 1);
521 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
522 // Phase 3, inputs and outputs
523 model->identifyInputsAndOutputs(
524 {op1},
525 {op2});
526 assert(model->isValid());
527 }
528
is_ignored_dynamic_output_shape_quant8(int i)529 inline bool is_ignored_dynamic_output_shape_quant8(int i) {
530 static std::set<int> ignore = {};
531 return ignore.find(i) != ignore.end();
532 }
533
CreateModel_dynamic_output_shape_quant8_dim1_axis0(Model * model)534 void CreateModel_dynamic_output_shape_quant8_dim1_axis0(Model *model) {
535 OperandType type2(Type::FLOAT32, {});
536 OperandType type21(Type::TENSOR_QUANT8_ASYMM, {5}, 0.25f, 128);
537 OperandType type31(Type::TENSOR_QUANT8_ASYMM, {0}, 0.00390625f, 0);
538 // Phase 1, operands
539 auto op1 = model->addOperand(&type21);
540 auto param = model->addOperand(&type2);
541 auto op2 = model->addOperand(&type31);
542 // Phase 2, operations
543 static float param_init[] = {1.0f};
544 model->setOperandValue(param, param_init, sizeof(float) * 1);
545 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
546 // Phase 3, inputs and outputs
547 model->identifyInputsAndOutputs(
548 {op1},
549 {op2});
550 assert(model->isValid());
551 }
552
is_ignored_dynamic_output_shape_quant8_dim1_axis0(int i)553 inline bool is_ignored_dynamic_output_shape_quant8_dim1_axis0(int i) {
554 static std::set<int> ignore = {};
555 return ignore.find(i) != ignore.end();
556 }
557
CreateModel_dynamic_output_shape_quant8_dim3_axis2(Model * model)558 void CreateModel_dynamic_output_shape_quant8_dim3_axis2(Model *model) {
559 OperandType type2(Type::FLOAT32, {});
560 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5}, 0.25f, 128);
561 OperandType type32(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.00390625f, 0);
562 // Phase 1, operands
563 auto op1 = model->addOperand(&type23);
564 auto param = model->addOperand(&type2);
565 auto op2 = model->addOperand(&type32);
566 // Phase 2, operations
567 static float param_init[] = {1.0f};
568 model->setOperandValue(param, param_init, sizeof(float) * 1);
569 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param}, {op2});
570 // Phase 3, inputs and outputs
571 model->identifyInputsAndOutputs(
572 {op1},
573 {op2});
574 assert(model->isValid());
575 }
576
is_ignored_dynamic_output_shape_quant8_dim3_axis2(int i)577 inline bool is_ignored_dynamic_output_shape_quant8_dim3_axis2(int i) {
578 static std::set<int> ignore = {};
579 return ignore.find(i) != ignore.end();
580 }
581
CreateModel_2(Model * model)582 void CreateModel_2(Model *model) {
583 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
584 OperandType type2(Type::FLOAT32, {});
585 // Phase 1, operands
586 auto op1 = model->addOperand(&type0);
587 auto param1 = model->addOperand(&type2);
588 auto op2 = model->addOperand(&type0);
589 // Phase 2, operations
590 static float param1_init[] = {1e-06f};
591 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
592 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
593 // Phase 3, inputs and outputs
594 model->identifyInputsAndOutputs(
595 {op1},
596 {op2});
597 assert(model->isValid());
598 }
599
is_ignored_2(int i)600 inline bool is_ignored_2(int i) {
601 static std::set<int> ignore = {};
602 return ignore.find(i) != ignore.end();
603 }
604
CreateModel_dim1_axis0_2(Model * model)605 void CreateModel_dim1_axis0_2(Model *model) {
606 OperandType type12(Type::TENSOR_FLOAT32, {5});
607 OperandType type2(Type::FLOAT32, {});
608 // Phase 1, operands
609 auto op1 = model->addOperand(&type12);
610 auto param1 = model->addOperand(&type2);
611 auto op2 = model->addOperand(&type12);
612 // Phase 2, operations
613 static float param1_init[] = {1e-06f};
614 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
615 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
616 // Phase 3, inputs and outputs
617 model->identifyInputsAndOutputs(
618 {op1},
619 {op2});
620 assert(model->isValid());
621 }
622
is_ignored_dim1_axis0_2(int i)623 inline bool is_ignored_dim1_axis0_2(int i) {
624 static std::set<int> ignore = {};
625 return ignore.find(i) != ignore.end();
626 }
627
CreateModel_dim3_axis2_2(Model * model)628 void CreateModel_dim3_axis2_2(Model *model) {
629 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
630 OperandType type2(Type::FLOAT32, {});
631 // Phase 1, operands
632 auto op1 = model->addOperand(&type13);
633 auto param1 = model->addOperand(&type2);
634 auto op2 = model->addOperand(&type13);
635 // Phase 2, operations
636 static float param1_init[] = {1e-06f};
637 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
638 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
639 // Phase 3, inputs and outputs
640 model->identifyInputsAndOutputs(
641 {op1},
642 {op2});
643 assert(model->isValid());
644 }
645
is_ignored_dim3_axis2_2(int i)646 inline bool is_ignored_dim3_axis2_2(int i) {
647 static std::set<int> ignore = {};
648 return ignore.find(i) != ignore.end();
649 }
650
CreateModel_relaxed_2(Model * model)651 void CreateModel_relaxed_2(Model *model) {
652 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
653 OperandType type2(Type::FLOAT32, {});
654 // Phase 1, operands
655 auto op1 = model->addOperand(&type0);
656 auto param1 = model->addOperand(&type2);
657 auto op2 = model->addOperand(&type0);
658 // Phase 2, operations
659 static float param1_init[] = {1e-06f};
660 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
661 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
662 // Phase 3, inputs and outputs
663 model->identifyInputsAndOutputs(
664 {op1},
665 {op2});
666 // Phase 4: set relaxed execution
667 model->relaxComputationFloat32toFloat16(true);
668 assert(model->isValid());
669 }
670
is_ignored_relaxed_2(int i)671 inline bool is_ignored_relaxed_2(int i) {
672 static std::set<int> ignore = {};
673 return ignore.find(i) != ignore.end();
674 }
675
CreateModel_relaxed_dim1_axis0_2(Model * model)676 void CreateModel_relaxed_dim1_axis0_2(Model *model) {
677 OperandType type12(Type::TENSOR_FLOAT32, {5});
678 OperandType type2(Type::FLOAT32, {});
679 // Phase 1, operands
680 auto op1 = model->addOperand(&type12);
681 auto param1 = model->addOperand(&type2);
682 auto op2 = model->addOperand(&type12);
683 // Phase 2, operations
684 static float param1_init[] = {1e-06f};
685 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
686 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {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_relaxed_dim1_axis0_2(int i)696 inline bool is_ignored_relaxed_dim1_axis0_2(int i) {
697 static std::set<int> ignore = {};
698 return ignore.find(i) != ignore.end();
699 }
700
CreateModel_relaxed_dim3_axis2_2(Model * model)701 void CreateModel_relaxed_dim3_axis2_2(Model *model) {
702 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
703 OperandType type2(Type::FLOAT32, {});
704 // Phase 1, operands
705 auto op1 = model->addOperand(&type13);
706 auto param1 = model->addOperand(&type2);
707 auto op2 = model->addOperand(&type13);
708 // Phase 2, operations
709 static float param1_init[] = {1e-06f};
710 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
711 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
712 // Phase 3, inputs and outputs
713 model->identifyInputsAndOutputs(
714 {op1},
715 {op2});
716 // Phase 4: set relaxed execution
717 model->relaxComputationFloat32toFloat16(true);
718 assert(model->isValid());
719 }
720
is_ignored_relaxed_dim3_axis2_2(int i)721 inline bool is_ignored_relaxed_dim3_axis2_2(int i) {
722 static std::set<int> ignore = {};
723 return ignore.find(i) != ignore.end();
724 }
725
CreateModel_float16_2(Model * model)726 void CreateModel_float16_2(Model *model) {
727 OperandType type14(Type::TENSOR_FLOAT16, {2, 2, 2, 5});
728 OperandType type15(Type::FLOAT16, {});
729 // Phase 1, operands
730 auto op1 = model->addOperand(&type14);
731 auto param1 = model->addOperand(&type15);
732 auto op2 = model->addOperand(&type14);
733 // Phase 2, operations
734 static _Float16 param1_init[] = {9.999999974752427e-07f};
735 model->setOperandValue(param1, param1_init, sizeof(_Float16) * 1);
736 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
737 // Phase 3, inputs and outputs
738 model->identifyInputsAndOutputs(
739 {op1},
740 {op2});
741 assert(model->isValid());
742 }
743
is_ignored_float16_2(int i)744 inline bool is_ignored_float16_2(int i) {
745 static std::set<int> ignore = {};
746 return ignore.find(i) != ignore.end();
747 }
748
CreateModel_float16_dim1_axis0_2(Model * model)749 void CreateModel_float16_dim1_axis0_2(Model *model) {
750 OperandType type15(Type::FLOAT16, {});
751 OperandType type17(Type::TENSOR_FLOAT16, {5});
752 // Phase 1, operands
753 auto op1 = model->addOperand(&type17);
754 auto param1 = model->addOperand(&type15);
755 auto op2 = model->addOperand(&type17);
756 // Phase 2, operations
757 static _Float16 param1_init[] = {9.999999974752427e-07f};
758 model->setOperandValue(param1, param1_init, sizeof(_Float16) * 1);
759 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
760 // Phase 3, inputs and outputs
761 model->identifyInputsAndOutputs(
762 {op1},
763 {op2});
764 assert(model->isValid());
765 }
766
is_ignored_float16_dim1_axis0_2(int i)767 inline bool is_ignored_float16_dim1_axis0_2(int i) {
768 static std::set<int> ignore = {};
769 return ignore.find(i) != ignore.end();
770 }
771
CreateModel_float16_dim3_axis2_2(Model * model)772 void CreateModel_float16_dim3_axis2_2(Model *model) {
773 OperandType type15(Type::FLOAT16, {});
774 OperandType type18(Type::TENSOR_FLOAT16, {2, 2, 5});
775 // Phase 1, operands
776 auto op1 = model->addOperand(&type18);
777 auto param1 = model->addOperand(&type15);
778 auto op2 = model->addOperand(&type18);
779 // Phase 2, operations
780 static _Float16 param1_init[] = {9.999999974752427e-07f};
781 model->setOperandValue(param1, param1_init, sizeof(_Float16) * 1);
782 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
783 // Phase 3, inputs and outputs
784 model->identifyInputsAndOutputs(
785 {op1},
786 {op2});
787 assert(model->isValid());
788 }
789
is_ignored_float16_dim3_axis2_2(int i)790 inline bool is_ignored_float16_dim3_axis2_2(int i) {
791 static std::set<int> ignore = {};
792 return ignore.find(i) != ignore.end();
793 }
794
CreateModel_quant8_2(Model * model)795 void CreateModel_quant8_2(Model *model) {
796 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 5}, 0.25f, 128);
797 OperandType type2(Type::FLOAT32, {});
798 OperandType type20(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 5}, 0.00390625f, 0);
799 // Phase 1, operands
800 auto op1 = model->addOperand(&type19);
801 auto param1 = model->addOperand(&type2);
802 auto op2 = model->addOperand(&type20);
803 // Phase 2, operations
804 static float param1_init[] = {1e-06f};
805 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
806 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
807 // Phase 3, inputs and outputs
808 model->identifyInputsAndOutputs(
809 {op1},
810 {op2});
811 assert(model->isValid());
812 }
813
is_ignored_quant8_2(int i)814 inline bool is_ignored_quant8_2(int i) {
815 static std::set<int> ignore = {};
816 return ignore.find(i) != ignore.end();
817 }
818
CreateModel_quant8_dim1_axis0_2(Model * model)819 void CreateModel_quant8_dim1_axis0_2(Model *model) {
820 OperandType type2(Type::FLOAT32, {});
821 OperandType type21(Type::TENSOR_QUANT8_ASYMM, {5}, 0.25f, 128);
822 OperandType type22(Type::TENSOR_QUANT8_ASYMM, {5}, 0.00390625f, 0);
823 // Phase 1, operands
824 auto op1 = model->addOperand(&type21);
825 auto param1 = model->addOperand(&type2);
826 auto op2 = model->addOperand(&type22);
827 // Phase 2, operations
828 static float param1_init[] = {1e-06f};
829 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
830 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
831 // Phase 3, inputs and outputs
832 model->identifyInputsAndOutputs(
833 {op1},
834 {op2});
835 assert(model->isValid());
836 }
837
is_ignored_quant8_dim1_axis0_2(int i)838 inline bool is_ignored_quant8_dim1_axis0_2(int i) {
839 static std::set<int> ignore = {};
840 return ignore.find(i) != ignore.end();
841 }
842
CreateModel_quant8_dim3_axis2_2(Model * model)843 void CreateModel_quant8_dim3_axis2_2(Model *model) {
844 OperandType type2(Type::FLOAT32, {});
845 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5}, 0.25f, 128);
846 OperandType type24(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5}, 0.00390625f, 0);
847 // Phase 1, operands
848 auto op1 = model->addOperand(&type23);
849 auto param1 = model->addOperand(&type2);
850 auto op2 = model->addOperand(&type24);
851 // Phase 2, operations
852 static float param1_init[] = {1e-06f};
853 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
854 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
855 // Phase 3, inputs and outputs
856 model->identifyInputsAndOutputs(
857 {op1},
858 {op2});
859 assert(model->isValid());
860 }
861
is_ignored_quant8_dim3_axis2_2(int i)862 inline bool is_ignored_quant8_dim3_axis2_2(int i) {
863 static std::set<int> ignore = {};
864 return ignore.find(i) != ignore.end();
865 }
866
CreateModel_dynamic_output_shape_2(Model * model)867 void CreateModel_dynamic_output_shape_2(Model *model) {
868 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
869 OperandType type2(Type::FLOAT32, {});
870 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
871 // Phase 1, operands
872 auto op1 = model->addOperand(&type0);
873 auto param1 = model->addOperand(&type2);
874 auto op2 = model->addOperand(&type25);
875 // Phase 2, operations
876 static float param1_init[] = {1e-06f};
877 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
878 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
879 // Phase 3, inputs and outputs
880 model->identifyInputsAndOutputs(
881 {op1},
882 {op2});
883 assert(model->isValid());
884 }
885
is_ignored_dynamic_output_shape_2(int i)886 inline bool is_ignored_dynamic_output_shape_2(int i) {
887 static std::set<int> ignore = {};
888 return ignore.find(i) != ignore.end();
889 }
890
CreateModel_dynamic_output_shape_dim1_axis0_2(Model * model)891 void CreateModel_dynamic_output_shape_dim1_axis0_2(Model *model) {
892 OperandType type12(Type::TENSOR_FLOAT32, {5});
893 OperandType type2(Type::FLOAT32, {});
894 OperandType type5(Type::TENSOR_FLOAT32, {0});
895 // Phase 1, operands
896 auto op1 = model->addOperand(&type12);
897 auto param1 = model->addOperand(&type2);
898 auto op2 = model->addOperand(&type5);
899 // Phase 2, operations
900 static float param1_init[] = {1e-06f};
901 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
902 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
903 // Phase 3, inputs and outputs
904 model->identifyInputsAndOutputs(
905 {op1},
906 {op2});
907 assert(model->isValid());
908 }
909
is_ignored_dynamic_output_shape_dim1_axis0_2(int i)910 inline bool is_ignored_dynamic_output_shape_dim1_axis0_2(int i) {
911 static std::set<int> ignore = {};
912 return ignore.find(i) != ignore.end();
913 }
914
CreateModel_dynamic_output_shape_dim3_axis2_2(Model * model)915 void CreateModel_dynamic_output_shape_dim3_axis2_2(Model *model) {
916 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
917 OperandType type2(Type::FLOAT32, {});
918 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
919 // Phase 1, operands
920 auto op1 = model->addOperand(&type13);
921 auto param1 = model->addOperand(&type2);
922 auto op2 = model->addOperand(&type26);
923 // Phase 2, operations
924 static float param1_init[] = {1e-06f};
925 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
926 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
927 // Phase 3, inputs and outputs
928 model->identifyInputsAndOutputs(
929 {op1},
930 {op2});
931 assert(model->isValid());
932 }
933
is_ignored_dynamic_output_shape_dim3_axis2_2(int i)934 inline bool is_ignored_dynamic_output_shape_dim3_axis2_2(int i) {
935 static std::set<int> ignore = {};
936 return ignore.find(i) != ignore.end();
937 }
938
CreateModel_dynamic_output_shape_relaxed_2(Model * model)939 void CreateModel_dynamic_output_shape_relaxed_2(Model *model) {
940 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
941 OperandType type2(Type::FLOAT32, {});
942 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
943 // Phase 1, operands
944 auto op1 = model->addOperand(&type0);
945 auto param1 = model->addOperand(&type2);
946 auto op2 = model->addOperand(&type25);
947 // Phase 2, operations
948 static float param1_init[] = {1e-06f};
949 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
950 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
951 // Phase 3, inputs and outputs
952 model->identifyInputsAndOutputs(
953 {op1},
954 {op2});
955 // Phase 4: set relaxed execution
956 model->relaxComputationFloat32toFloat16(true);
957 assert(model->isValid());
958 }
959
is_ignored_dynamic_output_shape_relaxed_2(int i)960 inline bool is_ignored_dynamic_output_shape_relaxed_2(int i) {
961 static std::set<int> ignore = {};
962 return ignore.find(i) != ignore.end();
963 }
964
CreateModel_dynamic_output_shape_relaxed_dim1_axis0_2(Model * model)965 void CreateModel_dynamic_output_shape_relaxed_dim1_axis0_2(Model *model) {
966 OperandType type12(Type::TENSOR_FLOAT32, {5});
967 OperandType type2(Type::FLOAT32, {});
968 OperandType type5(Type::TENSOR_FLOAT32, {0});
969 // Phase 1, operands
970 auto op1 = model->addOperand(&type12);
971 auto param1 = model->addOperand(&type2);
972 auto op2 = model->addOperand(&type5);
973 // Phase 2, operations
974 static float param1_init[] = {1e-06f};
975 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
976 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
977 // Phase 3, inputs and outputs
978 model->identifyInputsAndOutputs(
979 {op1},
980 {op2});
981 // Phase 4: set relaxed execution
982 model->relaxComputationFloat32toFloat16(true);
983 assert(model->isValid());
984 }
985
is_ignored_dynamic_output_shape_relaxed_dim1_axis0_2(int i)986 inline bool is_ignored_dynamic_output_shape_relaxed_dim1_axis0_2(int i) {
987 static std::set<int> ignore = {};
988 return ignore.find(i) != ignore.end();
989 }
990
CreateModel_dynamic_output_shape_relaxed_dim3_axis2_2(Model * model)991 void CreateModel_dynamic_output_shape_relaxed_dim3_axis2_2(Model *model) {
992 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
993 OperandType type2(Type::FLOAT32, {});
994 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
995 // Phase 1, operands
996 auto op1 = model->addOperand(&type13);
997 auto param1 = model->addOperand(&type2);
998 auto op2 = model->addOperand(&type26);
999 // Phase 2, operations
1000 static float param1_init[] = {1e-06f};
1001 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
1002 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
1003 // Phase 3, inputs and outputs
1004 model->identifyInputsAndOutputs(
1005 {op1},
1006 {op2});
1007 // Phase 4: set relaxed execution
1008 model->relaxComputationFloat32toFloat16(true);
1009 assert(model->isValid());
1010 }
1011
is_ignored_dynamic_output_shape_relaxed_dim3_axis2_2(int i)1012 inline bool is_ignored_dynamic_output_shape_relaxed_dim3_axis2_2(int i) {
1013 static std::set<int> ignore = {};
1014 return ignore.find(i) != ignore.end();
1015 }
1016
CreateModel_dynamic_output_shape_float16_2(Model * model)1017 void CreateModel_dynamic_output_shape_float16_2(Model *model) {
1018 OperandType type14(Type::TENSOR_FLOAT16, {2, 2, 2, 5});
1019 OperandType type15(Type::FLOAT16, {});
1020 OperandType type27(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
1021 // Phase 1, operands
1022 auto op1 = model->addOperand(&type14);
1023 auto param1 = model->addOperand(&type15);
1024 auto op2 = model->addOperand(&type27);
1025 // Phase 2, operations
1026 static _Float16 param1_init[] = {9.999999974752427e-07f};
1027 model->setOperandValue(param1, param1_init, sizeof(_Float16) * 1);
1028 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
1029 // Phase 3, inputs and outputs
1030 model->identifyInputsAndOutputs(
1031 {op1},
1032 {op2});
1033 assert(model->isValid());
1034 }
1035
is_ignored_dynamic_output_shape_float16_2(int i)1036 inline bool is_ignored_dynamic_output_shape_float16_2(int i) {
1037 static std::set<int> ignore = {};
1038 return ignore.find(i) != ignore.end();
1039 }
1040
CreateModel_dynamic_output_shape_float16_dim1_axis0_2(Model * model)1041 void CreateModel_dynamic_output_shape_float16_dim1_axis0_2(Model *model) {
1042 OperandType type15(Type::FLOAT16, {});
1043 OperandType type17(Type::TENSOR_FLOAT16, {5});
1044 OperandType type28(Type::TENSOR_FLOAT16, {0});
1045 // Phase 1, operands
1046 auto op1 = model->addOperand(&type17);
1047 auto param1 = model->addOperand(&type15);
1048 auto op2 = model->addOperand(&type28);
1049 // Phase 2, operations
1050 static _Float16 param1_init[] = {9.999999974752427e-07f};
1051 model->setOperandValue(param1, param1_init, sizeof(_Float16) * 1);
1052 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
1053 // Phase 3, inputs and outputs
1054 model->identifyInputsAndOutputs(
1055 {op1},
1056 {op2});
1057 assert(model->isValid());
1058 }
1059
is_ignored_dynamic_output_shape_float16_dim1_axis0_2(int i)1060 inline bool is_ignored_dynamic_output_shape_float16_dim1_axis0_2(int i) {
1061 static std::set<int> ignore = {};
1062 return ignore.find(i) != ignore.end();
1063 }
1064
CreateModel_dynamic_output_shape_float16_dim3_axis2_2(Model * model)1065 void CreateModel_dynamic_output_shape_float16_dim3_axis2_2(Model *model) {
1066 OperandType type15(Type::FLOAT16, {});
1067 OperandType type18(Type::TENSOR_FLOAT16, {2, 2, 5});
1068 OperandType type29(Type::TENSOR_FLOAT16, {0, 0, 0});
1069 // Phase 1, operands
1070 auto op1 = model->addOperand(&type18);
1071 auto param1 = model->addOperand(&type15);
1072 auto op2 = model->addOperand(&type29);
1073 // Phase 2, operations
1074 static _Float16 param1_init[] = {9.999999974752427e-07f};
1075 model->setOperandValue(param1, param1_init, sizeof(_Float16) * 1);
1076 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
1077 // Phase 3, inputs and outputs
1078 model->identifyInputsAndOutputs(
1079 {op1},
1080 {op2});
1081 assert(model->isValid());
1082 }
1083
is_ignored_dynamic_output_shape_float16_dim3_axis2_2(int i)1084 inline bool is_ignored_dynamic_output_shape_float16_dim3_axis2_2(int i) {
1085 static std::set<int> ignore = {};
1086 return ignore.find(i) != ignore.end();
1087 }
1088
CreateModel_dynamic_output_shape_quant8_2(Model * model)1089 void CreateModel_dynamic_output_shape_quant8_2(Model *model) {
1090 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 5}, 0.25f, 128);
1091 OperandType type2(Type::FLOAT32, {});
1092 OperandType type30(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.00390625f, 0);
1093 // Phase 1, operands
1094 auto op1 = model->addOperand(&type19);
1095 auto param1 = model->addOperand(&type2);
1096 auto op2 = model->addOperand(&type30);
1097 // Phase 2, operations
1098 static float param1_init[] = {1e-06f};
1099 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
1100 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
1101 // Phase 3, inputs and outputs
1102 model->identifyInputsAndOutputs(
1103 {op1},
1104 {op2});
1105 assert(model->isValid());
1106 }
1107
is_ignored_dynamic_output_shape_quant8_2(int i)1108 inline bool is_ignored_dynamic_output_shape_quant8_2(int i) {
1109 static std::set<int> ignore = {};
1110 return ignore.find(i) != ignore.end();
1111 }
1112
CreateModel_dynamic_output_shape_quant8_dim1_axis0_2(Model * model)1113 void CreateModel_dynamic_output_shape_quant8_dim1_axis0_2(Model *model) {
1114 OperandType type2(Type::FLOAT32, {});
1115 OperandType type21(Type::TENSOR_QUANT8_ASYMM, {5}, 0.25f, 128);
1116 OperandType type31(Type::TENSOR_QUANT8_ASYMM, {0}, 0.00390625f, 0);
1117 // Phase 1, operands
1118 auto op1 = model->addOperand(&type21);
1119 auto param1 = model->addOperand(&type2);
1120 auto op2 = model->addOperand(&type31);
1121 // Phase 2, operations
1122 static float param1_init[] = {1e-06f};
1123 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
1124 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
1125 // Phase 3, inputs and outputs
1126 model->identifyInputsAndOutputs(
1127 {op1},
1128 {op2});
1129 assert(model->isValid());
1130 }
1131
is_ignored_dynamic_output_shape_quant8_dim1_axis0_2(int i)1132 inline bool is_ignored_dynamic_output_shape_quant8_dim1_axis0_2(int i) {
1133 static std::set<int> ignore = {};
1134 return ignore.find(i) != ignore.end();
1135 }
1136
CreateModel_dynamic_output_shape_quant8_dim3_axis2_2(Model * model)1137 void CreateModel_dynamic_output_shape_quant8_dim3_axis2_2(Model *model) {
1138 OperandType type2(Type::FLOAT32, {});
1139 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5}, 0.25f, 128);
1140 OperandType type32(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.00390625f, 0);
1141 // Phase 1, operands
1142 auto op1 = model->addOperand(&type23);
1143 auto param1 = model->addOperand(&type2);
1144 auto op2 = model->addOperand(&type32);
1145 // Phase 2, operations
1146 static float param1_init[] = {1e-06f};
1147 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
1148 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param1}, {op2});
1149 // Phase 3, inputs and outputs
1150 model->identifyInputsAndOutputs(
1151 {op1},
1152 {op2});
1153 assert(model->isValid());
1154 }
1155
is_ignored_dynamic_output_shape_quant8_dim3_axis2_2(int i)1156 inline bool is_ignored_dynamic_output_shape_quant8_dim3_axis2_2(int i) {
1157 static std::set<int> ignore = {};
1158 return ignore.find(i) != ignore.end();
1159 }
1160
CreateModel_axis_dim4_axis0(Model * model)1161 void CreateModel_axis_dim4_axis0(Model *model) {
1162 OperandType type1(Type::INT32, {});
1163 OperandType type2(Type::FLOAT32, {});
1164 OperandType type33(Type::TENSOR_FLOAT32, {5, 2, 2, 2});
1165 // Phase 1, operands
1166 auto op1 = model->addOperand(&type33);
1167 auto param2 = model->addOperand(&type2);
1168 auto axis = model->addOperand(&type1);
1169 auto op2 = model->addOperand(&type33);
1170 // Phase 2, operations
1171 static float param2_init[] = {1.0f};
1172 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1173 static int32_t axis_init[] = {0};
1174 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1175 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1176 // Phase 3, inputs and outputs
1177 model->identifyInputsAndOutputs(
1178 {op1},
1179 {op2});
1180 assert(model->isValid());
1181 }
1182
is_ignored_axis_dim4_axis0(int i)1183 inline bool is_ignored_axis_dim4_axis0(int i) {
1184 static std::set<int> ignore = {};
1185 return ignore.find(i) != ignore.end();
1186 }
1187
CreateModel_axis_dim4_axis0_neg(Model * model)1188 void CreateModel_axis_dim4_axis0_neg(Model *model) {
1189 OperandType type1(Type::INT32, {});
1190 OperandType type2(Type::FLOAT32, {});
1191 OperandType type33(Type::TENSOR_FLOAT32, {5, 2, 2, 2});
1192 // Phase 1, operands
1193 auto op1 = model->addOperand(&type33);
1194 auto param2 = model->addOperand(&type2);
1195 auto axis = model->addOperand(&type1);
1196 auto op2 = model->addOperand(&type33);
1197 // Phase 2, operations
1198 static float param2_init[] = {1.0f};
1199 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1200 static int32_t axis_init[] = {-4};
1201 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1202 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1203 // Phase 3, inputs and outputs
1204 model->identifyInputsAndOutputs(
1205 {op1},
1206 {op2});
1207 assert(model->isValid());
1208 }
1209
is_ignored_axis_dim4_axis0_neg(int i)1210 inline bool is_ignored_axis_dim4_axis0_neg(int i) {
1211 static std::set<int> ignore = {};
1212 return ignore.find(i) != ignore.end();
1213 }
1214
CreateModel_axis_dim4_axis1(Model * model)1215 void CreateModel_axis_dim4_axis1(Model *model) {
1216 OperandType type1(Type::INT32, {});
1217 OperandType type2(Type::FLOAT32, {});
1218 OperandType type34(Type::TENSOR_FLOAT32, {2, 5, 2, 2});
1219 // Phase 1, operands
1220 auto op1 = model->addOperand(&type34);
1221 auto param2 = model->addOperand(&type2);
1222 auto axis = model->addOperand(&type1);
1223 auto op2 = model->addOperand(&type34);
1224 // Phase 2, operations
1225 static float param2_init[] = {1.0f};
1226 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1227 static int32_t axis_init[] = {1};
1228 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1229 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1230 // Phase 3, inputs and outputs
1231 model->identifyInputsAndOutputs(
1232 {op1},
1233 {op2});
1234 assert(model->isValid());
1235 }
1236
is_ignored_axis_dim4_axis1(int i)1237 inline bool is_ignored_axis_dim4_axis1(int i) {
1238 static std::set<int> ignore = {};
1239 return ignore.find(i) != ignore.end();
1240 }
1241
CreateModel_axis_dim4_axis1_neg(Model * model)1242 void CreateModel_axis_dim4_axis1_neg(Model *model) {
1243 OperandType type1(Type::INT32, {});
1244 OperandType type2(Type::FLOAT32, {});
1245 OperandType type34(Type::TENSOR_FLOAT32, {2, 5, 2, 2});
1246 // Phase 1, operands
1247 auto op1 = model->addOperand(&type34);
1248 auto param2 = model->addOperand(&type2);
1249 auto axis = model->addOperand(&type1);
1250 auto op2 = model->addOperand(&type34);
1251 // Phase 2, operations
1252 static float param2_init[] = {1.0f};
1253 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1254 static int32_t axis_init[] = {-3};
1255 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1256 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1257 // Phase 3, inputs and outputs
1258 model->identifyInputsAndOutputs(
1259 {op1},
1260 {op2});
1261 assert(model->isValid());
1262 }
1263
is_ignored_axis_dim4_axis1_neg(int i)1264 inline bool is_ignored_axis_dim4_axis1_neg(int i) {
1265 static std::set<int> ignore = {};
1266 return ignore.find(i) != ignore.end();
1267 }
1268
CreateModel_axis_dim4_axis2(Model * model)1269 void CreateModel_axis_dim4_axis2(Model *model) {
1270 OperandType type1(Type::INT32, {});
1271 OperandType type2(Type::FLOAT32, {});
1272 OperandType type35(Type::TENSOR_FLOAT32, {2, 2, 5, 2});
1273 // Phase 1, operands
1274 auto op1 = model->addOperand(&type35);
1275 auto param2 = model->addOperand(&type2);
1276 auto axis = model->addOperand(&type1);
1277 auto op2 = model->addOperand(&type35);
1278 // Phase 2, operations
1279 static float param2_init[] = {1.0f};
1280 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1281 static int32_t axis_init[] = {2};
1282 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1283 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1284 // Phase 3, inputs and outputs
1285 model->identifyInputsAndOutputs(
1286 {op1},
1287 {op2});
1288 assert(model->isValid());
1289 }
1290
is_ignored_axis_dim4_axis2(int i)1291 inline bool is_ignored_axis_dim4_axis2(int i) {
1292 static std::set<int> ignore = {};
1293 return ignore.find(i) != ignore.end();
1294 }
1295
CreateModel_axis_dim4_axis2_neg(Model * model)1296 void CreateModel_axis_dim4_axis2_neg(Model *model) {
1297 OperandType type1(Type::INT32, {});
1298 OperandType type2(Type::FLOAT32, {});
1299 OperandType type35(Type::TENSOR_FLOAT32, {2, 2, 5, 2});
1300 // Phase 1, operands
1301 auto op1 = model->addOperand(&type35);
1302 auto param2 = model->addOperand(&type2);
1303 auto axis = model->addOperand(&type1);
1304 auto op2 = model->addOperand(&type35);
1305 // Phase 2, operations
1306 static float param2_init[] = {1.0f};
1307 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1308 static int32_t axis_init[] = {-2};
1309 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1310 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1311 // Phase 3, inputs and outputs
1312 model->identifyInputsAndOutputs(
1313 {op1},
1314 {op2});
1315 assert(model->isValid());
1316 }
1317
is_ignored_axis_dim4_axis2_neg(int i)1318 inline bool is_ignored_axis_dim4_axis2_neg(int i) {
1319 static std::set<int> ignore = {};
1320 return ignore.find(i) != ignore.end();
1321 }
1322
CreateModel_axis_dim4_axis3(Model * model)1323 void CreateModel_axis_dim4_axis3(Model *model) {
1324 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
1325 OperandType type1(Type::INT32, {});
1326 OperandType type2(Type::FLOAT32, {});
1327 // Phase 1, operands
1328 auto op1 = model->addOperand(&type0);
1329 auto param2 = model->addOperand(&type2);
1330 auto axis = model->addOperand(&type1);
1331 auto op2 = model->addOperand(&type0);
1332 // Phase 2, operations
1333 static float param2_init[] = {1.0f};
1334 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1335 static int32_t axis_init[] = {3};
1336 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1337 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1338 // Phase 3, inputs and outputs
1339 model->identifyInputsAndOutputs(
1340 {op1},
1341 {op2});
1342 assert(model->isValid());
1343 }
1344
is_ignored_axis_dim4_axis3(int i)1345 inline bool is_ignored_axis_dim4_axis3(int i) {
1346 static std::set<int> ignore = {};
1347 return ignore.find(i) != ignore.end();
1348 }
1349
CreateModel_axis_dim4_axis3_neg(Model * model)1350 void CreateModel_axis_dim4_axis3_neg(Model *model) {
1351 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
1352 OperandType type1(Type::INT32, {});
1353 OperandType type2(Type::FLOAT32, {});
1354 // Phase 1, operands
1355 auto op1 = model->addOperand(&type0);
1356 auto param2 = model->addOperand(&type2);
1357 auto axis = model->addOperand(&type1);
1358 auto op2 = model->addOperand(&type0);
1359 // Phase 2, operations
1360 static float param2_init[] = {1.0f};
1361 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1362 static int32_t axis_init[] = {-1};
1363 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1364 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1365 // Phase 3, inputs and outputs
1366 model->identifyInputsAndOutputs(
1367 {op1},
1368 {op2});
1369 assert(model->isValid());
1370 }
1371
is_ignored_axis_dim4_axis3_neg(int i)1372 inline bool is_ignored_axis_dim4_axis3_neg(int i) {
1373 static std::set<int> ignore = {};
1374 return ignore.find(i) != ignore.end();
1375 }
1376
CreateModel_axis_dim3_axis0(Model * model)1377 void CreateModel_axis_dim3_axis0(Model *model) {
1378 OperandType type1(Type::INT32, {});
1379 OperandType type2(Type::FLOAT32, {});
1380 OperandType type36(Type::TENSOR_FLOAT32, {5, 2, 2});
1381 // Phase 1, operands
1382 auto op1 = model->addOperand(&type36);
1383 auto param2 = model->addOperand(&type2);
1384 auto axis = model->addOperand(&type1);
1385 auto op2 = model->addOperand(&type36);
1386 // Phase 2, operations
1387 static float param2_init[] = {1.0f};
1388 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1389 static int32_t axis_init[] = {0};
1390 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1391 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1392 // Phase 3, inputs and outputs
1393 model->identifyInputsAndOutputs(
1394 {op1},
1395 {op2});
1396 assert(model->isValid());
1397 }
1398
is_ignored_axis_dim3_axis0(int i)1399 inline bool is_ignored_axis_dim3_axis0(int i) {
1400 static std::set<int> ignore = {};
1401 return ignore.find(i) != ignore.end();
1402 }
1403
CreateModel_axis_dim3_axis0_neg(Model * model)1404 void CreateModel_axis_dim3_axis0_neg(Model *model) {
1405 OperandType type1(Type::INT32, {});
1406 OperandType type2(Type::FLOAT32, {});
1407 OperandType type36(Type::TENSOR_FLOAT32, {5, 2, 2});
1408 // Phase 1, operands
1409 auto op1 = model->addOperand(&type36);
1410 auto param2 = model->addOperand(&type2);
1411 auto axis = model->addOperand(&type1);
1412 auto op2 = model->addOperand(&type36);
1413 // Phase 2, operations
1414 static float param2_init[] = {1.0f};
1415 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1416 static int32_t axis_init[] = {-3};
1417 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1418 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1419 // Phase 3, inputs and outputs
1420 model->identifyInputsAndOutputs(
1421 {op1},
1422 {op2});
1423 assert(model->isValid());
1424 }
1425
is_ignored_axis_dim3_axis0_neg(int i)1426 inline bool is_ignored_axis_dim3_axis0_neg(int i) {
1427 static std::set<int> ignore = {};
1428 return ignore.find(i) != ignore.end();
1429 }
1430
CreateModel_axis_dim3_axis1(Model * model)1431 void CreateModel_axis_dim3_axis1(Model *model) {
1432 OperandType type1(Type::INT32, {});
1433 OperandType type2(Type::FLOAT32, {});
1434 OperandType type37(Type::TENSOR_FLOAT32, {2, 5, 2});
1435 // Phase 1, operands
1436 auto op1 = model->addOperand(&type37);
1437 auto param2 = model->addOperand(&type2);
1438 auto axis = model->addOperand(&type1);
1439 auto op2 = model->addOperand(&type37);
1440 // Phase 2, operations
1441 static float param2_init[] = {1.0f};
1442 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1443 static int32_t axis_init[] = {1};
1444 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1445 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1446 // Phase 3, inputs and outputs
1447 model->identifyInputsAndOutputs(
1448 {op1},
1449 {op2});
1450 assert(model->isValid());
1451 }
1452
is_ignored_axis_dim3_axis1(int i)1453 inline bool is_ignored_axis_dim3_axis1(int i) {
1454 static std::set<int> ignore = {};
1455 return ignore.find(i) != ignore.end();
1456 }
1457
CreateModel_axis_dim3_axis1_neg(Model * model)1458 void CreateModel_axis_dim3_axis1_neg(Model *model) {
1459 OperandType type1(Type::INT32, {});
1460 OperandType type2(Type::FLOAT32, {});
1461 OperandType type37(Type::TENSOR_FLOAT32, {2, 5, 2});
1462 // Phase 1, operands
1463 auto op1 = model->addOperand(&type37);
1464 auto param2 = model->addOperand(&type2);
1465 auto axis = model->addOperand(&type1);
1466 auto op2 = model->addOperand(&type37);
1467 // Phase 2, operations
1468 static float param2_init[] = {1.0f};
1469 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1470 static int32_t axis_init[] = {-2};
1471 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1472 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1473 // Phase 3, inputs and outputs
1474 model->identifyInputsAndOutputs(
1475 {op1},
1476 {op2});
1477 assert(model->isValid());
1478 }
1479
is_ignored_axis_dim3_axis1_neg(int i)1480 inline bool is_ignored_axis_dim3_axis1_neg(int i) {
1481 static std::set<int> ignore = {};
1482 return ignore.find(i) != ignore.end();
1483 }
1484
CreateModel_axis_dim3_axis2(Model * model)1485 void CreateModel_axis_dim3_axis2(Model *model) {
1486 OperandType type1(Type::INT32, {});
1487 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
1488 OperandType type2(Type::FLOAT32, {});
1489 // Phase 1, operands
1490 auto op1 = model->addOperand(&type13);
1491 auto param2 = model->addOperand(&type2);
1492 auto axis = model->addOperand(&type1);
1493 auto op2 = model->addOperand(&type13);
1494 // Phase 2, operations
1495 static float param2_init[] = {1.0f};
1496 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1497 static int32_t axis_init[] = {2};
1498 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1499 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1500 // Phase 3, inputs and outputs
1501 model->identifyInputsAndOutputs(
1502 {op1},
1503 {op2});
1504 assert(model->isValid());
1505 }
1506
is_ignored_axis_dim3_axis2(int i)1507 inline bool is_ignored_axis_dim3_axis2(int i) {
1508 static std::set<int> ignore = {};
1509 return ignore.find(i) != ignore.end();
1510 }
1511
CreateModel_axis_dim3_axis2_neg(Model * model)1512 void CreateModel_axis_dim3_axis2_neg(Model *model) {
1513 OperandType type1(Type::INT32, {});
1514 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
1515 OperandType type2(Type::FLOAT32, {});
1516 // Phase 1, operands
1517 auto op1 = model->addOperand(&type13);
1518 auto param2 = model->addOperand(&type2);
1519 auto axis = model->addOperand(&type1);
1520 auto op2 = model->addOperand(&type13);
1521 // Phase 2, operations
1522 static float param2_init[] = {1.0f};
1523 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1524 static int32_t axis_init[] = {-1};
1525 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1526 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1527 // Phase 3, inputs and outputs
1528 model->identifyInputsAndOutputs(
1529 {op1},
1530 {op2});
1531 assert(model->isValid());
1532 }
1533
is_ignored_axis_dim3_axis2_neg(int i)1534 inline bool is_ignored_axis_dim3_axis2_neg(int i) {
1535 static std::set<int> ignore = {};
1536 return ignore.find(i) != ignore.end();
1537 }
1538
CreateModel_axis_dim2_axis0(Model * model)1539 void CreateModel_axis_dim2_axis0(Model *model) {
1540 OperandType type1(Type::INT32, {});
1541 OperandType type2(Type::FLOAT32, {});
1542 OperandType type38(Type::TENSOR_FLOAT32, {5, 2});
1543 // Phase 1, operands
1544 auto op1 = model->addOperand(&type38);
1545 auto param2 = model->addOperand(&type2);
1546 auto axis = model->addOperand(&type1);
1547 auto op2 = model->addOperand(&type38);
1548 // Phase 2, operations
1549 static float param2_init[] = {1.0f};
1550 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1551 static int32_t axis_init[] = {0};
1552 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1553 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1554 // Phase 3, inputs and outputs
1555 model->identifyInputsAndOutputs(
1556 {op1},
1557 {op2});
1558 assert(model->isValid());
1559 }
1560
is_ignored_axis_dim2_axis0(int i)1561 inline bool is_ignored_axis_dim2_axis0(int i) {
1562 static std::set<int> ignore = {};
1563 return ignore.find(i) != ignore.end();
1564 }
1565
CreateModel_axis_dim2_axis0_neg(Model * model)1566 void CreateModel_axis_dim2_axis0_neg(Model *model) {
1567 OperandType type1(Type::INT32, {});
1568 OperandType type2(Type::FLOAT32, {});
1569 OperandType type38(Type::TENSOR_FLOAT32, {5, 2});
1570 // Phase 1, operands
1571 auto op1 = model->addOperand(&type38);
1572 auto param2 = model->addOperand(&type2);
1573 auto axis = model->addOperand(&type1);
1574 auto op2 = model->addOperand(&type38);
1575 // Phase 2, operations
1576 static float param2_init[] = {1.0f};
1577 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1578 static int32_t axis_init[] = {-2};
1579 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1580 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1581 // Phase 3, inputs and outputs
1582 model->identifyInputsAndOutputs(
1583 {op1},
1584 {op2});
1585 assert(model->isValid());
1586 }
1587
is_ignored_axis_dim2_axis0_neg(int i)1588 inline bool is_ignored_axis_dim2_axis0_neg(int i) {
1589 static std::set<int> ignore = {};
1590 return ignore.find(i) != ignore.end();
1591 }
1592
CreateModel_axis_dim2_axis1(Model * model)1593 void CreateModel_axis_dim2_axis1(Model *model) {
1594 OperandType type1(Type::INT32, {});
1595 OperandType type2(Type::FLOAT32, {});
1596 OperandType type39(Type::TENSOR_FLOAT32, {2, 5});
1597 // Phase 1, operands
1598 auto op1 = model->addOperand(&type39);
1599 auto param2 = model->addOperand(&type2);
1600 auto axis = model->addOperand(&type1);
1601 auto op2 = model->addOperand(&type39);
1602 // Phase 2, operations
1603 static float param2_init[] = {1.0f};
1604 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1605 static int32_t axis_init[] = {1};
1606 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1607 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1608 // Phase 3, inputs and outputs
1609 model->identifyInputsAndOutputs(
1610 {op1},
1611 {op2});
1612 assert(model->isValid());
1613 }
1614
is_ignored_axis_dim2_axis1(int i)1615 inline bool is_ignored_axis_dim2_axis1(int i) {
1616 static std::set<int> ignore = {};
1617 return ignore.find(i) != ignore.end();
1618 }
1619
CreateModel_axis_dim2_axis1_neg(Model * model)1620 void CreateModel_axis_dim2_axis1_neg(Model *model) {
1621 OperandType type1(Type::INT32, {});
1622 OperandType type2(Type::FLOAT32, {});
1623 OperandType type39(Type::TENSOR_FLOAT32, {2, 5});
1624 // Phase 1, operands
1625 auto op1 = model->addOperand(&type39);
1626 auto param2 = model->addOperand(&type2);
1627 auto axis = model->addOperand(&type1);
1628 auto op2 = model->addOperand(&type39);
1629 // Phase 2, operations
1630 static float param2_init[] = {1.0f};
1631 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1632 static int32_t axis_init[] = {-1};
1633 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1634 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1635 // Phase 3, inputs and outputs
1636 model->identifyInputsAndOutputs(
1637 {op1},
1638 {op2});
1639 assert(model->isValid());
1640 }
1641
is_ignored_axis_dim2_axis1_neg(int i)1642 inline bool is_ignored_axis_dim2_axis1_neg(int i) {
1643 static std::set<int> ignore = {};
1644 return ignore.find(i) != ignore.end();
1645 }
1646
CreateModel_axis_dim1_axis0(Model * model)1647 void CreateModel_axis_dim1_axis0(Model *model) {
1648 OperandType type1(Type::INT32, {});
1649 OperandType type12(Type::TENSOR_FLOAT32, {5});
1650 OperandType type2(Type::FLOAT32, {});
1651 // Phase 1, operands
1652 auto op1 = model->addOperand(&type12);
1653 auto param2 = model->addOperand(&type2);
1654 auto axis = model->addOperand(&type1);
1655 auto op2 = model->addOperand(&type12);
1656 // Phase 2, operations
1657 static float param2_init[] = {1.0f};
1658 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1659 static int32_t axis_init[] = {0};
1660 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1661 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1662 // Phase 3, inputs and outputs
1663 model->identifyInputsAndOutputs(
1664 {op1},
1665 {op2});
1666 assert(model->isValid());
1667 }
1668
is_ignored_axis_dim1_axis0(int i)1669 inline bool is_ignored_axis_dim1_axis0(int i) {
1670 static std::set<int> ignore = {};
1671 return ignore.find(i) != ignore.end();
1672 }
1673
CreateModel_axis_dim1_axis0_neg(Model * model)1674 void CreateModel_axis_dim1_axis0_neg(Model *model) {
1675 OperandType type1(Type::INT32, {});
1676 OperandType type12(Type::TENSOR_FLOAT32, {5});
1677 OperandType type2(Type::FLOAT32, {});
1678 // Phase 1, operands
1679 auto op1 = model->addOperand(&type12);
1680 auto param2 = model->addOperand(&type2);
1681 auto axis = model->addOperand(&type1);
1682 auto op2 = model->addOperand(&type12);
1683 // Phase 2, operations
1684 static float param2_init[] = {1.0f};
1685 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1686 static int32_t axis_init[] = {-1};
1687 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1688 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1689 // Phase 3, inputs and outputs
1690 model->identifyInputsAndOutputs(
1691 {op1},
1692 {op2});
1693 assert(model->isValid());
1694 }
1695
is_ignored_axis_dim1_axis0_neg(int i)1696 inline bool is_ignored_axis_dim1_axis0_neg(int i) {
1697 static std::set<int> ignore = {};
1698 return ignore.find(i) != ignore.end();
1699 }
1700
CreateModel_axis_relaxed_dim4_axis0(Model * model)1701 void CreateModel_axis_relaxed_dim4_axis0(Model *model) {
1702 OperandType type1(Type::INT32, {});
1703 OperandType type2(Type::FLOAT32, {});
1704 OperandType type33(Type::TENSOR_FLOAT32, {5, 2, 2, 2});
1705 // Phase 1, operands
1706 auto op1 = model->addOperand(&type33);
1707 auto param2 = model->addOperand(&type2);
1708 auto axis = model->addOperand(&type1);
1709 auto op2 = model->addOperand(&type33);
1710 // Phase 2, operations
1711 static float param2_init[] = {1.0f};
1712 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1713 static int32_t axis_init[] = {0};
1714 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1715 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1716 // Phase 3, inputs and outputs
1717 model->identifyInputsAndOutputs(
1718 {op1},
1719 {op2});
1720 // Phase 4: set relaxed execution
1721 model->relaxComputationFloat32toFloat16(true);
1722 assert(model->isValid());
1723 }
1724
is_ignored_axis_relaxed_dim4_axis0(int i)1725 inline bool is_ignored_axis_relaxed_dim4_axis0(int i) {
1726 static std::set<int> ignore = {};
1727 return ignore.find(i) != ignore.end();
1728 }
1729
CreateModel_axis_relaxed_dim4_axis0_neg(Model * model)1730 void CreateModel_axis_relaxed_dim4_axis0_neg(Model *model) {
1731 OperandType type1(Type::INT32, {});
1732 OperandType type2(Type::FLOAT32, {});
1733 OperandType type33(Type::TENSOR_FLOAT32, {5, 2, 2, 2});
1734 // Phase 1, operands
1735 auto op1 = model->addOperand(&type33);
1736 auto param2 = model->addOperand(&type2);
1737 auto axis = model->addOperand(&type1);
1738 auto op2 = model->addOperand(&type33);
1739 // Phase 2, operations
1740 static float param2_init[] = {1.0f};
1741 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1742 static int32_t axis_init[] = {-4};
1743 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1744 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1745 // Phase 3, inputs and outputs
1746 model->identifyInputsAndOutputs(
1747 {op1},
1748 {op2});
1749 // Phase 4: set relaxed execution
1750 model->relaxComputationFloat32toFloat16(true);
1751 assert(model->isValid());
1752 }
1753
is_ignored_axis_relaxed_dim4_axis0_neg(int i)1754 inline bool is_ignored_axis_relaxed_dim4_axis0_neg(int i) {
1755 static std::set<int> ignore = {};
1756 return ignore.find(i) != ignore.end();
1757 }
1758
CreateModel_axis_relaxed_dim4_axis1(Model * model)1759 void CreateModel_axis_relaxed_dim4_axis1(Model *model) {
1760 OperandType type1(Type::INT32, {});
1761 OperandType type2(Type::FLOAT32, {});
1762 OperandType type34(Type::TENSOR_FLOAT32, {2, 5, 2, 2});
1763 // Phase 1, operands
1764 auto op1 = model->addOperand(&type34);
1765 auto param2 = model->addOperand(&type2);
1766 auto axis = model->addOperand(&type1);
1767 auto op2 = model->addOperand(&type34);
1768 // Phase 2, operations
1769 static float param2_init[] = {1.0f};
1770 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1771 static int32_t axis_init[] = {1};
1772 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1773 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1774 // Phase 3, inputs and outputs
1775 model->identifyInputsAndOutputs(
1776 {op1},
1777 {op2});
1778 // Phase 4: set relaxed execution
1779 model->relaxComputationFloat32toFloat16(true);
1780 assert(model->isValid());
1781 }
1782
is_ignored_axis_relaxed_dim4_axis1(int i)1783 inline bool is_ignored_axis_relaxed_dim4_axis1(int i) {
1784 static std::set<int> ignore = {};
1785 return ignore.find(i) != ignore.end();
1786 }
1787
CreateModel_axis_relaxed_dim4_axis1_neg(Model * model)1788 void CreateModel_axis_relaxed_dim4_axis1_neg(Model *model) {
1789 OperandType type1(Type::INT32, {});
1790 OperandType type2(Type::FLOAT32, {});
1791 OperandType type34(Type::TENSOR_FLOAT32, {2, 5, 2, 2});
1792 // Phase 1, operands
1793 auto op1 = model->addOperand(&type34);
1794 auto param2 = model->addOperand(&type2);
1795 auto axis = model->addOperand(&type1);
1796 auto op2 = model->addOperand(&type34);
1797 // Phase 2, operations
1798 static float param2_init[] = {1.0f};
1799 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1800 static int32_t axis_init[] = {-3};
1801 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1802 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1803 // Phase 3, inputs and outputs
1804 model->identifyInputsAndOutputs(
1805 {op1},
1806 {op2});
1807 // Phase 4: set relaxed execution
1808 model->relaxComputationFloat32toFloat16(true);
1809 assert(model->isValid());
1810 }
1811
is_ignored_axis_relaxed_dim4_axis1_neg(int i)1812 inline bool is_ignored_axis_relaxed_dim4_axis1_neg(int i) {
1813 static std::set<int> ignore = {};
1814 return ignore.find(i) != ignore.end();
1815 }
1816
CreateModel_axis_relaxed_dim4_axis2(Model * model)1817 void CreateModel_axis_relaxed_dim4_axis2(Model *model) {
1818 OperandType type1(Type::INT32, {});
1819 OperandType type2(Type::FLOAT32, {});
1820 OperandType type35(Type::TENSOR_FLOAT32, {2, 2, 5, 2});
1821 // Phase 1, operands
1822 auto op1 = model->addOperand(&type35);
1823 auto param2 = model->addOperand(&type2);
1824 auto axis = model->addOperand(&type1);
1825 auto op2 = model->addOperand(&type35);
1826 // Phase 2, operations
1827 static float param2_init[] = {1.0f};
1828 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1829 static int32_t axis_init[] = {2};
1830 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1831 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1832 // Phase 3, inputs and outputs
1833 model->identifyInputsAndOutputs(
1834 {op1},
1835 {op2});
1836 // Phase 4: set relaxed execution
1837 model->relaxComputationFloat32toFloat16(true);
1838 assert(model->isValid());
1839 }
1840
is_ignored_axis_relaxed_dim4_axis2(int i)1841 inline bool is_ignored_axis_relaxed_dim4_axis2(int i) {
1842 static std::set<int> ignore = {};
1843 return ignore.find(i) != ignore.end();
1844 }
1845
CreateModel_axis_relaxed_dim4_axis2_neg(Model * model)1846 void CreateModel_axis_relaxed_dim4_axis2_neg(Model *model) {
1847 OperandType type1(Type::INT32, {});
1848 OperandType type2(Type::FLOAT32, {});
1849 OperandType type35(Type::TENSOR_FLOAT32, {2, 2, 5, 2});
1850 // Phase 1, operands
1851 auto op1 = model->addOperand(&type35);
1852 auto param2 = model->addOperand(&type2);
1853 auto axis = model->addOperand(&type1);
1854 auto op2 = model->addOperand(&type35);
1855 // Phase 2, operations
1856 static float param2_init[] = {1.0f};
1857 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1858 static int32_t axis_init[] = {-2};
1859 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1860 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1861 // Phase 3, inputs and outputs
1862 model->identifyInputsAndOutputs(
1863 {op1},
1864 {op2});
1865 // Phase 4: set relaxed execution
1866 model->relaxComputationFloat32toFloat16(true);
1867 assert(model->isValid());
1868 }
1869
is_ignored_axis_relaxed_dim4_axis2_neg(int i)1870 inline bool is_ignored_axis_relaxed_dim4_axis2_neg(int i) {
1871 static std::set<int> ignore = {};
1872 return ignore.find(i) != ignore.end();
1873 }
1874
CreateModel_axis_relaxed_dim4_axis3(Model * model)1875 void CreateModel_axis_relaxed_dim4_axis3(Model *model) {
1876 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
1877 OperandType type1(Type::INT32, {});
1878 OperandType type2(Type::FLOAT32, {});
1879 // Phase 1, operands
1880 auto op1 = model->addOperand(&type0);
1881 auto param2 = model->addOperand(&type2);
1882 auto axis = model->addOperand(&type1);
1883 auto op2 = model->addOperand(&type0);
1884 // Phase 2, operations
1885 static float param2_init[] = {1.0f};
1886 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1887 static int32_t axis_init[] = {3};
1888 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1889 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1890 // Phase 3, inputs and outputs
1891 model->identifyInputsAndOutputs(
1892 {op1},
1893 {op2});
1894 // Phase 4: set relaxed execution
1895 model->relaxComputationFloat32toFloat16(true);
1896 assert(model->isValid());
1897 }
1898
is_ignored_axis_relaxed_dim4_axis3(int i)1899 inline bool is_ignored_axis_relaxed_dim4_axis3(int i) {
1900 static std::set<int> ignore = {};
1901 return ignore.find(i) != ignore.end();
1902 }
1903
CreateModel_axis_relaxed_dim4_axis3_neg(Model * model)1904 void CreateModel_axis_relaxed_dim4_axis3_neg(Model *model) {
1905 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
1906 OperandType type1(Type::INT32, {});
1907 OperandType type2(Type::FLOAT32, {});
1908 // Phase 1, operands
1909 auto op1 = model->addOperand(&type0);
1910 auto param2 = model->addOperand(&type2);
1911 auto axis = model->addOperand(&type1);
1912 auto op2 = model->addOperand(&type0);
1913 // Phase 2, operations
1914 static float param2_init[] = {1.0f};
1915 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1916 static int32_t axis_init[] = {-1};
1917 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1918 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1919 // Phase 3, inputs and outputs
1920 model->identifyInputsAndOutputs(
1921 {op1},
1922 {op2});
1923 // Phase 4: set relaxed execution
1924 model->relaxComputationFloat32toFloat16(true);
1925 assert(model->isValid());
1926 }
1927
is_ignored_axis_relaxed_dim4_axis3_neg(int i)1928 inline bool is_ignored_axis_relaxed_dim4_axis3_neg(int i) {
1929 static std::set<int> ignore = {};
1930 return ignore.find(i) != ignore.end();
1931 }
1932
CreateModel_axis_relaxed_dim3_axis0(Model * model)1933 void CreateModel_axis_relaxed_dim3_axis0(Model *model) {
1934 OperandType type1(Type::INT32, {});
1935 OperandType type2(Type::FLOAT32, {});
1936 OperandType type36(Type::TENSOR_FLOAT32, {5, 2, 2});
1937 // Phase 1, operands
1938 auto op1 = model->addOperand(&type36);
1939 auto param2 = model->addOperand(&type2);
1940 auto axis = model->addOperand(&type1);
1941 auto op2 = model->addOperand(&type36);
1942 // Phase 2, operations
1943 static float param2_init[] = {1.0f};
1944 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1945 static int32_t axis_init[] = {0};
1946 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1947 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1948 // Phase 3, inputs and outputs
1949 model->identifyInputsAndOutputs(
1950 {op1},
1951 {op2});
1952 // Phase 4: set relaxed execution
1953 model->relaxComputationFloat32toFloat16(true);
1954 assert(model->isValid());
1955 }
1956
is_ignored_axis_relaxed_dim3_axis0(int i)1957 inline bool is_ignored_axis_relaxed_dim3_axis0(int i) {
1958 static std::set<int> ignore = {};
1959 return ignore.find(i) != ignore.end();
1960 }
1961
CreateModel_axis_relaxed_dim3_axis0_neg(Model * model)1962 void CreateModel_axis_relaxed_dim3_axis0_neg(Model *model) {
1963 OperandType type1(Type::INT32, {});
1964 OperandType type2(Type::FLOAT32, {});
1965 OperandType type36(Type::TENSOR_FLOAT32, {5, 2, 2});
1966 // Phase 1, operands
1967 auto op1 = model->addOperand(&type36);
1968 auto param2 = model->addOperand(&type2);
1969 auto axis = model->addOperand(&type1);
1970 auto op2 = model->addOperand(&type36);
1971 // Phase 2, operations
1972 static float param2_init[] = {1.0f};
1973 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
1974 static int32_t axis_init[] = {-3};
1975 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
1976 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
1977 // Phase 3, inputs and outputs
1978 model->identifyInputsAndOutputs(
1979 {op1},
1980 {op2});
1981 // Phase 4: set relaxed execution
1982 model->relaxComputationFloat32toFloat16(true);
1983 assert(model->isValid());
1984 }
1985
is_ignored_axis_relaxed_dim3_axis0_neg(int i)1986 inline bool is_ignored_axis_relaxed_dim3_axis0_neg(int i) {
1987 static std::set<int> ignore = {};
1988 return ignore.find(i) != ignore.end();
1989 }
1990
CreateModel_axis_relaxed_dim3_axis1(Model * model)1991 void CreateModel_axis_relaxed_dim3_axis1(Model *model) {
1992 OperandType type1(Type::INT32, {});
1993 OperandType type2(Type::FLOAT32, {});
1994 OperandType type37(Type::TENSOR_FLOAT32, {2, 5, 2});
1995 // Phase 1, operands
1996 auto op1 = model->addOperand(&type37);
1997 auto param2 = model->addOperand(&type2);
1998 auto axis = model->addOperand(&type1);
1999 auto op2 = model->addOperand(&type37);
2000 // Phase 2, operations
2001 static float param2_init[] = {1.0f};
2002 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
2003 static int32_t axis_init[] = {1};
2004 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2005 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2006 // Phase 3, inputs and outputs
2007 model->identifyInputsAndOutputs(
2008 {op1},
2009 {op2});
2010 // Phase 4: set relaxed execution
2011 model->relaxComputationFloat32toFloat16(true);
2012 assert(model->isValid());
2013 }
2014
is_ignored_axis_relaxed_dim3_axis1(int i)2015 inline bool is_ignored_axis_relaxed_dim3_axis1(int i) {
2016 static std::set<int> ignore = {};
2017 return ignore.find(i) != ignore.end();
2018 }
2019
CreateModel_axis_relaxed_dim3_axis1_neg(Model * model)2020 void CreateModel_axis_relaxed_dim3_axis1_neg(Model *model) {
2021 OperandType type1(Type::INT32, {});
2022 OperandType type2(Type::FLOAT32, {});
2023 OperandType type37(Type::TENSOR_FLOAT32, {2, 5, 2});
2024 // Phase 1, operands
2025 auto op1 = model->addOperand(&type37);
2026 auto param2 = model->addOperand(&type2);
2027 auto axis = model->addOperand(&type1);
2028 auto op2 = model->addOperand(&type37);
2029 // Phase 2, operations
2030 static float param2_init[] = {1.0f};
2031 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
2032 static int32_t axis_init[] = {-2};
2033 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2034 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2035 // Phase 3, inputs and outputs
2036 model->identifyInputsAndOutputs(
2037 {op1},
2038 {op2});
2039 // Phase 4: set relaxed execution
2040 model->relaxComputationFloat32toFloat16(true);
2041 assert(model->isValid());
2042 }
2043
is_ignored_axis_relaxed_dim3_axis1_neg(int i)2044 inline bool is_ignored_axis_relaxed_dim3_axis1_neg(int i) {
2045 static std::set<int> ignore = {};
2046 return ignore.find(i) != ignore.end();
2047 }
2048
CreateModel_axis_relaxed_dim3_axis2(Model * model)2049 void CreateModel_axis_relaxed_dim3_axis2(Model *model) {
2050 OperandType type1(Type::INT32, {});
2051 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
2052 OperandType type2(Type::FLOAT32, {});
2053 // Phase 1, operands
2054 auto op1 = model->addOperand(&type13);
2055 auto param2 = model->addOperand(&type2);
2056 auto axis = model->addOperand(&type1);
2057 auto op2 = model->addOperand(&type13);
2058 // Phase 2, operations
2059 static float param2_init[] = {1.0f};
2060 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
2061 static int32_t axis_init[] = {2};
2062 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2063 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2064 // Phase 3, inputs and outputs
2065 model->identifyInputsAndOutputs(
2066 {op1},
2067 {op2});
2068 // Phase 4: set relaxed execution
2069 model->relaxComputationFloat32toFloat16(true);
2070 assert(model->isValid());
2071 }
2072
is_ignored_axis_relaxed_dim3_axis2(int i)2073 inline bool is_ignored_axis_relaxed_dim3_axis2(int i) {
2074 static std::set<int> ignore = {};
2075 return ignore.find(i) != ignore.end();
2076 }
2077
CreateModel_axis_relaxed_dim3_axis2_neg(Model * model)2078 void CreateModel_axis_relaxed_dim3_axis2_neg(Model *model) {
2079 OperandType type1(Type::INT32, {});
2080 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
2081 OperandType type2(Type::FLOAT32, {});
2082 // Phase 1, operands
2083 auto op1 = model->addOperand(&type13);
2084 auto param2 = model->addOperand(&type2);
2085 auto axis = model->addOperand(&type1);
2086 auto op2 = model->addOperand(&type13);
2087 // Phase 2, operations
2088 static float param2_init[] = {1.0f};
2089 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
2090 static int32_t axis_init[] = {-1};
2091 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2092 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2093 // Phase 3, inputs and outputs
2094 model->identifyInputsAndOutputs(
2095 {op1},
2096 {op2});
2097 // Phase 4: set relaxed execution
2098 model->relaxComputationFloat32toFloat16(true);
2099 assert(model->isValid());
2100 }
2101
is_ignored_axis_relaxed_dim3_axis2_neg(int i)2102 inline bool is_ignored_axis_relaxed_dim3_axis2_neg(int i) {
2103 static std::set<int> ignore = {};
2104 return ignore.find(i) != ignore.end();
2105 }
2106
CreateModel_axis_relaxed_dim2_axis0(Model * model)2107 void CreateModel_axis_relaxed_dim2_axis0(Model *model) {
2108 OperandType type1(Type::INT32, {});
2109 OperandType type2(Type::FLOAT32, {});
2110 OperandType type38(Type::TENSOR_FLOAT32, {5, 2});
2111 // Phase 1, operands
2112 auto op1 = model->addOperand(&type38);
2113 auto param2 = model->addOperand(&type2);
2114 auto axis = model->addOperand(&type1);
2115 auto op2 = model->addOperand(&type38);
2116 // Phase 2, operations
2117 static float param2_init[] = {1.0f};
2118 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
2119 static int32_t axis_init[] = {0};
2120 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2121 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2122 // Phase 3, inputs and outputs
2123 model->identifyInputsAndOutputs(
2124 {op1},
2125 {op2});
2126 // Phase 4: set relaxed execution
2127 model->relaxComputationFloat32toFloat16(true);
2128 assert(model->isValid());
2129 }
2130
is_ignored_axis_relaxed_dim2_axis0(int i)2131 inline bool is_ignored_axis_relaxed_dim2_axis0(int i) {
2132 static std::set<int> ignore = {};
2133 return ignore.find(i) != ignore.end();
2134 }
2135
CreateModel_axis_relaxed_dim2_axis0_neg(Model * model)2136 void CreateModel_axis_relaxed_dim2_axis0_neg(Model *model) {
2137 OperandType type1(Type::INT32, {});
2138 OperandType type2(Type::FLOAT32, {});
2139 OperandType type38(Type::TENSOR_FLOAT32, {5, 2});
2140 // Phase 1, operands
2141 auto op1 = model->addOperand(&type38);
2142 auto param2 = model->addOperand(&type2);
2143 auto axis = model->addOperand(&type1);
2144 auto op2 = model->addOperand(&type38);
2145 // Phase 2, operations
2146 static float param2_init[] = {1.0f};
2147 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
2148 static int32_t axis_init[] = {-2};
2149 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2150 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2151 // Phase 3, inputs and outputs
2152 model->identifyInputsAndOutputs(
2153 {op1},
2154 {op2});
2155 // Phase 4: set relaxed execution
2156 model->relaxComputationFloat32toFloat16(true);
2157 assert(model->isValid());
2158 }
2159
is_ignored_axis_relaxed_dim2_axis0_neg(int i)2160 inline bool is_ignored_axis_relaxed_dim2_axis0_neg(int i) {
2161 static std::set<int> ignore = {};
2162 return ignore.find(i) != ignore.end();
2163 }
2164
CreateModel_axis_relaxed_dim2_axis1(Model * model)2165 void CreateModel_axis_relaxed_dim2_axis1(Model *model) {
2166 OperandType type1(Type::INT32, {});
2167 OperandType type2(Type::FLOAT32, {});
2168 OperandType type39(Type::TENSOR_FLOAT32, {2, 5});
2169 // Phase 1, operands
2170 auto op1 = model->addOperand(&type39);
2171 auto param2 = model->addOperand(&type2);
2172 auto axis = model->addOperand(&type1);
2173 auto op2 = model->addOperand(&type39);
2174 // Phase 2, operations
2175 static float param2_init[] = {1.0f};
2176 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
2177 static int32_t axis_init[] = {1};
2178 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2179 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2180 // Phase 3, inputs and outputs
2181 model->identifyInputsAndOutputs(
2182 {op1},
2183 {op2});
2184 // Phase 4: set relaxed execution
2185 model->relaxComputationFloat32toFloat16(true);
2186 assert(model->isValid());
2187 }
2188
is_ignored_axis_relaxed_dim2_axis1(int i)2189 inline bool is_ignored_axis_relaxed_dim2_axis1(int i) {
2190 static std::set<int> ignore = {};
2191 return ignore.find(i) != ignore.end();
2192 }
2193
CreateModel_axis_relaxed_dim2_axis1_neg(Model * model)2194 void CreateModel_axis_relaxed_dim2_axis1_neg(Model *model) {
2195 OperandType type1(Type::INT32, {});
2196 OperandType type2(Type::FLOAT32, {});
2197 OperandType type39(Type::TENSOR_FLOAT32, {2, 5});
2198 // Phase 1, operands
2199 auto op1 = model->addOperand(&type39);
2200 auto param2 = model->addOperand(&type2);
2201 auto axis = model->addOperand(&type1);
2202 auto op2 = model->addOperand(&type39);
2203 // Phase 2, operations
2204 static float param2_init[] = {1.0f};
2205 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
2206 static int32_t axis_init[] = {-1};
2207 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2208 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2209 // Phase 3, inputs and outputs
2210 model->identifyInputsAndOutputs(
2211 {op1},
2212 {op2});
2213 // Phase 4: set relaxed execution
2214 model->relaxComputationFloat32toFloat16(true);
2215 assert(model->isValid());
2216 }
2217
is_ignored_axis_relaxed_dim2_axis1_neg(int i)2218 inline bool is_ignored_axis_relaxed_dim2_axis1_neg(int i) {
2219 static std::set<int> ignore = {};
2220 return ignore.find(i) != ignore.end();
2221 }
2222
CreateModel_axis_relaxed_dim1_axis0(Model * model)2223 void CreateModel_axis_relaxed_dim1_axis0(Model *model) {
2224 OperandType type1(Type::INT32, {});
2225 OperandType type12(Type::TENSOR_FLOAT32, {5});
2226 OperandType type2(Type::FLOAT32, {});
2227 // Phase 1, operands
2228 auto op1 = model->addOperand(&type12);
2229 auto param2 = model->addOperand(&type2);
2230 auto axis = model->addOperand(&type1);
2231 auto op2 = model->addOperand(&type12);
2232 // Phase 2, operations
2233 static float param2_init[] = {1.0f};
2234 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
2235 static int32_t axis_init[] = {0};
2236 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2237 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2238 // Phase 3, inputs and outputs
2239 model->identifyInputsAndOutputs(
2240 {op1},
2241 {op2});
2242 // Phase 4: set relaxed execution
2243 model->relaxComputationFloat32toFloat16(true);
2244 assert(model->isValid());
2245 }
2246
is_ignored_axis_relaxed_dim1_axis0(int i)2247 inline bool is_ignored_axis_relaxed_dim1_axis0(int i) {
2248 static std::set<int> ignore = {};
2249 return ignore.find(i) != ignore.end();
2250 }
2251
CreateModel_axis_relaxed_dim1_axis0_neg(Model * model)2252 void CreateModel_axis_relaxed_dim1_axis0_neg(Model *model) {
2253 OperandType type1(Type::INT32, {});
2254 OperandType type12(Type::TENSOR_FLOAT32, {5});
2255 OperandType type2(Type::FLOAT32, {});
2256 // Phase 1, operands
2257 auto op1 = model->addOperand(&type12);
2258 auto param2 = model->addOperand(&type2);
2259 auto axis = model->addOperand(&type1);
2260 auto op2 = model->addOperand(&type12);
2261 // Phase 2, operations
2262 static float param2_init[] = {1.0f};
2263 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
2264 static int32_t axis_init[] = {-1};
2265 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2266 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, 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_axis_relaxed_dim1_axis0_neg(int i)2276 inline bool is_ignored_axis_relaxed_dim1_axis0_neg(int i) {
2277 static std::set<int> ignore = {};
2278 return ignore.find(i) != ignore.end();
2279 }
2280
CreateModel_axis_float16_dim4_axis0(Model * model)2281 void CreateModel_axis_float16_dim4_axis0(Model *model) {
2282 OperandType type1(Type::INT32, {});
2283 OperandType type15(Type::FLOAT16, {});
2284 OperandType type40(Type::TENSOR_FLOAT16, {5, 2, 2, 2});
2285 // Phase 1, operands
2286 auto op1 = model->addOperand(&type40);
2287 auto param2 = model->addOperand(&type15);
2288 auto axis = model->addOperand(&type1);
2289 auto op2 = model->addOperand(&type40);
2290 // Phase 2, operations
2291 static _Float16 param2_init[] = {1.0f};
2292 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
2293 static int32_t axis_init[] = {0};
2294 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2295 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2296 // Phase 3, inputs and outputs
2297 model->identifyInputsAndOutputs(
2298 {op1},
2299 {op2});
2300 assert(model->isValid());
2301 }
2302
is_ignored_axis_float16_dim4_axis0(int i)2303 inline bool is_ignored_axis_float16_dim4_axis0(int i) {
2304 static std::set<int> ignore = {};
2305 return ignore.find(i) != ignore.end();
2306 }
2307
CreateModel_axis_float16_dim4_axis0_neg(Model * model)2308 void CreateModel_axis_float16_dim4_axis0_neg(Model *model) {
2309 OperandType type1(Type::INT32, {});
2310 OperandType type15(Type::FLOAT16, {});
2311 OperandType type40(Type::TENSOR_FLOAT16, {5, 2, 2, 2});
2312 // Phase 1, operands
2313 auto op1 = model->addOperand(&type40);
2314 auto param2 = model->addOperand(&type15);
2315 auto axis = model->addOperand(&type1);
2316 auto op2 = model->addOperand(&type40);
2317 // Phase 2, operations
2318 static _Float16 param2_init[] = {1.0f};
2319 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
2320 static int32_t axis_init[] = {-4};
2321 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2322 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2323 // Phase 3, inputs and outputs
2324 model->identifyInputsAndOutputs(
2325 {op1},
2326 {op2});
2327 assert(model->isValid());
2328 }
2329
is_ignored_axis_float16_dim4_axis0_neg(int i)2330 inline bool is_ignored_axis_float16_dim4_axis0_neg(int i) {
2331 static std::set<int> ignore = {};
2332 return ignore.find(i) != ignore.end();
2333 }
2334
CreateModel_axis_float16_dim4_axis1(Model * model)2335 void CreateModel_axis_float16_dim4_axis1(Model *model) {
2336 OperandType type1(Type::INT32, {});
2337 OperandType type15(Type::FLOAT16, {});
2338 OperandType type41(Type::TENSOR_FLOAT16, {2, 5, 2, 2});
2339 // Phase 1, operands
2340 auto op1 = model->addOperand(&type41);
2341 auto param2 = model->addOperand(&type15);
2342 auto axis = model->addOperand(&type1);
2343 auto op2 = model->addOperand(&type41);
2344 // Phase 2, operations
2345 static _Float16 param2_init[] = {1.0f};
2346 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
2347 static int32_t axis_init[] = {1};
2348 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2349 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2350 // Phase 3, inputs and outputs
2351 model->identifyInputsAndOutputs(
2352 {op1},
2353 {op2});
2354 assert(model->isValid());
2355 }
2356
is_ignored_axis_float16_dim4_axis1(int i)2357 inline bool is_ignored_axis_float16_dim4_axis1(int i) {
2358 static std::set<int> ignore = {};
2359 return ignore.find(i) != ignore.end();
2360 }
2361
CreateModel_axis_float16_dim4_axis1_neg(Model * model)2362 void CreateModel_axis_float16_dim4_axis1_neg(Model *model) {
2363 OperandType type1(Type::INT32, {});
2364 OperandType type15(Type::FLOAT16, {});
2365 OperandType type41(Type::TENSOR_FLOAT16, {2, 5, 2, 2});
2366 // Phase 1, operands
2367 auto op1 = model->addOperand(&type41);
2368 auto param2 = model->addOperand(&type15);
2369 auto axis = model->addOperand(&type1);
2370 auto op2 = model->addOperand(&type41);
2371 // Phase 2, operations
2372 static _Float16 param2_init[] = {1.0f};
2373 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
2374 static int32_t axis_init[] = {-3};
2375 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2376 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2377 // Phase 3, inputs and outputs
2378 model->identifyInputsAndOutputs(
2379 {op1},
2380 {op2});
2381 assert(model->isValid());
2382 }
2383
is_ignored_axis_float16_dim4_axis1_neg(int i)2384 inline bool is_ignored_axis_float16_dim4_axis1_neg(int i) {
2385 static std::set<int> ignore = {};
2386 return ignore.find(i) != ignore.end();
2387 }
2388
CreateModel_axis_float16_dim4_axis2(Model * model)2389 void CreateModel_axis_float16_dim4_axis2(Model *model) {
2390 OperandType type1(Type::INT32, {});
2391 OperandType type15(Type::FLOAT16, {});
2392 OperandType type42(Type::TENSOR_FLOAT16, {2, 2, 5, 2});
2393 // Phase 1, operands
2394 auto op1 = model->addOperand(&type42);
2395 auto param2 = model->addOperand(&type15);
2396 auto axis = model->addOperand(&type1);
2397 auto op2 = model->addOperand(&type42);
2398 // Phase 2, operations
2399 static _Float16 param2_init[] = {1.0f};
2400 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
2401 static int32_t axis_init[] = {2};
2402 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2403 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2404 // Phase 3, inputs and outputs
2405 model->identifyInputsAndOutputs(
2406 {op1},
2407 {op2});
2408 assert(model->isValid());
2409 }
2410
is_ignored_axis_float16_dim4_axis2(int i)2411 inline bool is_ignored_axis_float16_dim4_axis2(int i) {
2412 static std::set<int> ignore = {};
2413 return ignore.find(i) != ignore.end();
2414 }
2415
CreateModel_axis_float16_dim4_axis2_neg(Model * model)2416 void CreateModel_axis_float16_dim4_axis2_neg(Model *model) {
2417 OperandType type1(Type::INT32, {});
2418 OperandType type15(Type::FLOAT16, {});
2419 OperandType type42(Type::TENSOR_FLOAT16, {2, 2, 5, 2});
2420 // Phase 1, operands
2421 auto op1 = model->addOperand(&type42);
2422 auto param2 = model->addOperand(&type15);
2423 auto axis = model->addOperand(&type1);
2424 auto op2 = model->addOperand(&type42);
2425 // Phase 2, operations
2426 static _Float16 param2_init[] = {1.0f};
2427 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
2428 static int32_t axis_init[] = {-2};
2429 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2430 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2431 // Phase 3, inputs and outputs
2432 model->identifyInputsAndOutputs(
2433 {op1},
2434 {op2});
2435 assert(model->isValid());
2436 }
2437
is_ignored_axis_float16_dim4_axis2_neg(int i)2438 inline bool is_ignored_axis_float16_dim4_axis2_neg(int i) {
2439 static std::set<int> ignore = {};
2440 return ignore.find(i) != ignore.end();
2441 }
2442
CreateModel_axis_float16_dim4_axis3(Model * model)2443 void CreateModel_axis_float16_dim4_axis3(Model *model) {
2444 OperandType type1(Type::INT32, {});
2445 OperandType type15(Type::FLOAT16, {});
2446 OperandType type16(Type::TENSOR_FLOAT16, {2, 2, 2, 5});
2447 // Phase 1, operands
2448 auto op1 = model->addOperand(&type16);
2449 auto param2 = model->addOperand(&type15);
2450 auto axis = model->addOperand(&type1);
2451 auto op2 = model->addOperand(&type16);
2452 // Phase 2, operations
2453 static _Float16 param2_init[] = {1.0f};
2454 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
2455 static int32_t axis_init[] = {3};
2456 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2457 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2458 // Phase 3, inputs and outputs
2459 model->identifyInputsAndOutputs(
2460 {op1},
2461 {op2});
2462 assert(model->isValid());
2463 }
2464
is_ignored_axis_float16_dim4_axis3(int i)2465 inline bool is_ignored_axis_float16_dim4_axis3(int i) {
2466 static std::set<int> ignore = {};
2467 return ignore.find(i) != ignore.end();
2468 }
2469
CreateModel_axis_float16_dim4_axis3_neg(Model * model)2470 void CreateModel_axis_float16_dim4_axis3_neg(Model *model) {
2471 OperandType type1(Type::INT32, {});
2472 OperandType type15(Type::FLOAT16, {});
2473 OperandType type16(Type::TENSOR_FLOAT16, {2, 2, 2, 5});
2474 // Phase 1, operands
2475 auto op1 = model->addOperand(&type16);
2476 auto param2 = model->addOperand(&type15);
2477 auto axis = model->addOperand(&type1);
2478 auto op2 = model->addOperand(&type16);
2479 // Phase 2, operations
2480 static _Float16 param2_init[] = {1.0f};
2481 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
2482 static int32_t axis_init[] = {-1};
2483 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2484 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2485 // Phase 3, inputs and outputs
2486 model->identifyInputsAndOutputs(
2487 {op1},
2488 {op2});
2489 assert(model->isValid());
2490 }
2491
is_ignored_axis_float16_dim4_axis3_neg(int i)2492 inline bool is_ignored_axis_float16_dim4_axis3_neg(int i) {
2493 static std::set<int> ignore = {};
2494 return ignore.find(i) != ignore.end();
2495 }
2496
CreateModel_axis_float16_dim3_axis0(Model * model)2497 void CreateModel_axis_float16_dim3_axis0(Model *model) {
2498 OperandType type1(Type::INT32, {});
2499 OperandType type15(Type::FLOAT16, {});
2500 OperandType type43(Type::TENSOR_FLOAT16, {5, 2, 2});
2501 // Phase 1, operands
2502 auto op1 = model->addOperand(&type43);
2503 auto param2 = model->addOperand(&type15);
2504 auto axis = model->addOperand(&type1);
2505 auto op2 = model->addOperand(&type43);
2506 // Phase 2, operations
2507 static _Float16 param2_init[] = {1.0f};
2508 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
2509 static int32_t axis_init[] = {0};
2510 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2511 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2512 // Phase 3, inputs and outputs
2513 model->identifyInputsAndOutputs(
2514 {op1},
2515 {op2});
2516 assert(model->isValid());
2517 }
2518
is_ignored_axis_float16_dim3_axis0(int i)2519 inline bool is_ignored_axis_float16_dim3_axis0(int i) {
2520 static std::set<int> ignore = {};
2521 return ignore.find(i) != ignore.end();
2522 }
2523
CreateModel_axis_float16_dim3_axis0_neg(Model * model)2524 void CreateModel_axis_float16_dim3_axis0_neg(Model *model) {
2525 OperandType type1(Type::INT32, {});
2526 OperandType type15(Type::FLOAT16, {});
2527 OperandType type43(Type::TENSOR_FLOAT16, {5, 2, 2});
2528 // Phase 1, operands
2529 auto op1 = model->addOperand(&type43);
2530 auto param2 = model->addOperand(&type15);
2531 auto axis = model->addOperand(&type1);
2532 auto op2 = model->addOperand(&type43);
2533 // Phase 2, operations
2534 static _Float16 param2_init[] = {1.0f};
2535 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
2536 static int32_t axis_init[] = {-3};
2537 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2538 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2539 // Phase 3, inputs and outputs
2540 model->identifyInputsAndOutputs(
2541 {op1},
2542 {op2});
2543 assert(model->isValid());
2544 }
2545
is_ignored_axis_float16_dim3_axis0_neg(int i)2546 inline bool is_ignored_axis_float16_dim3_axis0_neg(int i) {
2547 static std::set<int> ignore = {};
2548 return ignore.find(i) != ignore.end();
2549 }
2550
CreateModel_axis_float16_dim3_axis1(Model * model)2551 void CreateModel_axis_float16_dim3_axis1(Model *model) {
2552 OperandType type1(Type::INT32, {});
2553 OperandType type15(Type::FLOAT16, {});
2554 OperandType type44(Type::TENSOR_FLOAT16, {2, 5, 2});
2555 // Phase 1, operands
2556 auto op1 = model->addOperand(&type44);
2557 auto param2 = model->addOperand(&type15);
2558 auto axis = model->addOperand(&type1);
2559 auto op2 = model->addOperand(&type44);
2560 // Phase 2, operations
2561 static _Float16 param2_init[] = {1.0f};
2562 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
2563 static int32_t axis_init[] = {1};
2564 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2565 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2566 // Phase 3, inputs and outputs
2567 model->identifyInputsAndOutputs(
2568 {op1},
2569 {op2});
2570 assert(model->isValid());
2571 }
2572
is_ignored_axis_float16_dim3_axis1(int i)2573 inline bool is_ignored_axis_float16_dim3_axis1(int i) {
2574 static std::set<int> ignore = {};
2575 return ignore.find(i) != ignore.end();
2576 }
2577
CreateModel_axis_float16_dim3_axis1_neg(Model * model)2578 void CreateModel_axis_float16_dim3_axis1_neg(Model *model) {
2579 OperandType type1(Type::INT32, {});
2580 OperandType type15(Type::FLOAT16, {});
2581 OperandType type44(Type::TENSOR_FLOAT16, {2, 5, 2});
2582 // Phase 1, operands
2583 auto op1 = model->addOperand(&type44);
2584 auto param2 = model->addOperand(&type15);
2585 auto axis = model->addOperand(&type1);
2586 auto op2 = model->addOperand(&type44);
2587 // Phase 2, operations
2588 static _Float16 param2_init[] = {1.0f};
2589 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
2590 static int32_t axis_init[] = {-2};
2591 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2592 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2593 // Phase 3, inputs and outputs
2594 model->identifyInputsAndOutputs(
2595 {op1},
2596 {op2});
2597 assert(model->isValid());
2598 }
2599
is_ignored_axis_float16_dim3_axis1_neg(int i)2600 inline bool is_ignored_axis_float16_dim3_axis1_neg(int i) {
2601 static std::set<int> ignore = {};
2602 return ignore.find(i) != ignore.end();
2603 }
2604
CreateModel_axis_float16_dim3_axis2(Model * model)2605 void CreateModel_axis_float16_dim3_axis2(Model *model) {
2606 OperandType type1(Type::INT32, {});
2607 OperandType type15(Type::FLOAT16, {});
2608 OperandType type18(Type::TENSOR_FLOAT16, {2, 2, 5});
2609 // Phase 1, operands
2610 auto op1 = model->addOperand(&type18);
2611 auto param2 = model->addOperand(&type15);
2612 auto axis = model->addOperand(&type1);
2613 auto op2 = model->addOperand(&type18);
2614 // Phase 2, operations
2615 static _Float16 param2_init[] = {1.0f};
2616 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
2617 static int32_t axis_init[] = {2};
2618 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2619 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2620 // Phase 3, inputs and outputs
2621 model->identifyInputsAndOutputs(
2622 {op1},
2623 {op2});
2624 assert(model->isValid());
2625 }
2626
is_ignored_axis_float16_dim3_axis2(int i)2627 inline bool is_ignored_axis_float16_dim3_axis2(int i) {
2628 static std::set<int> ignore = {};
2629 return ignore.find(i) != ignore.end();
2630 }
2631
CreateModel_axis_float16_dim3_axis2_neg(Model * model)2632 void CreateModel_axis_float16_dim3_axis2_neg(Model *model) {
2633 OperandType type1(Type::INT32, {});
2634 OperandType type15(Type::FLOAT16, {});
2635 OperandType type18(Type::TENSOR_FLOAT16, {2, 2, 5});
2636 // Phase 1, operands
2637 auto op1 = model->addOperand(&type18);
2638 auto param2 = model->addOperand(&type15);
2639 auto axis = model->addOperand(&type1);
2640 auto op2 = model->addOperand(&type18);
2641 // Phase 2, operations
2642 static _Float16 param2_init[] = {1.0f};
2643 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
2644 static int32_t axis_init[] = {-1};
2645 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2646 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2647 // Phase 3, inputs and outputs
2648 model->identifyInputsAndOutputs(
2649 {op1},
2650 {op2});
2651 assert(model->isValid());
2652 }
2653
is_ignored_axis_float16_dim3_axis2_neg(int i)2654 inline bool is_ignored_axis_float16_dim3_axis2_neg(int i) {
2655 static std::set<int> ignore = {};
2656 return ignore.find(i) != ignore.end();
2657 }
2658
CreateModel_axis_float16_dim2_axis0(Model * model)2659 void CreateModel_axis_float16_dim2_axis0(Model *model) {
2660 OperandType type1(Type::INT32, {});
2661 OperandType type15(Type::FLOAT16, {});
2662 OperandType type45(Type::TENSOR_FLOAT16, {5, 2});
2663 // Phase 1, operands
2664 auto op1 = model->addOperand(&type45);
2665 auto param2 = model->addOperand(&type15);
2666 auto axis = model->addOperand(&type1);
2667 auto op2 = model->addOperand(&type45);
2668 // Phase 2, operations
2669 static _Float16 param2_init[] = {1.0f};
2670 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
2671 static int32_t axis_init[] = {0};
2672 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2673 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2674 // Phase 3, inputs and outputs
2675 model->identifyInputsAndOutputs(
2676 {op1},
2677 {op2});
2678 assert(model->isValid());
2679 }
2680
is_ignored_axis_float16_dim2_axis0(int i)2681 inline bool is_ignored_axis_float16_dim2_axis0(int i) {
2682 static std::set<int> ignore = {};
2683 return ignore.find(i) != ignore.end();
2684 }
2685
CreateModel_axis_float16_dim2_axis0_neg(Model * model)2686 void CreateModel_axis_float16_dim2_axis0_neg(Model *model) {
2687 OperandType type1(Type::INT32, {});
2688 OperandType type15(Type::FLOAT16, {});
2689 OperandType type45(Type::TENSOR_FLOAT16, {5, 2});
2690 // Phase 1, operands
2691 auto op1 = model->addOperand(&type45);
2692 auto param2 = model->addOperand(&type15);
2693 auto axis = model->addOperand(&type1);
2694 auto op2 = model->addOperand(&type45);
2695 // Phase 2, operations
2696 static _Float16 param2_init[] = {1.0f};
2697 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
2698 static int32_t axis_init[] = {-2};
2699 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2700 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2701 // Phase 3, inputs and outputs
2702 model->identifyInputsAndOutputs(
2703 {op1},
2704 {op2});
2705 assert(model->isValid());
2706 }
2707
is_ignored_axis_float16_dim2_axis0_neg(int i)2708 inline bool is_ignored_axis_float16_dim2_axis0_neg(int i) {
2709 static std::set<int> ignore = {};
2710 return ignore.find(i) != ignore.end();
2711 }
2712
CreateModel_axis_float16_dim2_axis1(Model * model)2713 void CreateModel_axis_float16_dim2_axis1(Model *model) {
2714 OperandType type1(Type::INT32, {});
2715 OperandType type15(Type::FLOAT16, {});
2716 OperandType type46(Type::TENSOR_FLOAT16, {2, 5});
2717 // Phase 1, operands
2718 auto op1 = model->addOperand(&type46);
2719 auto param2 = model->addOperand(&type15);
2720 auto axis = model->addOperand(&type1);
2721 auto op2 = model->addOperand(&type46);
2722 // Phase 2, operations
2723 static _Float16 param2_init[] = {1.0f};
2724 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
2725 static int32_t axis_init[] = {1};
2726 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2727 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2728 // Phase 3, inputs and outputs
2729 model->identifyInputsAndOutputs(
2730 {op1},
2731 {op2});
2732 assert(model->isValid());
2733 }
2734
is_ignored_axis_float16_dim2_axis1(int i)2735 inline bool is_ignored_axis_float16_dim2_axis1(int i) {
2736 static std::set<int> ignore = {};
2737 return ignore.find(i) != ignore.end();
2738 }
2739
CreateModel_axis_float16_dim2_axis1_neg(Model * model)2740 void CreateModel_axis_float16_dim2_axis1_neg(Model *model) {
2741 OperandType type1(Type::INT32, {});
2742 OperandType type15(Type::FLOAT16, {});
2743 OperandType type46(Type::TENSOR_FLOAT16, {2, 5});
2744 // Phase 1, operands
2745 auto op1 = model->addOperand(&type46);
2746 auto param2 = model->addOperand(&type15);
2747 auto axis = model->addOperand(&type1);
2748 auto op2 = model->addOperand(&type46);
2749 // Phase 2, operations
2750 static _Float16 param2_init[] = {1.0f};
2751 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
2752 static int32_t axis_init[] = {-1};
2753 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2754 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2755 // Phase 3, inputs and outputs
2756 model->identifyInputsAndOutputs(
2757 {op1},
2758 {op2});
2759 assert(model->isValid());
2760 }
2761
is_ignored_axis_float16_dim2_axis1_neg(int i)2762 inline bool is_ignored_axis_float16_dim2_axis1_neg(int i) {
2763 static std::set<int> ignore = {};
2764 return ignore.find(i) != ignore.end();
2765 }
2766
CreateModel_axis_float16_dim1_axis0(Model * model)2767 void CreateModel_axis_float16_dim1_axis0(Model *model) {
2768 OperandType type1(Type::INT32, {});
2769 OperandType type15(Type::FLOAT16, {});
2770 OperandType type17(Type::TENSOR_FLOAT16, {5});
2771 // Phase 1, operands
2772 auto op1 = model->addOperand(&type17);
2773 auto param2 = model->addOperand(&type15);
2774 auto axis = model->addOperand(&type1);
2775 auto op2 = model->addOperand(&type17);
2776 // Phase 2, operations
2777 static _Float16 param2_init[] = {1.0f};
2778 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
2779 static int32_t axis_init[] = {0};
2780 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2781 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2782 // Phase 3, inputs and outputs
2783 model->identifyInputsAndOutputs(
2784 {op1},
2785 {op2});
2786 assert(model->isValid());
2787 }
2788
is_ignored_axis_float16_dim1_axis0(int i)2789 inline bool is_ignored_axis_float16_dim1_axis0(int i) {
2790 static std::set<int> ignore = {};
2791 return ignore.find(i) != ignore.end();
2792 }
2793
CreateModel_axis_float16_dim1_axis0_neg(Model * model)2794 void CreateModel_axis_float16_dim1_axis0_neg(Model *model) {
2795 OperandType type1(Type::INT32, {});
2796 OperandType type15(Type::FLOAT16, {});
2797 OperandType type17(Type::TENSOR_FLOAT16, {5});
2798 // Phase 1, operands
2799 auto op1 = model->addOperand(&type17);
2800 auto param2 = model->addOperand(&type15);
2801 auto axis = model->addOperand(&type1);
2802 auto op2 = model->addOperand(&type17);
2803 // Phase 2, operations
2804 static _Float16 param2_init[] = {1.0f};
2805 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
2806 static int32_t axis_init[] = {-1};
2807 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2808 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2809 // Phase 3, inputs and outputs
2810 model->identifyInputsAndOutputs(
2811 {op1},
2812 {op2});
2813 assert(model->isValid());
2814 }
2815
is_ignored_axis_float16_dim1_axis0_neg(int i)2816 inline bool is_ignored_axis_float16_dim1_axis0_neg(int i) {
2817 static std::set<int> ignore = {};
2818 return ignore.find(i) != ignore.end();
2819 }
2820
CreateModel_axis_quant8_dim4_axis0(Model * model)2821 void CreateModel_axis_quant8_dim4_axis0(Model *model) {
2822 OperandType type1(Type::INT32, {});
2823 OperandType type2(Type::FLOAT32, {});
2824 OperandType type47(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2, 2}, 0.25f, 128);
2825 OperandType type48(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2, 2}, 0.00390625f, 0);
2826 // Phase 1, operands
2827 auto op1 = model->addOperand(&type47);
2828 auto param2 = model->addOperand(&type2);
2829 auto axis = model->addOperand(&type1);
2830 auto op2 = model->addOperand(&type48);
2831 // Phase 2, operations
2832 static float param2_init[] = {1.0f};
2833 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
2834 static int32_t axis_init[] = {0};
2835 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2836 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2837 // Phase 3, inputs and outputs
2838 model->identifyInputsAndOutputs(
2839 {op1},
2840 {op2});
2841 assert(model->isValid());
2842 }
2843
is_ignored_axis_quant8_dim4_axis0(int i)2844 inline bool is_ignored_axis_quant8_dim4_axis0(int i) {
2845 static std::set<int> ignore = {};
2846 return ignore.find(i) != ignore.end();
2847 }
2848
CreateModel_axis_quant8_dim4_axis0_neg(Model * model)2849 void CreateModel_axis_quant8_dim4_axis0_neg(Model *model) {
2850 OperandType type1(Type::INT32, {});
2851 OperandType type2(Type::FLOAT32, {});
2852 OperandType type47(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2, 2}, 0.25f, 128);
2853 OperandType type48(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2, 2}, 0.00390625f, 0);
2854 // Phase 1, operands
2855 auto op1 = model->addOperand(&type47);
2856 auto param2 = model->addOperand(&type2);
2857 auto axis = model->addOperand(&type1);
2858 auto op2 = model->addOperand(&type48);
2859 // Phase 2, operations
2860 static float param2_init[] = {1.0f};
2861 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
2862 static int32_t axis_init[] = {-4};
2863 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2864 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2865 // Phase 3, inputs and outputs
2866 model->identifyInputsAndOutputs(
2867 {op1},
2868 {op2});
2869 assert(model->isValid());
2870 }
2871
is_ignored_axis_quant8_dim4_axis0_neg(int i)2872 inline bool is_ignored_axis_quant8_dim4_axis0_neg(int i) {
2873 static std::set<int> ignore = {};
2874 return ignore.find(i) != ignore.end();
2875 }
2876
CreateModel_axis_quant8_dim4_axis1(Model * model)2877 void CreateModel_axis_quant8_dim4_axis1(Model *model) {
2878 OperandType type1(Type::INT32, {});
2879 OperandType type2(Type::FLOAT32, {});
2880 OperandType type49(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2, 2}, 0.25f, 128);
2881 OperandType type50(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2, 2}, 0.00390625f, 0);
2882 // Phase 1, operands
2883 auto op1 = model->addOperand(&type49);
2884 auto param2 = model->addOperand(&type2);
2885 auto axis = model->addOperand(&type1);
2886 auto op2 = model->addOperand(&type50);
2887 // Phase 2, operations
2888 static float param2_init[] = {1.0f};
2889 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
2890 static int32_t axis_init[] = {1};
2891 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2892 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2893 // Phase 3, inputs and outputs
2894 model->identifyInputsAndOutputs(
2895 {op1},
2896 {op2});
2897 assert(model->isValid());
2898 }
2899
is_ignored_axis_quant8_dim4_axis1(int i)2900 inline bool is_ignored_axis_quant8_dim4_axis1(int i) {
2901 static std::set<int> ignore = {};
2902 return ignore.find(i) != ignore.end();
2903 }
2904
CreateModel_axis_quant8_dim4_axis1_neg(Model * model)2905 void CreateModel_axis_quant8_dim4_axis1_neg(Model *model) {
2906 OperandType type1(Type::INT32, {});
2907 OperandType type2(Type::FLOAT32, {});
2908 OperandType type49(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2, 2}, 0.25f, 128);
2909 OperandType type50(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2, 2}, 0.00390625f, 0);
2910 // Phase 1, operands
2911 auto op1 = model->addOperand(&type49);
2912 auto param2 = model->addOperand(&type2);
2913 auto axis = model->addOperand(&type1);
2914 auto op2 = model->addOperand(&type50);
2915 // Phase 2, operations
2916 static float param2_init[] = {1.0f};
2917 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
2918 static int32_t axis_init[] = {-3};
2919 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2920 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2921 // Phase 3, inputs and outputs
2922 model->identifyInputsAndOutputs(
2923 {op1},
2924 {op2});
2925 assert(model->isValid());
2926 }
2927
is_ignored_axis_quant8_dim4_axis1_neg(int i)2928 inline bool is_ignored_axis_quant8_dim4_axis1_neg(int i) {
2929 static std::set<int> ignore = {};
2930 return ignore.find(i) != ignore.end();
2931 }
2932
CreateModel_axis_quant8_dim4_axis2(Model * model)2933 void CreateModel_axis_quant8_dim4_axis2(Model *model) {
2934 OperandType type1(Type::INT32, {});
2935 OperandType type2(Type::FLOAT32, {});
2936 OperandType type51(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5, 2}, 0.25f, 128);
2937 OperandType type52(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5, 2}, 0.00390625f, 0);
2938 // Phase 1, operands
2939 auto op1 = model->addOperand(&type51);
2940 auto param2 = model->addOperand(&type2);
2941 auto axis = model->addOperand(&type1);
2942 auto op2 = model->addOperand(&type52);
2943 // Phase 2, operations
2944 static float param2_init[] = {1.0f};
2945 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
2946 static int32_t axis_init[] = {2};
2947 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2948 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2949 // Phase 3, inputs and outputs
2950 model->identifyInputsAndOutputs(
2951 {op1},
2952 {op2});
2953 assert(model->isValid());
2954 }
2955
is_ignored_axis_quant8_dim4_axis2(int i)2956 inline bool is_ignored_axis_quant8_dim4_axis2(int i) {
2957 static std::set<int> ignore = {};
2958 return ignore.find(i) != ignore.end();
2959 }
2960
CreateModel_axis_quant8_dim4_axis2_neg(Model * model)2961 void CreateModel_axis_quant8_dim4_axis2_neg(Model *model) {
2962 OperandType type1(Type::INT32, {});
2963 OperandType type2(Type::FLOAT32, {});
2964 OperandType type51(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5, 2}, 0.25f, 128);
2965 OperandType type52(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5, 2}, 0.00390625f, 0);
2966 // Phase 1, operands
2967 auto op1 = model->addOperand(&type51);
2968 auto param2 = model->addOperand(&type2);
2969 auto axis = model->addOperand(&type1);
2970 auto op2 = model->addOperand(&type52);
2971 // Phase 2, operations
2972 static float param2_init[] = {1.0f};
2973 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
2974 static int32_t axis_init[] = {-2};
2975 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
2976 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
2977 // Phase 3, inputs and outputs
2978 model->identifyInputsAndOutputs(
2979 {op1},
2980 {op2});
2981 assert(model->isValid());
2982 }
2983
is_ignored_axis_quant8_dim4_axis2_neg(int i)2984 inline bool is_ignored_axis_quant8_dim4_axis2_neg(int i) {
2985 static std::set<int> ignore = {};
2986 return ignore.find(i) != ignore.end();
2987 }
2988
CreateModel_axis_quant8_dim4_axis3(Model * model)2989 void CreateModel_axis_quant8_dim4_axis3(Model *model) {
2990 OperandType type1(Type::INT32, {});
2991 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 5}, 0.25f, 128);
2992 OperandType type2(Type::FLOAT32, {});
2993 OperandType type20(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 5}, 0.00390625f, 0);
2994 // Phase 1, operands
2995 auto op1 = model->addOperand(&type19);
2996 auto param2 = model->addOperand(&type2);
2997 auto axis = model->addOperand(&type1);
2998 auto op2 = model->addOperand(&type20);
2999 // Phase 2, operations
3000 static float param2_init[] = {1.0f};
3001 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3002 static int32_t axis_init[] = {3};
3003 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3004 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3005 // Phase 3, inputs and outputs
3006 model->identifyInputsAndOutputs(
3007 {op1},
3008 {op2});
3009 assert(model->isValid());
3010 }
3011
is_ignored_axis_quant8_dim4_axis3(int i)3012 inline bool is_ignored_axis_quant8_dim4_axis3(int i) {
3013 static std::set<int> ignore = {};
3014 return ignore.find(i) != ignore.end();
3015 }
3016
CreateModel_axis_quant8_dim4_axis3_neg(Model * model)3017 void CreateModel_axis_quant8_dim4_axis3_neg(Model *model) {
3018 OperandType type1(Type::INT32, {});
3019 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 5}, 0.25f, 128);
3020 OperandType type2(Type::FLOAT32, {});
3021 OperandType type20(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 5}, 0.00390625f, 0);
3022 // Phase 1, operands
3023 auto op1 = model->addOperand(&type19);
3024 auto param2 = model->addOperand(&type2);
3025 auto axis = model->addOperand(&type1);
3026 auto op2 = model->addOperand(&type20);
3027 // Phase 2, operations
3028 static float param2_init[] = {1.0f};
3029 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3030 static int32_t axis_init[] = {-1};
3031 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3032 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3033 // Phase 3, inputs and outputs
3034 model->identifyInputsAndOutputs(
3035 {op1},
3036 {op2});
3037 assert(model->isValid());
3038 }
3039
is_ignored_axis_quant8_dim4_axis3_neg(int i)3040 inline bool is_ignored_axis_quant8_dim4_axis3_neg(int i) {
3041 static std::set<int> ignore = {};
3042 return ignore.find(i) != ignore.end();
3043 }
3044
CreateModel_axis_quant8_dim3_axis0(Model * model)3045 void CreateModel_axis_quant8_dim3_axis0(Model *model) {
3046 OperandType type1(Type::INT32, {});
3047 OperandType type2(Type::FLOAT32, {});
3048 OperandType type53(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2}, 0.25f, 128);
3049 OperandType type54(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2}, 0.00390625f, 0);
3050 // Phase 1, operands
3051 auto op1 = model->addOperand(&type53);
3052 auto param2 = model->addOperand(&type2);
3053 auto axis = model->addOperand(&type1);
3054 auto op2 = model->addOperand(&type54);
3055 // Phase 2, operations
3056 static float param2_init[] = {1.0f};
3057 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3058 static int32_t axis_init[] = {0};
3059 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3060 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3061 // Phase 3, inputs and outputs
3062 model->identifyInputsAndOutputs(
3063 {op1},
3064 {op2});
3065 assert(model->isValid());
3066 }
3067
is_ignored_axis_quant8_dim3_axis0(int i)3068 inline bool is_ignored_axis_quant8_dim3_axis0(int i) {
3069 static std::set<int> ignore = {};
3070 return ignore.find(i) != ignore.end();
3071 }
3072
CreateModel_axis_quant8_dim3_axis0_neg(Model * model)3073 void CreateModel_axis_quant8_dim3_axis0_neg(Model *model) {
3074 OperandType type1(Type::INT32, {});
3075 OperandType type2(Type::FLOAT32, {});
3076 OperandType type53(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2}, 0.25f, 128);
3077 OperandType type54(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2}, 0.00390625f, 0);
3078 // Phase 1, operands
3079 auto op1 = model->addOperand(&type53);
3080 auto param2 = model->addOperand(&type2);
3081 auto axis = model->addOperand(&type1);
3082 auto op2 = model->addOperand(&type54);
3083 // Phase 2, operations
3084 static float param2_init[] = {1.0f};
3085 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3086 static int32_t axis_init[] = {-3};
3087 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3088 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3089 // Phase 3, inputs and outputs
3090 model->identifyInputsAndOutputs(
3091 {op1},
3092 {op2});
3093 assert(model->isValid());
3094 }
3095
is_ignored_axis_quant8_dim3_axis0_neg(int i)3096 inline bool is_ignored_axis_quant8_dim3_axis0_neg(int i) {
3097 static std::set<int> ignore = {};
3098 return ignore.find(i) != ignore.end();
3099 }
3100
CreateModel_axis_quant8_dim3_axis1(Model * model)3101 void CreateModel_axis_quant8_dim3_axis1(Model *model) {
3102 OperandType type1(Type::INT32, {});
3103 OperandType type2(Type::FLOAT32, {});
3104 OperandType type55(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2}, 0.25f, 128);
3105 OperandType type56(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2}, 0.00390625f, 0);
3106 // Phase 1, operands
3107 auto op1 = model->addOperand(&type55);
3108 auto param2 = model->addOperand(&type2);
3109 auto axis = model->addOperand(&type1);
3110 auto op2 = model->addOperand(&type56);
3111 // Phase 2, operations
3112 static float param2_init[] = {1.0f};
3113 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3114 static int32_t axis_init[] = {1};
3115 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3116 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3117 // Phase 3, inputs and outputs
3118 model->identifyInputsAndOutputs(
3119 {op1},
3120 {op2});
3121 assert(model->isValid());
3122 }
3123
is_ignored_axis_quant8_dim3_axis1(int i)3124 inline bool is_ignored_axis_quant8_dim3_axis1(int i) {
3125 static std::set<int> ignore = {};
3126 return ignore.find(i) != ignore.end();
3127 }
3128
CreateModel_axis_quant8_dim3_axis1_neg(Model * model)3129 void CreateModel_axis_quant8_dim3_axis1_neg(Model *model) {
3130 OperandType type1(Type::INT32, {});
3131 OperandType type2(Type::FLOAT32, {});
3132 OperandType type55(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2}, 0.25f, 128);
3133 OperandType type56(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2}, 0.00390625f, 0);
3134 // Phase 1, operands
3135 auto op1 = model->addOperand(&type55);
3136 auto param2 = model->addOperand(&type2);
3137 auto axis = model->addOperand(&type1);
3138 auto op2 = model->addOperand(&type56);
3139 // Phase 2, operations
3140 static float param2_init[] = {1.0f};
3141 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3142 static int32_t axis_init[] = {-2};
3143 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3144 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3145 // Phase 3, inputs and outputs
3146 model->identifyInputsAndOutputs(
3147 {op1},
3148 {op2});
3149 assert(model->isValid());
3150 }
3151
is_ignored_axis_quant8_dim3_axis1_neg(int i)3152 inline bool is_ignored_axis_quant8_dim3_axis1_neg(int i) {
3153 static std::set<int> ignore = {};
3154 return ignore.find(i) != ignore.end();
3155 }
3156
CreateModel_axis_quant8_dim3_axis2(Model * model)3157 void CreateModel_axis_quant8_dim3_axis2(Model *model) {
3158 OperandType type1(Type::INT32, {});
3159 OperandType type2(Type::FLOAT32, {});
3160 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5}, 0.25f, 128);
3161 OperandType type24(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5}, 0.00390625f, 0);
3162 // Phase 1, operands
3163 auto op1 = model->addOperand(&type23);
3164 auto param2 = model->addOperand(&type2);
3165 auto axis = model->addOperand(&type1);
3166 auto op2 = model->addOperand(&type24);
3167 // Phase 2, operations
3168 static float param2_init[] = {1.0f};
3169 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3170 static int32_t axis_init[] = {2};
3171 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3172 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3173 // Phase 3, inputs and outputs
3174 model->identifyInputsAndOutputs(
3175 {op1},
3176 {op2});
3177 assert(model->isValid());
3178 }
3179
is_ignored_axis_quant8_dim3_axis2(int i)3180 inline bool is_ignored_axis_quant8_dim3_axis2(int i) {
3181 static std::set<int> ignore = {};
3182 return ignore.find(i) != ignore.end();
3183 }
3184
CreateModel_axis_quant8_dim3_axis2_neg(Model * model)3185 void CreateModel_axis_quant8_dim3_axis2_neg(Model *model) {
3186 OperandType type1(Type::INT32, {});
3187 OperandType type2(Type::FLOAT32, {});
3188 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5}, 0.25f, 128);
3189 OperandType type24(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5}, 0.00390625f, 0);
3190 // Phase 1, operands
3191 auto op1 = model->addOperand(&type23);
3192 auto param2 = model->addOperand(&type2);
3193 auto axis = model->addOperand(&type1);
3194 auto op2 = model->addOperand(&type24);
3195 // Phase 2, operations
3196 static float param2_init[] = {1.0f};
3197 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3198 static int32_t axis_init[] = {-1};
3199 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3200 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3201 // Phase 3, inputs and outputs
3202 model->identifyInputsAndOutputs(
3203 {op1},
3204 {op2});
3205 assert(model->isValid());
3206 }
3207
is_ignored_axis_quant8_dim3_axis2_neg(int i)3208 inline bool is_ignored_axis_quant8_dim3_axis2_neg(int i) {
3209 static std::set<int> ignore = {};
3210 return ignore.find(i) != ignore.end();
3211 }
3212
CreateModel_axis_quant8_dim2_axis0(Model * model)3213 void CreateModel_axis_quant8_dim2_axis0(Model *model) {
3214 OperandType type1(Type::INT32, {});
3215 OperandType type2(Type::FLOAT32, {});
3216 OperandType type57(Type::TENSOR_QUANT8_ASYMM, {5, 2}, 0.25f, 128);
3217 OperandType type58(Type::TENSOR_QUANT8_ASYMM, {5, 2}, 0.00390625f, 0);
3218 // Phase 1, operands
3219 auto op1 = model->addOperand(&type57);
3220 auto param2 = model->addOperand(&type2);
3221 auto axis = model->addOperand(&type1);
3222 auto op2 = model->addOperand(&type58);
3223 // Phase 2, operations
3224 static float param2_init[] = {1.0f};
3225 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3226 static int32_t axis_init[] = {0};
3227 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3228 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3229 // Phase 3, inputs and outputs
3230 model->identifyInputsAndOutputs(
3231 {op1},
3232 {op2});
3233 assert(model->isValid());
3234 }
3235
is_ignored_axis_quant8_dim2_axis0(int i)3236 inline bool is_ignored_axis_quant8_dim2_axis0(int i) {
3237 static std::set<int> ignore = {};
3238 return ignore.find(i) != ignore.end();
3239 }
3240
CreateModel_axis_quant8_dim2_axis0_neg(Model * model)3241 void CreateModel_axis_quant8_dim2_axis0_neg(Model *model) {
3242 OperandType type1(Type::INT32, {});
3243 OperandType type2(Type::FLOAT32, {});
3244 OperandType type57(Type::TENSOR_QUANT8_ASYMM, {5, 2}, 0.25f, 128);
3245 OperandType type58(Type::TENSOR_QUANT8_ASYMM, {5, 2}, 0.00390625f, 0);
3246 // Phase 1, operands
3247 auto op1 = model->addOperand(&type57);
3248 auto param2 = model->addOperand(&type2);
3249 auto axis = model->addOperand(&type1);
3250 auto op2 = model->addOperand(&type58);
3251 // Phase 2, operations
3252 static float param2_init[] = {1.0f};
3253 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3254 static int32_t axis_init[] = {-2};
3255 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3256 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3257 // Phase 3, inputs and outputs
3258 model->identifyInputsAndOutputs(
3259 {op1},
3260 {op2});
3261 assert(model->isValid());
3262 }
3263
is_ignored_axis_quant8_dim2_axis0_neg(int i)3264 inline bool is_ignored_axis_quant8_dim2_axis0_neg(int i) {
3265 static std::set<int> ignore = {};
3266 return ignore.find(i) != ignore.end();
3267 }
3268
CreateModel_axis_quant8_dim2_axis1(Model * model)3269 void CreateModel_axis_quant8_dim2_axis1(Model *model) {
3270 OperandType type1(Type::INT32, {});
3271 OperandType type2(Type::FLOAT32, {});
3272 OperandType type59(Type::TENSOR_QUANT8_ASYMM, {2, 5}, 0.25f, 128);
3273 OperandType type60(Type::TENSOR_QUANT8_ASYMM, {2, 5}, 0.00390625f, 0);
3274 // Phase 1, operands
3275 auto op1 = model->addOperand(&type59);
3276 auto param2 = model->addOperand(&type2);
3277 auto axis = model->addOperand(&type1);
3278 auto op2 = model->addOperand(&type60);
3279 // Phase 2, operations
3280 static float param2_init[] = {1.0f};
3281 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3282 static int32_t axis_init[] = {1};
3283 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3284 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3285 // Phase 3, inputs and outputs
3286 model->identifyInputsAndOutputs(
3287 {op1},
3288 {op2});
3289 assert(model->isValid());
3290 }
3291
is_ignored_axis_quant8_dim2_axis1(int i)3292 inline bool is_ignored_axis_quant8_dim2_axis1(int i) {
3293 static std::set<int> ignore = {};
3294 return ignore.find(i) != ignore.end();
3295 }
3296
CreateModel_axis_quant8_dim2_axis1_neg(Model * model)3297 void CreateModel_axis_quant8_dim2_axis1_neg(Model *model) {
3298 OperandType type1(Type::INT32, {});
3299 OperandType type2(Type::FLOAT32, {});
3300 OperandType type59(Type::TENSOR_QUANT8_ASYMM, {2, 5}, 0.25f, 128);
3301 OperandType type60(Type::TENSOR_QUANT8_ASYMM, {2, 5}, 0.00390625f, 0);
3302 // Phase 1, operands
3303 auto op1 = model->addOperand(&type59);
3304 auto param2 = model->addOperand(&type2);
3305 auto axis = model->addOperand(&type1);
3306 auto op2 = model->addOperand(&type60);
3307 // Phase 2, operations
3308 static float param2_init[] = {1.0f};
3309 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3310 static int32_t axis_init[] = {-1};
3311 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3312 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3313 // Phase 3, inputs and outputs
3314 model->identifyInputsAndOutputs(
3315 {op1},
3316 {op2});
3317 assert(model->isValid());
3318 }
3319
is_ignored_axis_quant8_dim2_axis1_neg(int i)3320 inline bool is_ignored_axis_quant8_dim2_axis1_neg(int i) {
3321 static std::set<int> ignore = {};
3322 return ignore.find(i) != ignore.end();
3323 }
3324
CreateModel_axis_quant8_dim1_axis0(Model * model)3325 void CreateModel_axis_quant8_dim1_axis0(Model *model) {
3326 OperandType type1(Type::INT32, {});
3327 OperandType type2(Type::FLOAT32, {});
3328 OperandType type21(Type::TENSOR_QUANT8_ASYMM, {5}, 0.25f, 128);
3329 OperandType type22(Type::TENSOR_QUANT8_ASYMM, {5}, 0.00390625f, 0);
3330 // Phase 1, operands
3331 auto op1 = model->addOperand(&type21);
3332 auto param2 = model->addOperand(&type2);
3333 auto axis = model->addOperand(&type1);
3334 auto op2 = model->addOperand(&type22);
3335 // Phase 2, operations
3336 static float param2_init[] = {1.0f};
3337 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3338 static int32_t axis_init[] = {0};
3339 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3340 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3341 // Phase 3, inputs and outputs
3342 model->identifyInputsAndOutputs(
3343 {op1},
3344 {op2});
3345 assert(model->isValid());
3346 }
3347
is_ignored_axis_quant8_dim1_axis0(int i)3348 inline bool is_ignored_axis_quant8_dim1_axis0(int i) {
3349 static std::set<int> ignore = {};
3350 return ignore.find(i) != ignore.end();
3351 }
3352
CreateModel_axis_quant8_dim1_axis0_neg(Model * model)3353 void CreateModel_axis_quant8_dim1_axis0_neg(Model *model) {
3354 OperandType type1(Type::INT32, {});
3355 OperandType type2(Type::FLOAT32, {});
3356 OperandType type21(Type::TENSOR_QUANT8_ASYMM, {5}, 0.25f, 128);
3357 OperandType type22(Type::TENSOR_QUANT8_ASYMM, {5}, 0.00390625f, 0);
3358 // Phase 1, operands
3359 auto op1 = model->addOperand(&type21);
3360 auto param2 = model->addOperand(&type2);
3361 auto axis = model->addOperand(&type1);
3362 auto op2 = model->addOperand(&type22);
3363 // Phase 2, operations
3364 static float param2_init[] = {1.0f};
3365 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3366 static int32_t axis_init[] = {-1};
3367 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3368 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3369 // Phase 3, inputs and outputs
3370 model->identifyInputsAndOutputs(
3371 {op1},
3372 {op2});
3373 assert(model->isValid());
3374 }
3375
is_ignored_axis_quant8_dim1_axis0_neg(int i)3376 inline bool is_ignored_axis_quant8_dim1_axis0_neg(int i) {
3377 static std::set<int> ignore = {};
3378 return ignore.find(i) != ignore.end();
3379 }
3380
CreateModel_axis_dynamic_output_shape_dim4_axis0(Model * model)3381 void CreateModel_axis_dynamic_output_shape_dim4_axis0(Model *model) {
3382 OperandType type1(Type::INT32, {});
3383 OperandType type2(Type::FLOAT32, {});
3384 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
3385 OperandType type33(Type::TENSOR_FLOAT32, {5, 2, 2, 2});
3386 // Phase 1, operands
3387 auto op1 = model->addOperand(&type33);
3388 auto param2 = model->addOperand(&type2);
3389 auto axis = model->addOperand(&type1);
3390 auto op2 = model->addOperand(&type25);
3391 // Phase 2, operations
3392 static float param2_init[] = {1.0f};
3393 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3394 static int32_t axis_init[] = {0};
3395 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3396 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3397 // Phase 3, inputs and outputs
3398 model->identifyInputsAndOutputs(
3399 {op1},
3400 {op2});
3401 assert(model->isValid());
3402 }
3403
is_ignored_axis_dynamic_output_shape_dim4_axis0(int i)3404 inline bool is_ignored_axis_dynamic_output_shape_dim4_axis0(int i) {
3405 static std::set<int> ignore = {};
3406 return ignore.find(i) != ignore.end();
3407 }
3408
CreateModel_axis_dynamic_output_shape_dim4_axis0_neg(Model * model)3409 void CreateModel_axis_dynamic_output_shape_dim4_axis0_neg(Model *model) {
3410 OperandType type1(Type::INT32, {});
3411 OperandType type2(Type::FLOAT32, {});
3412 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
3413 OperandType type33(Type::TENSOR_FLOAT32, {5, 2, 2, 2});
3414 // Phase 1, operands
3415 auto op1 = model->addOperand(&type33);
3416 auto param2 = model->addOperand(&type2);
3417 auto axis = model->addOperand(&type1);
3418 auto op2 = model->addOperand(&type25);
3419 // Phase 2, operations
3420 static float param2_init[] = {1.0f};
3421 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3422 static int32_t axis_init[] = {-4};
3423 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3424 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3425 // Phase 3, inputs and outputs
3426 model->identifyInputsAndOutputs(
3427 {op1},
3428 {op2});
3429 assert(model->isValid());
3430 }
3431
is_ignored_axis_dynamic_output_shape_dim4_axis0_neg(int i)3432 inline bool is_ignored_axis_dynamic_output_shape_dim4_axis0_neg(int i) {
3433 static std::set<int> ignore = {};
3434 return ignore.find(i) != ignore.end();
3435 }
3436
CreateModel_axis_dynamic_output_shape_dim4_axis1(Model * model)3437 void CreateModel_axis_dynamic_output_shape_dim4_axis1(Model *model) {
3438 OperandType type1(Type::INT32, {});
3439 OperandType type2(Type::FLOAT32, {});
3440 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
3441 OperandType type34(Type::TENSOR_FLOAT32, {2, 5, 2, 2});
3442 // Phase 1, operands
3443 auto op1 = model->addOperand(&type34);
3444 auto param2 = model->addOperand(&type2);
3445 auto axis = model->addOperand(&type1);
3446 auto op2 = model->addOperand(&type25);
3447 // Phase 2, operations
3448 static float param2_init[] = {1.0f};
3449 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3450 static int32_t axis_init[] = {1};
3451 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3452 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3453 // Phase 3, inputs and outputs
3454 model->identifyInputsAndOutputs(
3455 {op1},
3456 {op2});
3457 assert(model->isValid());
3458 }
3459
is_ignored_axis_dynamic_output_shape_dim4_axis1(int i)3460 inline bool is_ignored_axis_dynamic_output_shape_dim4_axis1(int i) {
3461 static std::set<int> ignore = {};
3462 return ignore.find(i) != ignore.end();
3463 }
3464
CreateModel_axis_dynamic_output_shape_dim4_axis1_neg(Model * model)3465 void CreateModel_axis_dynamic_output_shape_dim4_axis1_neg(Model *model) {
3466 OperandType type1(Type::INT32, {});
3467 OperandType type2(Type::FLOAT32, {});
3468 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
3469 OperandType type34(Type::TENSOR_FLOAT32, {2, 5, 2, 2});
3470 // Phase 1, operands
3471 auto op1 = model->addOperand(&type34);
3472 auto param2 = model->addOperand(&type2);
3473 auto axis = model->addOperand(&type1);
3474 auto op2 = model->addOperand(&type25);
3475 // Phase 2, operations
3476 static float param2_init[] = {1.0f};
3477 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3478 static int32_t axis_init[] = {-3};
3479 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3480 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3481 // Phase 3, inputs and outputs
3482 model->identifyInputsAndOutputs(
3483 {op1},
3484 {op2});
3485 assert(model->isValid());
3486 }
3487
is_ignored_axis_dynamic_output_shape_dim4_axis1_neg(int i)3488 inline bool is_ignored_axis_dynamic_output_shape_dim4_axis1_neg(int i) {
3489 static std::set<int> ignore = {};
3490 return ignore.find(i) != ignore.end();
3491 }
3492
CreateModel_axis_dynamic_output_shape_dim4_axis2(Model * model)3493 void CreateModel_axis_dynamic_output_shape_dim4_axis2(Model *model) {
3494 OperandType type1(Type::INT32, {});
3495 OperandType type2(Type::FLOAT32, {});
3496 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
3497 OperandType type35(Type::TENSOR_FLOAT32, {2, 2, 5, 2});
3498 // Phase 1, operands
3499 auto op1 = model->addOperand(&type35);
3500 auto param2 = model->addOperand(&type2);
3501 auto axis = model->addOperand(&type1);
3502 auto op2 = model->addOperand(&type25);
3503 // Phase 2, operations
3504 static float param2_init[] = {1.0f};
3505 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3506 static int32_t axis_init[] = {2};
3507 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3508 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3509 // Phase 3, inputs and outputs
3510 model->identifyInputsAndOutputs(
3511 {op1},
3512 {op2});
3513 assert(model->isValid());
3514 }
3515
is_ignored_axis_dynamic_output_shape_dim4_axis2(int i)3516 inline bool is_ignored_axis_dynamic_output_shape_dim4_axis2(int i) {
3517 static std::set<int> ignore = {};
3518 return ignore.find(i) != ignore.end();
3519 }
3520
CreateModel_axis_dynamic_output_shape_dim4_axis2_neg(Model * model)3521 void CreateModel_axis_dynamic_output_shape_dim4_axis2_neg(Model *model) {
3522 OperandType type1(Type::INT32, {});
3523 OperandType type2(Type::FLOAT32, {});
3524 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
3525 OperandType type35(Type::TENSOR_FLOAT32, {2, 2, 5, 2});
3526 // Phase 1, operands
3527 auto op1 = model->addOperand(&type35);
3528 auto param2 = model->addOperand(&type2);
3529 auto axis = model->addOperand(&type1);
3530 auto op2 = model->addOperand(&type25);
3531 // Phase 2, operations
3532 static float param2_init[] = {1.0f};
3533 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3534 static int32_t axis_init[] = {-2};
3535 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3536 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3537 // Phase 3, inputs and outputs
3538 model->identifyInputsAndOutputs(
3539 {op1},
3540 {op2});
3541 assert(model->isValid());
3542 }
3543
is_ignored_axis_dynamic_output_shape_dim4_axis2_neg(int i)3544 inline bool is_ignored_axis_dynamic_output_shape_dim4_axis2_neg(int i) {
3545 static std::set<int> ignore = {};
3546 return ignore.find(i) != ignore.end();
3547 }
3548
CreateModel_axis_dynamic_output_shape_dim4_axis3(Model * model)3549 void CreateModel_axis_dynamic_output_shape_dim4_axis3(Model *model) {
3550 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
3551 OperandType type1(Type::INT32, {});
3552 OperandType type2(Type::FLOAT32, {});
3553 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
3554 // Phase 1, operands
3555 auto op1 = model->addOperand(&type0);
3556 auto param2 = model->addOperand(&type2);
3557 auto axis = model->addOperand(&type1);
3558 auto op2 = model->addOperand(&type25);
3559 // Phase 2, operations
3560 static float param2_init[] = {1.0f};
3561 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3562 static int32_t axis_init[] = {3};
3563 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3564 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3565 // Phase 3, inputs and outputs
3566 model->identifyInputsAndOutputs(
3567 {op1},
3568 {op2});
3569 assert(model->isValid());
3570 }
3571
is_ignored_axis_dynamic_output_shape_dim4_axis3(int i)3572 inline bool is_ignored_axis_dynamic_output_shape_dim4_axis3(int i) {
3573 static std::set<int> ignore = {};
3574 return ignore.find(i) != ignore.end();
3575 }
3576
CreateModel_axis_dynamic_output_shape_dim4_axis3_neg(Model * model)3577 void CreateModel_axis_dynamic_output_shape_dim4_axis3_neg(Model *model) {
3578 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
3579 OperandType type1(Type::INT32, {});
3580 OperandType type2(Type::FLOAT32, {});
3581 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
3582 // Phase 1, operands
3583 auto op1 = model->addOperand(&type0);
3584 auto param2 = model->addOperand(&type2);
3585 auto axis = model->addOperand(&type1);
3586 auto op2 = model->addOperand(&type25);
3587 // Phase 2, operations
3588 static float param2_init[] = {1.0f};
3589 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3590 static int32_t axis_init[] = {-1};
3591 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3592 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3593 // Phase 3, inputs and outputs
3594 model->identifyInputsAndOutputs(
3595 {op1},
3596 {op2});
3597 assert(model->isValid());
3598 }
3599
is_ignored_axis_dynamic_output_shape_dim4_axis3_neg(int i)3600 inline bool is_ignored_axis_dynamic_output_shape_dim4_axis3_neg(int i) {
3601 static std::set<int> ignore = {};
3602 return ignore.find(i) != ignore.end();
3603 }
3604
CreateModel_axis_dynamic_output_shape_dim3_axis0(Model * model)3605 void CreateModel_axis_dynamic_output_shape_dim3_axis0(Model *model) {
3606 OperandType type1(Type::INT32, {});
3607 OperandType type2(Type::FLOAT32, {});
3608 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
3609 OperandType type36(Type::TENSOR_FLOAT32, {5, 2, 2});
3610 // Phase 1, operands
3611 auto op1 = model->addOperand(&type36);
3612 auto param2 = model->addOperand(&type2);
3613 auto axis = model->addOperand(&type1);
3614 auto op2 = model->addOperand(&type26);
3615 // Phase 2, operations
3616 static float param2_init[] = {1.0f};
3617 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3618 static int32_t axis_init[] = {0};
3619 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3620 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3621 // Phase 3, inputs and outputs
3622 model->identifyInputsAndOutputs(
3623 {op1},
3624 {op2});
3625 assert(model->isValid());
3626 }
3627
is_ignored_axis_dynamic_output_shape_dim3_axis0(int i)3628 inline bool is_ignored_axis_dynamic_output_shape_dim3_axis0(int i) {
3629 static std::set<int> ignore = {};
3630 return ignore.find(i) != ignore.end();
3631 }
3632
CreateModel_axis_dynamic_output_shape_dim3_axis0_neg(Model * model)3633 void CreateModel_axis_dynamic_output_shape_dim3_axis0_neg(Model *model) {
3634 OperandType type1(Type::INT32, {});
3635 OperandType type2(Type::FLOAT32, {});
3636 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
3637 OperandType type36(Type::TENSOR_FLOAT32, {5, 2, 2});
3638 // Phase 1, operands
3639 auto op1 = model->addOperand(&type36);
3640 auto param2 = model->addOperand(&type2);
3641 auto axis = model->addOperand(&type1);
3642 auto op2 = model->addOperand(&type26);
3643 // Phase 2, operations
3644 static float param2_init[] = {1.0f};
3645 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3646 static int32_t axis_init[] = {-3};
3647 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3648 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3649 // Phase 3, inputs and outputs
3650 model->identifyInputsAndOutputs(
3651 {op1},
3652 {op2});
3653 assert(model->isValid());
3654 }
3655
is_ignored_axis_dynamic_output_shape_dim3_axis0_neg(int i)3656 inline bool is_ignored_axis_dynamic_output_shape_dim3_axis0_neg(int i) {
3657 static std::set<int> ignore = {};
3658 return ignore.find(i) != ignore.end();
3659 }
3660
CreateModel_axis_dynamic_output_shape_dim3_axis1(Model * model)3661 void CreateModel_axis_dynamic_output_shape_dim3_axis1(Model *model) {
3662 OperandType type1(Type::INT32, {});
3663 OperandType type2(Type::FLOAT32, {});
3664 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
3665 OperandType type37(Type::TENSOR_FLOAT32, {2, 5, 2});
3666 // Phase 1, operands
3667 auto op1 = model->addOperand(&type37);
3668 auto param2 = model->addOperand(&type2);
3669 auto axis = model->addOperand(&type1);
3670 auto op2 = model->addOperand(&type26);
3671 // Phase 2, operations
3672 static float param2_init[] = {1.0f};
3673 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3674 static int32_t axis_init[] = {1};
3675 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3676 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3677 // Phase 3, inputs and outputs
3678 model->identifyInputsAndOutputs(
3679 {op1},
3680 {op2});
3681 assert(model->isValid());
3682 }
3683
is_ignored_axis_dynamic_output_shape_dim3_axis1(int i)3684 inline bool is_ignored_axis_dynamic_output_shape_dim3_axis1(int i) {
3685 static std::set<int> ignore = {};
3686 return ignore.find(i) != ignore.end();
3687 }
3688
CreateModel_axis_dynamic_output_shape_dim3_axis1_neg(Model * model)3689 void CreateModel_axis_dynamic_output_shape_dim3_axis1_neg(Model *model) {
3690 OperandType type1(Type::INT32, {});
3691 OperandType type2(Type::FLOAT32, {});
3692 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
3693 OperandType type37(Type::TENSOR_FLOAT32, {2, 5, 2});
3694 // Phase 1, operands
3695 auto op1 = model->addOperand(&type37);
3696 auto param2 = model->addOperand(&type2);
3697 auto axis = model->addOperand(&type1);
3698 auto op2 = model->addOperand(&type26);
3699 // Phase 2, operations
3700 static float param2_init[] = {1.0f};
3701 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3702 static int32_t axis_init[] = {-2};
3703 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3704 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3705 // Phase 3, inputs and outputs
3706 model->identifyInputsAndOutputs(
3707 {op1},
3708 {op2});
3709 assert(model->isValid());
3710 }
3711
is_ignored_axis_dynamic_output_shape_dim3_axis1_neg(int i)3712 inline bool is_ignored_axis_dynamic_output_shape_dim3_axis1_neg(int i) {
3713 static std::set<int> ignore = {};
3714 return ignore.find(i) != ignore.end();
3715 }
3716
CreateModel_axis_dynamic_output_shape_dim3_axis2(Model * model)3717 void CreateModel_axis_dynamic_output_shape_dim3_axis2(Model *model) {
3718 OperandType type1(Type::INT32, {});
3719 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
3720 OperandType type2(Type::FLOAT32, {});
3721 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
3722 // Phase 1, operands
3723 auto op1 = model->addOperand(&type13);
3724 auto param2 = model->addOperand(&type2);
3725 auto axis = model->addOperand(&type1);
3726 auto op2 = model->addOperand(&type26);
3727 // Phase 2, operations
3728 static float param2_init[] = {1.0f};
3729 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3730 static int32_t axis_init[] = {2};
3731 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3732 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3733 // Phase 3, inputs and outputs
3734 model->identifyInputsAndOutputs(
3735 {op1},
3736 {op2});
3737 assert(model->isValid());
3738 }
3739
is_ignored_axis_dynamic_output_shape_dim3_axis2(int i)3740 inline bool is_ignored_axis_dynamic_output_shape_dim3_axis2(int i) {
3741 static std::set<int> ignore = {};
3742 return ignore.find(i) != ignore.end();
3743 }
3744
CreateModel_axis_dynamic_output_shape_dim3_axis2_neg(Model * model)3745 void CreateModel_axis_dynamic_output_shape_dim3_axis2_neg(Model *model) {
3746 OperandType type1(Type::INT32, {});
3747 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
3748 OperandType type2(Type::FLOAT32, {});
3749 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
3750 // Phase 1, operands
3751 auto op1 = model->addOperand(&type13);
3752 auto param2 = model->addOperand(&type2);
3753 auto axis = model->addOperand(&type1);
3754 auto op2 = model->addOperand(&type26);
3755 // Phase 2, operations
3756 static float param2_init[] = {1.0f};
3757 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3758 static int32_t axis_init[] = {-1};
3759 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3760 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3761 // Phase 3, inputs and outputs
3762 model->identifyInputsAndOutputs(
3763 {op1},
3764 {op2});
3765 assert(model->isValid());
3766 }
3767
is_ignored_axis_dynamic_output_shape_dim3_axis2_neg(int i)3768 inline bool is_ignored_axis_dynamic_output_shape_dim3_axis2_neg(int i) {
3769 static std::set<int> ignore = {};
3770 return ignore.find(i) != ignore.end();
3771 }
3772
CreateModel_axis_dynamic_output_shape_dim2_axis0(Model * model)3773 void CreateModel_axis_dynamic_output_shape_dim2_axis0(Model *model) {
3774 OperandType type1(Type::INT32, {});
3775 OperandType type2(Type::FLOAT32, {});
3776 OperandType type38(Type::TENSOR_FLOAT32, {5, 2});
3777 OperandType type61(Type::TENSOR_FLOAT32, {0, 0});
3778 // Phase 1, operands
3779 auto op1 = model->addOperand(&type38);
3780 auto param2 = model->addOperand(&type2);
3781 auto axis = model->addOperand(&type1);
3782 auto op2 = model->addOperand(&type61);
3783 // Phase 2, operations
3784 static float param2_init[] = {1.0f};
3785 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3786 static int32_t axis_init[] = {0};
3787 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3788 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3789 // Phase 3, inputs and outputs
3790 model->identifyInputsAndOutputs(
3791 {op1},
3792 {op2});
3793 assert(model->isValid());
3794 }
3795
is_ignored_axis_dynamic_output_shape_dim2_axis0(int i)3796 inline bool is_ignored_axis_dynamic_output_shape_dim2_axis0(int i) {
3797 static std::set<int> ignore = {};
3798 return ignore.find(i) != ignore.end();
3799 }
3800
CreateModel_axis_dynamic_output_shape_dim2_axis0_neg(Model * model)3801 void CreateModel_axis_dynamic_output_shape_dim2_axis0_neg(Model *model) {
3802 OperandType type1(Type::INT32, {});
3803 OperandType type2(Type::FLOAT32, {});
3804 OperandType type38(Type::TENSOR_FLOAT32, {5, 2});
3805 OperandType type61(Type::TENSOR_FLOAT32, {0, 0});
3806 // Phase 1, operands
3807 auto op1 = model->addOperand(&type38);
3808 auto param2 = model->addOperand(&type2);
3809 auto axis = model->addOperand(&type1);
3810 auto op2 = model->addOperand(&type61);
3811 // Phase 2, operations
3812 static float param2_init[] = {1.0f};
3813 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3814 static int32_t axis_init[] = {-2};
3815 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3816 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3817 // Phase 3, inputs and outputs
3818 model->identifyInputsAndOutputs(
3819 {op1},
3820 {op2});
3821 assert(model->isValid());
3822 }
3823
is_ignored_axis_dynamic_output_shape_dim2_axis0_neg(int i)3824 inline bool is_ignored_axis_dynamic_output_shape_dim2_axis0_neg(int i) {
3825 static std::set<int> ignore = {};
3826 return ignore.find(i) != ignore.end();
3827 }
3828
CreateModel_axis_dynamic_output_shape_dim2_axis1(Model * model)3829 void CreateModel_axis_dynamic_output_shape_dim2_axis1(Model *model) {
3830 OperandType type1(Type::INT32, {});
3831 OperandType type2(Type::FLOAT32, {});
3832 OperandType type39(Type::TENSOR_FLOAT32, {2, 5});
3833 OperandType type61(Type::TENSOR_FLOAT32, {0, 0});
3834 // Phase 1, operands
3835 auto op1 = model->addOperand(&type39);
3836 auto param2 = model->addOperand(&type2);
3837 auto axis = model->addOperand(&type1);
3838 auto op2 = model->addOperand(&type61);
3839 // Phase 2, operations
3840 static float param2_init[] = {1.0f};
3841 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3842 static int32_t axis_init[] = {1};
3843 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3844 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3845 // Phase 3, inputs and outputs
3846 model->identifyInputsAndOutputs(
3847 {op1},
3848 {op2});
3849 assert(model->isValid());
3850 }
3851
is_ignored_axis_dynamic_output_shape_dim2_axis1(int i)3852 inline bool is_ignored_axis_dynamic_output_shape_dim2_axis1(int i) {
3853 static std::set<int> ignore = {};
3854 return ignore.find(i) != ignore.end();
3855 }
3856
CreateModel_axis_dynamic_output_shape_dim2_axis1_neg(Model * model)3857 void CreateModel_axis_dynamic_output_shape_dim2_axis1_neg(Model *model) {
3858 OperandType type1(Type::INT32, {});
3859 OperandType type2(Type::FLOAT32, {});
3860 OperandType type39(Type::TENSOR_FLOAT32, {2, 5});
3861 OperandType type61(Type::TENSOR_FLOAT32, {0, 0});
3862 // Phase 1, operands
3863 auto op1 = model->addOperand(&type39);
3864 auto param2 = model->addOperand(&type2);
3865 auto axis = model->addOperand(&type1);
3866 auto op2 = model->addOperand(&type61);
3867 // Phase 2, operations
3868 static float param2_init[] = {1.0f};
3869 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3870 static int32_t axis_init[] = {-1};
3871 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3872 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3873 // Phase 3, inputs and outputs
3874 model->identifyInputsAndOutputs(
3875 {op1},
3876 {op2});
3877 assert(model->isValid());
3878 }
3879
is_ignored_axis_dynamic_output_shape_dim2_axis1_neg(int i)3880 inline bool is_ignored_axis_dynamic_output_shape_dim2_axis1_neg(int i) {
3881 static std::set<int> ignore = {};
3882 return ignore.find(i) != ignore.end();
3883 }
3884
CreateModel_axis_dynamic_output_shape_dim1_axis0(Model * model)3885 void CreateModel_axis_dynamic_output_shape_dim1_axis0(Model *model) {
3886 OperandType type1(Type::INT32, {});
3887 OperandType type12(Type::TENSOR_FLOAT32, {5});
3888 OperandType type2(Type::FLOAT32, {});
3889 OperandType type5(Type::TENSOR_FLOAT32, {0});
3890 // Phase 1, operands
3891 auto op1 = model->addOperand(&type12);
3892 auto param2 = model->addOperand(&type2);
3893 auto axis = model->addOperand(&type1);
3894 auto op2 = model->addOperand(&type5);
3895 // Phase 2, operations
3896 static float param2_init[] = {1.0f};
3897 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3898 static int32_t axis_init[] = {0};
3899 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3900 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3901 // Phase 3, inputs and outputs
3902 model->identifyInputsAndOutputs(
3903 {op1},
3904 {op2});
3905 assert(model->isValid());
3906 }
3907
is_ignored_axis_dynamic_output_shape_dim1_axis0(int i)3908 inline bool is_ignored_axis_dynamic_output_shape_dim1_axis0(int i) {
3909 static std::set<int> ignore = {};
3910 return ignore.find(i) != ignore.end();
3911 }
3912
CreateModel_axis_dynamic_output_shape_dim1_axis0_neg(Model * model)3913 void CreateModel_axis_dynamic_output_shape_dim1_axis0_neg(Model *model) {
3914 OperandType type1(Type::INT32, {});
3915 OperandType type12(Type::TENSOR_FLOAT32, {5});
3916 OperandType type2(Type::FLOAT32, {});
3917 OperandType type5(Type::TENSOR_FLOAT32, {0});
3918 // Phase 1, operands
3919 auto op1 = model->addOperand(&type12);
3920 auto param2 = model->addOperand(&type2);
3921 auto axis = model->addOperand(&type1);
3922 auto op2 = model->addOperand(&type5);
3923 // Phase 2, operations
3924 static float param2_init[] = {1.0f};
3925 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3926 static int32_t axis_init[] = {-1};
3927 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3928 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3929 // Phase 3, inputs and outputs
3930 model->identifyInputsAndOutputs(
3931 {op1},
3932 {op2});
3933 assert(model->isValid());
3934 }
3935
is_ignored_axis_dynamic_output_shape_dim1_axis0_neg(int i)3936 inline bool is_ignored_axis_dynamic_output_shape_dim1_axis0_neg(int i) {
3937 static std::set<int> ignore = {};
3938 return ignore.find(i) != ignore.end();
3939 }
3940
CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis0(Model * model)3941 void CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis0(Model *model) {
3942 OperandType type1(Type::INT32, {});
3943 OperandType type2(Type::FLOAT32, {});
3944 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
3945 OperandType type33(Type::TENSOR_FLOAT32, {5, 2, 2, 2});
3946 // Phase 1, operands
3947 auto op1 = model->addOperand(&type33);
3948 auto param2 = model->addOperand(&type2);
3949 auto axis = model->addOperand(&type1);
3950 auto op2 = model->addOperand(&type25);
3951 // Phase 2, operations
3952 static float param2_init[] = {1.0f};
3953 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3954 static int32_t axis_init[] = {0};
3955 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3956 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3957 // Phase 3, inputs and outputs
3958 model->identifyInputsAndOutputs(
3959 {op1},
3960 {op2});
3961 // Phase 4: set relaxed execution
3962 model->relaxComputationFloat32toFloat16(true);
3963 assert(model->isValid());
3964 }
3965
is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis0(int i)3966 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis0(int i) {
3967 static std::set<int> ignore = {};
3968 return ignore.find(i) != ignore.end();
3969 }
3970
CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis0_neg(Model * model)3971 void CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis0_neg(Model *model) {
3972 OperandType type1(Type::INT32, {});
3973 OperandType type2(Type::FLOAT32, {});
3974 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
3975 OperandType type33(Type::TENSOR_FLOAT32, {5, 2, 2, 2});
3976 // Phase 1, operands
3977 auto op1 = model->addOperand(&type33);
3978 auto param2 = model->addOperand(&type2);
3979 auto axis = model->addOperand(&type1);
3980 auto op2 = model->addOperand(&type25);
3981 // Phase 2, operations
3982 static float param2_init[] = {1.0f};
3983 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
3984 static int32_t axis_init[] = {-4};
3985 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
3986 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
3987 // Phase 3, inputs and outputs
3988 model->identifyInputsAndOutputs(
3989 {op1},
3990 {op2});
3991 // Phase 4: set relaxed execution
3992 model->relaxComputationFloat32toFloat16(true);
3993 assert(model->isValid());
3994 }
3995
is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis0_neg(int i)3996 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis0_neg(int i) {
3997 static std::set<int> ignore = {};
3998 return ignore.find(i) != ignore.end();
3999 }
4000
CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis1(Model * model)4001 void CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis1(Model *model) {
4002 OperandType type1(Type::INT32, {});
4003 OperandType type2(Type::FLOAT32, {});
4004 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
4005 OperandType type34(Type::TENSOR_FLOAT32, {2, 5, 2, 2});
4006 // Phase 1, operands
4007 auto op1 = model->addOperand(&type34);
4008 auto param2 = model->addOperand(&type2);
4009 auto axis = model->addOperand(&type1);
4010 auto op2 = model->addOperand(&type25);
4011 // Phase 2, operations
4012 static float param2_init[] = {1.0f};
4013 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
4014 static int32_t axis_init[] = {1};
4015 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4016 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4017 // Phase 3, inputs and outputs
4018 model->identifyInputsAndOutputs(
4019 {op1},
4020 {op2});
4021 // Phase 4: set relaxed execution
4022 model->relaxComputationFloat32toFloat16(true);
4023 assert(model->isValid());
4024 }
4025
is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis1(int i)4026 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis1(int i) {
4027 static std::set<int> ignore = {};
4028 return ignore.find(i) != ignore.end();
4029 }
4030
CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis1_neg(Model * model)4031 void CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis1_neg(Model *model) {
4032 OperandType type1(Type::INT32, {});
4033 OperandType type2(Type::FLOAT32, {});
4034 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
4035 OperandType type34(Type::TENSOR_FLOAT32, {2, 5, 2, 2});
4036 // Phase 1, operands
4037 auto op1 = model->addOperand(&type34);
4038 auto param2 = model->addOperand(&type2);
4039 auto axis = model->addOperand(&type1);
4040 auto op2 = model->addOperand(&type25);
4041 // Phase 2, operations
4042 static float param2_init[] = {1.0f};
4043 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
4044 static int32_t axis_init[] = {-3};
4045 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4046 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4047 // Phase 3, inputs and outputs
4048 model->identifyInputsAndOutputs(
4049 {op1},
4050 {op2});
4051 // Phase 4: set relaxed execution
4052 model->relaxComputationFloat32toFloat16(true);
4053 assert(model->isValid());
4054 }
4055
is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis1_neg(int i)4056 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis1_neg(int i) {
4057 static std::set<int> ignore = {};
4058 return ignore.find(i) != ignore.end();
4059 }
4060
CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis2(Model * model)4061 void CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis2(Model *model) {
4062 OperandType type1(Type::INT32, {});
4063 OperandType type2(Type::FLOAT32, {});
4064 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
4065 OperandType type35(Type::TENSOR_FLOAT32, {2, 2, 5, 2});
4066 // Phase 1, operands
4067 auto op1 = model->addOperand(&type35);
4068 auto param2 = model->addOperand(&type2);
4069 auto axis = model->addOperand(&type1);
4070 auto op2 = model->addOperand(&type25);
4071 // Phase 2, operations
4072 static float param2_init[] = {1.0f};
4073 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
4074 static int32_t axis_init[] = {2};
4075 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4076 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4077 // Phase 3, inputs and outputs
4078 model->identifyInputsAndOutputs(
4079 {op1},
4080 {op2});
4081 // Phase 4: set relaxed execution
4082 model->relaxComputationFloat32toFloat16(true);
4083 assert(model->isValid());
4084 }
4085
is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis2(int i)4086 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis2(int i) {
4087 static std::set<int> ignore = {};
4088 return ignore.find(i) != ignore.end();
4089 }
4090
CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis2_neg(Model * model)4091 void CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis2_neg(Model *model) {
4092 OperandType type1(Type::INT32, {});
4093 OperandType type2(Type::FLOAT32, {});
4094 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
4095 OperandType type35(Type::TENSOR_FLOAT32, {2, 2, 5, 2});
4096 // Phase 1, operands
4097 auto op1 = model->addOperand(&type35);
4098 auto param2 = model->addOperand(&type2);
4099 auto axis = model->addOperand(&type1);
4100 auto op2 = model->addOperand(&type25);
4101 // Phase 2, operations
4102 static float param2_init[] = {1.0f};
4103 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
4104 static int32_t axis_init[] = {-2};
4105 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4106 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4107 // Phase 3, inputs and outputs
4108 model->identifyInputsAndOutputs(
4109 {op1},
4110 {op2});
4111 // Phase 4: set relaxed execution
4112 model->relaxComputationFloat32toFloat16(true);
4113 assert(model->isValid());
4114 }
4115
is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis2_neg(int i)4116 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis2_neg(int i) {
4117 static std::set<int> ignore = {};
4118 return ignore.find(i) != ignore.end();
4119 }
4120
CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis3(Model * model)4121 void CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis3(Model *model) {
4122 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
4123 OperandType type1(Type::INT32, {});
4124 OperandType type2(Type::FLOAT32, {});
4125 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
4126 // Phase 1, operands
4127 auto op1 = model->addOperand(&type0);
4128 auto param2 = model->addOperand(&type2);
4129 auto axis = model->addOperand(&type1);
4130 auto op2 = model->addOperand(&type25);
4131 // Phase 2, operations
4132 static float param2_init[] = {1.0f};
4133 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
4134 static int32_t axis_init[] = {3};
4135 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4136 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4137 // Phase 3, inputs and outputs
4138 model->identifyInputsAndOutputs(
4139 {op1},
4140 {op2});
4141 // Phase 4: set relaxed execution
4142 model->relaxComputationFloat32toFloat16(true);
4143 assert(model->isValid());
4144 }
4145
is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis3(int i)4146 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis3(int i) {
4147 static std::set<int> ignore = {};
4148 return ignore.find(i) != ignore.end();
4149 }
4150
CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis3_neg(Model * model)4151 void CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis3_neg(Model *model) {
4152 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
4153 OperandType type1(Type::INT32, {});
4154 OperandType type2(Type::FLOAT32, {});
4155 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
4156 // Phase 1, operands
4157 auto op1 = model->addOperand(&type0);
4158 auto param2 = model->addOperand(&type2);
4159 auto axis = model->addOperand(&type1);
4160 auto op2 = model->addOperand(&type25);
4161 // Phase 2, operations
4162 static float param2_init[] = {1.0f};
4163 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
4164 static int32_t axis_init[] = {-1};
4165 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4166 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4167 // Phase 3, inputs and outputs
4168 model->identifyInputsAndOutputs(
4169 {op1},
4170 {op2});
4171 // Phase 4: set relaxed execution
4172 model->relaxComputationFloat32toFloat16(true);
4173 assert(model->isValid());
4174 }
4175
is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis3_neg(int i)4176 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis3_neg(int i) {
4177 static std::set<int> ignore = {};
4178 return ignore.find(i) != ignore.end();
4179 }
4180
CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis0(Model * model)4181 void CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis0(Model *model) {
4182 OperandType type1(Type::INT32, {});
4183 OperandType type2(Type::FLOAT32, {});
4184 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
4185 OperandType type36(Type::TENSOR_FLOAT32, {5, 2, 2});
4186 // Phase 1, operands
4187 auto op1 = model->addOperand(&type36);
4188 auto param2 = model->addOperand(&type2);
4189 auto axis = model->addOperand(&type1);
4190 auto op2 = model->addOperand(&type26);
4191 // Phase 2, operations
4192 static float param2_init[] = {1.0f};
4193 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
4194 static int32_t axis_init[] = {0};
4195 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4196 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4197 // Phase 3, inputs and outputs
4198 model->identifyInputsAndOutputs(
4199 {op1},
4200 {op2});
4201 // Phase 4: set relaxed execution
4202 model->relaxComputationFloat32toFloat16(true);
4203 assert(model->isValid());
4204 }
4205
is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis0(int i)4206 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis0(int i) {
4207 static std::set<int> ignore = {};
4208 return ignore.find(i) != ignore.end();
4209 }
4210
CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis0_neg(Model * model)4211 void CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis0_neg(Model *model) {
4212 OperandType type1(Type::INT32, {});
4213 OperandType type2(Type::FLOAT32, {});
4214 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
4215 OperandType type36(Type::TENSOR_FLOAT32, {5, 2, 2});
4216 // Phase 1, operands
4217 auto op1 = model->addOperand(&type36);
4218 auto param2 = model->addOperand(&type2);
4219 auto axis = model->addOperand(&type1);
4220 auto op2 = model->addOperand(&type26);
4221 // Phase 2, operations
4222 static float param2_init[] = {1.0f};
4223 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
4224 static int32_t axis_init[] = {-3};
4225 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4226 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4227 // Phase 3, inputs and outputs
4228 model->identifyInputsAndOutputs(
4229 {op1},
4230 {op2});
4231 // Phase 4: set relaxed execution
4232 model->relaxComputationFloat32toFloat16(true);
4233 assert(model->isValid());
4234 }
4235
is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis0_neg(int i)4236 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis0_neg(int i) {
4237 static std::set<int> ignore = {};
4238 return ignore.find(i) != ignore.end();
4239 }
4240
CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis1(Model * model)4241 void CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis1(Model *model) {
4242 OperandType type1(Type::INT32, {});
4243 OperandType type2(Type::FLOAT32, {});
4244 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
4245 OperandType type37(Type::TENSOR_FLOAT32, {2, 5, 2});
4246 // Phase 1, operands
4247 auto op1 = model->addOperand(&type37);
4248 auto param2 = model->addOperand(&type2);
4249 auto axis = model->addOperand(&type1);
4250 auto op2 = model->addOperand(&type26);
4251 // Phase 2, operations
4252 static float param2_init[] = {1.0f};
4253 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
4254 static int32_t axis_init[] = {1};
4255 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4256 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4257 // Phase 3, inputs and outputs
4258 model->identifyInputsAndOutputs(
4259 {op1},
4260 {op2});
4261 // Phase 4: set relaxed execution
4262 model->relaxComputationFloat32toFloat16(true);
4263 assert(model->isValid());
4264 }
4265
is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis1(int i)4266 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis1(int i) {
4267 static std::set<int> ignore = {};
4268 return ignore.find(i) != ignore.end();
4269 }
4270
CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis1_neg(Model * model)4271 void CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis1_neg(Model *model) {
4272 OperandType type1(Type::INT32, {});
4273 OperandType type2(Type::FLOAT32, {});
4274 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
4275 OperandType type37(Type::TENSOR_FLOAT32, {2, 5, 2});
4276 // Phase 1, operands
4277 auto op1 = model->addOperand(&type37);
4278 auto param2 = model->addOperand(&type2);
4279 auto axis = model->addOperand(&type1);
4280 auto op2 = model->addOperand(&type26);
4281 // Phase 2, operations
4282 static float param2_init[] = {1.0f};
4283 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
4284 static int32_t axis_init[] = {-2};
4285 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4286 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4287 // Phase 3, inputs and outputs
4288 model->identifyInputsAndOutputs(
4289 {op1},
4290 {op2});
4291 // Phase 4: set relaxed execution
4292 model->relaxComputationFloat32toFloat16(true);
4293 assert(model->isValid());
4294 }
4295
is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis1_neg(int i)4296 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis1_neg(int i) {
4297 static std::set<int> ignore = {};
4298 return ignore.find(i) != ignore.end();
4299 }
4300
CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis2(Model * model)4301 void CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis2(Model *model) {
4302 OperandType type1(Type::INT32, {});
4303 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
4304 OperandType type2(Type::FLOAT32, {});
4305 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
4306 // Phase 1, operands
4307 auto op1 = model->addOperand(&type13);
4308 auto param2 = model->addOperand(&type2);
4309 auto axis = model->addOperand(&type1);
4310 auto op2 = model->addOperand(&type26);
4311 // Phase 2, operations
4312 static float param2_init[] = {1.0f};
4313 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
4314 static int32_t axis_init[] = {2};
4315 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4316 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4317 // Phase 3, inputs and outputs
4318 model->identifyInputsAndOutputs(
4319 {op1},
4320 {op2});
4321 // Phase 4: set relaxed execution
4322 model->relaxComputationFloat32toFloat16(true);
4323 assert(model->isValid());
4324 }
4325
is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis2(int i)4326 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis2(int i) {
4327 static std::set<int> ignore = {};
4328 return ignore.find(i) != ignore.end();
4329 }
4330
CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis2_neg(Model * model)4331 void CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis2_neg(Model *model) {
4332 OperandType type1(Type::INT32, {});
4333 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
4334 OperandType type2(Type::FLOAT32, {});
4335 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
4336 // Phase 1, operands
4337 auto op1 = model->addOperand(&type13);
4338 auto param2 = model->addOperand(&type2);
4339 auto axis = model->addOperand(&type1);
4340 auto op2 = model->addOperand(&type26);
4341 // Phase 2, operations
4342 static float param2_init[] = {1.0f};
4343 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
4344 static int32_t axis_init[] = {-1};
4345 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4346 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4347 // Phase 3, inputs and outputs
4348 model->identifyInputsAndOutputs(
4349 {op1},
4350 {op2});
4351 // Phase 4: set relaxed execution
4352 model->relaxComputationFloat32toFloat16(true);
4353 assert(model->isValid());
4354 }
4355
is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis2_neg(int i)4356 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis2_neg(int i) {
4357 static std::set<int> ignore = {};
4358 return ignore.find(i) != ignore.end();
4359 }
4360
CreateModel_axis_dynamic_output_shape_relaxed_dim2_axis0(Model * model)4361 void CreateModel_axis_dynamic_output_shape_relaxed_dim2_axis0(Model *model) {
4362 OperandType type1(Type::INT32, {});
4363 OperandType type2(Type::FLOAT32, {});
4364 OperandType type38(Type::TENSOR_FLOAT32, {5, 2});
4365 OperandType type61(Type::TENSOR_FLOAT32, {0, 0});
4366 // Phase 1, operands
4367 auto op1 = model->addOperand(&type38);
4368 auto param2 = model->addOperand(&type2);
4369 auto axis = model->addOperand(&type1);
4370 auto op2 = model->addOperand(&type61);
4371 // Phase 2, operations
4372 static float param2_init[] = {1.0f};
4373 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
4374 static int32_t axis_init[] = {0};
4375 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4376 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4377 // Phase 3, inputs and outputs
4378 model->identifyInputsAndOutputs(
4379 {op1},
4380 {op2});
4381 // Phase 4: set relaxed execution
4382 model->relaxComputationFloat32toFloat16(true);
4383 assert(model->isValid());
4384 }
4385
is_ignored_axis_dynamic_output_shape_relaxed_dim2_axis0(int i)4386 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim2_axis0(int i) {
4387 static std::set<int> ignore = {};
4388 return ignore.find(i) != ignore.end();
4389 }
4390
CreateModel_axis_dynamic_output_shape_relaxed_dim2_axis0_neg(Model * model)4391 void CreateModel_axis_dynamic_output_shape_relaxed_dim2_axis0_neg(Model *model) {
4392 OperandType type1(Type::INT32, {});
4393 OperandType type2(Type::FLOAT32, {});
4394 OperandType type38(Type::TENSOR_FLOAT32, {5, 2});
4395 OperandType type61(Type::TENSOR_FLOAT32, {0, 0});
4396 // Phase 1, operands
4397 auto op1 = model->addOperand(&type38);
4398 auto param2 = model->addOperand(&type2);
4399 auto axis = model->addOperand(&type1);
4400 auto op2 = model->addOperand(&type61);
4401 // Phase 2, operations
4402 static float param2_init[] = {1.0f};
4403 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
4404 static int32_t axis_init[] = {-2};
4405 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4406 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4407 // Phase 3, inputs and outputs
4408 model->identifyInputsAndOutputs(
4409 {op1},
4410 {op2});
4411 // Phase 4: set relaxed execution
4412 model->relaxComputationFloat32toFloat16(true);
4413 assert(model->isValid());
4414 }
4415
is_ignored_axis_dynamic_output_shape_relaxed_dim2_axis0_neg(int i)4416 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim2_axis0_neg(int i) {
4417 static std::set<int> ignore = {};
4418 return ignore.find(i) != ignore.end();
4419 }
4420
CreateModel_axis_dynamic_output_shape_relaxed_dim2_axis1(Model * model)4421 void CreateModel_axis_dynamic_output_shape_relaxed_dim2_axis1(Model *model) {
4422 OperandType type1(Type::INT32, {});
4423 OperandType type2(Type::FLOAT32, {});
4424 OperandType type39(Type::TENSOR_FLOAT32, {2, 5});
4425 OperandType type61(Type::TENSOR_FLOAT32, {0, 0});
4426 // Phase 1, operands
4427 auto op1 = model->addOperand(&type39);
4428 auto param2 = model->addOperand(&type2);
4429 auto axis = model->addOperand(&type1);
4430 auto op2 = model->addOperand(&type61);
4431 // Phase 2, operations
4432 static float param2_init[] = {1.0f};
4433 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
4434 static int32_t axis_init[] = {1};
4435 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4436 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4437 // Phase 3, inputs and outputs
4438 model->identifyInputsAndOutputs(
4439 {op1},
4440 {op2});
4441 // Phase 4: set relaxed execution
4442 model->relaxComputationFloat32toFloat16(true);
4443 assert(model->isValid());
4444 }
4445
is_ignored_axis_dynamic_output_shape_relaxed_dim2_axis1(int i)4446 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim2_axis1(int i) {
4447 static std::set<int> ignore = {};
4448 return ignore.find(i) != ignore.end();
4449 }
4450
CreateModel_axis_dynamic_output_shape_relaxed_dim2_axis1_neg(Model * model)4451 void CreateModel_axis_dynamic_output_shape_relaxed_dim2_axis1_neg(Model *model) {
4452 OperandType type1(Type::INT32, {});
4453 OperandType type2(Type::FLOAT32, {});
4454 OperandType type39(Type::TENSOR_FLOAT32, {2, 5});
4455 OperandType type61(Type::TENSOR_FLOAT32, {0, 0});
4456 // Phase 1, operands
4457 auto op1 = model->addOperand(&type39);
4458 auto param2 = model->addOperand(&type2);
4459 auto axis = model->addOperand(&type1);
4460 auto op2 = model->addOperand(&type61);
4461 // Phase 2, operations
4462 static float param2_init[] = {1.0f};
4463 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
4464 static int32_t axis_init[] = {-1};
4465 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4466 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4467 // Phase 3, inputs and outputs
4468 model->identifyInputsAndOutputs(
4469 {op1},
4470 {op2});
4471 // Phase 4: set relaxed execution
4472 model->relaxComputationFloat32toFloat16(true);
4473 assert(model->isValid());
4474 }
4475
is_ignored_axis_dynamic_output_shape_relaxed_dim2_axis1_neg(int i)4476 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim2_axis1_neg(int i) {
4477 static std::set<int> ignore = {};
4478 return ignore.find(i) != ignore.end();
4479 }
4480
CreateModel_axis_dynamic_output_shape_relaxed_dim1_axis0(Model * model)4481 void CreateModel_axis_dynamic_output_shape_relaxed_dim1_axis0(Model *model) {
4482 OperandType type1(Type::INT32, {});
4483 OperandType type12(Type::TENSOR_FLOAT32, {5});
4484 OperandType type2(Type::FLOAT32, {});
4485 OperandType type5(Type::TENSOR_FLOAT32, {0});
4486 // Phase 1, operands
4487 auto op1 = model->addOperand(&type12);
4488 auto param2 = model->addOperand(&type2);
4489 auto axis = model->addOperand(&type1);
4490 auto op2 = model->addOperand(&type5);
4491 // Phase 2, operations
4492 static float param2_init[] = {1.0f};
4493 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
4494 static int32_t axis_init[] = {0};
4495 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4496 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4497 // Phase 3, inputs and outputs
4498 model->identifyInputsAndOutputs(
4499 {op1},
4500 {op2});
4501 // Phase 4: set relaxed execution
4502 model->relaxComputationFloat32toFloat16(true);
4503 assert(model->isValid());
4504 }
4505
is_ignored_axis_dynamic_output_shape_relaxed_dim1_axis0(int i)4506 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim1_axis0(int i) {
4507 static std::set<int> ignore = {};
4508 return ignore.find(i) != ignore.end();
4509 }
4510
CreateModel_axis_dynamic_output_shape_relaxed_dim1_axis0_neg(Model * model)4511 void CreateModel_axis_dynamic_output_shape_relaxed_dim1_axis0_neg(Model *model) {
4512 OperandType type1(Type::INT32, {});
4513 OperandType type12(Type::TENSOR_FLOAT32, {5});
4514 OperandType type2(Type::FLOAT32, {});
4515 OperandType type5(Type::TENSOR_FLOAT32, {0});
4516 // Phase 1, operands
4517 auto op1 = model->addOperand(&type12);
4518 auto param2 = model->addOperand(&type2);
4519 auto axis = model->addOperand(&type1);
4520 auto op2 = model->addOperand(&type5);
4521 // Phase 2, operations
4522 static float param2_init[] = {1.0f};
4523 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
4524 static int32_t axis_init[] = {-1};
4525 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4526 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4527 // Phase 3, inputs and outputs
4528 model->identifyInputsAndOutputs(
4529 {op1},
4530 {op2});
4531 // Phase 4: set relaxed execution
4532 model->relaxComputationFloat32toFloat16(true);
4533 assert(model->isValid());
4534 }
4535
is_ignored_axis_dynamic_output_shape_relaxed_dim1_axis0_neg(int i)4536 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim1_axis0_neg(int i) {
4537 static std::set<int> ignore = {};
4538 return ignore.find(i) != ignore.end();
4539 }
4540
CreateModel_axis_dynamic_output_shape_float16_dim4_axis0(Model * model)4541 void CreateModel_axis_dynamic_output_shape_float16_dim4_axis0(Model *model) {
4542 OperandType type1(Type::INT32, {});
4543 OperandType type15(Type::FLOAT16, {});
4544 OperandType type27(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
4545 OperandType type40(Type::TENSOR_FLOAT16, {5, 2, 2, 2});
4546 // Phase 1, operands
4547 auto op1 = model->addOperand(&type40);
4548 auto param2 = model->addOperand(&type15);
4549 auto axis = model->addOperand(&type1);
4550 auto op2 = model->addOperand(&type27);
4551 // Phase 2, operations
4552 static _Float16 param2_init[] = {1.0f};
4553 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
4554 static int32_t axis_init[] = {0};
4555 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4556 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4557 // Phase 3, inputs and outputs
4558 model->identifyInputsAndOutputs(
4559 {op1},
4560 {op2});
4561 assert(model->isValid());
4562 }
4563
is_ignored_axis_dynamic_output_shape_float16_dim4_axis0(int i)4564 inline bool is_ignored_axis_dynamic_output_shape_float16_dim4_axis0(int i) {
4565 static std::set<int> ignore = {};
4566 return ignore.find(i) != ignore.end();
4567 }
4568
CreateModel_axis_dynamic_output_shape_float16_dim4_axis0_neg(Model * model)4569 void CreateModel_axis_dynamic_output_shape_float16_dim4_axis0_neg(Model *model) {
4570 OperandType type1(Type::INT32, {});
4571 OperandType type15(Type::FLOAT16, {});
4572 OperandType type27(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
4573 OperandType type40(Type::TENSOR_FLOAT16, {5, 2, 2, 2});
4574 // Phase 1, operands
4575 auto op1 = model->addOperand(&type40);
4576 auto param2 = model->addOperand(&type15);
4577 auto axis = model->addOperand(&type1);
4578 auto op2 = model->addOperand(&type27);
4579 // Phase 2, operations
4580 static _Float16 param2_init[] = {1.0f};
4581 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
4582 static int32_t axis_init[] = {-4};
4583 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4584 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4585 // Phase 3, inputs and outputs
4586 model->identifyInputsAndOutputs(
4587 {op1},
4588 {op2});
4589 assert(model->isValid());
4590 }
4591
is_ignored_axis_dynamic_output_shape_float16_dim4_axis0_neg(int i)4592 inline bool is_ignored_axis_dynamic_output_shape_float16_dim4_axis0_neg(int i) {
4593 static std::set<int> ignore = {};
4594 return ignore.find(i) != ignore.end();
4595 }
4596
CreateModel_axis_dynamic_output_shape_float16_dim4_axis1(Model * model)4597 void CreateModel_axis_dynamic_output_shape_float16_dim4_axis1(Model *model) {
4598 OperandType type1(Type::INT32, {});
4599 OperandType type15(Type::FLOAT16, {});
4600 OperandType type27(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
4601 OperandType type41(Type::TENSOR_FLOAT16, {2, 5, 2, 2});
4602 // Phase 1, operands
4603 auto op1 = model->addOperand(&type41);
4604 auto param2 = model->addOperand(&type15);
4605 auto axis = model->addOperand(&type1);
4606 auto op2 = model->addOperand(&type27);
4607 // Phase 2, operations
4608 static _Float16 param2_init[] = {1.0f};
4609 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
4610 static int32_t axis_init[] = {1};
4611 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4612 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4613 // Phase 3, inputs and outputs
4614 model->identifyInputsAndOutputs(
4615 {op1},
4616 {op2});
4617 assert(model->isValid());
4618 }
4619
is_ignored_axis_dynamic_output_shape_float16_dim4_axis1(int i)4620 inline bool is_ignored_axis_dynamic_output_shape_float16_dim4_axis1(int i) {
4621 static std::set<int> ignore = {};
4622 return ignore.find(i) != ignore.end();
4623 }
4624
CreateModel_axis_dynamic_output_shape_float16_dim4_axis1_neg(Model * model)4625 void CreateModel_axis_dynamic_output_shape_float16_dim4_axis1_neg(Model *model) {
4626 OperandType type1(Type::INT32, {});
4627 OperandType type15(Type::FLOAT16, {});
4628 OperandType type27(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
4629 OperandType type41(Type::TENSOR_FLOAT16, {2, 5, 2, 2});
4630 // Phase 1, operands
4631 auto op1 = model->addOperand(&type41);
4632 auto param2 = model->addOperand(&type15);
4633 auto axis = model->addOperand(&type1);
4634 auto op2 = model->addOperand(&type27);
4635 // Phase 2, operations
4636 static _Float16 param2_init[] = {1.0f};
4637 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
4638 static int32_t axis_init[] = {-3};
4639 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4640 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4641 // Phase 3, inputs and outputs
4642 model->identifyInputsAndOutputs(
4643 {op1},
4644 {op2});
4645 assert(model->isValid());
4646 }
4647
is_ignored_axis_dynamic_output_shape_float16_dim4_axis1_neg(int i)4648 inline bool is_ignored_axis_dynamic_output_shape_float16_dim4_axis1_neg(int i) {
4649 static std::set<int> ignore = {};
4650 return ignore.find(i) != ignore.end();
4651 }
4652
CreateModel_axis_dynamic_output_shape_float16_dim4_axis2(Model * model)4653 void CreateModel_axis_dynamic_output_shape_float16_dim4_axis2(Model *model) {
4654 OperandType type1(Type::INT32, {});
4655 OperandType type15(Type::FLOAT16, {});
4656 OperandType type27(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
4657 OperandType type42(Type::TENSOR_FLOAT16, {2, 2, 5, 2});
4658 // Phase 1, operands
4659 auto op1 = model->addOperand(&type42);
4660 auto param2 = model->addOperand(&type15);
4661 auto axis = model->addOperand(&type1);
4662 auto op2 = model->addOperand(&type27);
4663 // Phase 2, operations
4664 static _Float16 param2_init[] = {1.0f};
4665 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
4666 static int32_t axis_init[] = {2};
4667 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4668 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4669 // Phase 3, inputs and outputs
4670 model->identifyInputsAndOutputs(
4671 {op1},
4672 {op2});
4673 assert(model->isValid());
4674 }
4675
is_ignored_axis_dynamic_output_shape_float16_dim4_axis2(int i)4676 inline bool is_ignored_axis_dynamic_output_shape_float16_dim4_axis2(int i) {
4677 static std::set<int> ignore = {};
4678 return ignore.find(i) != ignore.end();
4679 }
4680
CreateModel_axis_dynamic_output_shape_float16_dim4_axis2_neg(Model * model)4681 void CreateModel_axis_dynamic_output_shape_float16_dim4_axis2_neg(Model *model) {
4682 OperandType type1(Type::INT32, {});
4683 OperandType type15(Type::FLOAT16, {});
4684 OperandType type27(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
4685 OperandType type42(Type::TENSOR_FLOAT16, {2, 2, 5, 2});
4686 // Phase 1, operands
4687 auto op1 = model->addOperand(&type42);
4688 auto param2 = model->addOperand(&type15);
4689 auto axis = model->addOperand(&type1);
4690 auto op2 = model->addOperand(&type27);
4691 // Phase 2, operations
4692 static _Float16 param2_init[] = {1.0f};
4693 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
4694 static int32_t axis_init[] = {-2};
4695 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4696 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4697 // Phase 3, inputs and outputs
4698 model->identifyInputsAndOutputs(
4699 {op1},
4700 {op2});
4701 assert(model->isValid());
4702 }
4703
is_ignored_axis_dynamic_output_shape_float16_dim4_axis2_neg(int i)4704 inline bool is_ignored_axis_dynamic_output_shape_float16_dim4_axis2_neg(int i) {
4705 static std::set<int> ignore = {};
4706 return ignore.find(i) != ignore.end();
4707 }
4708
CreateModel_axis_dynamic_output_shape_float16_dim4_axis3(Model * model)4709 void CreateModel_axis_dynamic_output_shape_float16_dim4_axis3(Model *model) {
4710 OperandType type1(Type::INT32, {});
4711 OperandType type15(Type::FLOAT16, {});
4712 OperandType type16(Type::TENSOR_FLOAT16, {2, 2, 2, 5});
4713 OperandType type27(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
4714 // Phase 1, operands
4715 auto op1 = model->addOperand(&type16);
4716 auto param2 = model->addOperand(&type15);
4717 auto axis = model->addOperand(&type1);
4718 auto op2 = model->addOperand(&type27);
4719 // Phase 2, operations
4720 static _Float16 param2_init[] = {1.0f};
4721 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
4722 static int32_t axis_init[] = {3};
4723 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4724 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4725 // Phase 3, inputs and outputs
4726 model->identifyInputsAndOutputs(
4727 {op1},
4728 {op2});
4729 assert(model->isValid());
4730 }
4731
is_ignored_axis_dynamic_output_shape_float16_dim4_axis3(int i)4732 inline bool is_ignored_axis_dynamic_output_shape_float16_dim4_axis3(int i) {
4733 static std::set<int> ignore = {};
4734 return ignore.find(i) != ignore.end();
4735 }
4736
CreateModel_axis_dynamic_output_shape_float16_dim4_axis3_neg(Model * model)4737 void CreateModel_axis_dynamic_output_shape_float16_dim4_axis3_neg(Model *model) {
4738 OperandType type1(Type::INT32, {});
4739 OperandType type15(Type::FLOAT16, {});
4740 OperandType type16(Type::TENSOR_FLOAT16, {2, 2, 2, 5});
4741 OperandType type27(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
4742 // Phase 1, operands
4743 auto op1 = model->addOperand(&type16);
4744 auto param2 = model->addOperand(&type15);
4745 auto axis = model->addOperand(&type1);
4746 auto op2 = model->addOperand(&type27);
4747 // Phase 2, operations
4748 static _Float16 param2_init[] = {1.0f};
4749 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
4750 static int32_t axis_init[] = {-1};
4751 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4752 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4753 // Phase 3, inputs and outputs
4754 model->identifyInputsAndOutputs(
4755 {op1},
4756 {op2});
4757 assert(model->isValid());
4758 }
4759
is_ignored_axis_dynamic_output_shape_float16_dim4_axis3_neg(int i)4760 inline bool is_ignored_axis_dynamic_output_shape_float16_dim4_axis3_neg(int i) {
4761 static std::set<int> ignore = {};
4762 return ignore.find(i) != ignore.end();
4763 }
4764
CreateModel_axis_dynamic_output_shape_float16_dim3_axis0(Model * model)4765 void CreateModel_axis_dynamic_output_shape_float16_dim3_axis0(Model *model) {
4766 OperandType type1(Type::INT32, {});
4767 OperandType type15(Type::FLOAT16, {});
4768 OperandType type29(Type::TENSOR_FLOAT16, {0, 0, 0});
4769 OperandType type43(Type::TENSOR_FLOAT16, {5, 2, 2});
4770 // Phase 1, operands
4771 auto op1 = model->addOperand(&type43);
4772 auto param2 = model->addOperand(&type15);
4773 auto axis = model->addOperand(&type1);
4774 auto op2 = model->addOperand(&type29);
4775 // Phase 2, operations
4776 static _Float16 param2_init[] = {1.0f};
4777 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
4778 static int32_t axis_init[] = {0};
4779 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4780 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4781 // Phase 3, inputs and outputs
4782 model->identifyInputsAndOutputs(
4783 {op1},
4784 {op2});
4785 assert(model->isValid());
4786 }
4787
is_ignored_axis_dynamic_output_shape_float16_dim3_axis0(int i)4788 inline bool is_ignored_axis_dynamic_output_shape_float16_dim3_axis0(int i) {
4789 static std::set<int> ignore = {};
4790 return ignore.find(i) != ignore.end();
4791 }
4792
CreateModel_axis_dynamic_output_shape_float16_dim3_axis0_neg(Model * model)4793 void CreateModel_axis_dynamic_output_shape_float16_dim3_axis0_neg(Model *model) {
4794 OperandType type1(Type::INT32, {});
4795 OperandType type15(Type::FLOAT16, {});
4796 OperandType type29(Type::TENSOR_FLOAT16, {0, 0, 0});
4797 OperandType type43(Type::TENSOR_FLOAT16, {5, 2, 2});
4798 // Phase 1, operands
4799 auto op1 = model->addOperand(&type43);
4800 auto param2 = model->addOperand(&type15);
4801 auto axis = model->addOperand(&type1);
4802 auto op2 = model->addOperand(&type29);
4803 // Phase 2, operations
4804 static _Float16 param2_init[] = {1.0f};
4805 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
4806 static int32_t axis_init[] = {-3};
4807 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4808 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4809 // Phase 3, inputs and outputs
4810 model->identifyInputsAndOutputs(
4811 {op1},
4812 {op2});
4813 assert(model->isValid());
4814 }
4815
is_ignored_axis_dynamic_output_shape_float16_dim3_axis0_neg(int i)4816 inline bool is_ignored_axis_dynamic_output_shape_float16_dim3_axis0_neg(int i) {
4817 static std::set<int> ignore = {};
4818 return ignore.find(i) != ignore.end();
4819 }
4820
CreateModel_axis_dynamic_output_shape_float16_dim3_axis1(Model * model)4821 void CreateModel_axis_dynamic_output_shape_float16_dim3_axis1(Model *model) {
4822 OperandType type1(Type::INT32, {});
4823 OperandType type15(Type::FLOAT16, {});
4824 OperandType type29(Type::TENSOR_FLOAT16, {0, 0, 0});
4825 OperandType type44(Type::TENSOR_FLOAT16, {2, 5, 2});
4826 // Phase 1, operands
4827 auto op1 = model->addOperand(&type44);
4828 auto param2 = model->addOperand(&type15);
4829 auto axis = model->addOperand(&type1);
4830 auto op2 = model->addOperand(&type29);
4831 // Phase 2, operations
4832 static _Float16 param2_init[] = {1.0f};
4833 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
4834 static int32_t axis_init[] = {1};
4835 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4836 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4837 // Phase 3, inputs and outputs
4838 model->identifyInputsAndOutputs(
4839 {op1},
4840 {op2});
4841 assert(model->isValid());
4842 }
4843
is_ignored_axis_dynamic_output_shape_float16_dim3_axis1(int i)4844 inline bool is_ignored_axis_dynamic_output_shape_float16_dim3_axis1(int i) {
4845 static std::set<int> ignore = {};
4846 return ignore.find(i) != ignore.end();
4847 }
4848
CreateModel_axis_dynamic_output_shape_float16_dim3_axis1_neg(Model * model)4849 void CreateModel_axis_dynamic_output_shape_float16_dim3_axis1_neg(Model *model) {
4850 OperandType type1(Type::INT32, {});
4851 OperandType type15(Type::FLOAT16, {});
4852 OperandType type29(Type::TENSOR_FLOAT16, {0, 0, 0});
4853 OperandType type44(Type::TENSOR_FLOAT16, {2, 5, 2});
4854 // Phase 1, operands
4855 auto op1 = model->addOperand(&type44);
4856 auto param2 = model->addOperand(&type15);
4857 auto axis = model->addOperand(&type1);
4858 auto op2 = model->addOperand(&type29);
4859 // Phase 2, operations
4860 static _Float16 param2_init[] = {1.0f};
4861 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
4862 static int32_t axis_init[] = {-2};
4863 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4864 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4865 // Phase 3, inputs and outputs
4866 model->identifyInputsAndOutputs(
4867 {op1},
4868 {op2});
4869 assert(model->isValid());
4870 }
4871
is_ignored_axis_dynamic_output_shape_float16_dim3_axis1_neg(int i)4872 inline bool is_ignored_axis_dynamic_output_shape_float16_dim3_axis1_neg(int i) {
4873 static std::set<int> ignore = {};
4874 return ignore.find(i) != ignore.end();
4875 }
4876
CreateModel_axis_dynamic_output_shape_float16_dim3_axis2(Model * model)4877 void CreateModel_axis_dynamic_output_shape_float16_dim3_axis2(Model *model) {
4878 OperandType type1(Type::INT32, {});
4879 OperandType type15(Type::FLOAT16, {});
4880 OperandType type18(Type::TENSOR_FLOAT16, {2, 2, 5});
4881 OperandType type29(Type::TENSOR_FLOAT16, {0, 0, 0});
4882 // Phase 1, operands
4883 auto op1 = model->addOperand(&type18);
4884 auto param2 = model->addOperand(&type15);
4885 auto axis = model->addOperand(&type1);
4886 auto op2 = model->addOperand(&type29);
4887 // Phase 2, operations
4888 static _Float16 param2_init[] = {1.0f};
4889 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
4890 static int32_t axis_init[] = {2};
4891 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4892 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4893 // Phase 3, inputs and outputs
4894 model->identifyInputsAndOutputs(
4895 {op1},
4896 {op2});
4897 assert(model->isValid());
4898 }
4899
is_ignored_axis_dynamic_output_shape_float16_dim3_axis2(int i)4900 inline bool is_ignored_axis_dynamic_output_shape_float16_dim3_axis2(int i) {
4901 static std::set<int> ignore = {};
4902 return ignore.find(i) != ignore.end();
4903 }
4904
CreateModel_axis_dynamic_output_shape_float16_dim3_axis2_neg(Model * model)4905 void CreateModel_axis_dynamic_output_shape_float16_dim3_axis2_neg(Model *model) {
4906 OperandType type1(Type::INT32, {});
4907 OperandType type15(Type::FLOAT16, {});
4908 OperandType type18(Type::TENSOR_FLOAT16, {2, 2, 5});
4909 OperandType type29(Type::TENSOR_FLOAT16, {0, 0, 0});
4910 // Phase 1, operands
4911 auto op1 = model->addOperand(&type18);
4912 auto param2 = model->addOperand(&type15);
4913 auto axis = model->addOperand(&type1);
4914 auto op2 = model->addOperand(&type29);
4915 // Phase 2, operations
4916 static _Float16 param2_init[] = {1.0f};
4917 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
4918 static int32_t axis_init[] = {-1};
4919 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4920 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4921 // Phase 3, inputs and outputs
4922 model->identifyInputsAndOutputs(
4923 {op1},
4924 {op2});
4925 assert(model->isValid());
4926 }
4927
is_ignored_axis_dynamic_output_shape_float16_dim3_axis2_neg(int i)4928 inline bool is_ignored_axis_dynamic_output_shape_float16_dim3_axis2_neg(int i) {
4929 static std::set<int> ignore = {};
4930 return ignore.find(i) != ignore.end();
4931 }
4932
CreateModel_axis_dynamic_output_shape_float16_dim2_axis0(Model * model)4933 void CreateModel_axis_dynamic_output_shape_float16_dim2_axis0(Model *model) {
4934 OperandType type1(Type::INT32, {});
4935 OperandType type15(Type::FLOAT16, {});
4936 OperandType type45(Type::TENSOR_FLOAT16, {5, 2});
4937 OperandType type62(Type::TENSOR_FLOAT16, {0, 0});
4938 // Phase 1, operands
4939 auto op1 = model->addOperand(&type45);
4940 auto param2 = model->addOperand(&type15);
4941 auto axis = model->addOperand(&type1);
4942 auto op2 = model->addOperand(&type62);
4943 // Phase 2, operations
4944 static _Float16 param2_init[] = {1.0f};
4945 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
4946 static int32_t axis_init[] = {0};
4947 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4948 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4949 // Phase 3, inputs and outputs
4950 model->identifyInputsAndOutputs(
4951 {op1},
4952 {op2});
4953 assert(model->isValid());
4954 }
4955
is_ignored_axis_dynamic_output_shape_float16_dim2_axis0(int i)4956 inline bool is_ignored_axis_dynamic_output_shape_float16_dim2_axis0(int i) {
4957 static std::set<int> ignore = {};
4958 return ignore.find(i) != ignore.end();
4959 }
4960
CreateModel_axis_dynamic_output_shape_float16_dim2_axis0_neg(Model * model)4961 void CreateModel_axis_dynamic_output_shape_float16_dim2_axis0_neg(Model *model) {
4962 OperandType type1(Type::INT32, {});
4963 OperandType type15(Type::FLOAT16, {});
4964 OperandType type45(Type::TENSOR_FLOAT16, {5, 2});
4965 OperandType type62(Type::TENSOR_FLOAT16, {0, 0});
4966 // Phase 1, operands
4967 auto op1 = model->addOperand(&type45);
4968 auto param2 = model->addOperand(&type15);
4969 auto axis = model->addOperand(&type1);
4970 auto op2 = model->addOperand(&type62);
4971 // Phase 2, operations
4972 static _Float16 param2_init[] = {1.0f};
4973 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
4974 static int32_t axis_init[] = {-2};
4975 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
4976 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
4977 // Phase 3, inputs and outputs
4978 model->identifyInputsAndOutputs(
4979 {op1},
4980 {op2});
4981 assert(model->isValid());
4982 }
4983
is_ignored_axis_dynamic_output_shape_float16_dim2_axis0_neg(int i)4984 inline bool is_ignored_axis_dynamic_output_shape_float16_dim2_axis0_neg(int i) {
4985 static std::set<int> ignore = {};
4986 return ignore.find(i) != ignore.end();
4987 }
4988
CreateModel_axis_dynamic_output_shape_float16_dim2_axis1(Model * model)4989 void CreateModel_axis_dynamic_output_shape_float16_dim2_axis1(Model *model) {
4990 OperandType type1(Type::INT32, {});
4991 OperandType type15(Type::FLOAT16, {});
4992 OperandType type46(Type::TENSOR_FLOAT16, {2, 5});
4993 OperandType type62(Type::TENSOR_FLOAT16, {0, 0});
4994 // Phase 1, operands
4995 auto op1 = model->addOperand(&type46);
4996 auto param2 = model->addOperand(&type15);
4997 auto axis = model->addOperand(&type1);
4998 auto op2 = model->addOperand(&type62);
4999 // Phase 2, operations
5000 static _Float16 param2_init[] = {1.0f};
5001 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
5002 static int32_t axis_init[] = {1};
5003 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5004 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5005 // Phase 3, inputs and outputs
5006 model->identifyInputsAndOutputs(
5007 {op1},
5008 {op2});
5009 assert(model->isValid());
5010 }
5011
is_ignored_axis_dynamic_output_shape_float16_dim2_axis1(int i)5012 inline bool is_ignored_axis_dynamic_output_shape_float16_dim2_axis1(int i) {
5013 static std::set<int> ignore = {};
5014 return ignore.find(i) != ignore.end();
5015 }
5016
CreateModel_axis_dynamic_output_shape_float16_dim2_axis1_neg(Model * model)5017 void CreateModel_axis_dynamic_output_shape_float16_dim2_axis1_neg(Model *model) {
5018 OperandType type1(Type::INT32, {});
5019 OperandType type15(Type::FLOAT16, {});
5020 OperandType type46(Type::TENSOR_FLOAT16, {2, 5});
5021 OperandType type62(Type::TENSOR_FLOAT16, {0, 0});
5022 // Phase 1, operands
5023 auto op1 = model->addOperand(&type46);
5024 auto param2 = model->addOperand(&type15);
5025 auto axis = model->addOperand(&type1);
5026 auto op2 = model->addOperand(&type62);
5027 // Phase 2, operations
5028 static _Float16 param2_init[] = {1.0f};
5029 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
5030 static int32_t axis_init[] = {-1};
5031 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5032 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5033 // Phase 3, inputs and outputs
5034 model->identifyInputsAndOutputs(
5035 {op1},
5036 {op2});
5037 assert(model->isValid());
5038 }
5039
is_ignored_axis_dynamic_output_shape_float16_dim2_axis1_neg(int i)5040 inline bool is_ignored_axis_dynamic_output_shape_float16_dim2_axis1_neg(int i) {
5041 static std::set<int> ignore = {};
5042 return ignore.find(i) != ignore.end();
5043 }
5044
CreateModel_axis_dynamic_output_shape_float16_dim1_axis0(Model * model)5045 void CreateModel_axis_dynamic_output_shape_float16_dim1_axis0(Model *model) {
5046 OperandType type1(Type::INT32, {});
5047 OperandType type15(Type::FLOAT16, {});
5048 OperandType type17(Type::TENSOR_FLOAT16, {5});
5049 OperandType type28(Type::TENSOR_FLOAT16, {0});
5050 // Phase 1, operands
5051 auto op1 = model->addOperand(&type17);
5052 auto param2 = model->addOperand(&type15);
5053 auto axis = model->addOperand(&type1);
5054 auto op2 = model->addOperand(&type28);
5055 // Phase 2, operations
5056 static _Float16 param2_init[] = {1.0f};
5057 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
5058 static int32_t axis_init[] = {0};
5059 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5060 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5061 // Phase 3, inputs and outputs
5062 model->identifyInputsAndOutputs(
5063 {op1},
5064 {op2});
5065 assert(model->isValid());
5066 }
5067
is_ignored_axis_dynamic_output_shape_float16_dim1_axis0(int i)5068 inline bool is_ignored_axis_dynamic_output_shape_float16_dim1_axis0(int i) {
5069 static std::set<int> ignore = {};
5070 return ignore.find(i) != ignore.end();
5071 }
5072
CreateModel_axis_dynamic_output_shape_float16_dim1_axis0_neg(Model * model)5073 void CreateModel_axis_dynamic_output_shape_float16_dim1_axis0_neg(Model *model) {
5074 OperandType type1(Type::INT32, {});
5075 OperandType type15(Type::FLOAT16, {});
5076 OperandType type17(Type::TENSOR_FLOAT16, {5});
5077 OperandType type28(Type::TENSOR_FLOAT16, {0});
5078 // Phase 1, operands
5079 auto op1 = model->addOperand(&type17);
5080 auto param2 = model->addOperand(&type15);
5081 auto axis = model->addOperand(&type1);
5082 auto op2 = model->addOperand(&type28);
5083 // Phase 2, operations
5084 static _Float16 param2_init[] = {1.0f};
5085 model->setOperandValue(param2, param2_init, sizeof(_Float16) * 1);
5086 static int32_t axis_init[] = {-1};
5087 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5088 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5089 // Phase 3, inputs and outputs
5090 model->identifyInputsAndOutputs(
5091 {op1},
5092 {op2});
5093 assert(model->isValid());
5094 }
5095
is_ignored_axis_dynamic_output_shape_float16_dim1_axis0_neg(int i)5096 inline bool is_ignored_axis_dynamic_output_shape_float16_dim1_axis0_neg(int i) {
5097 static std::set<int> ignore = {};
5098 return ignore.find(i) != ignore.end();
5099 }
5100
CreateModel_axis_dynamic_output_shape_quant8_dim4_axis0(Model * model)5101 void CreateModel_axis_dynamic_output_shape_quant8_dim4_axis0(Model *model) {
5102 OperandType type1(Type::INT32, {});
5103 OperandType type2(Type::FLOAT32, {});
5104 OperandType type30(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.00390625f, 0);
5105 OperandType type47(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2, 2}, 0.25f, 128);
5106 // Phase 1, operands
5107 auto op1 = model->addOperand(&type47);
5108 auto param2 = model->addOperand(&type2);
5109 auto axis = model->addOperand(&type1);
5110 auto op2 = model->addOperand(&type30);
5111 // Phase 2, operations
5112 static float param2_init[] = {1.0f};
5113 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
5114 static int32_t axis_init[] = {0};
5115 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5116 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5117 // Phase 3, inputs and outputs
5118 model->identifyInputsAndOutputs(
5119 {op1},
5120 {op2});
5121 assert(model->isValid());
5122 }
5123
is_ignored_axis_dynamic_output_shape_quant8_dim4_axis0(int i)5124 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim4_axis0(int i) {
5125 static std::set<int> ignore = {};
5126 return ignore.find(i) != ignore.end();
5127 }
5128
CreateModel_axis_dynamic_output_shape_quant8_dim4_axis0_neg(Model * model)5129 void CreateModel_axis_dynamic_output_shape_quant8_dim4_axis0_neg(Model *model) {
5130 OperandType type1(Type::INT32, {});
5131 OperandType type2(Type::FLOAT32, {});
5132 OperandType type30(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.00390625f, 0);
5133 OperandType type47(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2, 2}, 0.25f, 128);
5134 // Phase 1, operands
5135 auto op1 = model->addOperand(&type47);
5136 auto param2 = model->addOperand(&type2);
5137 auto axis = model->addOperand(&type1);
5138 auto op2 = model->addOperand(&type30);
5139 // Phase 2, operations
5140 static float param2_init[] = {1.0f};
5141 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
5142 static int32_t axis_init[] = {-4};
5143 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5144 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5145 // Phase 3, inputs and outputs
5146 model->identifyInputsAndOutputs(
5147 {op1},
5148 {op2});
5149 assert(model->isValid());
5150 }
5151
is_ignored_axis_dynamic_output_shape_quant8_dim4_axis0_neg(int i)5152 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim4_axis0_neg(int i) {
5153 static std::set<int> ignore = {};
5154 return ignore.find(i) != ignore.end();
5155 }
5156
CreateModel_axis_dynamic_output_shape_quant8_dim4_axis1(Model * model)5157 void CreateModel_axis_dynamic_output_shape_quant8_dim4_axis1(Model *model) {
5158 OperandType type1(Type::INT32, {});
5159 OperandType type2(Type::FLOAT32, {});
5160 OperandType type30(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.00390625f, 0);
5161 OperandType type49(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2, 2}, 0.25f, 128);
5162 // Phase 1, operands
5163 auto op1 = model->addOperand(&type49);
5164 auto param2 = model->addOperand(&type2);
5165 auto axis = model->addOperand(&type1);
5166 auto op2 = model->addOperand(&type30);
5167 // Phase 2, operations
5168 static float param2_init[] = {1.0f};
5169 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
5170 static int32_t axis_init[] = {1};
5171 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5172 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5173 // Phase 3, inputs and outputs
5174 model->identifyInputsAndOutputs(
5175 {op1},
5176 {op2});
5177 assert(model->isValid());
5178 }
5179
is_ignored_axis_dynamic_output_shape_quant8_dim4_axis1(int i)5180 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim4_axis1(int i) {
5181 static std::set<int> ignore = {};
5182 return ignore.find(i) != ignore.end();
5183 }
5184
CreateModel_axis_dynamic_output_shape_quant8_dim4_axis1_neg(Model * model)5185 void CreateModel_axis_dynamic_output_shape_quant8_dim4_axis1_neg(Model *model) {
5186 OperandType type1(Type::INT32, {});
5187 OperandType type2(Type::FLOAT32, {});
5188 OperandType type30(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.00390625f, 0);
5189 OperandType type49(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2, 2}, 0.25f, 128);
5190 // Phase 1, operands
5191 auto op1 = model->addOperand(&type49);
5192 auto param2 = model->addOperand(&type2);
5193 auto axis = model->addOperand(&type1);
5194 auto op2 = model->addOperand(&type30);
5195 // Phase 2, operations
5196 static float param2_init[] = {1.0f};
5197 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
5198 static int32_t axis_init[] = {-3};
5199 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5200 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5201 // Phase 3, inputs and outputs
5202 model->identifyInputsAndOutputs(
5203 {op1},
5204 {op2});
5205 assert(model->isValid());
5206 }
5207
is_ignored_axis_dynamic_output_shape_quant8_dim4_axis1_neg(int i)5208 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim4_axis1_neg(int i) {
5209 static std::set<int> ignore = {};
5210 return ignore.find(i) != ignore.end();
5211 }
5212
CreateModel_axis_dynamic_output_shape_quant8_dim4_axis2(Model * model)5213 void CreateModel_axis_dynamic_output_shape_quant8_dim4_axis2(Model *model) {
5214 OperandType type1(Type::INT32, {});
5215 OperandType type2(Type::FLOAT32, {});
5216 OperandType type30(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.00390625f, 0);
5217 OperandType type51(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5, 2}, 0.25f, 128);
5218 // Phase 1, operands
5219 auto op1 = model->addOperand(&type51);
5220 auto param2 = model->addOperand(&type2);
5221 auto axis = model->addOperand(&type1);
5222 auto op2 = model->addOperand(&type30);
5223 // Phase 2, operations
5224 static float param2_init[] = {1.0f};
5225 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
5226 static int32_t axis_init[] = {2};
5227 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5228 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5229 // Phase 3, inputs and outputs
5230 model->identifyInputsAndOutputs(
5231 {op1},
5232 {op2});
5233 assert(model->isValid());
5234 }
5235
is_ignored_axis_dynamic_output_shape_quant8_dim4_axis2(int i)5236 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim4_axis2(int i) {
5237 static std::set<int> ignore = {};
5238 return ignore.find(i) != ignore.end();
5239 }
5240
CreateModel_axis_dynamic_output_shape_quant8_dim4_axis2_neg(Model * model)5241 void CreateModel_axis_dynamic_output_shape_quant8_dim4_axis2_neg(Model *model) {
5242 OperandType type1(Type::INT32, {});
5243 OperandType type2(Type::FLOAT32, {});
5244 OperandType type30(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.00390625f, 0);
5245 OperandType type51(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5, 2}, 0.25f, 128);
5246 // Phase 1, operands
5247 auto op1 = model->addOperand(&type51);
5248 auto param2 = model->addOperand(&type2);
5249 auto axis = model->addOperand(&type1);
5250 auto op2 = model->addOperand(&type30);
5251 // Phase 2, operations
5252 static float param2_init[] = {1.0f};
5253 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
5254 static int32_t axis_init[] = {-2};
5255 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5256 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5257 // Phase 3, inputs and outputs
5258 model->identifyInputsAndOutputs(
5259 {op1},
5260 {op2});
5261 assert(model->isValid());
5262 }
5263
is_ignored_axis_dynamic_output_shape_quant8_dim4_axis2_neg(int i)5264 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim4_axis2_neg(int i) {
5265 static std::set<int> ignore = {};
5266 return ignore.find(i) != ignore.end();
5267 }
5268
CreateModel_axis_dynamic_output_shape_quant8_dim4_axis3(Model * model)5269 void CreateModel_axis_dynamic_output_shape_quant8_dim4_axis3(Model *model) {
5270 OperandType type1(Type::INT32, {});
5271 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 5}, 0.25f, 128);
5272 OperandType type2(Type::FLOAT32, {});
5273 OperandType type30(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.00390625f, 0);
5274 // Phase 1, operands
5275 auto op1 = model->addOperand(&type19);
5276 auto param2 = model->addOperand(&type2);
5277 auto axis = model->addOperand(&type1);
5278 auto op2 = model->addOperand(&type30);
5279 // Phase 2, operations
5280 static float param2_init[] = {1.0f};
5281 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
5282 static int32_t axis_init[] = {3};
5283 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5284 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5285 // Phase 3, inputs and outputs
5286 model->identifyInputsAndOutputs(
5287 {op1},
5288 {op2});
5289 assert(model->isValid());
5290 }
5291
is_ignored_axis_dynamic_output_shape_quant8_dim4_axis3(int i)5292 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim4_axis3(int i) {
5293 static std::set<int> ignore = {};
5294 return ignore.find(i) != ignore.end();
5295 }
5296
CreateModel_axis_dynamic_output_shape_quant8_dim4_axis3_neg(Model * model)5297 void CreateModel_axis_dynamic_output_shape_quant8_dim4_axis3_neg(Model *model) {
5298 OperandType type1(Type::INT32, {});
5299 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 5}, 0.25f, 128);
5300 OperandType type2(Type::FLOAT32, {});
5301 OperandType type30(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.00390625f, 0);
5302 // Phase 1, operands
5303 auto op1 = model->addOperand(&type19);
5304 auto param2 = model->addOperand(&type2);
5305 auto axis = model->addOperand(&type1);
5306 auto op2 = model->addOperand(&type30);
5307 // Phase 2, operations
5308 static float param2_init[] = {1.0f};
5309 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
5310 static int32_t axis_init[] = {-1};
5311 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5312 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5313 // Phase 3, inputs and outputs
5314 model->identifyInputsAndOutputs(
5315 {op1},
5316 {op2});
5317 assert(model->isValid());
5318 }
5319
is_ignored_axis_dynamic_output_shape_quant8_dim4_axis3_neg(int i)5320 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim4_axis3_neg(int i) {
5321 static std::set<int> ignore = {};
5322 return ignore.find(i) != ignore.end();
5323 }
5324
CreateModel_axis_dynamic_output_shape_quant8_dim3_axis0(Model * model)5325 void CreateModel_axis_dynamic_output_shape_quant8_dim3_axis0(Model *model) {
5326 OperandType type1(Type::INT32, {});
5327 OperandType type2(Type::FLOAT32, {});
5328 OperandType type32(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.00390625f, 0);
5329 OperandType type53(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2}, 0.25f, 128);
5330 // Phase 1, operands
5331 auto op1 = model->addOperand(&type53);
5332 auto param2 = model->addOperand(&type2);
5333 auto axis = model->addOperand(&type1);
5334 auto op2 = model->addOperand(&type32);
5335 // Phase 2, operations
5336 static float param2_init[] = {1.0f};
5337 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
5338 static int32_t axis_init[] = {0};
5339 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5340 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5341 // Phase 3, inputs and outputs
5342 model->identifyInputsAndOutputs(
5343 {op1},
5344 {op2});
5345 assert(model->isValid());
5346 }
5347
is_ignored_axis_dynamic_output_shape_quant8_dim3_axis0(int i)5348 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim3_axis0(int i) {
5349 static std::set<int> ignore = {};
5350 return ignore.find(i) != ignore.end();
5351 }
5352
CreateModel_axis_dynamic_output_shape_quant8_dim3_axis0_neg(Model * model)5353 void CreateModel_axis_dynamic_output_shape_quant8_dim3_axis0_neg(Model *model) {
5354 OperandType type1(Type::INT32, {});
5355 OperandType type2(Type::FLOAT32, {});
5356 OperandType type32(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.00390625f, 0);
5357 OperandType type53(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2}, 0.25f, 128);
5358 // Phase 1, operands
5359 auto op1 = model->addOperand(&type53);
5360 auto param2 = model->addOperand(&type2);
5361 auto axis = model->addOperand(&type1);
5362 auto op2 = model->addOperand(&type32);
5363 // Phase 2, operations
5364 static float param2_init[] = {1.0f};
5365 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
5366 static int32_t axis_init[] = {-3};
5367 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5368 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5369 // Phase 3, inputs and outputs
5370 model->identifyInputsAndOutputs(
5371 {op1},
5372 {op2});
5373 assert(model->isValid());
5374 }
5375
is_ignored_axis_dynamic_output_shape_quant8_dim3_axis0_neg(int i)5376 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim3_axis0_neg(int i) {
5377 static std::set<int> ignore = {};
5378 return ignore.find(i) != ignore.end();
5379 }
5380
CreateModel_axis_dynamic_output_shape_quant8_dim3_axis1(Model * model)5381 void CreateModel_axis_dynamic_output_shape_quant8_dim3_axis1(Model *model) {
5382 OperandType type1(Type::INT32, {});
5383 OperandType type2(Type::FLOAT32, {});
5384 OperandType type32(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.00390625f, 0);
5385 OperandType type55(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2}, 0.25f, 128);
5386 // Phase 1, operands
5387 auto op1 = model->addOperand(&type55);
5388 auto param2 = model->addOperand(&type2);
5389 auto axis = model->addOperand(&type1);
5390 auto op2 = model->addOperand(&type32);
5391 // Phase 2, operations
5392 static float param2_init[] = {1.0f};
5393 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
5394 static int32_t axis_init[] = {1};
5395 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5396 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5397 // Phase 3, inputs and outputs
5398 model->identifyInputsAndOutputs(
5399 {op1},
5400 {op2});
5401 assert(model->isValid());
5402 }
5403
is_ignored_axis_dynamic_output_shape_quant8_dim3_axis1(int i)5404 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim3_axis1(int i) {
5405 static std::set<int> ignore = {};
5406 return ignore.find(i) != ignore.end();
5407 }
5408
CreateModel_axis_dynamic_output_shape_quant8_dim3_axis1_neg(Model * model)5409 void CreateModel_axis_dynamic_output_shape_quant8_dim3_axis1_neg(Model *model) {
5410 OperandType type1(Type::INT32, {});
5411 OperandType type2(Type::FLOAT32, {});
5412 OperandType type32(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.00390625f, 0);
5413 OperandType type55(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2}, 0.25f, 128);
5414 // Phase 1, operands
5415 auto op1 = model->addOperand(&type55);
5416 auto param2 = model->addOperand(&type2);
5417 auto axis = model->addOperand(&type1);
5418 auto op2 = model->addOperand(&type32);
5419 // Phase 2, operations
5420 static float param2_init[] = {1.0f};
5421 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
5422 static int32_t axis_init[] = {-2};
5423 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5424 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5425 // Phase 3, inputs and outputs
5426 model->identifyInputsAndOutputs(
5427 {op1},
5428 {op2});
5429 assert(model->isValid());
5430 }
5431
is_ignored_axis_dynamic_output_shape_quant8_dim3_axis1_neg(int i)5432 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim3_axis1_neg(int i) {
5433 static std::set<int> ignore = {};
5434 return ignore.find(i) != ignore.end();
5435 }
5436
CreateModel_axis_dynamic_output_shape_quant8_dim3_axis2(Model * model)5437 void CreateModel_axis_dynamic_output_shape_quant8_dim3_axis2(Model *model) {
5438 OperandType type1(Type::INT32, {});
5439 OperandType type2(Type::FLOAT32, {});
5440 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5}, 0.25f, 128);
5441 OperandType type32(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.00390625f, 0);
5442 // Phase 1, operands
5443 auto op1 = model->addOperand(&type23);
5444 auto param2 = model->addOperand(&type2);
5445 auto axis = model->addOperand(&type1);
5446 auto op2 = model->addOperand(&type32);
5447 // Phase 2, operations
5448 static float param2_init[] = {1.0f};
5449 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
5450 static int32_t axis_init[] = {2};
5451 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5452 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5453 // Phase 3, inputs and outputs
5454 model->identifyInputsAndOutputs(
5455 {op1},
5456 {op2});
5457 assert(model->isValid());
5458 }
5459
is_ignored_axis_dynamic_output_shape_quant8_dim3_axis2(int i)5460 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim3_axis2(int i) {
5461 static std::set<int> ignore = {};
5462 return ignore.find(i) != ignore.end();
5463 }
5464
CreateModel_axis_dynamic_output_shape_quant8_dim3_axis2_neg(Model * model)5465 void CreateModel_axis_dynamic_output_shape_quant8_dim3_axis2_neg(Model *model) {
5466 OperandType type1(Type::INT32, {});
5467 OperandType type2(Type::FLOAT32, {});
5468 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5}, 0.25f, 128);
5469 OperandType type32(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.00390625f, 0);
5470 // Phase 1, operands
5471 auto op1 = model->addOperand(&type23);
5472 auto param2 = model->addOperand(&type2);
5473 auto axis = model->addOperand(&type1);
5474 auto op2 = model->addOperand(&type32);
5475 // Phase 2, operations
5476 static float param2_init[] = {1.0f};
5477 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
5478 static int32_t axis_init[] = {-1};
5479 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5480 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5481 // Phase 3, inputs and outputs
5482 model->identifyInputsAndOutputs(
5483 {op1},
5484 {op2});
5485 assert(model->isValid());
5486 }
5487
is_ignored_axis_dynamic_output_shape_quant8_dim3_axis2_neg(int i)5488 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim3_axis2_neg(int i) {
5489 static std::set<int> ignore = {};
5490 return ignore.find(i) != ignore.end();
5491 }
5492
CreateModel_axis_dynamic_output_shape_quant8_dim2_axis0(Model * model)5493 void CreateModel_axis_dynamic_output_shape_quant8_dim2_axis0(Model *model) {
5494 OperandType type1(Type::INT32, {});
5495 OperandType type2(Type::FLOAT32, {});
5496 OperandType type57(Type::TENSOR_QUANT8_ASYMM, {5, 2}, 0.25f, 128);
5497 OperandType type63(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 0.00390625f, 0);
5498 // Phase 1, operands
5499 auto op1 = model->addOperand(&type57);
5500 auto param2 = model->addOperand(&type2);
5501 auto axis = model->addOperand(&type1);
5502 auto op2 = model->addOperand(&type63);
5503 // Phase 2, operations
5504 static float param2_init[] = {1.0f};
5505 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
5506 static int32_t axis_init[] = {0};
5507 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5508 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5509 // Phase 3, inputs and outputs
5510 model->identifyInputsAndOutputs(
5511 {op1},
5512 {op2});
5513 assert(model->isValid());
5514 }
5515
is_ignored_axis_dynamic_output_shape_quant8_dim2_axis0(int i)5516 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim2_axis0(int i) {
5517 static std::set<int> ignore = {};
5518 return ignore.find(i) != ignore.end();
5519 }
5520
CreateModel_axis_dynamic_output_shape_quant8_dim2_axis0_neg(Model * model)5521 void CreateModel_axis_dynamic_output_shape_quant8_dim2_axis0_neg(Model *model) {
5522 OperandType type1(Type::INT32, {});
5523 OperandType type2(Type::FLOAT32, {});
5524 OperandType type57(Type::TENSOR_QUANT8_ASYMM, {5, 2}, 0.25f, 128);
5525 OperandType type63(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 0.00390625f, 0);
5526 // Phase 1, operands
5527 auto op1 = model->addOperand(&type57);
5528 auto param2 = model->addOperand(&type2);
5529 auto axis = model->addOperand(&type1);
5530 auto op2 = model->addOperand(&type63);
5531 // Phase 2, operations
5532 static float param2_init[] = {1.0f};
5533 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
5534 static int32_t axis_init[] = {-2};
5535 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5536 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5537 // Phase 3, inputs and outputs
5538 model->identifyInputsAndOutputs(
5539 {op1},
5540 {op2});
5541 assert(model->isValid());
5542 }
5543
is_ignored_axis_dynamic_output_shape_quant8_dim2_axis0_neg(int i)5544 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim2_axis0_neg(int i) {
5545 static std::set<int> ignore = {};
5546 return ignore.find(i) != ignore.end();
5547 }
5548
CreateModel_axis_dynamic_output_shape_quant8_dim2_axis1(Model * model)5549 void CreateModel_axis_dynamic_output_shape_quant8_dim2_axis1(Model *model) {
5550 OperandType type1(Type::INT32, {});
5551 OperandType type2(Type::FLOAT32, {});
5552 OperandType type59(Type::TENSOR_QUANT8_ASYMM, {2, 5}, 0.25f, 128);
5553 OperandType type63(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 0.00390625f, 0);
5554 // Phase 1, operands
5555 auto op1 = model->addOperand(&type59);
5556 auto param2 = model->addOperand(&type2);
5557 auto axis = model->addOperand(&type1);
5558 auto op2 = model->addOperand(&type63);
5559 // Phase 2, operations
5560 static float param2_init[] = {1.0f};
5561 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
5562 static int32_t axis_init[] = {1};
5563 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5564 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5565 // Phase 3, inputs and outputs
5566 model->identifyInputsAndOutputs(
5567 {op1},
5568 {op2});
5569 assert(model->isValid());
5570 }
5571
is_ignored_axis_dynamic_output_shape_quant8_dim2_axis1(int i)5572 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim2_axis1(int i) {
5573 static std::set<int> ignore = {};
5574 return ignore.find(i) != ignore.end();
5575 }
5576
CreateModel_axis_dynamic_output_shape_quant8_dim2_axis1_neg(Model * model)5577 void CreateModel_axis_dynamic_output_shape_quant8_dim2_axis1_neg(Model *model) {
5578 OperandType type1(Type::INT32, {});
5579 OperandType type2(Type::FLOAT32, {});
5580 OperandType type59(Type::TENSOR_QUANT8_ASYMM, {2, 5}, 0.25f, 128);
5581 OperandType type63(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 0.00390625f, 0);
5582 // Phase 1, operands
5583 auto op1 = model->addOperand(&type59);
5584 auto param2 = model->addOperand(&type2);
5585 auto axis = model->addOperand(&type1);
5586 auto op2 = model->addOperand(&type63);
5587 // Phase 2, operations
5588 static float param2_init[] = {1.0f};
5589 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
5590 static int32_t axis_init[] = {-1};
5591 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5592 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5593 // Phase 3, inputs and outputs
5594 model->identifyInputsAndOutputs(
5595 {op1},
5596 {op2});
5597 assert(model->isValid());
5598 }
5599
is_ignored_axis_dynamic_output_shape_quant8_dim2_axis1_neg(int i)5600 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim2_axis1_neg(int i) {
5601 static std::set<int> ignore = {};
5602 return ignore.find(i) != ignore.end();
5603 }
5604
CreateModel_axis_dynamic_output_shape_quant8_dim1_axis0(Model * model)5605 void CreateModel_axis_dynamic_output_shape_quant8_dim1_axis0(Model *model) {
5606 OperandType type1(Type::INT32, {});
5607 OperandType type2(Type::FLOAT32, {});
5608 OperandType type21(Type::TENSOR_QUANT8_ASYMM, {5}, 0.25f, 128);
5609 OperandType type31(Type::TENSOR_QUANT8_ASYMM, {0}, 0.00390625f, 0);
5610 // Phase 1, operands
5611 auto op1 = model->addOperand(&type21);
5612 auto param2 = model->addOperand(&type2);
5613 auto axis = model->addOperand(&type1);
5614 auto op2 = model->addOperand(&type31);
5615 // Phase 2, operations
5616 static float param2_init[] = {1.0f};
5617 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
5618 static int32_t axis_init[] = {0};
5619 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5620 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5621 // Phase 3, inputs and outputs
5622 model->identifyInputsAndOutputs(
5623 {op1},
5624 {op2});
5625 assert(model->isValid());
5626 }
5627
is_ignored_axis_dynamic_output_shape_quant8_dim1_axis0(int i)5628 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim1_axis0(int i) {
5629 static std::set<int> ignore = {};
5630 return ignore.find(i) != ignore.end();
5631 }
5632
CreateModel_axis_dynamic_output_shape_quant8_dim1_axis0_neg(Model * model)5633 void CreateModel_axis_dynamic_output_shape_quant8_dim1_axis0_neg(Model *model) {
5634 OperandType type1(Type::INT32, {});
5635 OperandType type2(Type::FLOAT32, {});
5636 OperandType type21(Type::TENSOR_QUANT8_ASYMM, {5}, 0.25f, 128);
5637 OperandType type31(Type::TENSOR_QUANT8_ASYMM, {0}, 0.00390625f, 0);
5638 // Phase 1, operands
5639 auto op1 = model->addOperand(&type21);
5640 auto param2 = model->addOperand(&type2);
5641 auto axis = model->addOperand(&type1);
5642 auto op2 = model->addOperand(&type31);
5643 // Phase 2, operations
5644 static float param2_init[] = {1.0f};
5645 model->setOperandValue(param2, param2_init, sizeof(float) * 1);
5646 static int32_t axis_init[] = {-1};
5647 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5648 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param2, axis}, {op2});
5649 // Phase 3, inputs and outputs
5650 model->identifyInputsAndOutputs(
5651 {op1},
5652 {op2});
5653 assert(model->isValid());
5654 }
5655
is_ignored_axis_dynamic_output_shape_quant8_dim1_axis0_neg(int i)5656 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim1_axis0_neg(int i) {
5657 static std::set<int> ignore = {};
5658 return ignore.find(i) != ignore.end();
5659 }
5660
CreateModel_axis_dim4_axis0_2(Model * model)5661 void CreateModel_axis_dim4_axis0_2(Model *model) {
5662 OperandType type1(Type::INT32, {});
5663 OperandType type2(Type::FLOAT32, {});
5664 OperandType type33(Type::TENSOR_FLOAT32, {5, 2, 2, 2});
5665 // Phase 1, operands
5666 auto op1 = model->addOperand(&type33);
5667 auto param3 = model->addOperand(&type2);
5668 auto axis = model->addOperand(&type1);
5669 auto op2 = model->addOperand(&type33);
5670 // Phase 2, operations
5671 static float param3_init[] = {1e-06f};
5672 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
5673 static int32_t axis_init[] = {0};
5674 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5675 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
5676 // Phase 3, inputs and outputs
5677 model->identifyInputsAndOutputs(
5678 {op1},
5679 {op2});
5680 assert(model->isValid());
5681 }
5682
is_ignored_axis_dim4_axis0_2(int i)5683 inline bool is_ignored_axis_dim4_axis0_2(int i) {
5684 static std::set<int> ignore = {};
5685 return ignore.find(i) != ignore.end();
5686 }
5687
CreateModel_axis_dim4_axis0_neg_2(Model * model)5688 void CreateModel_axis_dim4_axis0_neg_2(Model *model) {
5689 OperandType type1(Type::INT32, {});
5690 OperandType type2(Type::FLOAT32, {});
5691 OperandType type33(Type::TENSOR_FLOAT32, {5, 2, 2, 2});
5692 // Phase 1, operands
5693 auto op1 = model->addOperand(&type33);
5694 auto param3 = model->addOperand(&type2);
5695 auto axis = model->addOperand(&type1);
5696 auto op2 = model->addOperand(&type33);
5697 // Phase 2, operations
5698 static float param3_init[] = {1e-06f};
5699 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
5700 static int32_t axis_init[] = {-4};
5701 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5702 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
5703 // Phase 3, inputs and outputs
5704 model->identifyInputsAndOutputs(
5705 {op1},
5706 {op2});
5707 assert(model->isValid());
5708 }
5709
is_ignored_axis_dim4_axis0_neg_2(int i)5710 inline bool is_ignored_axis_dim4_axis0_neg_2(int i) {
5711 static std::set<int> ignore = {};
5712 return ignore.find(i) != ignore.end();
5713 }
5714
CreateModel_axis_dim4_axis1_2(Model * model)5715 void CreateModel_axis_dim4_axis1_2(Model *model) {
5716 OperandType type1(Type::INT32, {});
5717 OperandType type2(Type::FLOAT32, {});
5718 OperandType type34(Type::TENSOR_FLOAT32, {2, 5, 2, 2});
5719 // Phase 1, operands
5720 auto op1 = model->addOperand(&type34);
5721 auto param3 = model->addOperand(&type2);
5722 auto axis = model->addOperand(&type1);
5723 auto op2 = model->addOperand(&type34);
5724 // Phase 2, operations
5725 static float param3_init[] = {1e-06f};
5726 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
5727 static int32_t axis_init[] = {1};
5728 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5729 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
5730 // Phase 3, inputs and outputs
5731 model->identifyInputsAndOutputs(
5732 {op1},
5733 {op2});
5734 assert(model->isValid());
5735 }
5736
is_ignored_axis_dim4_axis1_2(int i)5737 inline bool is_ignored_axis_dim4_axis1_2(int i) {
5738 static std::set<int> ignore = {};
5739 return ignore.find(i) != ignore.end();
5740 }
5741
CreateModel_axis_dim4_axis1_neg_2(Model * model)5742 void CreateModel_axis_dim4_axis1_neg_2(Model *model) {
5743 OperandType type1(Type::INT32, {});
5744 OperandType type2(Type::FLOAT32, {});
5745 OperandType type34(Type::TENSOR_FLOAT32, {2, 5, 2, 2});
5746 // Phase 1, operands
5747 auto op1 = model->addOperand(&type34);
5748 auto param3 = model->addOperand(&type2);
5749 auto axis = model->addOperand(&type1);
5750 auto op2 = model->addOperand(&type34);
5751 // Phase 2, operations
5752 static float param3_init[] = {1e-06f};
5753 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
5754 static int32_t axis_init[] = {-3};
5755 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5756 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
5757 // Phase 3, inputs and outputs
5758 model->identifyInputsAndOutputs(
5759 {op1},
5760 {op2});
5761 assert(model->isValid());
5762 }
5763
is_ignored_axis_dim4_axis1_neg_2(int i)5764 inline bool is_ignored_axis_dim4_axis1_neg_2(int i) {
5765 static std::set<int> ignore = {};
5766 return ignore.find(i) != ignore.end();
5767 }
5768
CreateModel_axis_dim4_axis2_2(Model * model)5769 void CreateModel_axis_dim4_axis2_2(Model *model) {
5770 OperandType type1(Type::INT32, {});
5771 OperandType type2(Type::FLOAT32, {});
5772 OperandType type35(Type::TENSOR_FLOAT32, {2, 2, 5, 2});
5773 // Phase 1, operands
5774 auto op1 = model->addOperand(&type35);
5775 auto param3 = model->addOperand(&type2);
5776 auto axis = model->addOperand(&type1);
5777 auto op2 = model->addOperand(&type35);
5778 // Phase 2, operations
5779 static float param3_init[] = {1e-06f};
5780 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
5781 static int32_t axis_init[] = {2};
5782 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5783 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
5784 // Phase 3, inputs and outputs
5785 model->identifyInputsAndOutputs(
5786 {op1},
5787 {op2});
5788 assert(model->isValid());
5789 }
5790
is_ignored_axis_dim4_axis2_2(int i)5791 inline bool is_ignored_axis_dim4_axis2_2(int i) {
5792 static std::set<int> ignore = {};
5793 return ignore.find(i) != ignore.end();
5794 }
5795
CreateModel_axis_dim4_axis2_neg_2(Model * model)5796 void CreateModel_axis_dim4_axis2_neg_2(Model *model) {
5797 OperandType type1(Type::INT32, {});
5798 OperandType type2(Type::FLOAT32, {});
5799 OperandType type35(Type::TENSOR_FLOAT32, {2, 2, 5, 2});
5800 // Phase 1, operands
5801 auto op1 = model->addOperand(&type35);
5802 auto param3 = model->addOperand(&type2);
5803 auto axis = model->addOperand(&type1);
5804 auto op2 = model->addOperand(&type35);
5805 // Phase 2, operations
5806 static float param3_init[] = {1e-06f};
5807 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
5808 static int32_t axis_init[] = {-2};
5809 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5810 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
5811 // Phase 3, inputs and outputs
5812 model->identifyInputsAndOutputs(
5813 {op1},
5814 {op2});
5815 assert(model->isValid());
5816 }
5817
is_ignored_axis_dim4_axis2_neg_2(int i)5818 inline bool is_ignored_axis_dim4_axis2_neg_2(int i) {
5819 static std::set<int> ignore = {};
5820 return ignore.find(i) != ignore.end();
5821 }
5822
CreateModel_axis_dim4_axis3_2(Model * model)5823 void CreateModel_axis_dim4_axis3_2(Model *model) {
5824 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
5825 OperandType type1(Type::INT32, {});
5826 OperandType type2(Type::FLOAT32, {});
5827 // Phase 1, operands
5828 auto op1 = model->addOperand(&type0);
5829 auto param3 = model->addOperand(&type2);
5830 auto axis = model->addOperand(&type1);
5831 auto op2 = model->addOperand(&type0);
5832 // Phase 2, operations
5833 static float param3_init[] = {1e-06f};
5834 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
5835 static int32_t axis_init[] = {3};
5836 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5837 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
5838 // Phase 3, inputs and outputs
5839 model->identifyInputsAndOutputs(
5840 {op1},
5841 {op2});
5842 assert(model->isValid());
5843 }
5844
is_ignored_axis_dim4_axis3_2(int i)5845 inline bool is_ignored_axis_dim4_axis3_2(int i) {
5846 static std::set<int> ignore = {};
5847 return ignore.find(i) != ignore.end();
5848 }
5849
CreateModel_axis_dim4_axis3_neg_2(Model * model)5850 void CreateModel_axis_dim4_axis3_neg_2(Model *model) {
5851 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
5852 OperandType type1(Type::INT32, {});
5853 OperandType type2(Type::FLOAT32, {});
5854 // Phase 1, operands
5855 auto op1 = model->addOperand(&type0);
5856 auto param3 = model->addOperand(&type2);
5857 auto axis = model->addOperand(&type1);
5858 auto op2 = model->addOperand(&type0);
5859 // Phase 2, operations
5860 static float param3_init[] = {1e-06f};
5861 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
5862 static int32_t axis_init[] = {-1};
5863 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5864 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
5865 // Phase 3, inputs and outputs
5866 model->identifyInputsAndOutputs(
5867 {op1},
5868 {op2});
5869 assert(model->isValid());
5870 }
5871
is_ignored_axis_dim4_axis3_neg_2(int i)5872 inline bool is_ignored_axis_dim4_axis3_neg_2(int i) {
5873 static std::set<int> ignore = {};
5874 return ignore.find(i) != ignore.end();
5875 }
5876
CreateModel_axis_dim3_axis0_2(Model * model)5877 void CreateModel_axis_dim3_axis0_2(Model *model) {
5878 OperandType type1(Type::INT32, {});
5879 OperandType type2(Type::FLOAT32, {});
5880 OperandType type36(Type::TENSOR_FLOAT32, {5, 2, 2});
5881 // Phase 1, operands
5882 auto op1 = model->addOperand(&type36);
5883 auto param3 = model->addOperand(&type2);
5884 auto axis = model->addOperand(&type1);
5885 auto op2 = model->addOperand(&type36);
5886 // Phase 2, operations
5887 static float param3_init[] = {1e-06f};
5888 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
5889 static int32_t axis_init[] = {0};
5890 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5891 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
5892 // Phase 3, inputs and outputs
5893 model->identifyInputsAndOutputs(
5894 {op1},
5895 {op2});
5896 assert(model->isValid());
5897 }
5898
is_ignored_axis_dim3_axis0_2(int i)5899 inline bool is_ignored_axis_dim3_axis0_2(int i) {
5900 static std::set<int> ignore = {};
5901 return ignore.find(i) != ignore.end();
5902 }
5903
CreateModel_axis_dim3_axis0_neg_2(Model * model)5904 void CreateModel_axis_dim3_axis0_neg_2(Model *model) {
5905 OperandType type1(Type::INT32, {});
5906 OperandType type2(Type::FLOAT32, {});
5907 OperandType type36(Type::TENSOR_FLOAT32, {5, 2, 2});
5908 // Phase 1, operands
5909 auto op1 = model->addOperand(&type36);
5910 auto param3 = model->addOperand(&type2);
5911 auto axis = model->addOperand(&type1);
5912 auto op2 = model->addOperand(&type36);
5913 // Phase 2, operations
5914 static float param3_init[] = {1e-06f};
5915 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
5916 static int32_t axis_init[] = {-3};
5917 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5918 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
5919 // Phase 3, inputs and outputs
5920 model->identifyInputsAndOutputs(
5921 {op1},
5922 {op2});
5923 assert(model->isValid());
5924 }
5925
is_ignored_axis_dim3_axis0_neg_2(int i)5926 inline bool is_ignored_axis_dim3_axis0_neg_2(int i) {
5927 static std::set<int> ignore = {};
5928 return ignore.find(i) != ignore.end();
5929 }
5930
CreateModel_axis_dim3_axis1_2(Model * model)5931 void CreateModel_axis_dim3_axis1_2(Model *model) {
5932 OperandType type1(Type::INT32, {});
5933 OperandType type2(Type::FLOAT32, {});
5934 OperandType type37(Type::TENSOR_FLOAT32, {2, 5, 2});
5935 // Phase 1, operands
5936 auto op1 = model->addOperand(&type37);
5937 auto param3 = model->addOperand(&type2);
5938 auto axis = model->addOperand(&type1);
5939 auto op2 = model->addOperand(&type37);
5940 // Phase 2, operations
5941 static float param3_init[] = {1e-06f};
5942 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
5943 static int32_t axis_init[] = {1};
5944 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5945 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
5946 // Phase 3, inputs and outputs
5947 model->identifyInputsAndOutputs(
5948 {op1},
5949 {op2});
5950 assert(model->isValid());
5951 }
5952
is_ignored_axis_dim3_axis1_2(int i)5953 inline bool is_ignored_axis_dim3_axis1_2(int i) {
5954 static std::set<int> ignore = {};
5955 return ignore.find(i) != ignore.end();
5956 }
5957
CreateModel_axis_dim3_axis1_neg_2(Model * model)5958 void CreateModel_axis_dim3_axis1_neg_2(Model *model) {
5959 OperandType type1(Type::INT32, {});
5960 OperandType type2(Type::FLOAT32, {});
5961 OperandType type37(Type::TENSOR_FLOAT32, {2, 5, 2});
5962 // Phase 1, operands
5963 auto op1 = model->addOperand(&type37);
5964 auto param3 = model->addOperand(&type2);
5965 auto axis = model->addOperand(&type1);
5966 auto op2 = model->addOperand(&type37);
5967 // Phase 2, operations
5968 static float param3_init[] = {1e-06f};
5969 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
5970 static int32_t axis_init[] = {-2};
5971 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5972 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
5973 // Phase 3, inputs and outputs
5974 model->identifyInputsAndOutputs(
5975 {op1},
5976 {op2});
5977 assert(model->isValid());
5978 }
5979
is_ignored_axis_dim3_axis1_neg_2(int i)5980 inline bool is_ignored_axis_dim3_axis1_neg_2(int i) {
5981 static std::set<int> ignore = {};
5982 return ignore.find(i) != ignore.end();
5983 }
5984
CreateModel_axis_dim3_axis2_2(Model * model)5985 void CreateModel_axis_dim3_axis2_2(Model *model) {
5986 OperandType type1(Type::INT32, {});
5987 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
5988 OperandType type2(Type::FLOAT32, {});
5989 // Phase 1, operands
5990 auto op1 = model->addOperand(&type13);
5991 auto param3 = model->addOperand(&type2);
5992 auto axis = model->addOperand(&type1);
5993 auto op2 = model->addOperand(&type13);
5994 // Phase 2, operations
5995 static float param3_init[] = {1e-06f};
5996 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
5997 static int32_t axis_init[] = {2};
5998 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
5999 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6000 // Phase 3, inputs and outputs
6001 model->identifyInputsAndOutputs(
6002 {op1},
6003 {op2});
6004 assert(model->isValid());
6005 }
6006
is_ignored_axis_dim3_axis2_2(int i)6007 inline bool is_ignored_axis_dim3_axis2_2(int i) {
6008 static std::set<int> ignore = {};
6009 return ignore.find(i) != ignore.end();
6010 }
6011
CreateModel_axis_dim3_axis2_neg_2(Model * model)6012 void CreateModel_axis_dim3_axis2_neg_2(Model *model) {
6013 OperandType type1(Type::INT32, {});
6014 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
6015 OperandType type2(Type::FLOAT32, {});
6016 // Phase 1, operands
6017 auto op1 = model->addOperand(&type13);
6018 auto param3 = model->addOperand(&type2);
6019 auto axis = model->addOperand(&type1);
6020 auto op2 = model->addOperand(&type13);
6021 // Phase 2, operations
6022 static float param3_init[] = {1e-06f};
6023 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6024 static int32_t axis_init[] = {-1};
6025 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6026 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6027 // Phase 3, inputs and outputs
6028 model->identifyInputsAndOutputs(
6029 {op1},
6030 {op2});
6031 assert(model->isValid());
6032 }
6033
is_ignored_axis_dim3_axis2_neg_2(int i)6034 inline bool is_ignored_axis_dim3_axis2_neg_2(int i) {
6035 static std::set<int> ignore = {};
6036 return ignore.find(i) != ignore.end();
6037 }
6038
CreateModel_axis_dim2_axis0_2(Model * model)6039 void CreateModel_axis_dim2_axis0_2(Model *model) {
6040 OperandType type1(Type::INT32, {});
6041 OperandType type2(Type::FLOAT32, {});
6042 OperandType type38(Type::TENSOR_FLOAT32, {5, 2});
6043 // Phase 1, operands
6044 auto op1 = model->addOperand(&type38);
6045 auto param3 = model->addOperand(&type2);
6046 auto axis = model->addOperand(&type1);
6047 auto op2 = model->addOperand(&type38);
6048 // Phase 2, operations
6049 static float param3_init[] = {1e-06f};
6050 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6051 static int32_t axis_init[] = {0};
6052 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6053 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6054 // Phase 3, inputs and outputs
6055 model->identifyInputsAndOutputs(
6056 {op1},
6057 {op2});
6058 assert(model->isValid());
6059 }
6060
is_ignored_axis_dim2_axis0_2(int i)6061 inline bool is_ignored_axis_dim2_axis0_2(int i) {
6062 static std::set<int> ignore = {};
6063 return ignore.find(i) != ignore.end();
6064 }
6065
CreateModel_axis_dim2_axis0_neg_2(Model * model)6066 void CreateModel_axis_dim2_axis0_neg_2(Model *model) {
6067 OperandType type1(Type::INT32, {});
6068 OperandType type2(Type::FLOAT32, {});
6069 OperandType type38(Type::TENSOR_FLOAT32, {5, 2});
6070 // Phase 1, operands
6071 auto op1 = model->addOperand(&type38);
6072 auto param3 = model->addOperand(&type2);
6073 auto axis = model->addOperand(&type1);
6074 auto op2 = model->addOperand(&type38);
6075 // Phase 2, operations
6076 static float param3_init[] = {1e-06f};
6077 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6078 static int32_t axis_init[] = {-2};
6079 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6080 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6081 // Phase 3, inputs and outputs
6082 model->identifyInputsAndOutputs(
6083 {op1},
6084 {op2});
6085 assert(model->isValid());
6086 }
6087
is_ignored_axis_dim2_axis0_neg_2(int i)6088 inline bool is_ignored_axis_dim2_axis0_neg_2(int i) {
6089 static std::set<int> ignore = {};
6090 return ignore.find(i) != ignore.end();
6091 }
6092
CreateModel_axis_dim2_axis1_2(Model * model)6093 void CreateModel_axis_dim2_axis1_2(Model *model) {
6094 OperandType type1(Type::INT32, {});
6095 OperandType type2(Type::FLOAT32, {});
6096 OperandType type39(Type::TENSOR_FLOAT32, {2, 5});
6097 // Phase 1, operands
6098 auto op1 = model->addOperand(&type39);
6099 auto param3 = model->addOperand(&type2);
6100 auto axis = model->addOperand(&type1);
6101 auto op2 = model->addOperand(&type39);
6102 // Phase 2, operations
6103 static float param3_init[] = {1e-06f};
6104 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6105 static int32_t axis_init[] = {1};
6106 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6107 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6108 // Phase 3, inputs and outputs
6109 model->identifyInputsAndOutputs(
6110 {op1},
6111 {op2});
6112 assert(model->isValid());
6113 }
6114
is_ignored_axis_dim2_axis1_2(int i)6115 inline bool is_ignored_axis_dim2_axis1_2(int i) {
6116 static std::set<int> ignore = {};
6117 return ignore.find(i) != ignore.end();
6118 }
6119
CreateModel_axis_dim2_axis1_neg_2(Model * model)6120 void CreateModel_axis_dim2_axis1_neg_2(Model *model) {
6121 OperandType type1(Type::INT32, {});
6122 OperandType type2(Type::FLOAT32, {});
6123 OperandType type39(Type::TENSOR_FLOAT32, {2, 5});
6124 // Phase 1, operands
6125 auto op1 = model->addOperand(&type39);
6126 auto param3 = model->addOperand(&type2);
6127 auto axis = model->addOperand(&type1);
6128 auto op2 = model->addOperand(&type39);
6129 // Phase 2, operations
6130 static float param3_init[] = {1e-06f};
6131 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6132 static int32_t axis_init[] = {-1};
6133 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6134 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6135 // Phase 3, inputs and outputs
6136 model->identifyInputsAndOutputs(
6137 {op1},
6138 {op2});
6139 assert(model->isValid());
6140 }
6141
is_ignored_axis_dim2_axis1_neg_2(int i)6142 inline bool is_ignored_axis_dim2_axis1_neg_2(int i) {
6143 static std::set<int> ignore = {};
6144 return ignore.find(i) != ignore.end();
6145 }
6146
CreateModel_axis_dim1_axis0_2(Model * model)6147 void CreateModel_axis_dim1_axis0_2(Model *model) {
6148 OperandType type1(Type::INT32, {});
6149 OperandType type12(Type::TENSOR_FLOAT32, {5});
6150 OperandType type2(Type::FLOAT32, {});
6151 // Phase 1, operands
6152 auto op1 = model->addOperand(&type12);
6153 auto param3 = model->addOperand(&type2);
6154 auto axis = model->addOperand(&type1);
6155 auto op2 = model->addOperand(&type12);
6156 // Phase 2, operations
6157 static float param3_init[] = {1e-06f};
6158 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6159 static int32_t axis_init[] = {0};
6160 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6161 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6162 // Phase 3, inputs and outputs
6163 model->identifyInputsAndOutputs(
6164 {op1},
6165 {op2});
6166 assert(model->isValid());
6167 }
6168
is_ignored_axis_dim1_axis0_2(int i)6169 inline bool is_ignored_axis_dim1_axis0_2(int i) {
6170 static std::set<int> ignore = {};
6171 return ignore.find(i) != ignore.end();
6172 }
6173
CreateModel_axis_dim1_axis0_neg_2(Model * model)6174 void CreateModel_axis_dim1_axis0_neg_2(Model *model) {
6175 OperandType type1(Type::INT32, {});
6176 OperandType type12(Type::TENSOR_FLOAT32, {5});
6177 OperandType type2(Type::FLOAT32, {});
6178 // Phase 1, operands
6179 auto op1 = model->addOperand(&type12);
6180 auto param3 = model->addOperand(&type2);
6181 auto axis = model->addOperand(&type1);
6182 auto op2 = model->addOperand(&type12);
6183 // Phase 2, operations
6184 static float param3_init[] = {1e-06f};
6185 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6186 static int32_t axis_init[] = {-1};
6187 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6188 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6189 // Phase 3, inputs and outputs
6190 model->identifyInputsAndOutputs(
6191 {op1},
6192 {op2});
6193 assert(model->isValid());
6194 }
6195
is_ignored_axis_dim1_axis0_neg_2(int i)6196 inline bool is_ignored_axis_dim1_axis0_neg_2(int i) {
6197 static std::set<int> ignore = {};
6198 return ignore.find(i) != ignore.end();
6199 }
6200
CreateModel_axis_relaxed_dim4_axis0_2(Model * model)6201 void CreateModel_axis_relaxed_dim4_axis0_2(Model *model) {
6202 OperandType type1(Type::INT32, {});
6203 OperandType type2(Type::FLOAT32, {});
6204 OperandType type33(Type::TENSOR_FLOAT32, {5, 2, 2, 2});
6205 // Phase 1, operands
6206 auto op1 = model->addOperand(&type33);
6207 auto param3 = model->addOperand(&type2);
6208 auto axis = model->addOperand(&type1);
6209 auto op2 = model->addOperand(&type33);
6210 // Phase 2, operations
6211 static float param3_init[] = {1e-06f};
6212 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6213 static int32_t axis_init[] = {0};
6214 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6215 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6216 // Phase 3, inputs and outputs
6217 model->identifyInputsAndOutputs(
6218 {op1},
6219 {op2});
6220 // Phase 4: set relaxed execution
6221 model->relaxComputationFloat32toFloat16(true);
6222 assert(model->isValid());
6223 }
6224
is_ignored_axis_relaxed_dim4_axis0_2(int i)6225 inline bool is_ignored_axis_relaxed_dim4_axis0_2(int i) {
6226 static std::set<int> ignore = {};
6227 return ignore.find(i) != ignore.end();
6228 }
6229
CreateModel_axis_relaxed_dim4_axis0_neg_2(Model * model)6230 void CreateModel_axis_relaxed_dim4_axis0_neg_2(Model *model) {
6231 OperandType type1(Type::INT32, {});
6232 OperandType type2(Type::FLOAT32, {});
6233 OperandType type33(Type::TENSOR_FLOAT32, {5, 2, 2, 2});
6234 // Phase 1, operands
6235 auto op1 = model->addOperand(&type33);
6236 auto param3 = model->addOperand(&type2);
6237 auto axis = model->addOperand(&type1);
6238 auto op2 = model->addOperand(&type33);
6239 // Phase 2, operations
6240 static float param3_init[] = {1e-06f};
6241 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6242 static int32_t axis_init[] = {-4};
6243 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6244 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6245 // Phase 3, inputs and outputs
6246 model->identifyInputsAndOutputs(
6247 {op1},
6248 {op2});
6249 // Phase 4: set relaxed execution
6250 model->relaxComputationFloat32toFloat16(true);
6251 assert(model->isValid());
6252 }
6253
is_ignored_axis_relaxed_dim4_axis0_neg_2(int i)6254 inline bool is_ignored_axis_relaxed_dim4_axis0_neg_2(int i) {
6255 static std::set<int> ignore = {};
6256 return ignore.find(i) != ignore.end();
6257 }
6258
CreateModel_axis_relaxed_dim4_axis1_2(Model * model)6259 void CreateModel_axis_relaxed_dim4_axis1_2(Model *model) {
6260 OperandType type1(Type::INT32, {});
6261 OperandType type2(Type::FLOAT32, {});
6262 OperandType type34(Type::TENSOR_FLOAT32, {2, 5, 2, 2});
6263 // Phase 1, operands
6264 auto op1 = model->addOperand(&type34);
6265 auto param3 = model->addOperand(&type2);
6266 auto axis = model->addOperand(&type1);
6267 auto op2 = model->addOperand(&type34);
6268 // Phase 2, operations
6269 static float param3_init[] = {1e-06f};
6270 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6271 static int32_t axis_init[] = {1};
6272 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6273 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6274 // Phase 3, inputs and outputs
6275 model->identifyInputsAndOutputs(
6276 {op1},
6277 {op2});
6278 // Phase 4: set relaxed execution
6279 model->relaxComputationFloat32toFloat16(true);
6280 assert(model->isValid());
6281 }
6282
is_ignored_axis_relaxed_dim4_axis1_2(int i)6283 inline bool is_ignored_axis_relaxed_dim4_axis1_2(int i) {
6284 static std::set<int> ignore = {};
6285 return ignore.find(i) != ignore.end();
6286 }
6287
CreateModel_axis_relaxed_dim4_axis1_neg_2(Model * model)6288 void CreateModel_axis_relaxed_dim4_axis1_neg_2(Model *model) {
6289 OperandType type1(Type::INT32, {});
6290 OperandType type2(Type::FLOAT32, {});
6291 OperandType type34(Type::TENSOR_FLOAT32, {2, 5, 2, 2});
6292 // Phase 1, operands
6293 auto op1 = model->addOperand(&type34);
6294 auto param3 = model->addOperand(&type2);
6295 auto axis = model->addOperand(&type1);
6296 auto op2 = model->addOperand(&type34);
6297 // Phase 2, operations
6298 static float param3_init[] = {1e-06f};
6299 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6300 static int32_t axis_init[] = {-3};
6301 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6302 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6303 // Phase 3, inputs and outputs
6304 model->identifyInputsAndOutputs(
6305 {op1},
6306 {op2});
6307 // Phase 4: set relaxed execution
6308 model->relaxComputationFloat32toFloat16(true);
6309 assert(model->isValid());
6310 }
6311
is_ignored_axis_relaxed_dim4_axis1_neg_2(int i)6312 inline bool is_ignored_axis_relaxed_dim4_axis1_neg_2(int i) {
6313 static std::set<int> ignore = {};
6314 return ignore.find(i) != ignore.end();
6315 }
6316
CreateModel_axis_relaxed_dim4_axis2_2(Model * model)6317 void CreateModel_axis_relaxed_dim4_axis2_2(Model *model) {
6318 OperandType type1(Type::INT32, {});
6319 OperandType type2(Type::FLOAT32, {});
6320 OperandType type35(Type::TENSOR_FLOAT32, {2, 2, 5, 2});
6321 // Phase 1, operands
6322 auto op1 = model->addOperand(&type35);
6323 auto param3 = model->addOperand(&type2);
6324 auto axis = model->addOperand(&type1);
6325 auto op2 = model->addOperand(&type35);
6326 // Phase 2, operations
6327 static float param3_init[] = {1e-06f};
6328 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6329 static int32_t axis_init[] = {2};
6330 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6331 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6332 // Phase 3, inputs and outputs
6333 model->identifyInputsAndOutputs(
6334 {op1},
6335 {op2});
6336 // Phase 4: set relaxed execution
6337 model->relaxComputationFloat32toFloat16(true);
6338 assert(model->isValid());
6339 }
6340
is_ignored_axis_relaxed_dim4_axis2_2(int i)6341 inline bool is_ignored_axis_relaxed_dim4_axis2_2(int i) {
6342 static std::set<int> ignore = {};
6343 return ignore.find(i) != ignore.end();
6344 }
6345
CreateModel_axis_relaxed_dim4_axis2_neg_2(Model * model)6346 void CreateModel_axis_relaxed_dim4_axis2_neg_2(Model *model) {
6347 OperandType type1(Type::INT32, {});
6348 OperandType type2(Type::FLOAT32, {});
6349 OperandType type35(Type::TENSOR_FLOAT32, {2, 2, 5, 2});
6350 // Phase 1, operands
6351 auto op1 = model->addOperand(&type35);
6352 auto param3 = model->addOperand(&type2);
6353 auto axis = model->addOperand(&type1);
6354 auto op2 = model->addOperand(&type35);
6355 // Phase 2, operations
6356 static float param3_init[] = {1e-06f};
6357 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6358 static int32_t axis_init[] = {-2};
6359 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6360 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6361 // Phase 3, inputs and outputs
6362 model->identifyInputsAndOutputs(
6363 {op1},
6364 {op2});
6365 // Phase 4: set relaxed execution
6366 model->relaxComputationFloat32toFloat16(true);
6367 assert(model->isValid());
6368 }
6369
is_ignored_axis_relaxed_dim4_axis2_neg_2(int i)6370 inline bool is_ignored_axis_relaxed_dim4_axis2_neg_2(int i) {
6371 static std::set<int> ignore = {};
6372 return ignore.find(i) != ignore.end();
6373 }
6374
CreateModel_axis_relaxed_dim4_axis3_2(Model * model)6375 void CreateModel_axis_relaxed_dim4_axis3_2(Model *model) {
6376 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
6377 OperandType type1(Type::INT32, {});
6378 OperandType type2(Type::FLOAT32, {});
6379 // Phase 1, operands
6380 auto op1 = model->addOperand(&type0);
6381 auto param3 = model->addOperand(&type2);
6382 auto axis = model->addOperand(&type1);
6383 auto op2 = model->addOperand(&type0);
6384 // Phase 2, operations
6385 static float param3_init[] = {1e-06f};
6386 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6387 static int32_t axis_init[] = {3};
6388 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6389 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6390 // Phase 3, inputs and outputs
6391 model->identifyInputsAndOutputs(
6392 {op1},
6393 {op2});
6394 // Phase 4: set relaxed execution
6395 model->relaxComputationFloat32toFloat16(true);
6396 assert(model->isValid());
6397 }
6398
is_ignored_axis_relaxed_dim4_axis3_2(int i)6399 inline bool is_ignored_axis_relaxed_dim4_axis3_2(int i) {
6400 static std::set<int> ignore = {};
6401 return ignore.find(i) != ignore.end();
6402 }
6403
CreateModel_axis_relaxed_dim4_axis3_neg_2(Model * model)6404 void CreateModel_axis_relaxed_dim4_axis3_neg_2(Model *model) {
6405 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
6406 OperandType type1(Type::INT32, {});
6407 OperandType type2(Type::FLOAT32, {});
6408 // Phase 1, operands
6409 auto op1 = model->addOperand(&type0);
6410 auto param3 = model->addOperand(&type2);
6411 auto axis = model->addOperand(&type1);
6412 auto op2 = model->addOperand(&type0);
6413 // Phase 2, operations
6414 static float param3_init[] = {1e-06f};
6415 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6416 static int32_t axis_init[] = {-1};
6417 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6418 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6419 // Phase 3, inputs and outputs
6420 model->identifyInputsAndOutputs(
6421 {op1},
6422 {op2});
6423 // Phase 4: set relaxed execution
6424 model->relaxComputationFloat32toFloat16(true);
6425 assert(model->isValid());
6426 }
6427
is_ignored_axis_relaxed_dim4_axis3_neg_2(int i)6428 inline bool is_ignored_axis_relaxed_dim4_axis3_neg_2(int i) {
6429 static std::set<int> ignore = {};
6430 return ignore.find(i) != ignore.end();
6431 }
6432
CreateModel_axis_relaxed_dim3_axis0_2(Model * model)6433 void CreateModel_axis_relaxed_dim3_axis0_2(Model *model) {
6434 OperandType type1(Type::INT32, {});
6435 OperandType type2(Type::FLOAT32, {});
6436 OperandType type36(Type::TENSOR_FLOAT32, {5, 2, 2});
6437 // Phase 1, operands
6438 auto op1 = model->addOperand(&type36);
6439 auto param3 = model->addOperand(&type2);
6440 auto axis = model->addOperand(&type1);
6441 auto op2 = model->addOperand(&type36);
6442 // Phase 2, operations
6443 static float param3_init[] = {1e-06f};
6444 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6445 static int32_t axis_init[] = {0};
6446 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6447 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6448 // Phase 3, inputs and outputs
6449 model->identifyInputsAndOutputs(
6450 {op1},
6451 {op2});
6452 // Phase 4: set relaxed execution
6453 model->relaxComputationFloat32toFloat16(true);
6454 assert(model->isValid());
6455 }
6456
is_ignored_axis_relaxed_dim3_axis0_2(int i)6457 inline bool is_ignored_axis_relaxed_dim3_axis0_2(int i) {
6458 static std::set<int> ignore = {};
6459 return ignore.find(i) != ignore.end();
6460 }
6461
CreateModel_axis_relaxed_dim3_axis0_neg_2(Model * model)6462 void CreateModel_axis_relaxed_dim3_axis0_neg_2(Model *model) {
6463 OperandType type1(Type::INT32, {});
6464 OperandType type2(Type::FLOAT32, {});
6465 OperandType type36(Type::TENSOR_FLOAT32, {5, 2, 2});
6466 // Phase 1, operands
6467 auto op1 = model->addOperand(&type36);
6468 auto param3 = model->addOperand(&type2);
6469 auto axis = model->addOperand(&type1);
6470 auto op2 = model->addOperand(&type36);
6471 // Phase 2, operations
6472 static float param3_init[] = {1e-06f};
6473 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6474 static int32_t axis_init[] = {-3};
6475 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6476 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6477 // Phase 3, inputs and outputs
6478 model->identifyInputsAndOutputs(
6479 {op1},
6480 {op2});
6481 // Phase 4: set relaxed execution
6482 model->relaxComputationFloat32toFloat16(true);
6483 assert(model->isValid());
6484 }
6485
is_ignored_axis_relaxed_dim3_axis0_neg_2(int i)6486 inline bool is_ignored_axis_relaxed_dim3_axis0_neg_2(int i) {
6487 static std::set<int> ignore = {};
6488 return ignore.find(i) != ignore.end();
6489 }
6490
CreateModel_axis_relaxed_dim3_axis1_2(Model * model)6491 void CreateModel_axis_relaxed_dim3_axis1_2(Model *model) {
6492 OperandType type1(Type::INT32, {});
6493 OperandType type2(Type::FLOAT32, {});
6494 OperandType type37(Type::TENSOR_FLOAT32, {2, 5, 2});
6495 // Phase 1, operands
6496 auto op1 = model->addOperand(&type37);
6497 auto param3 = model->addOperand(&type2);
6498 auto axis = model->addOperand(&type1);
6499 auto op2 = model->addOperand(&type37);
6500 // Phase 2, operations
6501 static float param3_init[] = {1e-06f};
6502 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6503 static int32_t axis_init[] = {1};
6504 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6505 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6506 // Phase 3, inputs and outputs
6507 model->identifyInputsAndOutputs(
6508 {op1},
6509 {op2});
6510 // Phase 4: set relaxed execution
6511 model->relaxComputationFloat32toFloat16(true);
6512 assert(model->isValid());
6513 }
6514
is_ignored_axis_relaxed_dim3_axis1_2(int i)6515 inline bool is_ignored_axis_relaxed_dim3_axis1_2(int i) {
6516 static std::set<int> ignore = {};
6517 return ignore.find(i) != ignore.end();
6518 }
6519
CreateModel_axis_relaxed_dim3_axis1_neg_2(Model * model)6520 void CreateModel_axis_relaxed_dim3_axis1_neg_2(Model *model) {
6521 OperandType type1(Type::INT32, {});
6522 OperandType type2(Type::FLOAT32, {});
6523 OperandType type37(Type::TENSOR_FLOAT32, {2, 5, 2});
6524 // Phase 1, operands
6525 auto op1 = model->addOperand(&type37);
6526 auto param3 = model->addOperand(&type2);
6527 auto axis = model->addOperand(&type1);
6528 auto op2 = model->addOperand(&type37);
6529 // Phase 2, operations
6530 static float param3_init[] = {1e-06f};
6531 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6532 static int32_t axis_init[] = {-2};
6533 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6534 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6535 // Phase 3, inputs and outputs
6536 model->identifyInputsAndOutputs(
6537 {op1},
6538 {op2});
6539 // Phase 4: set relaxed execution
6540 model->relaxComputationFloat32toFloat16(true);
6541 assert(model->isValid());
6542 }
6543
is_ignored_axis_relaxed_dim3_axis1_neg_2(int i)6544 inline bool is_ignored_axis_relaxed_dim3_axis1_neg_2(int i) {
6545 static std::set<int> ignore = {};
6546 return ignore.find(i) != ignore.end();
6547 }
6548
CreateModel_axis_relaxed_dim3_axis2_2(Model * model)6549 void CreateModel_axis_relaxed_dim3_axis2_2(Model *model) {
6550 OperandType type1(Type::INT32, {});
6551 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
6552 OperandType type2(Type::FLOAT32, {});
6553 // Phase 1, operands
6554 auto op1 = model->addOperand(&type13);
6555 auto param3 = model->addOperand(&type2);
6556 auto axis = model->addOperand(&type1);
6557 auto op2 = model->addOperand(&type13);
6558 // Phase 2, operations
6559 static float param3_init[] = {1e-06f};
6560 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6561 static int32_t axis_init[] = {2};
6562 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6563 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6564 // Phase 3, inputs and outputs
6565 model->identifyInputsAndOutputs(
6566 {op1},
6567 {op2});
6568 // Phase 4: set relaxed execution
6569 model->relaxComputationFloat32toFloat16(true);
6570 assert(model->isValid());
6571 }
6572
is_ignored_axis_relaxed_dim3_axis2_2(int i)6573 inline bool is_ignored_axis_relaxed_dim3_axis2_2(int i) {
6574 static std::set<int> ignore = {};
6575 return ignore.find(i) != ignore.end();
6576 }
6577
CreateModel_axis_relaxed_dim3_axis2_neg_2(Model * model)6578 void CreateModel_axis_relaxed_dim3_axis2_neg_2(Model *model) {
6579 OperandType type1(Type::INT32, {});
6580 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
6581 OperandType type2(Type::FLOAT32, {});
6582 // Phase 1, operands
6583 auto op1 = model->addOperand(&type13);
6584 auto param3 = model->addOperand(&type2);
6585 auto axis = model->addOperand(&type1);
6586 auto op2 = model->addOperand(&type13);
6587 // Phase 2, operations
6588 static float param3_init[] = {1e-06f};
6589 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6590 static int32_t axis_init[] = {-1};
6591 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6592 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6593 // Phase 3, inputs and outputs
6594 model->identifyInputsAndOutputs(
6595 {op1},
6596 {op2});
6597 // Phase 4: set relaxed execution
6598 model->relaxComputationFloat32toFloat16(true);
6599 assert(model->isValid());
6600 }
6601
is_ignored_axis_relaxed_dim3_axis2_neg_2(int i)6602 inline bool is_ignored_axis_relaxed_dim3_axis2_neg_2(int i) {
6603 static std::set<int> ignore = {};
6604 return ignore.find(i) != ignore.end();
6605 }
6606
CreateModel_axis_relaxed_dim2_axis0_2(Model * model)6607 void CreateModel_axis_relaxed_dim2_axis0_2(Model *model) {
6608 OperandType type1(Type::INT32, {});
6609 OperandType type2(Type::FLOAT32, {});
6610 OperandType type38(Type::TENSOR_FLOAT32, {5, 2});
6611 // Phase 1, operands
6612 auto op1 = model->addOperand(&type38);
6613 auto param3 = model->addOperand(&type2);
6614 auto axis = model->addOperand(&type1);
6615 auto op2 = model->addOperand(&type38);
6616 // Phase 2, operations
6617 static float param3_init[] = {1e-06f};
6618 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6619 static int32_t axis_init[] = {0};
6620 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6621 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6622 // Phase 3, inputs and outputs
6623 model->identifyInputsAndOutputs(
6624 {op1},
6625 {op2});
6626 // Phase 4: set relaxed execution
6627 model->relaxComputationFloat32toFloat16(true);
6628 assert(model->isValid());
6629 }
6630
is_ignored_axis_relaxed_dim2_axis0_2(int i)6631 inline bool is_ignored_axis_relaxed_dim2_axis0_2(int i) {
6632 static std::set<int> ignore = {};
6633 return ignore.find(i) != ignore.end();
6634 }
6635
CreateModel_axis_relaxed_dim2_axis0_neg_2(Model * model)6636 void CreateModel_axis_relaxed_dim2_axis0_neg_2(Model *model) {
6637 OperandType type1(Type::INT32, {});
6638 OperandType type2(Type::FLOAT32, {});
6639 OperandType type38(Type::TENSOR_FLOAT32, {5, 2});
6640 // Phase 1, operands
6641 auto op1 = model->addOperand(&type38);
6642 auto param3 = model->addOperand(&type2);
6643 auto axis = model->addOperand(&type1);
6644 auto op2 = model->addOperand(&type38);
6645 // Phase 2, operations
6646 static float param3_init[] = {1e-06f};
6647 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6648 static int32_t axis_init[] = {-2};
6649 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6650 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6651 // Phase 3, inputs and outputs
6652 model->identifyInputsAndOutputs(
6653 {op1},
6654 {op2});
6655 // Phase 4: set relaxed execution
6656 model->relaxComputationFloat32toFloat16(true);
6657 assert(model->isValid());
6658 }
6659
is_ignored_axis_relaxed_dim2_axis0_neg_2(int i)6660 inline bool is_ignored_axis_relaxed_dim2_axis0_neg_2(int i) {
6661 static std::set<int> ignore = {};
6662 return ignore.find(i) != ignore.end();
6663 }
6664
CreateModel_axis_relaxed_dim2_axis1_2(Model * model)6665 void CreateModel_axis_relaxed_dim2_axis1_2(Model *model) {
6666 OperandType type1(Type::INT32, {});
6667 OperandType type2(Type::FLOAT32, {});
6668 OperandType type39(Type::TENSOR_FLOAT32, {2, 5});
6669 // Phase 1, operands
6670 auto op1 = model->addOperand(&type39);
6671 auto param3 = model->addOperand(&type2);
6672 auto axis = model->addOperand(&type1);
6673 auto op2 = model->addOperand(&type39);
6674 // Phase 2, operations
6675 static float param3_init[] = {1e-06f};
6676 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6677 static int32_t axis_init[] = {1};
6678 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6679 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6680 // Phase 3, inputs and outputs
6681 model->identifyInputsAndOutputs(
6682 {op1},
6683 {op2});
6684 // Phase 4: set relaxed execution
6685 model->relaxComputationFloat32toFloat16(true);
6686 assert(model->isValid());
6687 }
6688
is_ignored_axis_relaxed_dim2_axis1_2(int i)6689 inline bool is_ignored_axis_relaxed_dim2_axis1_2(int i) {
6690 static std::set<int> ignore = {};
6691 return ignore.find(i) != ignore.end();
6692 }
6693
CreateModel_axis_relaxed_dim2_axis1_neg_2(Model * model)6694 void CreateModel_axis_relaxed_dim2_axis1_neg_2(Model *model) {
6695 OperandType type1(Type::INT32, {});
6696 OperandType type2(Type::FLOAT32, {});
6697 OperandType type39(Type::TENSOR_FLOAT32, {2, 5});
6698 // Phase 1, operands
6699 auto op1 = model->addOperand(&type39);
6700 auto param3 = model->addOperand(&type2);
6701 auto axis = model->addOperand(&type1);
6702 auto op2 = model->addOperand(&type39);
6703 // Phase 2, operations
6704 static float param3_init[] = {1e-06f};
6705 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6706 static int32_t axis_init[] = {-1};
6707 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6708 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6709 // Phase 3, inputs and outputs
6710 model->identifyInputsAndOutputs(
6711 {op1},
6712 {op2});
6713 // Phase 4: set relaxed execution
6714 model->relaxComputationFloat32toFloat16(true);
6715 assert(model->isValid());
6716 }
6717
is_ignored_axis_relaxed_dim2_axis1_neg_2(int i)6718 inline bool is_ignored_axis_relaxed_dim2_axis1_neg_2(int i) {
6719 static std::set<int> ignore = {};
6720 return ignore.find(i) != ignore.end();
6721 }
6722
CreateModel_axis_relaxed_dim1_axis0_2(Model * model)6723 void CreateModel_axis_relaxed_dim1_axis0_2(Model *model) {
6724 OperandType type1(Type::INT32, {});
6725 OperandType type12(Type::TENSOR_FLOAT32, {5});
6726 OperandType type2(Type::FLOAT32, {});
6727 // Phase 1, operands
6728 auto op1 = model->addOperand(&type12);
6729 auto param3 = model->addOperand(&type2);
6730 auto axis = model->addOperand(&type1);
6731 auto op2 = model->addOperand(&type12);
6732 // Phase 2, operations
6733 static float param3_init[] = {1e-06f};
6734 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6735 static int32_t axis_init[] = {0};
6736 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6737 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6738 // Phase 3, inputs and outputs
6739 model->identifyInputsAndOutputs(
6740 {op1},
6741 {op2});
6742 // Phase 4: set relaxed execution
6743 model->relaxComputationFloat32toFloat16(true);
6744 assert(model->isValid());
6745 }
6746
is_ignored_axis_relaxed_dim1_axis0_2(int i)6747 inline bool is_ignored_axis_relaxed_dim1_axis0_2(int i) {
6748 static std::set<int> ignore = {};
6749 return ignore.find(i) != ignore.end();
6750 }
6751
CreateModel_axis_relaxed_dim1_axis0_neg_2(Model * model)6752 void CreateModel_axis_relaxed_dim1_axis0_neg_2(Model *model) {
6753 OperandType type1(Type::INT32, {});
6754 OperandType type12(Type::TENSOR_FLOAT32, {5});
6755 OperandType type2(Type::FLOAT32, {});
6756 // Phase 1, operands
6757 auto op1 = model->addOperand(&type12);
6758 auto param3 = model->addOperand(&type2);
6759 auto axis = model->addOperand(&type1);
6760 auto op2 = model->addOperand(&type12);
6761 // Phase 2, operations
6762 static float param3_init[] = {1e-06f};
6763 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
6764 static int32_t axis_init[] = {-1};
6765 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6766 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6767 // Phase 3, inputs and outputs
6768 model->identifyInputsAndOutputs(
6769 {op1},
6770 {op2});
6771 // Phase 4: set relaxed execution
6772 model->relaxComputationFloat32toFloat16(true);
6773 assert(model->isValid());
6774 }
6775
is_ignored_axis_relaxed_dim1_axis0_neg_2(int i)6776 inline bool is_ignored_axis_relaxed_dim1_axis0_neg_2(int i) {
6777 static std::set<int> ignore = {};
6778 return ignore.find(i) != ignore.end();
6779 }
6780
CreateModel_axis_float16_dim4_axis0_2(Model * model)6781 void CreateModel_axis_float16_dim4_axis0_2(Model *model) {
6782 OperandType type1(Type::INT32, {});
6783 OperandType type15(Type::FLOAT16, {});
6784 OperandType type40(Type::TENSOR_FLOAT16, {5, 2, 2, 2});
6785 // Phase 1, operands
6786 auto op1 = model->addOperand(&type40);
6787 auto param3 = model->addOperand(&type15);
6788 auto axis = model->addOperand(&type1);
6789 auto op2 = model->addOperand(&type40);
6790 // Phase 2, operations
6791 static _Float16 param3_init[] = {9.999999974752427e-07f};
6792 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
6793 static int32_t axis_init[] = {0};
6794 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6795 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6796 // Phase 3, inputs and outputs
6797 model->identifyInputsAndOutputs(
6798 {op1},
6799 {op2});
6800 assert(model->isValid());
6801 }
6802
is_ignored_axis_float16_dim4_axis0_2(int i)6803 inline bool is_ignored_axis_float16_dim4_axis0_2(int i) {
6804 static std::set<int> ignore = {};
6805 return ignore.find(i) != ignore.end();
6806 }
6807
CreateModel_axis_float16_dim4_axis0_neg_2(Model * model)6808 void CreateModel_axis_float16_dim4_axis0_neg_2(Model *model) {
6809 OperandType type1(Type::INT32, {});
6810 OperandType type15(Type::FLOAT16, {});
6811 OperandType type40(Type::TENSOR_FLOAT16, {5, 2, 2, 2});
6812 // Phase 1, operands
6813 auto op1 = model->addOperand(&type40);
6814 auto param3 = model->addOperand(&type15);
6815 auto axis = model->addOperand(&type1);
6816 auto op2 = model->addOperand(&type40);
6817 // Phase 2, operations
6818 static _Float16 param3_init[] = {9.999999974752427e-07f};
6819 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
6820 static int32_t axis_init[] = {-4};
6821 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6822 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6823 // Phase 3, inputs and outputs
6824 model->identifyInputsAndOutputs(
6825 {op1},
6826 {op2});
6827 assert(model->isValid());
6828 }
6829
is_ignored_axis_float16_dim4_axis0_neg_2(int i)6830 inline bool is_ignored_axis_float16_dim4_axis0_neg_2(int i) {
6831 static std::set<int> ignore = {};
6832 return ignore.find(i) != ignore.end();
6833 }
6834
CreateModel_axis_float16_dim4_axis1_2(Model * model)6835 void CreateModel_axis_float16_dim4_axis1_2(Model *model) {
6836 OperandType type1(Type::INT32, {});
6837 OperandType type15(Type::FLOAT16, {});
6838 OperandType type41(Type::TENSOR_FLOAT16, {2, 5, 2, 2});
6839 // Phase 1, operands
6840 auto op1 = model->addOperand(&type41);
6841 auto param3 = model->addOperand(&type15);
6842 auto axis = model->addOperand(&type1);
6843 auto op2 = model->addOperand(&type41);
6844 // Phase 2, operations
6845 static _Float16 param3_init[] = {9.999999974752427e-07f};
6846 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
6847 static int32_t axis_init[] = {1};
6848 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6849 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6850 // Phase 3, inputs and outputs
6851 model->identifyInputsAndOutputs(
6852 {op1},
6853 {op2});
6854 assert(model->isValid());
6855 }
6856
is_ignored_axis_float16_dim4_axis1_2(int i)6857 inline bool is_ignored_axis_float16_dim4_axis1_2(int i) {
6858 static std::set<int> ignore = {};
6859 return ignore.find(i) != ignore.end();
6860 }
6861
CreateModel_axis_float16_dim4_axis1_neg_2(Model * model)6862 void CreateModel_axis_float16_dim4_axis1_neg_2(Model *model) {
6863 OperandType type1(Type::INT32, {});
6864 OperandType type15(Type::FLOAT16, {});
6865 OperandType type41(Type::TENSOR_FLOAT16, {2, 5, 2, 2});
6866 // Phase 1, operands
6867 auto op1 = model->addOperand(&type41);
6868 auto param3 = model->addOperand(&type15);
6869 auto axis = model->addOperand(&type1);
6870 auto op2 = model->addOperand(&type41);
6871 // Phase 2, operations
6872 static _Float16 param3_init[] = {9.999999974752427e-07f};
6873 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
6874 static int32_t axis_init[] = {-3};
6875 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6876 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6877 // Phase 3, inputs and outputs
6878 model->identifyInputsAndOutputs(
6879 {op1},
6880 {op2});
6881 assert(model->isValid());
6882 }
6883
is_ignored_axis_float16_dim4_axis1_neg_2(int i)6884 inline bool is_ignored_axis_float16_dim4_axis1_neg_2(int i) {
6885 static std::set<int> ignore = {};
6886 return ignore.find(i) != ignore.end();
6887 }
6888
CreateModel_axis_float16_dim4_axis2_2(Model * model)6889 void CreateModel_axis_float16_dim4_axis2_2(Model *model) {
6890 OperandType type1(Type::INT32, {});
6891 OperandType type15(Type::FLOAT16, {});
6892 OperandType type42(Type::TENSOR_FLOAT16, {2, 2, 5, 2});
6893 // Phase 1, operands
6894 auto op1 = model->addOperand(&type42);
6895 auto param3 = model->addOperand(&type15);
6896 auto axis = model->addOperand(&type1);
6897 auto op2 = model->addOperand(&type42);
6898 // Phase 2, operations
6899 static _Float16 param3_init[] = {9.999999974752427e-07f};
6900 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
6901 static int32_t axis_init[] = {2};
6902 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6903 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6904 // Phase 3, inputs and outputs
6905 model->identifyInputsAndOutputs(
6906 {op1},
6907 {op2});
6908 assert(model->isValid());
6909 }
6910
is_ignored_axis_float16_dim4_axis2_2(int i)6911 inline bool is_ignored_axis_float16_dim4_axis2_2(int i) {
6912 static std::set<int> ignore = {};
6913 return ignore.find(i) != ignore.end();
6914 }
6915
CreateModel_axis_float16_dim4_axis2_neg_2(Model * model)6916 void CreateModel_axis_float16_dim4_axis2_neg_2(Model *model) {
6917 OperandType type1(Type::INT32, {});
6918 OperandType type15(Type::FLOAT16, {});
6919 OperandType type42(Type::TENSOR_FLOAT16, {2, 2, 5, 2});
6920 // Phase 1, operands
6921 auto op1 = model->addOperand(&type42);
6922 auto param3 = model->addOperand(&type15);
6923 auto axis = model->addOperand(&type1);
6924 auto op2 = model->addOperand(&type42);
6925 // Phase 2, operations
6926 static _Float16 param3_init[] = {9.999999974752427e-07f};
6927 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
6928 static int32_t axis_init[] = {-2};
6929 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6930 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6931 // Phase 3, inputs and outputs
6932 model->identifyInputsAndOutputs(
6933 {op1},
6934 {op2});
6935 assert(model->isValid());
6936 }
6937
is_ignored_axis_float16_dim4_axis2_neg_2(int i)6938 inline bool is_ignored_axis_float16_dim4_axis2_neg_2(int i) {
6939 static std::set<int> ignore = {};
6940 return ignore.find(i) != ignore.end();
6941 }
6942
CreateModel_axis_float16_dim4_axis3_2(Model * model)6943 void CreateModel_axis_float16_dim4_axis3_2(Model *model) {
6944 OperandType type1(Type::INT32, {});
6945 OperandType type15(Type::FLOAT16, {});
6946 OperandType type16(Type::TENSOR_FLOAT16, {2, 2, 2, 5});
6947 // Phase 1, operands
6948 auto op1 = model->addOperand(&type16);
6949 auto param3 = model->addOperand(&type15);
6950 auto axis = model->addOperand(&type1);
6951 auto op2 = model->addOperand(&type16);
6952 // Phase 2, operations
6953 static _Float16 param3_init[] = {9.999999974752427e-07f};
6954 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
6955 static int32_t axis_init[] = {3};
6956 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6957 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6958 // Phase 3, inputs and outputs
6959 model->identifyInputsAndOutputs(
6960 {op1},
6961 {op2});
6962 assert(model->isValid());
6963 }
6964
is_ignored_axis_float16_dim4_axis3_2(int i)6965 inline bool is_ignored_axis_float16_dim4_axis3_2(int i) {
6966 static std::set<int> ignore = {};
6967 return ignore.find(i) != ignore.end();
6968 }
6969
CreateModel_axis_float16_dim4_axis3_neg_2(Model * model)6970 void CreateModel_axis_float16_dim4_axis3_neg_2(Model *model) {
6971 OperandType type1(Type::INT32, {});
6972 OperandType type15(Type::FLOAT16, {});
6973 OperandType type16(Type::TENSOR_FLOAT16, {2, 2, 2, 5});
6974 // Phase 1, operands
6975 auto op1 = model->addOperand(&type16);
6976 auto param3 = model->addOperand(&type15);
6977 auto axis = model->addOperand(&type1);
6978 auto op2 = model->addOperand(&type16);
6979 // Phase 2, operations
6980 static _Float16 param3_init[] = {9.999999974752427e-07f};
6981 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
6982 static int32_t axis_init[] = {-1};
6983 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
6984 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
6985 // Phase 3, inputs and outputs
6986 model->identifyInputsAndOutputs(
6987 {op1},
6988 {op2});
6989 assert(model->isValid());
6990 }
6991
is_ignored_axis_float16_dim4_axis3_neg_2(int i)6992 inline bool is_ignored_axis_float16_dim4_axis3_neg_2(int i) {
6993 static std::set<int> ignore = {};
6994 return ignore.find(i) != ignore.end();
6995 }
6996
CreateModel_axis_float16_dim3_axis0_2(Model * model)6997 void CreateModel_axis_float16_dim3_axis0_2(Model *model) {
6998 OperandType type1(Type::INT32, {});
6999 OperandType type15(Type::FLOAT16, {});
7000 OperandType type43(Type::TENSOR_FLOAT16, {5, 2, 2});
7001 // Phase 1, operands
7002 auto op1 = model->addOperand(&type43);
7003 auto param3 = model->addOperand(&type15);
7004 auto axis = model->addOperand(&type1);
7005 auto op2 = model->addOperand(&type43);
7006 // Phase 2, operations
7007 static _Float16 param3_init[] = {9.999999974752427e-07f};
7008 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
7009 static int32_t axis_init[] = {0};
7010 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7011 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7012 // Phase 3, inputs and outputs
7013 model->identifyInputsAndOutputs(
7014 {op1},
7015 {op2});
7016 assert(model->isValid());
7017 }
7018
is_ignored_axis_float16_dim3_axis0_2(int i)7019 inline bool is_ignored_axis_float16_dim3_axis0_2(int i) {
7020 static std::set<int> ignore = {};
7021 return ignore.find(i) != ignore.end();
7022 }
7023
CreateModel_axis_float16_dim3_axis0_neg_2(Model * model)7024 void CreateModel_axis_float16_dim3_axis0_neg_2(Model *model) {
7025 OperandType type1(Type::INT32, {});
7026 OperandType type15(Type::FLOAT16, {});
7027 OperandType type43(Type::TENSOR_FLOAT16, {5, 2, 2});
7028 // Phase 1, operands
7029 auto op1 = model->addOperand(&type43);
7030 auto param3 = model->addOperand(&type15);
7031 auto axis = model->addOperand(&type1);
7032 auto op2 = model->addOperand(&type43);
7033 // Phase 2, operations
7034 static _Float16 param3_init[] = {9.999999974752427e-07f};
7035 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
7036 static int32_t axis_init[] = {-3};
7037 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7038 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7039 // Phase 3, inputs and outputs
7040 model->identifyInputsAndOutputs(
7041 {op1},
7042 {op2});
7043 assert(model->isValid());
7044 }
7045
is_ignored_axis_float16_dim3_axis0_neg_2(int i)7046 inline bool is_ignored_axis_float16_dim3_axis0_neg_2(int i) {
7047 static std::set<int> ignore = {};
7048 return ignore.find(i) != ignore.end();
7049 }
7050
CreateModel_axis_float16_dim3_axis1_2(Model * model)7051 void CreateModel_axis_float16_dim3_axis1_2(Model *model) {
7052 OperandType type1(Type::INT32, {});
7053 OperandType type15(Type::FLOAT16, {});
7054 OperandType type44(Type::TENSOR_FLOAT16, {2, 5, 2});
7055 // Phase 1, operands
7056 auto op1 = model->addOperand(&type44);
7057 auto param3 = model->addOperand(&type15);
7058 auto axis = model->addOperand(&type1);
7059 auto op2 = model->addOperand(&type44);
7060 // Phase 2, operations
7061 static _Float16 param3_init[] = {9.999999974752427e-07f};
7062 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
7063 static int32_t axis_init[] = {1};
7064 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7065 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7066 // Phase 3, inputs and outputs
7067 model->identifyInputsAndOutputs(
7068 {op1},
7069 {op2});
7070 assert(model->isValid());
7071 }
7072
is_ignored_axis_float16_dim3_axis1_2(int i)7073 inline bool is_ignored_axis_float16_dim3_axis1_2(int i) {
7074 static std::set<int> ignore = {};
7075 return ignore.find(i) != ignore.end();
7076 }
7077
CreateModel_axis_float16_dim3_axis1_neg_2(Model * model)7078 void CreateModel_axis_float16_dim3_axis1_neg_2(Model *model) {
7079 OperandType type1(Type::INT32, {});
7080 OperandType type15(Type::FLOAT16, {});
7081 OperandType type44(Type::TENSOR_FLOAT16, {2, 5, 2});
7082 // Phase 1, operands
7083 auto op1 = model->addOperand(&type44);
7084 auto param3 = model->addOperand(&type15);
7085 auto axis = model->addOperand(&type1);
7086 auto op2 = model->addOperand(&type44);
7087 // Phase 2, operations
7088 static _Float16 param3_init[] = {9.999999974752427e-07f};
7089 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
7090 static int32_t axis_init[] = {-2};
7091 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7092 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7093 // Phase 3, inputs and outputs
7094 model->identifyInputsAndOutputs(
7095 {op1},
7096 {op2});
7097 assert(model->isValid());
7098 }
7099
is_ignored_axis_float16_dim3_axis1_neg_2(int i)7100 inline bool is_ignored_axis_float16_dim3_axis1_neg_2(int i) {
7101 static std::set<int> ignore = {};
7102 return ignore.find(i) != ignore.end();
7103 }
7104
CreateModel_axis_float16_dim3_axis2_2(Model * model)7105 void CreateModel_axis_float16_dim3_axis2_2(Model *model) {
7106 OperandType type1(Type::INT32, {});
7107 OperandType type15(Type::FLOAT16, {});
7108 OperandType type18(Type::TENSOR_FLOAT16, {2, 2, 5});
7109 // Phase 1, operands
7110 auto op1 = model->addOperand(&type18);
7111 auto param3 = model->addOperand(&type15);
7112 auto axis = model->addOperand(&type1);
7113 auto op2 = model->addOperand(&type18);
7114 // Phase 2, operations
7115 static _Float16 param3_init[] = {9.999999974752427e-07f};
7116 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
7117 static int32_t axis_init[] = {2};
7118 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7119 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7120 // Phase 3, inputs and outputs
7121 model->identifyInputsAndOutputs(
7122 {op1},
7123 {op2});
7124 assert(model->isValid());
7125 }
7126
is_ignored_axis_float16_dim3_axis2_2(int i)7127 inline bool is_ignored_axis_float16_dim3_axis2_2(int i) {
7128 static std::set<int> ignore = {};
7129 return ignore.find(i) != ignore.end();
7130 }
7131
CreateModel_axis_float16_dim3_axis2_neg_2(Model * model)7132 void CreateModel_axis_float16_dim3_axis2_neg_2(Model *model) {
7133 OperandType type1(Type::INT32, {});
7134 OperandType type15(Type::FLOAT16, {});
7135 OperandType type18(Type::TENSOR_FLOAT16, {2, 2, 5});
7136 // Phase 1, operands
7137 auto op1 = model->addOperand(&type18);
7138 auto param3 = model->addOperand(&type15);
7139 auto axis = model->addOperand(&type1);
7140 auto op2 = model->addOperand(&type18);
7141 // Phase 2, operations
7142 static _Float16 param3_init[] = {9.999999974752427e-07f};
7143 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
7144 static int32_t axis_init[] = {-1};
7145 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7146 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7147 // Phase 3, inputs and outputs
7148 model->identifyInputsAndOutputs(
7149 {op1},
7150 {op2});
7151 assert(model->isValid());
7152 }
7153
is_ignored_axis_float16_dim3_axis2_neg_2(int i)7154 inline bool is_ignored_axis_float16_dim3_axis2_neg_2(int i) {
7155 static std::set<int> ignore = {};
7156 return ignore.find(i) != ignore.end();
7157 }
7158
CreateModel_axis_float16_dim2_axis0_2(Model * model)7159 void CreateModel_axis_float16_dim2_axis0_2(Model *model) {
7160 OperandType type1(Type::INT32, {});
7161 OperandType type15(Type::FLOAT16, {});
7162 OperandType type45(Type::TENSOR_FLOAT16, {5, 2});
7163 // Phase 1, operands
7164 auto op1 = model->addOperand(&type45);
7165 auto param3 = model->addOperand(&type15);
7166 auto axis = model->addOperand(&type1);
7167 auto op2 = model->addOperand(&type45);
7168 // Phase 2, operations
7169 static _Float16 param3_init[] = {9.999999974752427e-07f};
7170 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
7171 static int32_t axis_init[] = {0};
7172 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7173 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7174 // Phase 3, inputs and outputs
7175 model->identifyInputsAndOutputs(
7176 {op1},
7177 {op2});
7178 assert(model->isValid());
7179 }
7180
is_ignored_axis_float16_dim2_axis0_2(int i)7181 inline bool is_ignored_axis_float16_dim2_axis0_2(int i) {
7182 static std::set<int> ignore = {};
7183 return ignore.find(i) != ignore.end();
7184 }
7185
CreateModel_axis_float16_dim2_axis0_neg_2(Model * model)7186 void CreateModel_axis_float16_dim2_axis0_neg_2(Model *model) {
7187 OperandType type1(Type::INT32, {});
7188 OperandType type15(Type::FLOAT16, {});
7189 OperandType type45(Type::TENSOR_FLOAT16, {5, 2});
7190 // Phase 1, operands
7191 auto op1 = model->addOperand(&type45);
7192 auto param3 = model->addOperand(&type15);
7193 auto axis = model->addOperand(&type1);
7194 auto op2 = model->addOperand(&type45);
7195 // Phase 2, operations
7196 static _Float16 param3_init[] = {9.999999974752427e-07f};
7197 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
7198 static int32_t axis_init[] = {-2};
7199 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7200 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7201 // Phase 3, inputs and outputs
7202 model->identifyInputsAndOutputs(
7203 {op1},
7204 {op2});
7205 assert(model->isValid());
7206 }
7207
is_ignored_axis_float16_dim2_axis0_neg_2(int i)7208 inline bool is_ignored_axis_float16_dim2_axis0_neg_2(int i) {
7209 static std::set<int> ignore = {};
7210 return ignore.find(i) != ignore.end();
7211 }
7212
CreateModel_axis_float16_dim2_axis1_2(Model * model)7213 void CreateModel_axis_float16_dim2_axis1_2(Model *model) {
7214 OperandType type1(Type::INT32, {});
7215 OperandType type15(Type::FLOAT16, {});
7216 OperandType type46(Type::TENSOR_FLOAT16, {2, 5});
7217 // Phase 1, operands
7218 auto op1 = model->addOperand(&type46);
7219 auto param3 = model->addOperand(&type15);
7220 auto axis = model->addOperand(&type1);
7221 auto op2 = model->addOperand(&type46);
7222 // Phase 2, operations
7223 static _Float16 param3_init[] = {9.999999974752427e-07f};
7224 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
7225 static int32_t axis_init[] = {1};
7226 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7227 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7228 // Phase 3, inputs and outputs
7229 model->identifyInputsAndOutputs(
7230 {op1},
7231 {op2});
7232 assert(model->isValid());
7233 }
7234
is_ignored_axis_float16_dim2_axis1_2(int i)7235 inline bool is_ignored_axis_float16_dim2_axis1_2(int i) {
7236 static std::set<int> ignore = {};
7237 return ignore.find(i) != ignore.end();
7238 }
7239
CreateModel_axis_float16_dim2_axis1_neg_2(Model * model)7240 void CreateModel_axis_float16_dim2_axis1_neg_2(Model *model) {
7241 OperandType type1(Type::INT32, {});
7242 OperandType type15(Type::FLOAT16, {});
7243 OperandType type46(Type::TENSOR_FLOAT16, {2, 5});
7244 // Phase 1, operands
7245 auto op1 = model->addOperand(&type46);
7246 auto param3 = model->addOperand(&type15);
7247 auto axis = model->addOperand(&type1);
7248 auto op2 = model->addOperand(&type46);
7249 // Phase 2, operations
7250 static _Float16 param3_init[] = {9.999999974752427e-07f};
7251 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
7252 static int32_t axis_init[] = {-1};
7253 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7254 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7255 // Phase 3, inputs and outputs
7256 model->identifyInputsAndOutputs(
7257 {op1},
7258 {op2});
7259 assert(model->isValid());
7260 }
7261
is_ignored_axis_float16_dim2_axis1_neg_2(int i)7262 inline bool is_ignored_axis_float16_dim2_axis1_neg_2(int i) {
7263 static std::set<int> ignore = {};
7264 return ignore.find(i) != ignore.end();
7265 }
7266
CreateModel_axis_float16_dim1_axis0_2(Model * model)7267 void CreateModel_axis_float16_dim1_axis0_2(Model *model) {
7268 OperandType type1(Type::INT32, {});
7269 OperandType type15(Type::FLOAT16, {});
7270 OperandType type17(Type::TENSOR_FLOAT16, {5});
7271 // Phase 1, operands
7272 auto op1 = model->addOperand(&type17);
7273 auto param3 = model->addOperand(&type15);
7274 auto axis = model->addOperand(&type1);
7275 auto op2 = model->addOperand(&type17);
7276 // Phase 2, operations
7277 static _Float16 param3_init[] = {9.999999974752427e-07f};
7278 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
7279 static int32_t axis_init[] = {0};
7280 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7281 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7282 // Phase 3, inputs and outputs
7283 model->identifyInputsAndOutputs(
7284 {op1},
7285 {op2});
7286 assert(model->isValid());
7287 }
7288
is_ignored_axis_float16_dim1_axis0_2(int i)7289 inline bool is_ignored_axis_float16_dim1_axis0_2(int i) {
7290 static std::set<int> ignore = {};
7291 return ignore.find(i) != ignore.end();
7292 }
7293
CreateModel_axis_float16_dim1_axis0_neg_2(Model * model)7294 void CreateModel_axis_float16_dim1_axis0_neg_2(Model *model) {
7295 OperandType type1(Type::INT32, {});
7296 OperandType type15(Type::FLOAT16, {});
7297 OperandType type17(Type::TENSOR_FLOAT16, {5});
7298 // Phase 1, operands
7299 auto op1 = model->addOperand(&type17);
7300 auto param3 = model->addOperand(&type15);
7301 auto axis = model->addOperand(&type1);
7302 auto op2 = model->addOperand(&type17);
7303 // Phase 2, operations
7304 static _Float16 param3_init[] = {9.999999974752427e-07f};
7305 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
7306 static int32_t axis_init[] = {-1};
7307 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7308 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7309 // Phase 3, inputs and outputs
7310 model->identifyInputsAndOutputs(
7311 {op1},
7312 {op2});
7313 assert(model->isValid());
7314 }
7315
is_ignored_axis_float16_dim1_axis0_neg_2(int i)7316 inline bool is_ignored_axis_float16_dim1_axis0_neg_2(int i) {
7317 static std::set<int> ignore = {};
7318 return ignore.find(i) != ignore.end();
7319 }
7320
CreateModel_axis_quant8_dim4_axis0_2(Model * model)7321 void CreateModel_axis_quant8_dim4_axis0_2(Model *model) {
7322 OperandType type1(Type::INT32, {});
7323 OperandType type2(Type::FLOAT32, {});
7324 OperandType type47(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2, 2}, 0.25f, 128);
7325 OperandType type48(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2, 2}, 0.00390625f, 0);
7326 // Phase 1, operands
7327 auto op1 = model->addOperand(&type47);
7328 auto param3 = model->addOperand(&type2);
7329 auto axis = model->addOperand(&type1);
7330 auto op2 = model->addOperand(&type48);
7331 // Phase 2, operations
7332 static float param3_init[] = {1e-06f};
7333 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7334 static int32_t axis_init[] = {0};
7335 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7336 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7337 // Phase 3, inputs and outputs
7338 model->identifyInputsAndOutputs(
7339 {op1},
7340 {op2});
7341 assert(model->isValid());
7342 }
7343
is_ignored_axis_quant8_dim4_axis0_2(int i)7344 inline bool is_ignored_axis_quant8_dim4_axis0_2(int i) {
7345 static std::set<int> ignore = {};
7346 return ignore.find(i) != ignore.end();
7347 }
7348
CreateModel_axis_quant8_dim4_axis0_neg_2(Model * model)7349 void CreateModel_axis_quant8_dim4_axis0_neg_2(Model *model) {
7350 OperandType type1(Type::INT32, {});
7351 OperandType type2(Type::FLOAT32, {});
7352 OperandType type47(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2, 2}, 0.25f, 128);
7353 OperandType type48(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2, 2}, 0.00390625f, 0);
7354 // Phase 1, operands
7355 auto op1 = model->addOperand(&type47);
7356 auto param3 = model->addOperand(&type2);
7357 auto axis = model->addOperand(&type1);
7358 auto op2 = model->addOperand(&type48);
7359 // Phase 2, operations
7360 static float param3_init[] = {1e-06f};
7361 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7362 static int32_t axis_init[] = {-4};
7363 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7364 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7365 // Phase 3, inputs and outputs
7366 model->identifyInputsAndOutputs(
7367 {op1},
7368 {op2});
7369 assert(model->isValid());
7370 }
7371
is_ignored_axis_quant8_dim4_axis0_neg_2(int i)7372 inline bool is_ignored_axis_quant8_dim4_axis0_neg_2(int i) {
7373 static std::set<int> ignore = {};
7374 return ignore.find(i) != ignore.end();
7375 }
7376
CreateModel_axis_quant8_dim4_axis1_2(Model * model)7377 void CreateModel_axis_quant8_dim4_axis1_2(Model *model) {
7378 OperandType type1(Type::INT32, {});
7379 OperandType type2(Type::FLOAT32, {});
7380 OperandType type49(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2, 2}, 0.25f, 128);
7381 OperandType type50(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2, 2}, 0.00390625f, 0);
7382 // Phase 1, operands
7383 auto op1 = model->addOperand(&type49);
7384 auto param3 = model->addOperand(&type2);
7385 auto axis = model->addOperand(&type1);
7386 auto op2 = model->addOperand(&type50);
7387 // Phase 2, operations
7388 static float param3_init[] = {1e-06f};
7389 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7390 static int32_t axis_init[] = {1};
7391 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7392 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7393 // Phase 3, inputs and outputs
7394 model->identifyInputsAndOutputs(
7395 {op1},
7396 {op2});
7397 assert(model->isValid());
7398 }
7399
is_ignored_axis_quant8_dim4_axis1_2(int i)7400 inline bool is_ignored_axis_quant8_dim4_axis1_2(int i) {
7401 static std::set<int> ignore = {};
7402 return ignore.find(i) != ignore.end();
7403 }
7404
CreateModel_axis_quant8_dim4_axis1_neg_2(Model * model)7405 void CreateModel_axis_quant8_dim4_axis1_neg_2(Model *model) {
7406 OperandType type1(Type::INT32, {});
7407 OperandType type2(Type::FLOAT32, {});
7408 OperandType type49(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2, 2}, 0.25f, 128);
7409 OperandType type50(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2, 2}, 0.00390625f, 0);
7410 // Phase 1, operands
7411 auto op1 = model->addOperand(&type49);
7412 auto param3 = model->addOperand(&type2);
7413 auto axis = model->addOperand(&type1);
7414 auto op2 = model->addOperand(&type50);
7415 // Phase 2, operations
7416 static float param3_init[] = {1e-06f};
7417 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7418 static int32_t axis_init[] = {-3};
7419 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7420 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7421 // Phase 3, inputs and outputs
7422 model->identifyInputsAndOutputs(
7423 {op1},
7424 {op2});
7425 assert(model->isValid());
7426 }
7427
is_ignored_axis_quant8_dim4_axis1_neg_2(int i)7428 inline bool is_ignored_axis_quant8_dim4_axis1_neg_2(int i) {
7429 static std::set<int> ignore = {};
7430 return ignore.find(i) != ignore.end();
7431 }
7432
CreateModel_axis_quant8_dim4_axis2_2(Model * model)7433 void CreateModel_axis_quant8_dim4_axis2_2(Model *model) {
7434 OperandType type1(Type::INT32, {});
7435 OperandType type2(Type::FLOAT32, {});
7436 OperandType type51(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5, 2}, 0.25f, 128);
7437 OperandType type52(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5, 2}, 0.00390625f, 0);
7438 // Phase 1, operands
7439 auto op1 = model->addOperand(&type51);
7440 auto param3 = model->addOperand(&type2);
7441 auto axis = model->addOperand(&type1);
7442 auto op2 = model->addOperand(&type52);
7443 // Phase 2, operations
7444 static float param3_init[] = {1e-06f};
7445 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7446 static int32_t axis_init[] = {2};
7447 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7448 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7449 // Phase 3, inputs and outputs
7450 model->identifyInputsAndOutputs(
7451 {op1},
7452 {op2});
7453 assert(model->isValid());
7454 }
7455
is_ignored_axis_quant8_dim4_axis2_2(int i)7456 inline bool is_ignored_axis_quant8_dim4_axis2_2(int i) {
7457 static std::set<int> ignore = {};
7458 return ignore.find(i) != ignore.end();
7459 }
7460
CreateModel_axis_quant8_dim4_axis2_neg_2(Model * model)7461 void CreateModel_axis_quant8_dim4_axis2_neg_2(Model *model) {
7462 OperandType type1(Type::INT32, {});
7463 OperandType type2(Type::FLOAT32, {});
7464 OperandType type51(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5, 2}, 0.25f, 128);
7465 OperandType type52(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5, 2}, 0.00390625f, 0);
7466 // Phase 1, operands
7467 auto op1 = model->addOperand(&type51);
7468 auto param3 = model->addOperand(&type2);
7469 auto axis = model->addOperand(&type1);
7470 auto op2 = model->addOperand(&type52);
7471 // Phase 2, operations
7472 static float param3_init[] = {1e-06f};
7473 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7474 static int32_t axis_init[] = {-2};
7475 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7476 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7477 // Phase 3, inputs and outputs
7478 model->identifyInputsAndOutputs(
7479 {op1},
7480 {op2});
7481 assert(model->isValid());
7482 }
7483
is_ignored_axis_quant8_dim4_axis2_neg_2(int i)7484 inline bool is_ignored_axis_quant8_dim4_axis2_neg_2(int i) {
7485 static std::set<int> ignore = {};
7486 return ignore.find(i) != ignore.end();
7487 }
7488
CreateModel_axis_quant8_dim4_axis3_2(Model * model)7489 void CreateModel_axis_quant8_dim4_axis3_2(Model *model) {
7490 OperandType type1(Type::INT32, {});
7491 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 5}, 0.25f, 128);
7492 OperandType type2(Type::FLOAT32, {});
7493 OperandType type20(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 5}, 0.00390625f, 0);
7494 // Phase 1, operands
7495 auto op1 = model->addOperand(&type19);
7496 auto param3 = model->addOperand(&type2);
7497 auto axis = model->addOperand(&type1);
7498 auto op2 = model->addOperand(&type20);
7499 // Phase 2, operations
7500 static float param3_init[] = {1e-06f};
7501 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7502 static int32_t axis_init[] = {3};
7503 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7504 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7505 // Phase 3, inputs and outputs
7506 model->identifyInputsAndOutputs(
7507 {op1},
7508 {op2});
7509 assert(model->isValid());
7510 }
7511
is_ignored_axis_quant8_dim4_axis3_2(int i)7512 inline bool is_ignored_axis_quant8_dim4_axis3_2(int i) {
7513 static std::set<int> ignore = {};
7514 return ignore.find(i) != ignore.end();
7515 }
7516
CreateModel_axis_quant8_dim4_axis3_neg_2(Model * model)7517 void CreateModel_axis_quant8_dim4_axis3_neg_2(Model *model) {
7518 OperandType type1(Type::INT32, {});
7519 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 5}, 0.25f, 128);
7520 OperandType type2(Type::FLOAT32, {});
7521 OperandType type20(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 5}, 0.00390625f, 0);
7522 // Phase 1, operands
7523 auto op1 = model->addOperand(&type19);
7524 auto param3 = model->addOperand(&type2);
7525 auto axis = model->addOperand(&type1);
7526 auto op2 = model->addOperand(&type20);
7527 // Phase 2, operations
7528 static float param3_init[] = {1e-06f};
7529 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7530 static int32_t axis_init[] = {-1};
7531 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7532 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7533 // Phase 3, inputs and outputs
7534 model->identifyInputsAndOutputs(
7535 {op1},
7536 {op2});
7537 assert(model->isValid());
7538 }
7539
is_ignored_axis_quant8_dim4_axis3_neg_2(int i)7540 inline bool is_ignored_axis_quant8_dim4_axis3_neg_2(int i) {
7541 static std::set<int> ignore = {};
7542 return ignore.find(i) != ignore.end();
7543 }
7544
CreateModel_axis_quant8_dim3_axis0_2(Model * model)7545 void CreateModel_axis_quant8_dim3_axis0_2(Model *model) {
7546 OperandType type1(Type::INT32, {});
7547 OperandType type2(Type::FLOAT32, {});
7548 OperandType type53(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2}, 0.25f, 128);
7549 OperandType type54(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2}, 0.00390625f, 0);
7550 // Phase 1, operands
7551 auto op1 = model->addOperand(&type53);
7552 auto param3 = model->addOperand(&type2);
7553 auto axis = model->addOperand(&type1);
7554 auto op2 = model->addOperand(&type54);
7555 // Phase 2, operations
7556 static float param3_init[] = {1e-06f};
7557 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7558 static int32_t axis_init[] = {0};
7559 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7560 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7561 // Phase 3, inputs and outputs
7562 model->identifyInputsAndOutputs(
7563 {op1},
7564 {op2});
7565 assert(model->isValid());
7566 }
7567
is_ignored_axis_quant8_dim3_axis0_2(int i)7568 inline bool is_ignored_axis_quant8_dim3_axis0_2(int i) {
7569 static std::set<int> ignore = {};
7570 return ignore.find(i) != ignore.end();
7571 }
7572
CreateModel_axis_quant8_dim3_axis0_neg_2(Model * model)7573 void CreateModel_axis_quant8_dim3_axis0_neg_2(Model *model) {
7574 OperandType type1(Type::INT32, {});
7575 OperandType type2(Type::FLOAT32, {});
7576 OperandType type53(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2}, 0.25f, 128);
7577 OperandType type54(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2}, 0.00390625f, 0);
7578 // Phase 1, operands
7579 auto op1 = model->addOperand(&type53);
7580 auto param3 = model->addOperand(&type2);
7581 auto axis = model->addOperand(&type1);
7582 auto op2 = model->addOperand(&type54);
7583 // Phase 2, operations
7584 static float param3_init[] = {1e-06f};
7585 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7586 static int32_t axis_init[] = {-3};
7587 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7588 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7589 // Phase 3, inputs and outputs
7590 model->identifyInputsAndOutputs(
7591 {op1},
7592 {op2});
7593 assert(model->isValid());
7594 }
7595
is_ignored_axis_quant8_dim3_axis0_neg_2(int i)7596 inline bool is_ignored_axis_quant8_dim3_axis0_neg_2(int i) {
7597 static std::set<int> ignore = {};
7598 return ignore.find(i) != ignore.end();
7599 }
7600
CreateModel_axis_quant8_dim3_axis1_2(Model * model)7601 void CreateModel_axis_quant8_dim3_axis1_2(Model *model) {
7602 OperandType type1(Type::INT32, {});
7603 OperandType type2(Type::FLOAT32, {});
7604 OperandType type55(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2}, 0.25f, 128);
7605 OperandType type56(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2}, 0.00390625f, 0);
7606 // Phase 1, operands
7607 auto op1 = model->addOperand(&type55);
7608 auto param3 = model->addOperand(&type2);
7609 auto axis = model->addOperand(&type1);
7610 auto op2 = model->addOperand(&type56);
7611 // Phase 2, operations
7612 static float param3_init[] = {1e-06f};
7613 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7614 static int32_t axis_init[] = {1};
7615 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7616 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7617 // Phase 3, inputs and outputs
7618 model->identifyInputsAndOutputs(
7619 {op1},
7620 {op2});
7621 assert(model->isValid());
7622 }
7623
is_ignored_axis_quant8_dim3_axis1_2(int i)7624 inline bool is_ignored_axis_quant8_dim3_axis1_2(int i) {
7625 static std::set<int> ignore = {};
7626 return ignore.find(i) != ignore.end();
7627 }
7628
CreateModel_axis_quant8_dim3_axis1_neg_2(Model * model)7629 void CreateModel_axis_quant8_dim3_axis1_neg_2(Model *model) {
7630 OperandType type1(Type::INT32, {});
7631 OperandType type2(Type::FLOAT32, {});
7632 OperandType type55(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2}, 0.25f, 128);
7633 OperandType type56(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2}, 0.00390625f, 0);
7634 // Phase 1, operands
7635 auto op1 = model->addOperand(&type55);
7636 auto param3 = model->addOperand(&type2);
7637 auto axis = model->addOperand(&type1);
7638 auto op2 = model->addOperand(&type56);
7639 // Phase 2, operations
7640 static float param3_init[] = {1e-06f};
7641 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7642 static int32_t axis_init[] = {-2};
7643 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7644 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7645 // Phase 3, inputs and outputs
7646 model->identifyInputsAndOutputs(
7647 {op1},
7648 {op2});
7649 assert(model->isValid());
7650 }
7651
is_ignored_axis_quant8_dim3_axis1_neg_2(int i)7652 inline bool is_ignored_axis_quant8_dim3_axis1_neg_2(int i) {
7653 static std::set<int> ignore = {};
7654 return ignore.find(i) != ignore.end();
7655 }
7656
CreateModel_axis_quant8_dim3_axis2_2(Model * model)7657 void CreateModel_axis_quant8_dim3_axis2_2(Model *model) {
7658 OperandType type1(Type::INT32, {});
7659 OperandType type2(Type::FLOAT32, {});
7660 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5}, 0.25f, 128);
7661 OperandType type24(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5}, 0.00390625f, 0);
7662 // Phase 1, operands
7663 auto op1 = model->addOperand(&type23);
7664 auto param3 = model->addOperand(&type2);
7665 auto axis = model->addOperand(&type1);
7666 auto op2 = model->addOperand(&type24);
7667 // Phase 2, operations
7668 static float param3_init[] = {1e-06f};
7669 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7670 static int32_t axis_init[] = {2};
7671 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7672 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7673 // Phase 3, inputs and outputs
7674 model->identifyInputsAndOutputs(
7675 {op1},
7676 {op2});
7677 assert(model->isValid());
7678 }
7679
is_ignored_axis_quant8_dim3_axis2_2(int i)7680 inline bool is_ignored_axis_quant8_dim3_axis2_2(int i) {
7681 static std::set<int> ignore = {};
7682 return ignore.find(i) != ignore.end();
7683 }
7684
CreateModel_axis_quant8_dim3_axis2_neg_2(Model * model)7685 void CreateModel_axis_quant8_dim3_axis2_neg_2(Model *model) {
7686 OperandType type1(Type::INT32, {});
7687 OperandType type2(Type::FLOAT32, {});
7688 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5}, 0.25f, 128);
7689 OperandType type24(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5}, 0.00390625f, 0);
7690 // Phase 1, operands
7691 auto op1 = model->addOperand(&type23);
7692 auto param3 = model->addOperand(&type2);
7693 auto axis = model->addOperand(&type1);
7694 auto op2 = model->addOperand(&type24);
7695 // Phase 2, operations
7696 static float param3_init[] = {1e-06f};
7697 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7698 static int32_t axis_init[] = {-1};
7699 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7700 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7701 // Phase 3, inputs and outputs
7702 model->identifyInputsAndOutputs(
7703 {op1},
7704 {op2});
7705 assert(model->isValid());
7706 }
7707
is_ignored_axis_quant8_dim3_axis2_neg_2(int i)7708 inline bool is_ignored_axis_quant8_dim3_axis2_neg_2(int i) {
7709 static std::set<int> ignore = {};
7710 return ignore.find(i) != ignore.end();
7711 }
7712
CreateModel_axis_quant8_dim2_axis0_2(Model * model)7713 void CreateModel_axis_quant8_dim2_axis0_2(Model *model) {
7714 OperandType type1(Type::INT32, {});
7715 OperandType type2(Type::FLOAT32, {});
7716 OperandType type57(Type::TENSOR_QUANT8_ASYMM, {5, 2}, 0.25f, 128);
7717 OperandType type58(Type::TENSOR_QUANT8_ASYMM, {5, 2}, 0.00390625f, 0);
7718 // Phase 1, operands
7719 auto op1 = model->addOperand(&type57);
7720 auto param3 = model->addOperand(&type2);
7721 auto axis = model->addOperand(&type1);
7722 auto op2 = model->addOperand(&type58);
7723 // Phase 2, operations
7724 static float param3_init[] = {1e-06f};
7725 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7726 static int32_t axis_init[] = {0};
7727 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7728 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7729 // Phase 3, inputs and outputs
7730 model->identifyInputsAndOutputs(
7731 {op1},
7732 {op2});
7733 assert(model->isValid());
7734 }
7735
is_ignored_axis_quant8_dim2_axis0_2(int i)7736 inline bool is_ignored_axis_quant8_dim2_axis0_2(int i) {
7737 static std::set<int> ignore = {};
7738 return ignore.find(i) != ignore.end();
7739 }
7740
CreateModel_axis_quant8_dim2_axis0_neg_2(Model * model)7741 void CreateModel_axis_quant8_dim2_axis0_neg_2(Model *model) {
7742 OperandType type1(Type::INT32, {});
7743 OperandType type2(Type::FLOAT32, {});
7744 OperandType type57(Type::TENSOR_QUANT8_ASYMM, {5, 2}, 0.25f, 128);
7745 OperandType type58(Type::TENSOR_QUANT8_ASYMM, {5, 2}, 0.00390625f, 0);
7746 // Phase 1, operands
7747 auto op1 = model->addOperand(&type57);
7748 auto param3 = model->addOperand(&type2);
7749 auto axis = model->addOperand(&type1);
7750 auto op2 = model->addOperand(&type58);
7751 // Phase 2, operations
7752 static float param3_init[] = {1e-06f};
7753 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7754 static int32_t axis_init[] = {-2};
7755 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7756 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7757 // Phase 3, inputs and outputs
7758 model->identifyInputsAndOutputs(
7759 {op1},
7760 {op2});
7761 assert(model->isValid());
7762 }
7763
is_ignored_axis_quant8_dim2_axis0_neg_2(int i)7764 inline bool is_ignored_axis_quant8_dim2_axis0_neg_2(int i) {
7765 static std::set<int> ignore = {};
7766 return ignore.find(i) != ignore.end();
7767 }
7768
CreateModel_axis_quant8_dim2_axis1_2(Model * model)7769 void CreateModel_axis_quant8_dim2_axis1_2(Model *model) {
7770 OperandType type1(Type::INT32, {});
7771 OperandType type2(Type::FLOAT32, {});
7772 OperandType type59(Type::TENSOR_QUANT8_ASYMM, {2, 5}, 0.25f, 128);
7773 OperandType type60(Type::TENSOR_QUANT8_ASYMM, {2, 5}, 0.00390625f, 0);
7774 // Phase 1, operands
7775 auto op1 = model->addOperand(&type59);
7776 auto param3 = model->addOperand(&type2);
7777 auto axis = model->addOperand(&type1);
7778 auto op2 = model->addOperand(&type60);
7779 // Phase 2, operations
7780 static float param3_init[] = {1e-06f};
7781 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7782 static int32_t axis_init[] = {1};
7783 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7784 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7785 // Phase 3, inputs and outputs
7786 model->identifyInputsAndOutputs(
7787 {op1},
7788 {op2});
7789 assert(model->isValid());
7790 }
7791
is_ignored_axis_quant8_dim2_axis1_2(int i)7792 inline bool is_ignored_axis_quant8_dim2_axis1_2(int i) {
7793 static std::set<int> ignore = {};
7794 return ignore.find(i) != ignore.end();
7795 }
7796
CreateModel_axis_quant8_dim2_axis1_neg_2(Model * model)7797 void CreateModel_axis_quant8_dim2_axis1_neg_2(Model *model) {
7798 OperandType type1(Type::INT32, {});
7799 OperandType type2(Type::FLOAT32, {});
7800 OperandType type59(Type::TENSOR_QUANT8_ASYMM, {2, 5}, 0.25f, 128);
7801 OperandType type60(Type::TENSOR_QUANT8_ASYMM, {2, 5}, 0.00390625f, 0);
7802 // Phase 1, operands
7803 auto op1 = model->addOperand(&type59);
7804 auto param3 = model->addOperand(&type2);
7805 auto axis = model->addOperand(&type1);
7806 auto op2 = model->addOperand(&type60);
7807 // Phase 2, operations
7808 static float param3_init[] = {1e-06f};
7809 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7810 static int32_t axis_init[] = {-1};
7811 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7812 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7813 // Phase 3, inputs and outputs
7814 model->identifyInputsAndOutputs(
7815 {op1},
7816 {op2});
7817 assert(model->isValid());
7818 }
7819
is_ignored_axis_quant8_dim2_axis1_neg_2(int i)7820 inline bool is_ignored_axis_quant8_dim2_axis1_neg_2(int i) {
7821 static std::set<int> ignore = {};
7822 return ignore.find(i) != ignore.end();
7823 }
7824
CreateModel_axis_quant8_dim1_axis0_2(Model * model)7825 void CreateModel_axis_quant8_dim1_axis0_2(Model *model) {
7826 OperandType type1(Type::INT32, {});
7827 OperandType type2(Type::FLOAT32, {});
7828 OperandType type21(Type::TENSOR_QUANT8_ASYMM, {5}, 0.25f, 128);
7829 OperandType type22(Type::TENSOR_QUANT8_ASYMM, {5}, 0.00390625f, 0);
7830 // Phase 1, operands
7831 auto op1 = model->addOperand(&type21);
7832 auto param3 = model->addOperand(&type2);
7833 auto axis = model->addOperand(&type1);
7834 auto op2 = model->addOperand(&type22);
7835 // Phase 2, operations
7836 static float param3_init[] = {1e-06f};
7837 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7838 static int32_t axis_init[] = {0};
7839 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7840 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7841 // Phase 3, inputs and outputs
7842 model->identifyInputsAndOutputs(
7843 {op1},
7844 {op2});
7845 assert(model->isValid());
7846 }
7847
is_ignored_axis_quant8_dim1_axis0_2(int i)7848 inline bool is_ignored_axis_quant8_dim1_axis0_2(int i) {
7849 static std::set<int> ignore = {};
7850 return ignore.find(i) != ignore.end();
7851 }
7852
CreateModel_axis_quant8_dim1_axis0_neg_2(Model * model)7853 void CreateModel_axis_quant8_dim1_axis0_neg_2(Model *model) {
7854 OperandType type1(Type::INT32, {});
7855 OperandType type2(Type::FLOAT32, {});
7856 OperandType type21(Type::TENSOR_QUANT8_ASYMM, {5}, 0.25f, 128);
7857 OperandType type22(Type::TENSOR_QUANT8_ASYMM, {5}, 0.00390625f, 0);
7858 // Phase 1, operands
7859 auto op1 = model->addOperand(&type21);
7860 auto param3 = model->addOperand(&type2);
7861 auto axis = model->addOperand(&type1);
7862 auto op2 = model->addOperand(&type22);
7863 // Phase 2, operations
7864 static float param3_init[] = {1e-06f};
7865 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7866 static int32_t axis_init[] = {-1};
7867 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7868 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7869 // Phase 3, inputs and outputs
7870 model->identifyInputsAndOutputs(
7871 {op1},
7872 {op2});
7873 assert(model->isValid());
7874 }
7875
is_ignored_axis_quant8_dim1_axis0_neg_2(int i)7876 inline bool is_ignored_axis_quant8_dim1_axis0_neg_2(int i) {
7877 static std::set<int> ignore = {};
7878 return ignore.find(i) != ignore.end();
7879 }
7880
CreateModel_axis_dynamic_output_shape_dim4_axis0_2(Model * model)7881 void CreateModel_axis_dynamic_output_shape_dim4_axis0_2(Model *model) {
7882 OperandType type1(Type::INT32, {});
7883 OperandType type2(Type::FLOAT32, {});
7884 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
7885 OperandType type33(Type::TENSOR_FLOAT32, {5, 2, 2, 2});
7886 // Phase 1, operands
7887 auto op1 = model->addOperand(&type33);
7888 auto param3 = model->addOperand(&type2);
7889 auto axis = model->addOperand(&type1);
7890 auto op2 = model->addOperand(&type25);
7891 // Phase 2, operations
7892 static float param3_init[] = {1e-06f};
7893 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7894 static int32_t axis_init[] = {0};
7895 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7896 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7897 // Phase 3, inputs and outputs
7898 model->identifyInputsAndOutputs(
7899 {op1},
7900 {op2});
7901 assert(model->isValid());
7902 }
7903
is_ignored_axis_dynamic_output_shape_dim4_axis0_2(int i)7904 inline bool is_ignored_axis_dynamic_output_shape_dim4_axis0_2(int i) {
7905 static std::set<int> ignore = {};
7906 return ignore.find(i) != ignore.end();
7907 }
7908
CreateModel_axis_dynamic_output_shape_dim4_axis0_neg_2(Model * model)7909 void CreateModel_axis_dynamic_output_shape_dim4_axis0_neg_2(Model *model) {
7910 OperandType type1(Type::INT32, {});
7911 OperandType type2(Type::FLOAT32, {});
7912 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
7913 OperandType type33(Type::TENSOR_FLOAT32, {5, 2, 2, 2});
7914 // Phase 1, operands
7915 auto op1 = model->addOperand(&type33);
7916 auto param3 = model->addOperand(&type2);
7917 auto axis = model->addOperand(&type1);
7918 auto op2 = model->addOperand(&type25);
7919 // Phase 2, operations
7920 static float param3_init[] = {1e-06f};
7921 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7922 static int32_t axis_init[] = {-4};
7923 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7924 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7925 // Phase 3, inputs and outputs
7926 model->identifyInputsAndOutputs(
7927 {op1},
7928 {op2});
7929 assert(model->isValid());
7930 }
7931
is_ignored_axis_dynamic_output_shape_dim4_axis0_neg_2(int i)7932 inline bool is_ignored_axis_dynamic_output_shape_dim4_axis0_neg_2(int i) {
7933 static std::set<int> ignore = {};
7934 return ignore.find(i) != ignore.end();
7935 }
7936
CreateModel_axis_dynamic_output_shape_dim4_axis1_2(Model * model)7937 void CreateModel_axis_dynamic_output_shape_dim4_axis1_2(Model *model) {
7938 OperandType type1(Type::INT32, {});
7939 OperandType type2(Type::FLOAT32, {});
7940 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
7941 OperandType type34(Type::TENSOR_FLOAT32, {2, 5, 2, 2});
7942 // Phase 1, operands
7943 auto op1 = model->addOperand(&type34);
7944 auto param3 = model->addOperand(&type2);
7945 auto axis = model->addOperand(&type1);
7946 auto op2 = model->addOperand(&type25);
7947 // Phase 2, operations
7948 static float param3_init[] = {1e-06f};
7949 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7950 static int32_t axis_init[] = {1};
7951 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7952 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7953 // Phase 3, inputs and outputs
7954 model->identifyInputsAndOutputs(
7955 {op1},
7956 {op2});
7957 assert(model->isValid());
7958 }
7959
is_ignored_axis_dynamic_output_shape_dim4_axis1_2(int i)7960 inline bool is_ignored_axis_dynamic_output_shape_dim4_axis1_2(int i) {
7961 static std::set<int> ignore = {};
7962 return ignore.find(i) != ignore.end();
7963 }
7964
CreateModel_axis_dynamic_output_shape_dim4_axis1_neg_2(Model * model)7965 void CreateModel_axis_dynamic_output_shape_dim4_axis1_neg_2(Model *model) {
7966 OperandType type1(Type::INT32, {});
7967 OperandType type2(Type::FLOAT32, {});
7968 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
7969 OperandType type34(Type::TENSOR_FLOAT32, {2, 5, 2, 2});
7970 // Phase 1, operands
7971 auto op1 = model->addOperand(&type34);
7972 auto param3 = model->addOperand(&type2);
7973 auto axis = model->addOperand(&type1);
7974 auto op2 = model->addOperand(&type25);
7975 // Phase 2, operations
7976 static float param3_init[] = {1e-06f};
7977 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
7978 static int32_t axis_init[] = {-3};
7979 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
7980 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
7981 // Phase 3, inputs and outputs
7982 model->identifyInputsAndOutputs(
7983 {op1},
7984 {op2});
7985 assert(model->isValid());
7986 }
7987
is_ignored_axis_dynamic_output_shape_dim4_axis1_neg_2(int i)7988 inline bool is_ignored_axis_dynamic_output_shape_dim4_axis1_neg_2(int i) {
7989 static std::set<int> ignore = {};
7990 return ignore.find(i) != ignore.end();
7991 }
7992
CreateModel_axis_dynamic_output_shape_dim4_axis2_2(Model * model)7993 void CreateModel_axis_dynamic_output_shape_dim4_axis2_2(Model *model) {
7994 OperandType type1(Type::INT32, {});
7995 OperandType type2(Type::FLOAT32, {});
7996 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
7997 OperandType type35(Type::TENSOR_FLOAT32, {2, 2, 5, 2});
7998 // Phase 1, operands
7999 auto op1 = model->addOperand(&type35);
8000 auto param3 = model->addOperand(&type2);
8001 auto axis = model->addOperand(&type1);
8002 auto op2 = model->addOperand(&type25);
8003 // Phase 2, operations
8004 static float param3_init[] = {1e-06f};
8005 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8006 static int32_t axis_init[] = {2};
8007 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8008 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8009 // Phase 3, inputs and outputs
8010 model->identifyInputsAndOutputs(
8011 {op1},
8012 {op2});
8013 assert(model->isValid());
8014 }
8015
is_ignored_axis_dynamic_output_shape_dim4_axis2_2(int i)8016 inline bool is_ignored_axis_dynamic_output_shape_dim4_axis2_2(int i) {
8017 static std::set<int> ignore = {};
8018 return ignore.find(i) != ignore.end();
8019 }
8020
CreateModel_axis_dynamic_output_shape_dim4_axis2_neg_2(Model * model)8021 void CreateModel_axis_dynamic_output_shape_dim4_axis2_neg_2(Model *model) {
8022 OperandType type1(Type::INT32, {});
8023 OperandType type2(Type::FLOAT32, {});
8024 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
8025 OperandType type35(Type::TENSOR_FLOAT32, {2, 2, 5, 2});
8026 // Phase 1, operands
8027 auto op1 = model->addOperand(&type35);
8028 auto param3 = model->addOperand(&type2);
8029 auto axis = model->addOperand(&type1);
8030 auto op2 = model->addOperand(&type25);
8031 // Phase 2, operations
8032 static float param3_init[] = {1e-06f};
8033 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8034 static int32_t axis_init[] = {-2};
8035 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8036 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8037 // Phase 3, inputs and outputs
8038 model->identifyInputsAndOutputs(
8039 {op1},
8040 {op2});
8041 assert(model->isValid());
8042 }
8043
is_ignored_axis_dynamic_output_shape_dim4_axis2_neg_2(int i)8044 inline bool is_ignored_axis_dynamic_output_shape_dim4_axis2_neg_2(int i) {
8045 static std::set<int> ignore = {};
8046 return ignore.find(i) != ignore.end();
8047 }
8048
CreateModel_axis_dynamic_output_shape_dim4_axis3_2(Model * model)8049 void CreateModel_axis_dynamic_output_shape_dim4_axis3_2(Model *model) {
8050 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
8051 OperandType type1(Type::INT32, {});
8052 OperandType type2(Type::FLOAT32, {});
8053 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
8054 // Phase 1, operands
8055 auto op1 = model->addOperand(&type0);
8056 auto param3 = model->addOperand(&type2);
8057 auto axis = model->addOperand(&type1);
8058 auto op2 = model->addOperand(&type25);
8059 // Phase 2, operations
8060 static float param3_init[] = {1e-06f};
8061 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8062 static int32_t axis_init[] = {3};
8063 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8064 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8065 // Phase 3, inputs and outputs
8066 model->identifyInputsAndOutputs(
8067 {op1},
8068 {op2});
8069 assert(model->isValid());
8070 }
8071
is_ignored_axis_dynamic_output_shape_dim4_axis3_2(int i)8072 inline bool is_ignored_axis_dynamic_output_shape_dim4_axis3_2(int i) {
8073 static std::set<int> ignore = {};
8074 return ignore.find(i) != ignore.end();
8075 }
8076
CreateModel_axis_dynamic_output_shape_dim4_axis3_neg_2(Model * model)8077 void CreateModel_axis_dynamic_output_shape_dim4_axis3_neg_2(Model *model) {
8078 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
8079 OperandType type1(Type::INT32, {});
8080 OperandType type2(Type::FLOAT32, {});
8081 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
8082 // Phase 1, operands
8083 auto op1 = model->addOperand(&type0);
8084 auto param3 = model->addOperand(&type2);
8085 auto axis = model->addOperand(&type1);
8086 auto op2 = model->addOperand(&type25);
8087 // Phase 2, operations
8088 static float param3_init[] = {1e-06f};
8089 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8090 static int32_t axis_init[] = {-1};
8091 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8092 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8093 // Phase 3, inputs and outputs
8094 model->identifyInputsAndOutputs(
8095 {op1},
8096 {op2});
8097 assert(model->isValid());
8098 }
8099
is_ignored_axis_dynamic_output_shape_dim4_axis3_neg_2(int i)8100 inline bool is_ignored_axis_dynamic_output_shape_dim4_axis3_neg_2(int i) {
8101 static std::set<int> ignore = {};
8102 return ignore.find(i) != ignore.end();
8103 }
8104
CreateModel_axis_dynamic_output_shape_dim3_axis0_2(Model * model)8105 void CreateModel_axis_dynamic_output_shape_dim3_axis0_2(Model *model) {
8106 OperandType type1(Type::INT32, {});
8107 OperandType type2(Type::FLOAT32, {});
8108 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
8109 OperandType type36(Type::TENSOR_FLOAT32, {5, 2, 2});
8110 // Phase 1, operands
8111 auto op1 = model->addOperand(&type36);
8112 auto param3 = model->addOperand(&type2);
8113 auto axis = model->addOperand(&type1);
8114 auto op2 = model->addOperand(&type26);
8115 // Phase 2, operations
8116 static float param3_init[] = {1e-06f};
8117 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8118 static int32_t axis_init[] = {0};
8119 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8120 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8121 // Phase 3, inputs and outputs
8122 model->identifyInputsAndOutputs(
8123 {op1},
8124 {op2});
8125 assert(model->isValid());
8126 }
8127
is_ignored_axis_dynamic_output_shape_dim3_axis0_2(int i)8128 inline bool is_ignored_axis_dynamic_output_shape_dim3_axis0_2(int i) {
8129 static std::set<int> ignore = {};
8130 return ignore.find(i) != ignore.end();
8131 }
8132
CreateModel_axis_dynamic_output_shape_dim3_axis0_neg_2(Model * model)8133 void CreateModel_axis_dynamic_output_shape_dim3_axis0_neg_2(Model *model) {
8134 OperandType type1(Type::INT32, {});
8135 OperandType type2(Type::FLOAT32, {});
8136 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
8137 OperandType type36(Type::TENSOR_FLOAT32, {5, 2, 2});
8138 // Phase 1, operands
8139 auto op1 = model->addOperand(&type36);
8140 auto param3 = model->addOperand(&type2);
8141 auto axis = model->addOperand(&type1);
8142 auto op2 = model->addOperand(&type26);
8143 // Phase 2, operations
8144 static float param3_init[] = {1e-06f};
8145 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8146 static int32_t axis_init[] = {-3};
8147 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8148 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8149 // Phase 3, inputs and outputs
8150 model->identifyInputsAndOutputs(
8151 {op1},
8152 {op2});
8153 assert(model->isValid());
8154 }
8155
is_ignored_axis_dynamic_output_shape_dim3_axis0_neg_2(int i)8156 inline bool is_ignored_axis_dynamic_output_shape_dim3_axis0_neg_2(int i) {
8157 static std::set<int> ignore = {};
8158 return ignore.find(i) != ignore.end();
8159 }
8160
CreateModel_axis_dynamic_output_shape_dim3_axis1_2(Model * model)8161 void CreateModel_axis_dynamic_output_shape_dim3_axis1_2(Model *model) {
8162 OperandType type1(Type::INT32, {});
8163 OperandType type2(Type::FLOAT32, {});
8164 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
8165 OperandType type37(Type::TENSOR_FLOAT32, {2, 5, 2});
8166 // Phase 1, operands
8167 auto op1 = model->addOperand(&type37);
8168 auto param3 = model->addOperand(&type2);
8169 auto axis = model->addOperand(&type1);
8170 auto op2 = model->addOperand(&type26);
8171 // Phase 2, operations
8172 static float param3_init[] = {1e-06f};
8173 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8174 static int32_t axis_init[] = {1};
8175 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8176 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8177 // Phase 3, inputs and outputs
8178 model->identifyInputsAndOutputs(
8179 {op1},
8180 {op2});
8181 assert(model->isValid());
8182 }
8183
is_ignored_axis_dynamic_output_shape_dim3_axis1_2(int i)8184 inline bool is_ignored_axis_dynamic_output_shape_dim3_axis1_2(int i) {
8185 static std::set<int> ignore = {};
8186 return ignore.find(i) != ignore.end();
8187 }
8188
CreateModel_axis_dynamic_output_shape_dim3_axis1_neg_2(Model * model)8189 void CreateModel_axis_dynamic_output_shape_dim3_axis1_neg_2(Model *model) {
8190 OperandType type1(Type::INT32, {});
8191 OperandType type2(Type::FLOAT32, {});
8192 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
8193 OperandType type37(Type::TENSOR_FLOAT32, {2, 5, 2});
8194 // Phase 1, operands
8195 auto op1 = model->addOperand(&type37);
8196 auto param3 = model->addOperand(&type2);
8197 auto axis = model->addOperand(&type1);
8198 auto op2 = model->addOperand(&type26);
8199 // Phase 2, operations
8200 static float param3_init[] = {1e-06f};
8201 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8202 static int32_t axis_init[] = {-2};
8203 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8204 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8205 // Phase 3, inputs and outputs
8206 model->identifyInputsAndOutputs(
8207 {op1},
8208 {op2});
8209 assert(model->isValid());
8210 }
8211
is_ignored_axis_dynamic_output_shape_dim3_axis1_neg_2(int i)8212 inline bool is_ignored_axis_dynamic_output_shape_dim3_axis1_neg_2(int i) {
8213 static std::set<int> ignore = {};
8214 return ignore.find(i) != ignore.end();
8215 }
8216
CreateModel_axis_dynamic_output_shape_dim3_axis2_2(Model * model)8217 void CreateModel_axis_dynamic_output_shape_dim3_axis2_2(Model *model) {
8218 OperandType type1(Type::INT32, {});
8219 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
8220 OperandType type2(Type::FLOAT32, {});
8221 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
8222 // Phase 1, operands
8223 auto op1 = model->addOperand(&type13);
8224 auto param3 = model->addOperand(&type2);
8225 auto axis = model->addOperand(&type1);
8226 auto op2 = model->addOperand(&type26);
8227 // Phase 2, operations
8228 static float param3_init[] = {1e-06f};
8229 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8230 static int32_t axis_init[] = {2};
8231 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8232 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8233 // Phase 3, inputs and outputs
8234 model->identifyInputsAndOutputs(
8235 {op1},
8236 {op2});
8237 assert(model->isValid());
8238 }
8239
is_ignored_axis_dynamic_output_shape_dim3_axis2_2(int i)8240 inline bool is_ignored_axis_dynamic_output_shape_dim3_axis2_2(int i) {
8241 static std::set<int> ignore = {};
8242 return ignore.find(i) != ignore.end();
8243 }
8244
CreateModel_axis_dynamic_output_shape_dim3_axis2_neg_2(Model * model)8245 void CreateModel_axis_dynamic_output_shape_dim3_axis2_neg_2(Model *model) {
8246 OperandType type1(Type::INT32, {});
8247 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
8248 OperandType type2(Type::FLOAT32, {});
8249 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
8250 // Phase 1, operands
8251 auto op1 = model->addOperand(&type13);
8252 auto param3 = model->addOperand(&type2);
8253 auto axis = model->addOperand(&type1);
8254 auto op2 = model->addOperand(&type26);
8255 // Phase 2, operations
8256 static float param3_init[] = {1e-06f};
8257 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8258 static int32_t axis_init[] = {-1};
8259 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8260 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8261 // Phase 3, inputs and outputs
8262 model->identifyInputsAndOutputs(
8263 {op1},
8264 {op2});
8265 assert(model->isValid());
8266 }
8267
is_ignored_axis_dynamic_output_shape_dim3_axis2_neg_2(int i)8268 inline bool is_ignored_axis_dynamic_output_shape_dim3_axis2_neg_2(int i) {
8269 static std::set<int> ignore = {};
8270 return ignore.find(i) != ignore.end();
8271 }
8272
CreateModel_axis_dynamic_output_shape_dim2_axis0_2(Model * model)8273 void CreateModel_axis_dynamic_output_shape_dim2_axis0_2(Model *model) {
8274 OperandType type1(Type::INT32, {});
8275 OperandType type2(Type::FLOAT32, {});
8276 OperandType type38(Type::TENSOR_FLOAT32, {5, 2});
8277 OperandType type61(Type::TENSOR_FLOAT32, {0, 0});
8278 // Phase 1, operands
8279 auto op1 = model->addOperand(&type38);
8280 auto param3 = model->addOperand(&type2);
8281 auto axis = model->addOperand(&type1);
8282 auto op2 = model->addOperand(&type61);
8283 // Phase 2, operations
8284 static float param3_init[] = {1e-06f};
8285 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8286 static int32_t axis_init[] = {0};
8287 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8288 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8289 // Phase 3, inputs and outputs
8290 model->identifyInputsAndOutputs(
8291 {op1},
8292 {op2});
8293 assert(model->isValid());
8294 }
8295
is_ignored_axis_dynamic_output_shape_dim2_axis0_2(int i)8296 inline bool is_ignored_axis_dynamic_output_shape_dim2_axis0_2(int i) {
8297 static std::set<int> ignore = {};
8298 return ignore.find(i) != ignore.end();
8299 }
8300
CreateModel_axis_dynamic_output_shape_dim2_axis0_neg_2(Model * model)8301 void CreateModel_axis_dynamic_output_shape_dim2_axis0_neg_2(Model *model) {
8302 OperandType type1(Type::INT32, {});
8303 OperandType type2(Type::FLOAT32, {});
8304 OperandType type38(Type::TENSOR_FLOAT32, {5, 2});
8305 OperandType type61(Type::TENSOR_FLOAT32, {0, 0});
8306 // Phase 1, operands
8307 auto op1 = model->addOperand(&type38);
8308 auto param3 = model->addOperand(&type2);
8309 auto axis = model->addOperand(&type1);
8310 auto op2 = model->addOperand(&type61);
8311 // Phase 2, operations
8312 static float param3_init[] = {1e-06f};
8313 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8314 static int32_t axis_init[] = {-2};
8315 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8316 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8317 // Phase 3, inputs and outputs
8318 model->identifyInputsAndOutputs(
8319 {op1},
8320 {op2});
8321 assert(model->isValid());
8322 }
8323
is_ignored_axis_dynamic_output_shape_dim2_axis0_neg_2(int i)8324 inline bool is_ignored_axis_dynamic_output_shape_dim2_axis0_neg_2(int i) {
8325 static std::set<int> ignore = {};
8326 return ignore.find(i) != ignore.end();
8327 }
8328
CreateModel_axis_dynamic_output_shape_dim2_axis1_2(Model * model)8329 void CreateModel_axis_dynamic_output_shape_dim2_axis1_2(Model *model) {
8330 OperandType type1(Type::INT32, {});
8331 OperandType type2(Type::FLOAT32, {});
8332 OperandType type39(Type::TENSOR_FLOAT32, {2, 5});
8333 OperandType type61(Type::TENSOR_FLOAT32, {0, 0});
8334 // Phase 1, operands
8335 auto op1 = model->addOperand(&type39);
8336 auto param3 = model->addOperand(&type2);
8337 auto axis = model->addOperand(&type1);
8338 auto op2 = model->addOperand(&type61);
8339 // Phase 2, operations
8340 static float param3_init[] = {1e-06f};
8341 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8342 static int32_t axis_init[] = {1};
8343 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8344 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8345 // Phase 3, inputs and outputs
8346 model->identifyInputsAndOutputs(
8347 {op1},
8348 {op2});
8349 assert(model->isValid());
8350 }
8351
is_ignored_axis_dynamic_output_shape_dim2_axis1_2(int i)8352 inline bool is_ignored_axis_dynamic_output_shape_dim2_axis1_2(int i) {
8353 static std::set<int> ignore = {};
8354 return ignore.find(i) != ignore.end();
8355 }
8356
CreateModel_axis_dynamic_output_shape_dim2_axis1_neg_2(Model * model)8357 void CreateModel_axis_dynamic_output_shape_dim2_axis1_neg_2(Model *model) {
8358 OperandType type1(Type::INT32, {});
8359 OperandType type2(Type::FLOAT32, {});
8360 OperandType type39(Type::TENSOR_FLOAT32, {2, 5});
8361 OperandType type61(Type::TENSOR_FLOAT32, {0, 0});
8362 // Phase 1, operands
8363 auto op1 = model->addOperand(&type39);
8364 auto param3 = model->addOperand(&type2);
8365 auto axis = model->addOperand(&type1);
8366 auto op2 = model->addOperand(&type61);
8367 // Phase 2, operations
8368 static float param3_init[] = {1e-06f};
8369 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8370 static int32_t axis_init[] = {-1};
8371 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8372 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8373 // Phase 3, inputs and outputs
8374 model->identifyInputsAndOutputs(
8375 {op1},
8376 {op2});
8377 assert(model->isValid());
8378 }
8379
is_ignored_axis_dynamic_output_shape_dim2_axis1_neg_2(int i)8380 inline bool is_ignored_axis_dynamic_output_shape_dim2_axis1_neg_2(int i) {
8381 static std::set<int> ignore = {};
8382 return ignore.find(i) != ignore.end();
8383 }
8384
CreateModel_axis_dynamic_output_shape_dim1_axis0_2(Model * model)8385 void CreateModel_axis_dynamic_output_shape_dim1_axis0_2(Model *model) {
8386 OperandType type1(Type::INT32, {});
8387 OperandType type12(Type::TENSOR_FLOAT32, {5});
8388 OperandType type2(Type::FLOAT32, {});
8389 OperandType type5(Type::TENSOR_FLOAT32, {0});
8390 // Phase 1, operands
8391 auto op1 = model->addOperand(&type12);
8392 auto param3 = model->addOperand(&type2);
8393 auto axis = model->addOperand(&type1);
8394 auto op2 = model->addOperand(&type5);
8395 // Phase 2, operations
8396 static float param3_init[] = {1e-06f};
8397 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8398 static int32_t axis_init[] = {0};
8399 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8400 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8401 // Phase 3, inputs and outputs
8402 model->identifyInputsAndOutputs(
8403 {op1},
8404 {op2});
8405 assert(model->isValid());
8406 }
8407
is_ignored_axis_dynamic_output_shape_dim1_axis0_2(int i)8408 inline bool is_ignored_axis_dynamic_output_shape_dim1_axis0_2(int i) {
8409 static std::set<int> ignore = {};
8410 return ignore.find(i) != ignore.end();
8411 }
8412
CreateModel_axis_dynamic_output_shape_dim1_axis0_neg_2(Model * model)8413 void CreateModel_axis_dynamic_output_shape_dim1_axis0_neg_2(Model *model) {
8414 OperandType type1(Type::INT32, {});
8415 OperandType type12(Type::TENSOR_FLOAT32, {5});
8416 OperandType type2(Type::FLOAT32, {});
8417 OperandType type5(Type::TENSOR_FLOAT32, {0});
8418 // Phase 1, operands
8419 auto op1 = model->addOperand(&type12);
8420 auto param3 = model->addOperand(&type2);
8421 auto axis = model->addOperand(&type1);
8422 auto op2 = model->addOperand(&type5);
8423 // Phase 2, operations
8424 static float param3_init[] = {1e-06f};
8425 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8426 static int32_t axis_init[] = {-1};
8427 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8428 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8429 // Phase 3, inputs and outputs
8430 model->identifyInputsAndOutputs(
8431 {op1},
8432 {op2});
8433 assert(model->isValid());
8434 }
8435
is_ignored_axis_dynamic_output_shape_dim1_axis0_neg_2(int i)8436 inline bool is_ignored_axis_dynamic_output_shape_dim1_axis0_neg_2(int i) {
8437 static std::set<int> ignore = {};
8438 return ignore.find(i) != ignore.end();
8439 }
8440
CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis0_2(Model * model)8441 void CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis0_2(Model *model) {
8442 OperandType type1(Type::INT32, {});
8443 OperandType type2(Type::FLOAT32, {});
8444 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
8445 OperandType type33(Type::TENSOR_FLOAT32, {5, 2, 2, 2});
8446 // Phase 1, operands
8447 auto op1 = model->addOperand(&type33);
8448 auto param3 = model->addOperand(&type2);
8449 auto axis = model->addOperand(&type1);
8450 auto op2 = model->addOperand(&type25);
8451 // Phase 2, operations
8452 static float param3_init[] = {1e-06f};
8453 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8454 static int32_t axis_init[] = {0};
8455 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8456 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8457 // Phase 3, inputs and outputs
8458 model->identifyInputsAndOutputs(
8459 {op1},
8460 {op2});
8461 // Phase 4: set relaxed execution
8462 model->relaxComputationFloat32toFloat16(true);
8463 assert(model->isValid());
8464 }
8465
is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis0_2(int i)8466 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis0_2(int i) {
8467 static std::set<int> ignore = {};
8468 return ignore.find(i) != ignore.end();
8469 }
8470
CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis0_neg_2(Model * model)8471 void CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis0_neg_2(Model *model) {
8472 OperandType type1(Type::INT32, {});
8473 OperandType type2(Type::FLOAT32, {});
8474 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
8475 OperandType type33(Type::TENSOR_FLOAT32, {5, 2, 2, 2});
8476 // Phase 1, operands
8477 auto op1 = model->addOperand(&type33);
8478 auto param3 = model->addOperand(&type2);
8479 auto axis = model->addOperand(&type1);
8480 auto op2 = model->addOperand(&type25);
8481 // Phase 2, operations
8482 static float param3_init[] = {1e-06f};
8483 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8484 static int32_t axis_init[] = {-4};
8485 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8486 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8487 // Phase 3, inputs and outputs
8488 model->identifyInputsAndOutputs(
8489 {op1},
8490 {op2});
8491 // Phase 4: set relaxed execution
8492 model->relaxComputationFloat32toFloat16(true);
8493 assert(model->isValid());
8494 }
8495
is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis0_neg_2(int i)8496 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis0_neg_2(int i) {
8497 static std::set<int> ignore = {};
8498 return ignore.find(i) != ignore.end();
8499 }
8500
CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis1_2(Model * model)8501 void CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis1_2(Model *model) {
8502 OperandType type1(Type::INT32, {});
8503 OperandType type2(Type::FLOAT32, {});
8504 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
8505 OperandType type34(Type::TENSOR_FLOAT32, {2, 5, 2, 2});
8506 // Phase 1, operands
8507 auto op1 = model->addOperand(&type34);
8508 auto param3 = model->addOperand(&type2);
8509 auto axis = model->addOperand(&type1);
8510 auto op2 = model->addOperand(&type25);
8511 // Phase 2, operations
8512 static float param3_init[] = {1e-06f};
8513 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8514 static int32_t axis_init[] = {1};
8515 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8516 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8517 // Phase 3, inputs and outputs
8518 model->identifyInputsAndOutputs(
8519 {op1},
8520 {op2});
8521 // Phase 4: set relaxed execution
8522 model->relaxComputationFloat32toFloat16(true);
8523 assert(model->isValid());
8524 }
8525
is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis1_2(int i)8526 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis1_2(int i) {
8527 static std::set<int> ignore = {};
8528 return ignore.find(i) != ignore.end();
8529 }
8530
CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis1_neg_2(Model * model)8531 void CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis1_neg_2(Model *model) {
8532 OperandType type1(Type::INT32, {});
8533 OperandType type2(Type::FLOAT32, {});
8534 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
8535 OperandType type34(Type::TENSOR_FLOAT32, {2, 5, 2, 2});
8536 // Phase 1, operands
8537 auto op1 = model->addOperand(&type34);
8538 auto param3 = model->addOperand(&type2);
8539 auto axis = model->addOperand(&type1);
8540 auto op2 = model->addOperand(&type25);
8541 // Phase 2, operations
8542 static float param3_init[] = {1e-06f};
8543 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8544 static int32_t axis_init[] = {-3};
8545 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8546 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8547 // Phase 3, inputs and outputs
8548 model->identifyInputsAndOutputs(
8549 {op1},
8550 {op2});
8551 // Phase 4: set relaxed execution
8552 model->relaxComputationFloat32toFloat16(true);
8553 assert(model->isValid());
8554 }
8555
is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis1_neg_2(int i)8556 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis1_neg_2(int i) {
8557 static std::set<int> ignore = {};
8558 return ignore.find(i) != ignore.end();
8559 }
8560
CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis2_2(Model * model)8561 void CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis2_2(Model *model) {
8562 OperandType type1(Type::INT32, {});
8563 OperandType type2(Type::FLOAT32, {});
8564 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
8565 OperandType type35(Type::TENSOR_FLOAT32, {2, 2, 5, 2});
8566 // Phase 1, operands
8567 auto op1 = model->addOperand(&type35);
8568 auto param3 = model->addOperand(&type2);
8569 auto axis = model->addOperand(&type1);
8570 auto op2 = model->addOperand(&type25);
8571 // Phase 2, operations
8572 static float param3_init[] = {1e-06f};
8573 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8574 static int32_t axis_init[] = {2};
8575 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8576 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8577 // Phase 3, inputs and outputs
8578 model->identifyInputsAndOutputs(
8579 {op1},
8580 {op2});
8581 // Phase 4: set relaxed execution
8582 model->relaxComputationFloat32toFloat16(true);
8583 assert(model->isValid());
8584 }
8585
is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis2_2(int i)8586 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis2_2(int i) {
8587 static std::set<int> ignore = {};
8588 return ignore.find(i) != ignore.end();
8589 }
8590
CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis2_neg_2(Model * model)8591 void CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis2_neg_2(Model *model) {
8592 OperandType type1(Type::INT32, {});
8593 OperandType type2(Type::FLOAT32, {});
8594 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
8595 OperandType type35(Type::TENSOR_FLOAT32, {2, 2, 5, 2});
8596 // Phase 1, operands
8597 auto op1 = model->addOperand(&type35);
8598 auto param3 = model->addOperand(&type2);
8599 auto axis = model->addOperand(&type1);
8600 auto op2 = model->addOperand(&type25);
8601 // Phase 2, operations
8602 static float param3_init[] = {1e-06f};
8603 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8604 static int32_t axis_init[] = {-2};
8605 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8606 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8607 // Phase 3, inputs and outputs
8608 model->identifyInputsAndOutputs(
8609 {op1},
8610 {op2});
8611 // Phase 4: set relaxed execution
8612 model->relaxComputationFloat32toFloat16(true);
8613 assert(model->isValid());
8614 }
8615
is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis2_neg_2(int i)8616 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis2_neg_2(int i) {
8617 static std::set<int> ignore = {};
8618 return ignore.find(i) != ignore.end();
8619 }
8620
CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis3_2(Model * model)8621 void CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis3_2(Model *model) {
8622 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
8623 OperandType type1(Type::INT32, {});
8624 OperandType type2(Type::FLOAT32, {});
8625 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
8626 // Phase 1, operands
8627 auto op1 = model->addOperand(&type0);
8628 auto param3 = model->addOperand(&type2);
8629 auto axis = model->addOperand(&type1);
8630 auto op2 = model->addOperand(&type25);
8631 // Phase 2, operations
8632 static float param3_init[] = {1e-06f};
8633 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8634 static int32_t axis_init[] = {3};
8635 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8636 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8637 // Phase 3, inputs and outputs
8638 model->identifyInputsAndOutputs(
8639 {op1},
8640 {op2});
8641 // Phase 4: set relaxed execution
8642 model->relaxComputationFloat32toFloat16(true);
8643 assert(model->isValid());
8644 }
8645
is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis3_2(int i)8646 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis3_2(int i) {
8647 static std::set<int> ignore = {};
8648 return ignore.find(i) != ignore.end();
8649 }
8650
CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis3_neg_2(Model * model)8651 void CreateModel_axis_dynamic_output_shape_relaxed_dim4_axis3_neg_2(Model *model) {
8652 OperandType type0(Type::TENSOR_FLOAT32, {2, 2, 2, 5});
8653 OperandType type1(Type::INT32, {});
8654 OperandType type2(Type::FLOAT32, {});
8655 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
8656 // Phase 1, operands
8657 auto op1 = model->addOperand(&type0);
8658 auto param3 = model->addOperand(&type2);
8659 auto axis = model->addOperand(&type1);
8660 auto op2 = model->addOperand(&type25);
8661 // Phase 2, operations
8662 static float param3_init[] = {1e-06f};
8663 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8664 static int32_t axis_init[] = {-1};
8665 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8666 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8667 // Phase 3, inputs and outputs
8668 model->identifyInputsAndOutputs(
8669 {op1},
8670 {op2});
8671 // Phase 4: set relaxed execution
8672 model->relaxComputationFloat32toFloat16(true);
8673 assert(model->isValid());
8674 }
8675
is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis3_neg_2(int i)8676 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim4_axis3_neg_2(int i) {
8677 static std::set<int> ignore = {};
8678 return ignore.find(i) != ignore.end();
8679 }
8680
CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis0_2(Model * model)8681 void CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis0_2(Model *model) {
8682 OperandType type1(Type::INT32, {});
8683 OperandType type2(Type::FLOAT32, {});
8684 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
8685 OperandType type36(Type::TENSOR_FLOAT32, {5, 2, 2});
8686 // Phase 1, operands
8687 auto op1 = model->addOperand(&type36);
8688 auto param3 = model->addOperand(&type2);
8689 auto axis = model->addOperand(&type1);
8690 auto op2 = model->addOperand(&type26);
8691 // Phase 2, operations
8692 static float param3_init[] = {1e-06f};
8693 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8694 static int32_t axis_init[] = {0};
8695 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8696 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8697 // Phase 3, inputs and outputs
8698 model->identifyInputsAndOutputs(
8699 {op1},
8700 {op2});
8701 // Phase 4: set relaxed execution
8702 model->relaxComputationFloat32toFloat16(true);
8703 assert(model->isValid());
8704 }
8705
is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis0_2(int i)8706 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis0_2(int i) {
8707 static std::set<int> ignore = {};
8708 return ignore.find(i) != ignore.end();
8709 }
8710
CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis0_neg_2(Model * model)8711 void CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis0_neg_2(Model *model) {
8712 OperandType type1(Type::INT32, {});
8713 OperandType type2(Type::FLOAT32, {});
8714 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
8715 OperandType type36(Type::TENSOR_FLOAT32, {5, 2, 2});
8716 // Phase 1, operands
8717 auto op1 = model->addOperand(&type36);
8718 auto param3 = model->addOperand(&type2);
8719 auto axis = model->addOperand(&type1);
8720 auto op2 = model->addOperand(&type26);
8721 // Phase 2, operations
8722 static float param3_init[] = {1e-06f};
8723 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8724 static int32_t axis_init[] = {-3};
8725 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8726 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8727 // Phase 3, inputs and outputs
8728 model->identifyInputsAndOutputs(
8729 {op1},
8730 {op2});
8731 // Phase 4: set relaxed execution
8732 model->relaxComputationFloat32toFloat16(true);
8733 assert(model->isValid());
8734 }
8735
is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis0_neg_2(int i)8736 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis0_neg_2(int i) {
8737 static std::set<int> ignore = {};
8738 return ignore.find(i) != ignore.end();
8739 }
8740
CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis1_2(Model * model)8741 void CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis1_2(Model *model) {
8742 OperandType type1(Type::INT32, {});
8743 OperandType type2(Type::FLOAT32, {});
8744 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
8745 OperandType type37(Type::TENSOR_FLOAT32, {2, 5, 2});
8746 // Phase 1, operands
8747 auto op1 = model->addOperand(&type37);
8748 auto param3 = model->addOperand(&type2);
8749 auto axis = model->addOperand(&type1);
8750 auto op2 = model->addOperand(&type26);
8751 // Phase 2, operations
8752 static float param3_init[] = {1e-06f};
8753 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8754 static int32_t axis_init[] = {1};
8755 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8756 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8757 // Phase 3, inputs and outputs
8758 model->identifyInputsAndOutputs(
8759 {op1},
8760 {op2});
8761 // Phase 4: set relaxed execution
8762 model->relaxComputationFloat32toFloat16(true);
8763 assert(model->isValid());
8764 }
8765
is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis1_2(int i)8766 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis1_2(int i) {
8767 static std::set<int> ignore = {};
8768 return ignore.find(i) != ignore.end();
8769 }
8770
CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis1_neg_2(Model * model)8771 void CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis1_neg_2(Model *model) {
8772 OperandType type1(Type::INT32, {});
8773 OperandType type2(Type::FLOAT32, {});
8774 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
8775 OperandType type37(Type::TENSOR_FLOAT32, {2, 5, 2});
8776 // Phase 1, operands
8777 auto op1 = model->addOperand(&type37);
8778 auto param3 = model->addOperand(&type2);
8779 auto axis = model->addOperand(&type1);
8780 auto op2 = model->addOperand(&type26);
8781 // Phase 2, operations
8782 static float param3_init[] = {1e-06f};
8783 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8784 static int32_t axis_init[] = {-2};
8785 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8786 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8787 // Phase 3, inputs and outputs
8788 model->identifyInputsAndOutputs(
8789 {op1},
8790 {op2});
8791 // Phase 4: set relaxed execution
8792 model->relaxComputationFloat32toFloat16(true);
8793 assert(model->isValid());
8794 }
8795
is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis1_neg_2(int i)8796 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis1_neg_2(int i) {
8797 static std::set<int> ignore = {};
8798 return ignore.find(i) != ignore.end();
8799 }
8800
CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis2_2(Model * model)8801 void CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis2_2(Model *model) {
8802 OperandType type1(Type::INT32, {});
8803 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
8804 OperandType type2(Type::FLOAT32, {});
8805 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
8806 // Phase 1, operands
8807 auto op1 = model->addOperand(&type13);
8808 auto param3 = model->addOperand(&type2);
8809 auto axis = model->addOperand(&type1);
8810 auto op2 = model->addOperand(&type26);
8811 // Phase 2, operations
8812 static float param3_init[] = {1e-06f};
8813 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8814 static int32_t axis_init[] = {2};
8815 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8816 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8817 // Phase 3, inputs and outputs
8818 model->identifyInputsAndOutputs(
8819 {op1},
8820 {op2});
8821 // Phase 4: set relaxed execution
8822 model->relaxComputationFloat32toFloat16(true);
8823 assert(model->isValid());
8824 }
8825
is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis2_2(int i)8826 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis2_2(int i) {
8827 static std::set<int> ignore = {};
8828 return ignore.find(i) != ignore.end();
8829 }
8830
CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis2_neg_2(Model * model)8831 void CreateModel_axis_dynamic_output_shape_relaxed_dim3_axis2_neg_2(Model *model) {
8832 OperandType type1(Type::INT32, {});
8833 OperandType type13(Type::TENSOR_FLOAT32, {2, 2, 5});
8834 OperandType type2(Type::FLOAT32, {});
8835 OperandType type26(Type::TENSOR_FLOAT32, {0, 0, 0});
8836 // Phase 1, operands
8837 auto op1 = model->addOperand(&type13);
8838 auto param3 = model->addOperand(&type2);
8839 auto axis = model->addOperand(&type1);
8840 auto op2 = model->addOperand(&type26);
8841 // Phase 2, operations
8842 static float param3_init[] = {1e-06f};
8843 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8844 static int32_t axis_init[] = {-1};
8845 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8846 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8847 // Phase 3, inputs and outputs
8848 model->identifyInputsAndOutputs(
8849 {op1},
8850 {op2});
8851 // Phase 4: set relaxed execution
8852 model->relaxComputationFloat32toFloat16(true);
8853 assert(model->isValid());
8854 }
8855
is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis2_neg_2(int i)8856 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim3_axis2_neg_2(int i) {
8857 static std::set<int> ignore = {};
8858 return ignore.find(i) != ignore.end();
8859 }
8860
CreateModel_axis_dynamic_output_shape_relaxed_dim2_axis0_2(Model * model)8861 void CreateModel_axis_dynamic_output_shape_relaxed_dim2_axis0_2(Model *model) {
8862 OperandType type1(Type::INT32, {});
8863 OperandType type2(Type::FLOAT32, {});
8864 OperandType type38(Type::TENSOR_FLOAT32, {5, 2});
8865 OperandType type61(Type::TENSOR_FLOAT32, {0, 0});
8866 // Phase 1, operands
8867 auto op1 = model->addOperand(&type38);
8868 auto param3 = model->addOperand(&type2);
8869 auto axis = model->addOperand(&type1);
8870 auto op2 = model->addOperand(&type61);
8871 // Phase 2, operations
8872 static float param3_init[] = {1e-06f};
8873 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8874 static int32_t axis_init[] = {0};
8875 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8876 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8877 // Phase 3, inputs and outputs
8878 model->identifyInputsAndOutputs(
8879 {op1},
8880 {op2});
8881 // Phase 4: set relaxed execution
8882 model->relaxComputationFloat32toFloat16(true);
8883 assert(model->isValid());
8884 }
8885
is_ignored_axis_dynamic_output_shape_relaxed_dim2_axis0_2(int i)8886 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim2_axis0_2(int i) {
8887 static std::set<int> ignore = {};
8888 return ignore.find(i) != ignore.end();
8889 }
8890
CreateModel_axis_dynamic_output_shape_relaxed_dim2_axis0_neg_2(Model * model)8891 void CreateModel_axis_dynamic_output_shape_relaxed_dim2_axis0_neg_2(Model *model) {
8892 OperandType type1(Type::INT32, {});
8893 OperandType type2(Type::FLOAT32, {});
8894 OperandType type38(Type::TENSOR_FLOAT32, {5, 2});
8895 OperandType type61(Type::TENSOR_FLOAT32, {0, 0});
8896 // Phase 1, operands
8897 auto op1 = model->addOperand(&type38);
8898 auto param3 = model->addOperand(&type2);
8899 auto axis = model->addOperand(&type1);
8900 auto op2 = model->addOperand(&type61);
8901 // Phase 2, operations
8902 static float param3_init[] = {1e-06f};
8903 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8904 static int32_t axis_init[] = {-2};
8905 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8906 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8907 // Phase 3, inputs and outputs
8908 model->identifyInputsAndOutputs(
8909 {op1},
8910 {op2});
8911 // Phase 4: set relaxed execution
8912 model->relaxComputationFloat32toFloat16(true);
8913 assert(model->isValid());
8914 }
8915
is_ignored_axis_dynamic_output_shape_relaxed_dim2_axis0_neg_2(int i)8916 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim2_axis0_neg_2(int i) {
8917 static std::set<int> ignore = {};
8918 return ignore.find(i) != ignore.end();
8919 }
8920
CreateModel_axis_dynamic_output_shape_relaxed_dim2_axis1_2(Model * model)8921 void CreateModel_axis_dynamic_output_shape_relaxed_dim2_axis1_2(Model *model) {
8922 OperandType type1(Type::INT32, {});
8923 OperandType type2(Type::FLOAT32, {});
8924 OperandType type39(Type::TENSOR_FLOAT32, {2, 5});
8925 OperandType type61(Type::TENSOR_FLOAT32, {0, 0});
8926 // Phase 1, operands
8927 auto op1 = model->addOperand(&type39);
8928 auto param3 = model->addOperand(&type2);
8929 auto axis = model->addOperand(&type1);
8930 auto op2 = model->addOperand(&type61);
8931 // Phase 2, operations
8932 static float param3_init[] = {1e-06f};
8933 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8934 static int32_t axis_init[] = {1};
8935 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8936 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8937 // Phase 3, inputs and outputs
8938 model->identifyInputsAndOutputs(
8939 {op1},
8940 {op2});
8941 // Phase 4: set relaxed execution
8942 model->relaxComputationFloat32toFloat16(true);
8943 assert(model->isValid());
8944 }
8945
is_ignored_axis_dynamic_output_shape_relaxed_dim2_axis1_2(int i)8946 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim2_axis1_2(int i) {
8947 static std::set<int> ignore = {};
8948 return ignore.find(i) != ignore.end();
8949 }
8950
CreateModel_axis_dynamic_output_shape_relaxed_dim2_axis1_neg_2(Model * model)8951 void CreateModel_axis_dynamic_output_shape_relaxed_dim2_axis1_neg_2(Model *model) {
8952 OperandType type1(Type::INT32, {});
8953 OperandType type2(Type::FLOAT32, {});
8954 OperandType type39(Type::TENSOR_FLOAT32, {2, 5});
8955 OperandType type61(Type::TENSOR_FLOAT32, {0, 0});
8956 // Phase 1, operands
8957 auto op1 = model->addOperand(&type39);
8958 auto param3 = model->addOperand(&type2);
8959 auto axis = model->addOperand(&type1);
8960 auto op2 = model->addOperand(&type61);
8961 // Phase 2, operations
8962 static float param3_init[] = {1e-06f};
8963 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8964 static int32_t axis_init[] = {-1};
8965 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8966 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8967 // Phase 3, inputs and outputs
8968 model->identifyInputsAndOutputs(
8969 {op1},
8970 {op2});
8971 // Phase 4: set relaxed execution
8972 model->relaxComputationFloat32toFloat16(true);
8973 assert(model->isValid());
8974 }
8975
is_ignored_axis_dynamic_output_shape_relaxed_dim2_axis1_neg_2(int i)8976 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim2_axis1_neg_2(int i) {
8977 static std::set<int> ignore = {};
8978 return ignore.find(i) != ignore.end();
8979 }
8980
CreateModel_axis_dynamic_output_shape_relaxed_dim1_axis0_2(Model * model)8981 void CreateModel_axis_dynamic_output_shape_relaxed_dim1_axis0_2(Model *model) {
8982 OperandType type1(Type::INT32, {});
8983 OperandType type12(Type::TENSOR_FLOAT32, {5});
8984 OperandType type2(Type::FLOAT32, {});
8985 OperandType type5(Type::TENSOR_FLOAT32, {0});
8986 // Phase 1, operands
8987 auto op1 = model->addOperand(&type12);
8988 auto param3 = model->addOperand(&type2);
8989 auto axis = model->addOperand(&type1);
8990 auto op2 = model->addOperand(&type5);
8991 // Phase 2, operations
8992 static float param3_init[] = {1e-06f};
8993 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
8994 static int32_t axis_init[] = {0};
8995 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
8996 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
8997 // Phase 3, inputs and outputs
8998 model->identifyInputsAndOutputs(
8999 {op1},
9000 {op2});
9001 // Phase 4: set relaxed execution
9002 model->relaxComputationFloat32toFloat16(true);
9003 assert(model->isValid());
9004 }
9005
is_ignored_axis_dynamic_output_shape_relaxed_dim1_axis0_2(int i)9006 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim1_axis0_2(int i) {
9007 static std::set<int> ignore = {};
9008 return ignore.find(i) != ignore.end();
9009 }
9010
CreateModel_axis_dynamic_output_shape_relaxed_dim1_axis0_neg_2(Model * model)9011 void CreateModel_axis_dynamic_output_shape_relaxed_dim1_axis0_neg_2(Model *model) {
9012 OperandType type1(Type::INT32, {});
9013 OperandType type12(Type::TENSOR_FLOAT32, {5});
9014 OperandType type2(Type::FLOAT32, {});
9015 OperandType type5(Type::TENSOR_FLOAT32, {0});
9016 // Phase 1, operands
9017 auto op1 = model->addOperand(&type12);
9018 auto param3 = model->addOperand(&type2);
9019 auto axis = model->addOperand(&type1);
9020 auto op2 = model->addOperand(&type5);
9021 // Phase 2, operations
9022 static float param3_init[] = {1e-06f};
9023 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
9024 static int32_t axis_init[] = {-1};
9025 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9026 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9027 // Phase 3, inputs and outputs
9028 model->identifyInputsAndOutputs(
9029 {op1},
9030 {op2});
9031 // Phase 4: set relaxed execution
9032 model->relaxComputationFloat32toFloat16(true);
9033 assert(model->isValid());
9034 }
9035
is_ignored_axis_dynamic_output_shape_relaxed_dim1_axis0_neg_2(int i)9036 inline bool is_ignored_axis_dynamic_output_shape_relaxed_dim1_axis0_neg_2(int i) {
9037 static std::set<int> ignore = {};
9038 return ignore.find(i) != ignore.end();
9039 }
9040
CreateModel_axis_dynamic_output_shape_float16_dim4_axis0_2(Model * model)9041 void CreateModel_axis_dynamic_output_shape_float16_dim4_axis0_2(Model *model) {
9042 OperandType type1(Type::INT32, {});
9043 OperandType type15(Type::FLOAT16, {});
9044 OperandType type27(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
9045 OperandType type40(Type::TENSOR_FLOAT16, {5, 2, 2, 2});
9046 // Phase 1, operands
9047 auto op1 = model->addOperand(&type40);
9048 auto param3 = model->addOperand(&type15);
9049 auto axis = model->addOperand(&type1);
9050 auto op2 = model->addOperand(&type27);
9051 // Phase 2, operations
9052 static _Float16 param3_init[] = {9.999999974752427e-07f};
9053 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
9054 static int32_t axis_init[] = {0};
9055 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9056 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9057 // Phase 3, inputs and outputs
9058 model->identifyInputsAndOutputs(
9059 {op1},
9060 {op2});
9061 assert(model->isValid());
9062 }
9063
is_ignored_axis_dynamic_output_shape_float16_dim4_axis0_2(int i)9064 inline bool is_ignored_axis_dynamic_output_shape_float16_dim4_axis0_2(int i) {
9065 static std::set<int> ignore = {};
9066 return ignore.find(i) != ignore.end();
9067 }
9068
CreateModel_axis_dynamic_output_shape_float16_dim4_axis0_neg_2(Model * model)9069 void CreateModel_axis_dynamic_output_shape_float16_dim4_axis0_neg_2(Model *model) {
9070 OperandType type1(Type::INT32, {});
9071 OperandType type15(Type::FLOAT16, {});
9072 OperandType type27(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
9073 OperandType type40(Type::TENSOR_FLOAT16, {5, 2, 2, 2});
9074 // Phase 1, operands
9075 auto op1 = model->addOperand(&type40);
9076 auto param3 = model->addOperand(&type15);
9077 auto axis = model->addOperand(&type1);
9078 auto op2 = model->addOperand(&type27);
9079 // Phase 2, operations
9080 static _Float16 param3_init[] = {9.999999974752427e-07f};
9081 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
9082 static int32_t axis_init[] = {-4};
9083 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9084 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9085 // Phase 3, inputs and outputs
9086 model->identifyInputsAndOutputs(
9087 {op1},
9088 {op2});
9089 assert(model->isValid());
9090 }
9091
is_ignored_axis_dynamic_output_shape_float16_dim4_axis0_neg_2(int i)9092 inline bool is_ignored_axis_dynamic_output_shape_float16_dim4_axis0_neg_2(int i) {
9093 static std::set<int> ignore = {};
9094 return ignore.find(i) != ignore.end();
9095 }
9096
CreateModel_axis_dynamic_output_shape_float16_dim4_axis1_2(Model * model)9097 void CreateModel_axis_dynamic_output_shape_float16_dim4_axis1_2(Model *model) {
9098 OperandType type1(Type::INT32, {});
9099 OperandType type15(Type::FLOAT16, {});
9100 OperandType type27(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
9101 OperandType type41(Type::TENSOR_FLOAT16, {2, 5, 2, 2});
9102 // Phase 1, operands
9103 auto op1 = model->addOperand(&type41);
9104 auto param3 = model->addOperand(&type15);
9105 auto axis = model->addOperand(&type1);
9106 auto op2 = model->addOperand(&type27);
9107 // Phase 2, operations
9108 static _Float16 param3_init[] = {9.999999974752427e-07f};
9109 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
9110 static int32_t axis_init[] = {1};
9111 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9112 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9113 // Phase 3, inputs and outputs
9114 model->identifyInputsAndOutputs(
9115 {op1},
9116 {op2});
9117 assert(model->isValid());
9118 }
9119
is_ignored_axis_dynamic_output_shape_float16_dim4_axis1_2(int i)9120 inline bool is_ignored_axis_dynamic_output_shape_float16_dim4_axis1_2(int i) {
9121 static std::set<int> ignore = {};
9122 return ignore.find(i) != ignore.end();
9123 }
9124
CreateModel_axis_dynamic_output_shape_float16_dim4_axis1_neg_2(Model * model)9125 void CreateModel_axis_dynamic_output_shape_float16_dim4_axis1_neg_2(Model *model) {
9126 OperandType type1(Type::INT32, {});
9127 OperandType type15(Type::FLOAT16, {});
9128 OperandType type27(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
9129 OperandType type41(Type::TENSOR_FLOAT16, {2, 5, 2, 2});
9130 // Phase 1, operands
9131 auto op1 = model->addOperand(&type41);
9132 auto param3 = model->addOperand(&type15);
9133 auto axis = model->addOperand(&type1);
9134 auto op2 = model->addOperand(&type27);
9135 // Phase 2, operations
9136 static _Float16 param3_init[] = {9.999999974752427e-07f};
9137 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
9138 static int32_t axis_init[] = {-3};
9139 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9140 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9141 // Phase 3, inputs and outputs
9142 model->identifyInputsAndOutputs(
9143 {op1},
9144 {op2});
9145 assert(model->isValid());
9146 }
9147
is_ignored_axis_dynamic_output_shape_float16_dim4_axis1_neg_2(int i)9148 inline bool is_ignored_axis_dynamic_output_shape_float16_dim4_axis1_neg_2(int i) {
9149 static std::set<int> ignore = {};
9150 return ignore.find(i) != ignore.end();
9151 }
9152
CreateModel_axis_dynamic_output_shape_float16_dim4_axis2_2(Model * model)9153 void CreateModel_axis_dynamic_output_shape_float16_dim4_axis2_2(Model *model) {
9154 OperandType type1(Type::INT32, {});
9155 OperandType type15(Type::FLOAT16, {});
9156 OperandType type27(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
9157 OperandType type42(Type::TENSOR_FLOAT16, {2, 2, 5, 2});
9158 // Phase 1, operands
9159 auto op1 = model->addOperand(&type42);
9160 auto param3 = model->addOperand(&type15);
9161 auto axis = model->addOperand(&type1);
9162 auto op2 = model->addOperand(&type27);
9163 // Phase 2, operations
9164 static _Float16 param3_init[] = {9.999999974752427e-07f};
9165 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
9166 static int32_t axis_init[] = {2};
9167 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9168 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9169 // Phase 3, inputs and outputs
9170 model->identifyInputsAndOutputs(
9171 {op1},
9172 {op2});
9173 assert(model->isValid());
9174 }
9175
is_ignored_axis_dynamic_output_shape_float16_dim4_axis2_2(int i)9176 inline bool is_ignored_axis_dynamic_output_shape_float16_dim4_axis2_2(int i) {
9177 static std::set<int> ignore = {};
9178 return ignore.find(i) != ignore.end();
9179 }
9180
CreateModel_axis_dynamic_output_shape_float16_dim4_axis2_neg_2(Model * model)9181 void CreateModel_axis_dynamic_output_shape_float16_dim4_axis2_neg_2(Model *model) {
9182 OperandType type1(Type::INT32, {});
9183 OperandType type15(Type::FLOAT16, {});
9184 OperandType type27(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
9185 OperandType type42(Type::TENSOR_FLOAT16, {2, 2, 5, 2});
9186 // Phase 1, operands
9187 auto op1 = model->addOperand(&type42);
9188 auto param3 = model->addOperand(&type15);
9189 auto axis = model->addOperand(&type1);
9190 auto op2 = model->addOperand(&type27);
9191 // Phase 2, operations
9192 static _Float16 param3_init[] = {9.999999974752427e-07f};
9193 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
9194 static int32_t axis_init[] = {-2};
9195 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9196 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9197 // Phase 3, inputs and outputs
9198 model->identifyInputsAndOutputs(
9199 {op1},
9200 {op2});
9201 assert(model->isValid());
9202 }
9203
is_ignored_axis_dynamic_output_shape_float16_dim4_axis2_neg_2(int i)9204 inline bool is_ignored_axis_dynamic_output_shape_float16_dim4_axis2_neg_2(int i) {
9205 static std::set<int> ignore = {};
9206 return ignore.find(i) != ignore.end();
9207 }
9208
CreateModel_axis_dynamic_output_shape_float16_dim4_axis3_2(Model * model)9209 void CreateModel_axis_dynamic_output_shape_float16_dim4_axis3_2(Model *model) {
9210 OperandType type1(Type::INT32, {});
9211 OperandType type15(Type::FLOAT16, {});
9212 OperandType type16(Type::TENSOR_FLOAT16, {2, 2, 2, 5});
9213 OperandType type27(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
9214 // Phase 1, operands
9215 auto op1 = model->addOperand(&type16);
9216 auto param3 = model->addOperand(&type15);
9217 auto axis = model->addOperand(&type1);
9218 auto op2 = model->addOperand(&type27);
9219 // Phase 2, operations
9220 static _Float16 param3_init[] = {9.999999974752427e-07f};
9221 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
9222 static int32_t axis_init[] = {3};
9223 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9224 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9225 // Phase 3, inputs and outputs
9226 model->identifyInputsAndOutputs(
9227 {op1},
9228 {op2});
9229 assert(model->isValid());
9230 }
9231
is_ignored_axis_dynamic_output_shape_float16_dim4_axis3_2(int i)9232 inline bool is_ignored_axis_dynamic_output_shape_float16_dim4_axis3_2(int i) {
9233 static std::set<int> ignore = {};
9234 return ignore.find(i) != ignore.end();
9235 }
9236
CreateModel_axis_dynamic_output_shape_float16_dim4_axis3_neg_2(Model * model)9237 void CreateModel_axis_dynamic_output_shape_float16_dim4_axis3_neg_2(Model *model) {
9238 OperandType type1(Type::INT32, {});
9239 OperandType type15(Type::FLOAT16, {});
9240 OperandType type16(Type::TENSOR_FLOAT16, {2, 2, 2, 5});
9241 OperandType type27(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
9242 // Phase 1, operands
9243 auto op1 = model->addOperand(&type16);
9244 auto param3 = model->addOperand(&type15);
9245 auto axis = model->addOperand(&type1);
9246 auto op2 = model->addOperand(&type27);
9247 // Phase 2, operations
9248 static _Float16 param3_init[] = {9.999999974752427e-07f};
9249 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
9250 static int32_t axis_init[] = {-1};
9251 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9252 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9253 // Phase 3, inputs and outputs
9254 model->identifyInputsAndOutputs(
9255 {op1},
9256 {op2});
9257 assert(model->isValid());
9258 }
9259
is_ignored_axis_dynamic_output_shape_float16_dim4_axis3_neg_2(int i)9260 inline bool is_ignored_axis_dynamic_output_shape_float16_dim4_axis3_neg_2(int i) {
9261 static std::set<int> ignore = {};
9262 return ignore.find(i) != ignore.end();
9263 }
9264
CreateModel_axis_dynamic_output_shape_float16_dim3_axis0_2(Model * model)9265 void CreateModel_axis_dynamic_output_shape_float16_dim3_axis0_2(Model *model) {
9266 OperandType type1(Type::INT32, {});
9267 OperandType type15(Type::FLOAT16, {});
9268 OperandType type29(Type::TENSOR_FLOAT16, {0, 0, 0});
9269 OperandType type43(Type::TENSOR_FLOAT16, {5, 2, 2});
9270 // Phase 1, operands
9271 auto op1 = model->addOperand(&type43);
9272 auto param3 = model->addOperand(&type15);
9273 auto axis = model->addOperand(&type1);
9274 auto op2 = model->addOperand(&type29);
9275 // Phase 2, operations
9276 static _Float16 param3_init[] = {9.999999974752427e-07f};
9277 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
9278 static int32_t axis_init[] = {0};
9279 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9280 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9281 // Phase 3, inputs and outputs
9282 model->identifyInputsAndOutputs(
9283 {op1},
9284 {op2});
9285 assert(model->isValid());
9286 }
9287
is_ignored_axis_dynamic_output_shape_float16_dim3_axis0_2(int i)9288 inline bool is_ignored_axis_dynamic_output_shape_float16_dim3_axis0_2(int i) {
9289 static std::set<int> ignore = {};
9290 return ignore.find(i) != ignore.end();
9291 }
9292
CreateModel_axis_dynamic_output_shape_float16_dim3_axis0_neg_2(Model * model)9293 void CreateModel_axis_dynamic_output_shape_float16_dim3_axis0_neg_2(Model *model) {
9294 OperandType type1(Type::INT32, {});
9295 OperandType type15(Type::FLOAT16, {});
9296 OperandType type29(Type::TENSOR_FLOAT16, {0, 0, 0});
9297 OperandType type43(Type::TENSOR_FLOAT16, {5, 2, 2});
9298 // Phase 1, operands
9299 auto op1 = model->addOperand(&type43);
9300 auto param3 = model->addOperand(&type15);
9301 auto axis = model->addOperand(&type1);
9302 auto op2 = model->addOperand(&type29);
9303 // Phase 2, operations
9304 static _Float16 param3_init[] = {9.999999974752427e-07f};
9305 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
9306 static int32_t axis_init[] = {-3};
9307 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9308 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9309 // Phase 3, inputs and outputs
9310 model->identifyInputsAndOutputs(
9311 {op1},
9312 {op2});
9313 assert(model->isValid());
9314 }
9315
is_ignored_axis_dynamic_output_shape_float16_dim3_axis0_neg_2(int i)9316 inline bool is_ignored_axis_dynamic_output_shape_float16_dim3_axis0_neg_2(int i) {
9317 static std::set<int> ignore = {};
9318 return ignore.find(i) != ignore.end();
9319 }
9320
CreateModel_axis_dynamic_output_shape_float16_dim3_axis1_2(Model * model)9321 void CreateModel_axis_dynamic_output_shape_float16_dim3_axis1_2(Model *model) {
9322 OperandType type1(Type::INT32, {});
9323 OperandType type15(Type::FLOAT16, {});
9324 OperandType type29(Type::TENSOR_FLOAT16, {0, 0, 0});
9325 OperandType type44(Type::TENSOR_FLOAT16, {2, 5, 2});
9326 // Phase 1, operands
9327 auto op1 = model->addOperand(&type44);
9328 auto param3 = model->addOperand(&type15);
9329 auto axis = model->addOperand(&type1);
9330 auto op2 = model->addOperand(&type29);
9331 // Phase 2, operations
9332 static _Float16 param3_init[] = {9.999999974752427e-07f};
9333 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
9334 static int32_t axis_init[] = {1};
9335 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9336 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9337 // Phase 3, inputs and outputs
9338 model->identifyInputsAndOutputs(
9339 {op1},
9340 {op2});
9341 assert(model->isValid());
9342 }
9343
is_ignored_axis_dynamic_output_shape_float16_dim3_axis1_2(int i)9344 inline bool is_ignored_axis_dynamic_output_shape_float16_dim3_axis1_2(int i) {
9345 static std::set<int> ignore = {};
9346 return ignore.find(i) != ignore.end();
9347 }
9348
CreateModel_axis_dynamic_output_shape_float16_dim3_axis1_neg_2(Model * model)9349 void CreateModel_axis_dynamic_output_shape_float16_dim3_axis1_neg_2(Model *model) {
9350 OperandType type1(Type::INT32, {});
9351 OperandType type15(Type::FLOAT16, {});
9352 OperandType type29(Type::TENSOR_FLOAT16, {0, 0, 0});
9353 OperandType type44(Type::TENSOR_FLOAT16, {2, 5, 2});
9354 // Phase 1, operands
9355 auto op1 = model->addOperand(&type44);
9356 auto param3 = model->addOperand(&type15);
9357 auto axis = model->addOperand(&type1);
9358 auto op2 = model->addOperand(&type29);
9359 // Phase 2, operations
9360 static _Float16 param3_init[] = {9.999999974752427e-07f};
9361 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
9362 static int32_t axis_init[] = {-2};
9363 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9364 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9365 // Phase 3, inputs and outputs
9366 model->identifyInputsAndOutputs(
9367 {op1},
9368 {op2});
9369 assert(model->isValid());
9370 }
9371
is_ignored_axis_dynamic_output_shape_float16_dim3_axis1_neg_2(int i)9372 inline bool is_ignored_axis_dynamic_output_shape_float16_dim3_axis1_neg_2(int i) {
9373 static std::set<int> ignore = {};
9374 return ignore.find(i) != ignore.end();
9375 }
9376
CreateModel_axis_dynamic_output_shape_float16_dim3_axis2_2(Model * model)9377 void CreateModel_axis_dynamic_output_shape_float16_dim3_axis2_2(Model *model) {
9378 OperandType type1(Type::INT32, {});
9379 OperandType type15(Type::FLOAT16, {});
9380 OperandType type18(Type::TENSOR_FLOAT16, {2, 2, 5});
9381 OperandType type29(Type::TENSOR_FLOAT16, {0, 0, 0});
9382 // Phase 1, operands
9383 auto op1 = model->addOperand(&type18);
9384 auto param3 = model->addOperand(&type15);
9385 auto axis = model->addOperand(&type1);
9386 auto op2 = model->addOperand(&type29);
9387 // Phase 2, operations
9388 static _Float16 param3_init[] = {9.999999974752427e-07f};
9389 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
9390 static int32_t axis_init[] = {2};
9391 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9392 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9393 // Phase 3, inputs and outputs
9394 model->identifyInputsAndOutputs(
9395 {op1},
9396 {op2});
9397 assert(model->isValid());
9398 }
9399
is_ignored_axis_dynamic_output_shape_float16_dim3_axis2_2(int i)9400 inline bool is_ignored_axis_dynamic_output_shape_float16_dim3_axis2_2(int i) {
9401 static std::set<int> ignore = {};
9402 return ignore.find(i) != ignore.end();
9403 }
9404
CreateModel_axis_dynamic_output_shape_float16_dim3_axis2_neg_2(Model * model)9405 void CreateModel_axis_dynamic_output_shape_float16_dim3_axis2_neg_2(Model *model) {
9406 OperandType type1(Type::INT32, {});
9407 OperandType type15(Type::FLOAT16, {});
9408 OperandType type18(Type::TENSOR_FLOAT16, {2, 2, 5});
9409 OperandType type29(Type::TENSOR_FLOAT16, {0, 0, 0});
9410 // Phase 1, operands
9411 auto op1 = model->addOperand(&type18);
9412 auto param3 = model->addOperand(&type15);
9413 auto axis = model->addOperand(&type1);
9414 auto op2 = model->addOperand(&type29);
9415 // Phase 2, operations
9416 static _Float16 param3_init[] = {9.999999974752427e-07f};
9417 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
9418 static int32_t axis_init[] = {-1};
9419 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9420 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9421 // Phase 3, inputs and outputs
9422 model->identifyInputsAndOutputs(
9423 {op1},
9424 {op2});
9425 assert(model->isValid());
9426 }
9427
is_ignored_axis_dynamic_output_shape_float16_dim3_axis2_neg_2(int i)9428 inline bool is_ignored_axis_dynamic_output_shape_float16_dim3_axis2_neg_2(int i) {
9429 static std::set<int> ignore = {};
9430 return ignore.find(i) != ignore.end();
9431 }
9432
CreateModel_axis_dynamic_output_shape_float16_dim2_axis0_2(Model * model)9433 void CreateModel_axis_dynamic_output_shape_float16_dim2_axis0_2(Model *model) {
9434 OperandType type1(Type::INT32, {});
9435 OperandType type15(Type::FLOAT16, {});
9436 OperandType type45(Type::TENSOR_FLOAT16, {5, 2});
9437 OperandType type62(Type::TENSOR_FLOAT16, {0, 0});
9438 // Phase 1, operands
9439 auto op1 = model->addOperand(&type45);
9440 auto param3 = model->addOperand(&type15);
9441 auto axis = model->addOperand(&type1);
9442 auto op2 = model->addOperand(&type62);
9443 // Phase 2, operations
9444 static _Float16 param3_init[] = {9.999999974752427e-07f};
9445 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
9446 static int32_t axis_init[] = {0};
9447 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9448 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9449 // Phase 3, inputs and outputs
9450 model->identifyInputsAndOutputs(
9451 {op1},
9452 {op2});
9453 assert(model->isValid());
9454 }
9455
is_ignored_axis_dynamic_output_shape_float16_dim2_axis0_2(int i)9456 inline bool is_ignored_axis_dynamic_output_shape_float16_dim2_axis0_2(int i) {
9457 static std::set<int> ignore = {};
9458 return ignore.find(i) != ignore.end();
9459 }
9460
CreateModel_axis_dynamic_output_shape_float16_dim2_axis0_neg_2(Model * model)9461 void CreateModel_axis_dynamic_output_shape_float16_dim2_axis0_neg_2(Model *model) {
9462 OperandType type1(Type::INT32, {});
9463 OperandType type15(Type::FLOAT16, {});
9464 OperandType type45(Type::TENSOR_FLOAT16, {5, 2});
9465 OperandType type62(Type::TENSOR_FLOAT16, {0, 0});
9466 // Phase 1, operands
9467 auto op1 = model->addOperand(&type45);
9468 auto param3 = model->addOperand(&type15);
9469 auto axis = model->addOperand(&type1);
9470 auto op2 = model->addOperand(&type62);
9471 // Phase 2, operations
9472 static _Float16 param3_init[] = {9.999999974752427e-07f};
9473 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
9474 static int32_t axis_init[] = {-2};
9475 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9476 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9477 // Phase 3, inputs and outputs
9478 model->identifyInputsAndOutputs(
9479 {op1},
9480 {op2});
9481 assert(model->isValid());
9482 }
9483
is_ignored_axis_dynamic_output_shape_float16_dim2_axis0_neg_2(int i)9484 inline bool is_ignored_axis_dynamic_output_shape_float16_dim2_axis0_neg_2(int i) {
9485 static std::set<int> ignore = {};
9486 return ignore.find(i) != ignore.end();
9487 }
9488
CreateModel_axis_dynamic_output_shape_float16_dim2_axis1_2(Model * model)9489 void CreateModel_axis_dynamic_output_shape_float16_dim2_axis1_2(Model *model) {
9490 OperandType type1(Type::INT32, {});
9491 OperandType type15(Type::FLOAT16, {});
9492 OperandType type46(Type::TENSOR_FLOAT16, {2, 5});
9493 OperandType type62(Type::TENSOR_FLOAT16, {0, 0});
9494 // Phase 1, operands
9495 auto op1 = model->addOperand(&type46);
9496 auto param3 = model->addOperand(&type15);
9497 auto axis = model->addOperand(&type1);
9498 auto op2 = model->addOperand(&type62);
9499 // Phase 2, operations
9500 static _Float16 param3_init[] = {9.999999974752427e-07f};
9501 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
9502 static int32_t axis_init[] = {1};
9503 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9504 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9505 // Phase 3, inputs and outputs
9506 model->identifyInputsAndOutputs(
9507 {op1},
9508 {op2});
9509 assert(model->isValid());
9510 }
9511
is_ignored_axis_dynamic_output_shape_float16_dim2_axis1_2(int i)9512 inline bool is_ignored_axis_dynamic_output_shape_float16_dim2_axis1_2(int i) {
9513 static std::set<int> ignore = {};
9514 return ignore.find(i) != ignore.end();
9515 }
9516
CreateModel_axis_dynamic_output_shape_float16_dim2_axis1_neg_2(Model * model)9517 void CreateModel_axis_dynamic_output_shape_float16_dim2_axis1_neg_2(Model *model) {
9518 OperandType type1(Type::INT32, {});
9519 OperandType type15(Type::FLOAT16, {});
9520 OperandType type46(Type::TENSOR_FLOAT16, {2, 5});
9521 OperandType type62(Type::TENSOR_FLOAT16, {0, 0});
9522 // Phase 1, operands
9523 auto op1 = model->addOperand(&type46);
9524 auto param3 = model->addOperand(&type15);
9525 auto axis = model->addOperand(&type1);
9526 auto op2 = model->addOperand(&type62);
9527 // Phase 2, operations
9528 static _Float16 param3_init[] = {9.999999974752427e-07f};
9529 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
9530 static int32_t axis_init[] = {-1};
9531 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9532 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9533 // Phase 3, inputs and outputs
9534 model->identifyInputsAndOutputs(
9535 {op1},
9536 {op2});
9537 assert(model->isValid());
9538 }
9539
is_ignored_axis_dynamic_output_shape_float16_dim2_axis1_neg_2(int i)9540 inline bool is_ignored_axis_dynamic_output_shape_float16_dim2_axis1_neg_2(int i) {
9541 static std::set<int> ignore = {};
9542 return ignore.find(i) != ignore.end();
9543 }
9544
CreateModel_axis_dynamic_output_shape_float16_dim1_axis0_2(Model * model)9545 void CreateModel_axis_dynamic_output_shape_float16_dim1_axis0_2(Model *model) {
9546 OperandType type1(Type::INT32, {});
9547 OperandType type15(Type::FLOAT16, {});
9548 OperandType type17(Type::TENSOR_FLOAT16, {5});
9549 OperandType type28(Type::TENSOR_FLOAT16, {0});
9550 // Phase 1, operands
9551 auto op1 = model->addOperand(&type17);
9552 auto param3 = model->addOperand(&type15);
9553 auto axis = model->addOperand(&type1);
9554 auto op2 = model->addOperand(&type28);
9555 // Phase 2, operations
9556 static _Float16 param3_init[] = {9.999999974752427e-07f};
9557 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
9558 static int32_t axis_init[] = {0};
9559 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9560 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9561 // Phase 3, inputs and outputs
9562 model->identifyInputsAndOutputs(
9563 {op1},
9564 {op2});
9565 assert(model->isValid());
9566 }
9567
is_ignored_axis_dynamic_output_shape_float16_dim1_axis0_2(int i)9568 inline bool is_ignored_axis_dynamic_output_shape_float16_dim1_axis0_2(int i) {
9569 static std::set<int> ignore = {};
9570 return ignore.find(i) != ignore.end();
9571 }
9572
CreateModel_axis_dynamic_output_shape_float16_dim1_axis0_neg_2(Model * model)9573 void CreateModel_axis_dynamic_output_shape_float16_dim1_axis0_neg_2(Model *model) {
9574 OperandType type1(Type::INT32, {});
9575 OperandType type15(Type::FLOAT16, {});
9576 OperandType type17(Type::TENSOR_FLOAT16, {5});
9577 OperandType type28(Type::TENSOR_FLOAT16, {0});
9578 // Phase 1, operands
9579 auto op1 = model->addOperand(&type17);
9580 auto param3 = model->addOperand(&type15);
9581 auto axis = model->addOperand(&type1);
9582 auto op2 = model->addOperand(&type28);
9583 // Phase 2, operations
9584 static _Float16 param3_init[] = {9.999999974752427e-07f};
9585 model->setOperandValue(param3, param3_init, sizeof(_Float16) * 1);
9586 static int32_t axis_init[] = {-1};
9587 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9588 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9589 // Phase 3, inputs and outputs
9590 model->identifyInputsAndOutputs(
9591 {op1},
9592 {op2});
9593 assert(model->isValid());
9594 }
9595
is_ignored_axis_dynamic_output_shape_float16_dim1_axis0_neg_2(int i)9596 inline bool is_ignored_axis_dynamic_output_shape_float16_dim1_axis0_neg_2(int i) {
9597 static std::set<int> ignore = {};
9598 return ignore.find(i) != ignore.end();
9599 }
9600
CreateModel_axis_dynamic_output_shape_quant8_dim4_axis0_2(Model * model)9601 void CreateModel_axis_dynamic_output_shape_quant8_dim4_axis0_2(Model *model) {
9602 OperandType type1(Type::INT32, {});
9603 OperandType type2(Type::FLOAT32, {});
9604 OperandType type30(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.00390625f, 0);
9605 OperandType type47(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2, 2}, 0.25f, 128);
9606 // Phase 1, operands
9607 auto op1 = model->addOperand(&type47);
9608 auto param3 = model->addOperand(&type2);
9609 auto axis = model->addOperand(&type1);
9610 auto op2 = model->addOperand(&type30);
9611 // Phase 2, operations
9612 static float param3_init[] = {1e-06f};
9613 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
9614 static int32_t axis_init[] = {0};
9615 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9616 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9617 // Phase 3, inputs and outputs
9618 model->identifyInputsAndOutputs(
9619 {op1},
9620 {op2});
9621 assert(model->isValid());
9622 }
9623
is_ignored_axis_dynamic_output_shape_quant8_dim4_axis0_2(int i)9624 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim4_axis0_2(int i) {
9625 static std::set<int> ignore = {};
9626 return ignore.find(i) != ignore.end();
9627 }
9628
CreateModel_axis_dynamic_output_shape_quant8_dim4_axis0_neg_2(Model * model)9629 void CreateModel_axis_dynamic_output_shape_quant8_dim4_axis0_neg_2(Model *model) {
9630 OperandType type1(Type::INT32, {});
9631 OperandType type2(Type::FLOAT32, {});
9632 OperandType type30(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.00390625f, 0);
9633 OperandType type47(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2, 2}, 0.25f, 128);
9634 // Phase 1, operands
9635 auto op1 = model->addOperand(&type47);
9636 auto param3 = model->addOperand(&type2);
9637 auto axis = model->addOperand(&type1);
9638 auto op2 = model->addOperand(&type30);
9639 // Phase 2, operations
9640 static float param3_init[] = {1e-06f};
9641 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
9642 static int32_t axis_init[] = {-4};
9643 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9644 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9645 // Phase 3, inputs and outputs
9646 model->identifyInputsAndOutputs(
9647 {op1},
9648 {op2});
9649 assert(model->isValid());
9650 }
9651
is_ignored_axis_dynamic_output_shape_quant8_dim4_axis0_neg_2(int i)9652 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim4_axis0_neg_2(int i) {
9653 static std::set<int> ignore = {};
9654 return ignore.find(i) != ignore.end();
9655 }
9656
CreateModel_axis_dynamic_output_shape_quant8_dim4_axis1_2(Model * model)9657 void CreateModel_axis_dynamic_output_shape_quant8_dim4_axis1_2(Model *model) {
9658 OperandType type1(Type::INT32, {});
9659 OperandType type2(Type::FLOAT32, {});
9660 OperandType type30(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.00390625f, 0);
9661 OperandType type49(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2, 2}, 0.25f, 128);
9662 // Phase 1, operands
9663 auto op1 = model->addOperand(&type49);
9664 auto param3 = model->addOperand(&type2);
9665 auto axis = model->addOperand(&type1);
9666 auto op2 = model->addOperand(&type30);
9667 // Phase 2, operations
9668 static float param3_init[] = {1e-06f};
9669 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
9670 static int32_t axis_init[] = {1};
9671 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9672 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9673 // Phase 3, inputs and outputs
9674 model->identifyInputsAndOutputs(
9675 {op1},
9676 {op2});
9677 assert(model->isValid());
9678 }
9679
is_ignored_axis_dynamic_output_shape_quant8_dim4_axis1_2(int i)9680 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim4_axis1_2(int i) {
9681 static std::set<int> ignore = {};
9682 return ignore.find(i) != ignore.end();
9683 }
9684
CreateModel_axis_dynamic_output_shape_quant8_dim4_axis1_neg_2(Model * model)9685 void CreateModel_axis_dynamic_output_shape_quant8_dim4_axis1_neg_2(Model *model) {
9686 OperandType type1(Type::INT32, {});
9687 OperandType type2(Type::FLOAT32, {});
9688 OperandType type30(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.00390625f, 0);
9689 OperandType type49(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2, 2}, 0.25f, 128);
9690 // Phase 1, operands
9691 auto op1 = model->addOperand(&type49);
9692 auto param3 = model->addOperand(&type2);
9693 auto axis = model->addOperand(&type1);
9694 auto op2 = model->addOperand(&type30);
9695 // Phase 2, operations
9696 static float param3_init[] = {1e-06f};
9697 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
9698 static int32_t axis_init[] = {-3};
9699 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9700 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9701 // Phase 3, inputs and outputs
9702 model->identifyInputsAndOutputs(
9703 {op1},
9704 {op2});
9705 assert(model->isValid());
9706 }
9707
is_ignored_axis_dynamic_output_shape_quant8_dim4_axis1_neg_2(int i)9708 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim4_axis1_neg_2(int i) {
9709 static std::set<int> ignore = {};
9710 return ignore.find(i) != ignore.end();
9711 }
9712
CreateModel_axis_dynamic_output_shape_quant8_dim4_axis2_2(Model * model)9713 void CreateModel_axis_dynamic_output_shape_quant8_dim4_axis2_2(Model *model) {
9714 OperandType type1(Type::INT32, {});
9715 OperandType type2(Type::FLOAT32, {});
9716 OperandType type30(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.00390625f, 0);
9717 OperandType type51(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5, 2}, 0.25f, 128);
9718 // Phase 1, operands
9719 auto op1 = model->addOperand(&type51);
9720 auto param3 = model->addOperand(&type2);
9721 auto axis = model->addOperand(&type1);
9722 auto op2 = model->addOperand(&type30);
9723 // Phase 2, operations
9724 static float param3_init[] = {1e-06f};
9725 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
9726 static int32_t axis_init[] = {2};
9727 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9728 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9729 // Phase 3, inputs and outputs
9730 model->identifyInputsAndOutputs(
9731 {op1},
9732 {op2});
9733 assert(model->isValid());
9734 }
9735
is_ignored_axis_dynamic_output_shape_quant8_dim4_axis2_2(int i)9736 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim4_axis2_2(int i) {
9737 static std::set<int> ignore = {};
9738 return ignore.find(i) != ignore.end();
9739 }
9740
CreateModel_axis_dynamic_output_shape_quant8_dim4_axis2_neg_2(Model * model)9741 void CreateModel_axis_dynamic_output_shape_quant8_dim4_axis2_neg_2(Model *model) {
9742 OperandType type1(Type::INT32, {});
9743 OperandType type2(Type::FLOAT32, {});
9744 OperandType type30(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.00390625f, 0);
9745 OperandType type51(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5, 2}, 0.25f, 128);
9746 // Phase 1, operands
9747 auto op1 = model->addOperand(&type51);
9748 auto param3 = model->addOperand(&type2);
9749 auto axis = model->addOperand(&type1);
9750 auto op2 = model->addOperand(&type30);
9751 // Phase 2, operations
9752 static float param3_init[] = {1e-06f};
9753 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
9754 static int32_t axis_init[] = {-2};
9755 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9756 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9757 // Phase 3, inputs and outputs
9758 model->identifyInputsAndOutputs(
9759 {op1},
9760 {op2});
9761 assert(model->isValid());
9762 }
9763
is_ignored_axis_dynamic_output_shape_quant8_dim4_axis2_neg_2(int i)9764 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim4_axis2_neg_2(int i) {
9765 static std::set<int> ignore = {};
9766 return ignore.find(i) != ignore.end();
9767 }
9768
CreateModel_axis_dynamic_output_shape_quant8_dim4_axis3_2(Model * model)9769 void CreateModel_axis_dynamic_output_shape_quant8_dim4_axis3_2(Model *model) {
9770 OperandType type1(Type::INT32, {});
9771 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 5}, 0.25f, 128);
9772 OperandType type2(Type::FLOAT32, {});
9773 OperandType type30(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.00390625f, 0);
9774 // Phase 1, operands
9775 auto op1 = model->addOperand(&type19);
9776 auto param3 = model->addOperand(&type2);
9777 auto axis = model->addOperand(&type1);
9778 auto op2 = model->addOperand(&type30);
9779 // Phase 2, operations
9780 static float param3_init[] = {1e-06f};
9781 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
9782 static int32_t axis_init[] = {3};
9783 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9784 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9785 // Phase 3, inputs and outputs
9786 model->identifyInputsAndOutputs(
9787 {op1},
9788 {op2});
9789 assert(model->isValid());
9790 }
9791
is_ignored_axis_dynamic_output_shape_quant8_dim4_axis3_2(int i)9792 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim4_axis3_2(int i) {
9793 static std::set<int> ignore = {};
9794 return ignore.find(i) != ignore.end();
9795 }
9796
CreateModel_axis_dynamic_output_shape_quant8_dim4_axis3_neg_2(Model * model)9797 void CreateModel_axis_dynamic_output_shape_quant8_dim4_axis3_neg_2(Model *model) {
9798 OperandType type1(Type::INT32, {});
9799 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {2, 2, 2, 5}, 0.25f, 128);
9800 OperandType type2(Type::FLOAT32, {});
9801 OperandType type30(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.00390625f, 0);
9802 // Phase 1, operands
9803 auto op1 = model->addOperand(&type19);
9804 auto param3 = model->addOperand(&type2);
9805 auto axis = model->addOperand(&type1);
9806 auto op2 = model->addOperand(&type30);
9807 // Phase 2, operations
9808 static float param3_init[] = {1e-06f};
9809 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
9810 static int32_t axis_init[] = {-1};
9811 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9812 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9813 // Phase 3, inputs and outputs
9814 model->identifyInputsAndOutputs(
9815 {op1},
9816 {op2});
9817 assert(model->isValid());
9818 }
9819
is_ignored_axis_dynamic_output_shape_quant8_dim4_axis3_neg_2(int i)9820 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim4_axis3_neg_2(int i) {
9821 static std::set<int> ignore = {};
9822 return ignore.find(i) != ignore.end();
9823 }
9824
CreateModel_axis_dynamic_output_shape_quant8_dim3_axis0_2(Model * model)9825 void CreateModel_axis_dynamic_output_shape_quant8_dim3_axis0_2(Model *model) {
9826 OperandType type1(Type::INT32, {});
9827 OperandType type2(Type::FLOAT32, {});
9828 OperandType type32(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.00390625f, 0);
9829 OperandType type53(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2}, 0.25f, 128);
9830 // Phase 1, operands
9831 auto op1 = model->addOperand(&type53);
9832 auto param3 = model->addOperand(&type2);
9833 auto axis = model->addOperand(&type1);
9834 auto op2 = model->addOperand(&type32);
9835 // Phase 2, operations
9836 static float param3_init[] = {1e-06f};
9837 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
9838 static int32_t axis_init[] = {0};
9839 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9840 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9841 // Phase 3, inputs and outputs
9842 model->identifyInputsAndOutputs(
9843 {op1},
9844 {op2});
9845 assert(model->isValid());
9846 }
9847
is_ignored_axis_dynamic_output_shape_quant8_dim3_axis0_2(int i)9848 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim3_axis0_2(int i) {
9849 static std::set<int> ignore = {};
9850 return ignore.find(i) != ignore.end();
9851 }
9852
CreateModel_axis_dynamic_output_shape_quant8_dim3_axis0_neg_2(Model * model)9853 void CreateModel_axis_dynamic_output_shape_quant8_dim3_axis0_neg_2(Model *model) {
9854 OperandType type1(Type::INT32, {});
9855 OperandType type2(Type::FLOAT32, {});
9856 OperandType type32(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.00390625f, 0);
9857 OperandType type53(Type::TENSOR_QUANT8_ASYMM, {5, 2, 2}, 0.25f, 128);
9858 // Phase 1, operands
9859 auto op1 = model->addOperand(&type53);
9860 auto param3 = model->addOperand(&type2);
9861 auto axis = model->addOperand(&type1);
9862 auto op2 = model->addOperand(&type32);
9863 // Phase 2, operations
9864 static float param3_init[] = {1e-06f};
9865 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
9866 static int32_t axis_init[] = {-3};
9867 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9868 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9869 // Phase 3, inputs and outputs
9870 model->identifyInputsAndOutputs(
9871 {op1},
9872 {op2});
9873 assert(model->isValid());
9874 }
9875
is_ignored_axis_dynamic_output_shape_quant8_dim3_axis0_neg_2(int i)9876 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim3_axis0_neg_2(int i) {
9877 static std::set<int> ignore = {};
9878 return ignore.find(i) != ignore.end();
9879 }
9880
CreateModel_axis_dynamic_output_shape_quant8_dim3_axis1_2(Model * model)9881 void CreateModel_axis_dynamic_output_shape_quant8_dim3_axis1_2(Model *model) {
9882 OperandType type1(Type::INT32, {});
9883 OperandType type2(Type::FLOAT32, {});
9884 OperandType type32(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.00390625f, 0);
9885 OperandType type55(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2}, 0.25f, 128);
9886 // Phase 1, operands
9887 auto op1 = model->addOperand(&type55);
9888 auto param3 = model->addOperand(&type2);
9889 auto axis = model->addOperand(&type1);
9890 auto op2 = model->addOperand(&type32);
9891 // Phase 2, operations
9892 static float param3_init[] = {1e-06f};
9893 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
9894 static int32_t axis_init[] = {1};
9895 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9896 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9897 // Phase 3, inputs and outputs
9898 model->identifyInputsAndOutputs(
9899 {op1},
9900 {op2});
9901 assert(model->isValid());
9902 }
9903
is_ignored_axis_dynamic_output_shape_quant8_dim3_axis1_2(int i)9904 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim3_axis1_2(int i) {
9905 static std::set<int> ignore = {};
9906 return ignore.find(i) != ignore.end();
9907 }
9908
CreateModel_axis_dynamic_output_shape_quant8_dim3_axis1_neg_2(Model * model)9909 void CreateModel_axis_dynamic_output_shape_quant8_dim3_axis1_neg_2(Model *model) {
9910 OperandType type1(Type::INT32, {});
9911 OperandType type2(Type::FLOAT32, {});
9912 OperandType type32(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.00390625f, 0);
9913 OperandType type55(Type::TENSOR_QUANT8_ASYMM, {2, 5, 2}, 0.25f, 128);
9914 // Phase 1, operands
9915 auto op1 = model->addOperand(&type55);
9916 auto param3 = model->addOperand(&type2);
9917 auto axis = model->addOperand(&type1);
9918 auto op2 = model->addOperand(&type32);
9919 // Phase 2, operations
9920 static float param3_init[] = {1e-06f};
9921 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
9922 static int32_t axis_init[] = {-2};
9923 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9924 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9925 // Phase 3, inputs and outputs
9926 model->identifyInputsAndOutputs(
9927 {op1},
9928 {op2});
9929 assert(model->isValid());
9930 }
9931
is_ignored_axis_dynamic_output_shape_quant8_dim3_axis1_neg_2(int i)9932 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim3_axis1_neg_2(int i) {
9933 static std::set<int> ignore = {};
9934 return ignore.find(i) != ignore.end();
9935 }
9936
CreateModel_axis_dynamic_output_shape_quant8_dim3_axis2_2(Model * model)9937 void CreateModel_axis_dynamic_output_shape_quant8_dim3_axis2_2(Model *model) {
9938 OperandType type1(Type::INT32, {});
9939 OperandType type2(Type::FLOAT32, {});
9940 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5}, 0.25f, 128);
9941 OperandType type32(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.00390625f, 0);
9942 // Phase 1, operands
9943 auto op1 = model->addOperand(&type23);
9944 auto param3 = model->addOperand(&type2);
9945 auto axis = model->addOperand(&type1);
9946 auto op2 = model->addOperand(&type32);
9947 // Phase 2, operations
9948 static float param3_init[] = {1e-06f};
9949 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
9950 static int32_t axis_init[] = {2};
9951 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9952 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9953 // Phase 3, inputs and outputs
9954 model->identifyInputsAndOutputs(
9955 {op1},
9956 {op2});
9957 assert(model->isValid());
9958 }
9959
is_ignored_axis_dynamic_output_shape_quant8_dim3_axis2_2(int i)9960 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim3_axis2_2(int i) {
9961 static std::set<int> ignore = {};
9962 return ignore.find(i) != ignore.end();
9963 }
9964
CreateModel_axis_dynamic_output_shape_quant8_dim3_axis2_neg_2(Model * model)9965 void CreateModel_axis_dynamic_output_shape_quant8_dim3_axis2_neg_2(Model *model) {
9966 OperandType type1(Type::INT32, {});
9967 OperandType type2(Type::FLOAT32, {});
9968 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {2, 2, 5}, 0.25f, 128);
9969 OperandType type32(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0}, 0.00390625f, 0);
9970 // Phase 1, operands
9971 auto op1 = model->addOperand(&type23);
9972 auto param3 = model->addOperand(&type2);
9973 auto axis = model->addOperand(&type1);
9974 auto op2 = model->addOperand(&type32);
9975 // Phase 2, operations
9976 static float param3_init[] = {1e-06f};
9977 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
9978 static int32_t axis_init[] = {-1};
9979 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
9980 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
9981 // Phase 3, inputs and outputs
9982 model->identifyInputsAndOutputs(
9983 {op1},
9984 {op2});
9985 assert(model->isValid());
9986 }
9987
is_ignored_axis_dynamic_output_shape_quant8_dim3_axis2_neg_2(int i)9988 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim3_axis2_neg_2(int i) {
9989 static std::set<int> ignore = {};
9990 return ignore.find(i) != ignore.end();
9991 }
9992
CreateModel_axis_dynamic_output_shape_quant8_dim2_axis0_2(Model * model)9993 void CreateModel_axis_dynamic_output_shape_quant8_dim2_axis0_2(Model *model) {
9994 OperandType type1(Type::INT32, {});
9995 OperandType type2(Type::FLOAT32, {});
9996 OperandType type57(Type::TENSOR_QUANT8_ASYMM, {5, 2}, 0.25f, 128);
9997 OperandType type63(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 0.00390625f, 0);
9998 // Phase 1, operands
9999 auto op1 = model->addOperand(&type57);
10000 auto param3 = model->addOperand(&type2);
10001 auto axis = model->addOperand(&type1);
10002 auto op2 = model->addOperand(&type63);
10003 // Phase 2, operations
10004 static float param3_init[] = {1e-06f};
10005 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
10006 static int32_t axis_init[] = {0};
10007 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
10008 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
10009 // Phase 3, inputs and outputs
10010 model->identifyInputsAndOutputs(
10011 {op1},
10012 {op2});
10013 assert(model->isValid());
10014 }
10015
is_ignored_axis_dynamic_output_shape_quant8_dim2_axis0_2(int i)10016 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim2_axis0_2(int i) {
10017 static std::set<int> ignore = {};
10018 return ignore.find(i) != ignore.end();
10019 }
10020
CreateModel_axis_dynamic_output_shape_quant8_dim2_axis0_neg_2(Model * model)10021 void CreateModel_axis_dynamic_output_shape_quant8_dim2_axis0_neg_2(Model *model) {
10022 OperandType type1(Type::INT32, {});
10023 OperandType type2(Type::FLOAT32, {});
10024 OperandType type57(Type::TENSOR_QUANT8_ASYMM, {5, 2}, 0.25f, 128);
10025 OperandType type63(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 0.00390625f, 0);
10026 // Phase 1, operands
10027 auto op1 = model->addOperand(&type57);
10028 auto param3 = model->addOperand(&type2);
10029 auto axis = model->addOperand(&type1);
10030 auto op2 = model->addOperand(&type63);
10031 // Phase 2, operations
10032 static float param3_init[] = {1e-06f};
10033 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
10034 static int32_t axis_init[] = {-2};
10035 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
10036 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
10037 // Phase 3, inputs and outputs
10038 model->identifyInputsAndOutputs(
10039 {op1},
10040 {op2});
10041 assert(model->isValid());
10042 }
10043
is_ignored_axis_dynamic_output_shape_quant8_dim2_axis0_neg_2(int i)10044 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim2_axis0_neg_2(int i) {
10045 static std::set<int> ignore = {};
10046 return ignore.find(i) != ignore.end();
10047 }
10048
CreateModel_axis_dynamic_output_shape_quant8_dim2_axis1_2(Model * model)10049 void CreateModel_axis_dynamic_output_shape_quant8_dim2_axis1_2(Model *model) {
10050 OperandType type1(Type::INT32, {});
10051 OperandType type2(Type::FLOAT32, {});
10052 OperandType type59(Type::TENSOR_QUANT8_ASYMM, {2, 5}, 0.25f, 128);
10053 OperandType type63(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 0.00390625f, 0);
10054 // Phase 1, operands
10055 auto op1 = model->addOperand(&type59);
10056 auto param3 = model->addOperand(&type2);
10057 auto axis = model->addOperand(&type1);
10058 auto op2 = model->addOperand(&type63);
10059 // Phase 2, operations
10060 static float param3_init[] = {1e-06f};
10061 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
10062 static int32_t axis_init[] = {1};
10063 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
10064 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
10065 // Phase 3, inputs and outputs
10066 model->identifyInputsAndOutputs(
10067 {op1},
10068 {op2});
10069 assert(model->isValid());
10070 }
10071
is_ignored_axis_dynamic_output_shape_quant8_dim2_axis1_2(int i)10072 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim2_axis1_2(int i) {
10073 static std::set<int> ignore = {};
10074 return ignore.find(i) != ignore.end();
10075 }
10076
CreateModel_axis_dynamic_output_shape_quant8_dim2_axis1_neg_2(Model * model)10077 void CreateModel_axis_dynamic_output_shape_quant8_dim2_axis1_neg_2(Model *model) {
10078 OperandType type1(Type::INT32, {});
10079 OperandType type2(Type::FLOAT32, {});
10080 OperandType type59(Type::TENSOR_QUANT8_ASYMM, {2, 5}, 0.25f, 128);
10081 OperandType type63(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 0.00390625f, 0);
10082 // Phase 1, operands
10083 auto op1 = model->addOperand(&type59);
10084 auto param3 = model->addOperand(&type2);
10085 auto axis = model->addOperand(&type1);
10086 auto op2 = model->addOperand(&type63);
10087 // Phase 2, operations
10088 static float param3_init[] = {1e-06f};
10089 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
10090 static int32_t axis_init[] = {-1};
10091 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
10092 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
10093 // Phase 3, inputs and outputs
10094 model->identifyInputsAndOutputs(
10095 {op1},
10096 {op2});
10097 assert(model->isValid());
10098 }
10099
is_ignored_axis_dynamic_output_shape_quant8_dim2_axis1_neg_2(int i)10100 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim2_axis1_neg_2(int i) {
10101 static std::set<int> ignore = {};
10102 return ignore.find(i) != ignore.end();
10103 }
10104
CreateModel_axis_dynamic_output_shape_quant8_dim1_axis0_2(Model * model)10105 void CreateModel_axis_dynamic_output_shape_quant8_dim1_axis0_2(Model *model) {
10106 OperandType type1(Type::INT32, {});
10107 OperandType type2(Type::FLOAT32, {});
10108 OperandType type21(Type::TENSOR_QUANT8_ASYMM, {5}, 0.25f, 128);
10109 OperandType type31(Type::TENSOR_QUANT8_ASYMM, {0}, 0.00390625f, 0);
10110 // Phase 1, operands
10111 auto op1 = model->addOperand(&type21);
10112 auto param3 = model->addOperand(&type2);
10113 auto axis = model->addOperand(&type1);
10114 auto op2 = model->addOperand(&type31);
10115 // Phase 2, operations
10116 static float param3_init[] = {1e-06f};
10117 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
10118 static int32_t axis_init[] = {0};
10119 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
10120 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
10121 // Phase 3, inputs and outputs
10122 model->identifyInputsAndOutputs(
10123 {op1},
10124 {op2});
10125 assert(model->isValid());
10126 }
10127
is_ignored_axis_dynamic_output_shape_quant8_dim1_axis0_2(int i)10128 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim1_axis0_2(int i) {
10129 static std::set<int> ignore = {};
10130 return ignore.find(i) != ignore.end();
10131 }
10132
CreateModel_axis_dynamic_output_shape_quant8_dim1_axis0_neg_2(Model * model)10133 void CreateModel_axis_dynamic_output_shape_quant8_dim1_axis0_neg_2(Model *model) {
10134 OperandType type1(Type::INT32, {});
10135 OperandType type2(Type::FLOAT32, {});
10136 OperandType type21(Type::TENSOR_QUANT8_ASYMM, {5}, 0.25f, 128);
10137 OperandType type31(Type::TENSOR_QUANT8_ASYMM, {0}, 0.00390625f, 0);
10138 // Phase 1, operands
10139 auto op1 = model->addOperand(&type21);
10140 auto param3 = model->addOperand(&type2);
10141 auto axis = model->addOperand(&type1);
10142 auto op2 = model->addOperand(&type31);
10143 // Phase 2, operations
10144 static float param3_init[] = {1e-06f};
10145 model->setOperandValue(param3, param3_init, sizeof(float) * 1);
10146 static int32_t axis_init[] = {-1};
10147 model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
10148 model->addOperation(ANEURALNETWORKS_SOFTMAX, {op1, param3, axis}, {op2});
10149 // Phase 3, inputs and outputs
10150 model->identifyInputsAndOutputs(
10151 {op1},
10152 {op2});
10153 assert(model->isValid());
10154 }
10155
is_ignored_axis_dynamic_output_shape_quant8_dim1_axis0_neg_2(int i)10156 inline bool is_ignored_axis_dynamic_output_shape_quant8_dim1_axis0_neg_2(int i) {
10157 static std::set<int> ignore = {};
10158 return ignore.find(i) != ignore.end();
10159 }
10160
CreateModel_zero_sized(Model * model)10161 void CreateModel_zero_sized(Model *model) {
10162 OperandType type1(Type::INT32, {});
10163 OperandType type10(Type::TENSOR_FLOAT32, {1, 1, 1, 1});
10164 OperandType type11(Type::TENSOR_FLOAT32, {0, 2, 2, 1});
10165 OperandType type2(Type::FLOAT32, {});
10166 OperandType type3(Type::TENSOR_FLOAT32, {1, 2});
10167 OperandType type4(Type::TENSOR_FLOAT32, {1, 8});
10168 OperandType type5(Type::TENSOR_FLOAT32, {0});
10169 OperandType type6(Type::TENSOR_INT32, {0});
10170 OperandType type7(Type::TENSOR_FLOAT32, {0, 4});
10171 OperandType type8(Type::TENSOR_INT32, {1});
10172 OperandType type9(Type::BOOL, {});
10173 // Phase 1, operands
10174 auto scores = model->addOperand(&type3);
10175 auto roi = model->addOperand(&type4);
10176 auto param4 = model->addOperand(&type8);
10177 auto param5 = model->addOperand(&type2);
10178 auto param6 = model->addOperand(&type1);
10179 auto param7 = model->addOperand(&type1);
10180 auto param8 = model->addOperand(&type2);
10181 auto param9 = model->addOperand(&type2);
10182 auto param10 = model->addOperand(&type2);
10183 auto scoresOut = model->addOperand(&type5);
10184 auto roiOut = model->addOperand(&type7);
10185 auto classesOut = model->addOperand(&type6);
10186 auto batchSplitOut = model->addOperand(&type6);
10187 auto in = model->addOperand(&type10);
10188 auto param11 = model->addOperand(&type1);
10189 auto param12 = model->addOperand(&type1);
10190 auto param13 = model->addOperand(&type2);
10191 auto param14 = model->addOperand(&type2);
10192 auto param15 = model->addOperand(&type1);
10193 auto param16 = model->addOperand(&type1);
10194 auto layout = model->addOperand(&type9);
10195 auto featureMap = model->addOperand(&type11);
10196 auto param17 = model->addOperand(&type2);
10197 auto out = model->addOperand(&type11);
10198 // Phase 2, operations
10199 static float scores_init[] = {0.9f, 0.1f};
10200 model->setOperandValue(scores, scores_init, sizeof(float) * 2);
10201 static float roi_init[] = {1.0f, 1.0f, 10.0f, 10.0f, 0.0f, 0.0f, 10.0f, 10.0f};
10202 model->setOperandValue(roi, roi_init, sizeof(float) * 8);
10203 static int32_t param4_init[] = {0};
10204 model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
10205 static float param5_init[] = {0.3f};
10206 model->setOperandValue(param5, param5_init, sizeof(float) * 1);
10207 static int32_t param6_init[] = {-1};
10208 model->setOperandValue(param6, param6_init, sizeof(int32_t) * 1);
10209 static int32_t param7_init[] = {0};
10210 model->setOperandValue(param7, param7_init, sizeof(int32_t) * 1);
10211 static float param8_init[] = {0.4f};
10212 model->setOperandValue(param8, param8_init, sizeof(float) * 1);
10213 static float param9_init[] = {1.0f};
10214 model->setOperandValue(param9, param9_init, sizeof(float) * 1);
10215 static float param10_init[] = {0.3f};
10216 model->setOperandValue(param10, param10_init, sizeof(float) * 1);
10217 static int32_t param11_init[] = {2};
10218 model->setOperandValue(param11, param11_init, sizeof(int32_t) * 1);
10219 static int32_t param12_init[] = {2};
10220 model->setOperandValue(param12, param12_init, sizeof(int32_t) * 1);
10221 static float param13_init[] = {2.0f};
10222 model->setOperandValue(param13, param13_init, sizeof(float) * 1);
10223 static float param14_init[] = {2.0f};
10224 model->setOperandValue(param14, param14_init, sizeof(float) * 1);
10225 static int32_t param15_init[] = {4};
10226 model->setOperandValue(param15, param15_init, sizeof(int32_t) * 1);
10227 static int32_t param16_init[] = {4};
10228 model->setOperandValue(param16, param16_init, sizeof(int32_t) * 1);
10229 static bool8 layout_init[] = {false};
10230 model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
10231 static float param17_init[] = {1.0f};
10232 model->setOperandValue(param17, param17_init, sizeof(float) * 1);
10233 model->addOperation(ANEURALNETWORKS_BOX_WITH_NMS_LIMIT, {scores, roi, param4, param5, param6, param7, param8, param9, param10}, {scoresOut, roiOut, classesOut, batchSplitOut});
10234 model->addOperation(ANEURALNETWORKS_ROI_ALIGN, {in, roiOut, batchSplitOut, param11, param12, param13, param14, param15, param16, layout}, {featureMap});
10235 model->addOperation(ANEURALNETWORKS_SOFTMAX, {featureMap, param17}, {out});
10236 // Phase 3, inputs and outputs
10237 model->identifyInputsAndOutputs(
10238 {in},
10239 {scoresOut, classesOut, out});
10240 assert(model->isValid());
10241 }
10242
is_ignored_zero_sized(int i)10243 inline bool is_ignored_zero_sized(int i) {
10244 static std::set<int> ignore = {};
10245 return ignore.find(i) != ignore.end();
10246 }
10247
CreateModel_zero_sized_relaxed(Model * model)10248 void CreateModel_zero_sized_relaxed(Model *model) {
10249 OperandType type1(Type::INT32, {});
10250 OperandType type10(Type::TENSOR_FLOAT32, {1, 1, 1, 1});
10251 OperandType type11(Type::TENSOR_FLOAT32, {0, 2, 2, 1});
10252 OperandType type2(Type::FLOAT32, {});
10253 OperandType type3(Type::TENSOR_FLOAT32, {1, 2});
10254 OperandType type4(Type::TENSOR_FLOAT32, {1, 8});
10255 OperandType type5(Type::TENSOR_FLOAT32, {0});
10256 OperandType type6(Type::TENSOR_INT32, {0});
10257 OperandType type7(Type::TENSOR_FLOAT32, {0, 4});
10258 OperandType type8(Type::TENSOR_INT32, {1});
10259 OperandType type9(Type::BOOL, {});
10260 // Phase 1, operands
10261 auto scores = model->addOperand(&type3);
10262 auto roi = model->addOperand(&type4);
10263 auto param4 = model->addOperand(&type8);
10264 auto param5 = model->addOperand(&type2);
10265 auto param6 = model->addOperand(&type1);
10266 auto param7 = model->addOperand(&type1);
10267 auto param8 = model->addOperand(&type2);
10268 auto param9 = model->addOperand(&type2);
10269 auto param10 = model->addOperand(&type2);
10270 auto scoresOut = model->addOperand(&type5);
10271 auto roiOut = model->addOperand(&type7);
10272 auto classesOut = model->addOperand(&type6);
10273 auto batchSplitOut = model->addOperand(&type6);
10274 auto in = model->addOperand(&type10);
10275 auto param11 = model->addOperand(&type1);
10276 auto param12 = model->addOperand(&type1);
10277 auto param13 = model->addOperand(&type2);
10278 auto param14 = model->addOperand(&type2);
10279 auto param15 = model->addOperand(&type1);
10280 auto param16 = model->addOperand(&type1);
10281 auto layout = model->addOperand(&type9);
10282 auto featureMap = model->addOperand(&type11);
10283 auto param17 = model->addOperand(&type2);
10284 auto out = model->addOperand(&type11);
10285 // Phase 2, operations
10286 static float scores_init[] = {0.9f, 0.1f};
10287 model->setOperandValue(scores, scores_init, sizeof(float) * 2);
10288 static float roi_init[] = {1.0f, 1.0f, 10.0f, 10.0f, 0.0f, 0.0f, 10.0f, 10.0f};
10289 model->setOperandValue(roi, roi_init, sizeof(float) * 8);
10290 static int32_t param4_init[] = {0};
10291 model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
10292 static float param5_init[] = {0.3f};
10293 model->setOperandValue(param5, param5_init, sizeof(float) * 1);
10294 static int32_t param6_init[] = {-1};
10295 model->setOperandValue(param6, param6_init, sizeof(int32_t) * 1);
10296 static int32_t param7_init[] = {0};
10297 model->setOperandValue(param7, param7_init, sizeof(int32_t) * 1);
10298 static float param8_init[] = {0.4f};
10299 model->setOperandValue(param8, param8_init, sizeof(float) * 1);
10300 static float param9_init[] = {1.0f};
10301 model->setOperandValue(param9, param9_init, sizeof(float) * 1);
10302 static float param10_init[] = {0.3f};
10303 model->setOperandValue(param10, param10_init, sizeof(float) * 1);
10304 static int32_t param11_init[] = {2};
10305 model->setOperandValue(param11, param11_init, sizeof(int32_t) * 1);
10306 static int32_t param12_init[] = {2};
10307 model->setOperandValue(param12, param12_init, sizeof(int32_t) * 1);
10308 static float param13_init[] = {2.0f};
10309 model->setOperandValue(param13, param13_init, sizeof(float) * 1);
10310 static float param14_init[] = {2.0f};
10311 model->setOperandValue(param14, param14_init, sizeof(float) * 1);
10312 static int32_t param15_init[] = {4};
10313 model->setOperandValue(param15, param15_init, sizeof(int32_t) * 1);
10314 static int32_t param16_init[] = {4};
10315 model->setOperandValue(param16, param16_init, sizeof(int32_t) * 1);
10316 static bool8 layout_init[] = {false};
10317 model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
10318 static float param17_init[] = {1.0f};
10319 model->setOperandValue(param17, param17_init, sizeof(float) * 1);
10320 model->addOperation(ANEURALNETWORKS_BOX_WITH_NMS_LIMIT, {scores, roi, param4, param5, param6, param7, param8, param9, param10}, {scoresOut, roiOut, classesOut, batchSplitOut});
10321 model->addOperation(ANEURALNETWORKS_ROI_ALIGN, {in, roiOut, batchSplitOut, param11, param12, param13, param14, param15, param16, layout}, {featureMap});
10322 model->addOperation(ANEURALNETWORKS_SOFTMAX, {featureMap, param17}, {out});
10323 // Phase 3, inputs and outputs
10324 model->identifyInputsAndOutputs(
10325 {in},
10326 {scoresOut, classesOut, out});
10327 // Phase 4: set relaxed execution
10328 model->relaxComputationFloat32toFloat16(true);
10329 assert(model->isValid());
10330 }
10331
is_ignored_zero_sized_relaxed(int i)10332 inline bool is_ignored_zero_sized_relaxed(int i) {
10333 static std::set<int> ignore = {};
10334 return ignore.find(i) != ignore.end();
10335 }
10336
CreateModel_zero_sized_quant8(Model * model)10337 void CreateModel_zero_sized_quant8(Model *model) {
10338 OperandType type1(Type::INT32, {});
10339 OperandType type2(Type::FLOAT32, {});
10340 OperandType type6(Type::TENSOR_INT32, {0});
10341 OperandType type64(Type::TENSOR_QUANT8_ASYMM, {0, 2, 2, 1}, 0.1f, 128);
10342 OperandType type65(Type::TENSOR_QUANT8_ASYMM, {1, 1, 1, 1}, 0.1f, 128);
10343 OperandType type66(Type::TENSOR_QUANT8_ASYMM, {0, 2, 2, 1}, 0.00390625f, 0);
10344 OperandType type67(Type::TENSOR_QUANT16_ASYMM, {1, 8}, 0.125f, 0);
10345 OperandType type68(Type::TENSOR_QUANT16_ASYMM, {0, 4}, 0.125f, 0);
10346 OperandType type69(Type::TENSOR_QUANT8_ASYMM, {1, 2}, 0.1f, 128);
10347 OperandType type70(Type::TENSOR_QUANT8_ASYMM, {0}, 0.1f, 128);
10348 OperandType type8(Type::TENSOR_INT32, {1});
10349 OperandType type9(Type::BOOL, {});
10350 // Phase 1, operands
10351 auto scores = model->addOperand(&type69);
10352 auto roi = model->addOperand(&type67);
10353 auto param4 = model->addOperand(&type8);
10354 auto param5 = model->addOperand(&type2);
10355 auto param6 = model->addOperand(&type1);
10356 auto param7 = model->addOperand(&type1);
10357 auto param8 = model->addOperand(&type2);
10358 auto param9 = model->addOperand(&type2);
10359 auto param10 = model->addOperand(&type2);
10360 auto scoresOut = model->addOperand(&type70);
10361 auto roiOut = model->addOperand(&type68);
10362 auto classesOut = model->addOperand(&type6);
10363 auto batchSplitOut = model->addOperand(&type6);
10364 auto in = model->addOperand(&type65);
10365 auto param11 = model->addOperand(&type1);
10366 auto param12 = model->addOperand(&type1);
10367 auto param13 = model->addOperand(&type2);
10368 auto param14 = model->addOperand(&type2);
10369 auto param15 = model->addOperand(&type1);
10370 auto param16 = model->addOperand(&type1);
10371 auto layout = model->addOperand(&type9);
10372 auto featureMap = model->addOperand(&type64);
10373 auto param17 = model->addOperand(&type2);
10374 auto out = model->addOperand(&type66);
10375 // Phase 2, operations
10376 static uint8_t scores_init[] = {137, 129};
10377 model->setOperandValue(scores, scores_init, sizeof(uint8_t) * 2);
10378 static uint16_t roi_init[] = {8, 8, 80, 80, 0, 0, 80, 80};
10379 model->setOperandValue(roi, roi_init, sizeof(uint16_t) * 8);
10380 static int32_t param4_init[] = {0};
10381 model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
10382 static float param5_init[] = {0.3f};
10383 model->setOperandValue(param5, param5_init, sizeof(float) * 1);
10384 static int32_t param6_init[] = {-1};
10385 model->setOperandValue(param6, param6_init, sizeof(int32_t) * 1);
10386 static int32_t param7_init[] = {0};
10387 model->setOperandValue(param7, param7_init, sizeof(int32_t) * 1);
10388 static float param8_init[] = {0.4f};
10389 model->setOperandValue(param8, param8_init, sizeof(float) * 1);
10390 static float param9_init[] = {1.0f};
10391 model->setOperandValue(param9, param9_init, sizeof(float) * 1);
10392 static float param10_init[] = {0.3f};
10393 model->setOperandValue(param10, param10_init, sizeof(float) * 1);
10394 static int32_t param11_init[] = {2};
10395 model->setOperandValue(param11, param11_init, sizeof(int32_t) * 1);
10396 static int32_t param12_init[] = {2};
10397 model->setOperandValue(param12, param12_init, sizeof(int32_t) * 1);
10398 static float param13_init[] = {2.0f};
10399 model->setOperandValue(param13, param13_init, sizeof(float) * 1);
10400 static float param14_init[] = {2.0f};
10401 model->setOperandValue(param14, param14_init, sizeof(float) * 1);
10402 static int32_t param15_init[] = {4};
10403 model->setOperandValue(param15, param15_init, sizeof(int32_t) * 1);
10404 static int32_t param16_init[] = {4};
10405 model->setOperandValue(param16, param16_init, sizeof(int32_t) * 1);
10406 static bool8 layout_init[] = {false};
10407 model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
10408 static float param17_init[] = {1.0f};
10409 model->setOperandValue(param17, param17_init, sizeof(float) * 1);
10410 model->addOperation(ANEURALNETWORKS_BOX_WITH_NMS_LIMIT, {scores, roi, param4, param5, param6, param7, param8, param9, param10}, {scoresOut, roiOut, classesOut, batchSplitOut});
10411 model->addOperation(ANEURALNETWORKS_ROI_ALIGN, {in, roiOut, batchSplitOut, param11, param12, param13, param14, param15, param16, layout}, {featureMap});
10412 model->addOperation(ANEURALNETWORKS_SOFTMAX, {featureMap, param17}, {out});
10413 // Phase 3, inputs and outputs
10414 model->identifyInputsAndOutputs(
10415 {in},
10416 {scoresOut, classesOut, out});
10417 assert(model->isValid());
10418 }
10419
is_ignored_zero_sized_quant8(int i)10420 inline bool is_ignored_zero_sized_quant8(int i) {
10421 static std::set<int> ignore = {};
10422 return ignore.find(i) != ignore.end();
10423 }
10424
CreateModel_zero_sized_float16(Model * model)10425 void CreateModel_zero_sized_float16(Model *model) {
10426 OperandType type1(Type::INT32, {});
10427 OperandType type15(Type::FLOAT16, {});
10428 OperandType type6(Type::TENSOR_INT32, {0});
10429 OperandType type71(Type::TENSOR_FLOAT16, {0, 2, 2, 1});
10430 OperandType type72(Type::TENSOR_FLOAT16, {1, 1, 1, 1});
10431 OperandType type73(Type::TENSOR_FLOAT16, {1, 8});
10432 OperandType type74(Type::TENSOR_FLOAT16, {0, 4});
10433 OperandType type75(Type::TENSOR_FLOAT16, {1, 2});
10434 OperandType type76(Type::TENSOR_FLOAT16, {0});
10435 OperandType type8(Type::TENSOR_INT32, {1});
10436 OperandType type9(Type::BOOL, {});
10437 // Phase 1, operands
10438 auto scores = model->addOperand(&type75);
10439 auto roi = model->addOperand(&type73);
10440 auto param4 = model->addOperand(&type8);
10441 auto param5 = model->addOperand(&type15);
10442 auto param6 = model->addOperand(&type1);
10443 auto param7 = model->addOperand(&type1);
10444 auto param8 = model->addOperand(&type15);
10445 auto param9 = model->addOperand(&type15);
10446 auto param10 = model->addOperand(&type15);
10447 auto scoresOut = model->addOperand(&type76);
10448 auto roiOut = model->addOperand(&type74);
10449 auto classesOut = model->addOperand(&type6);
10450 auto batchSplitOut = model->addOperand(&type6);
10451 auto in = model->addOperand(&type72);
10452 auto param11 = model->addOperand(&type1);
10453 auto param12 = model->addOperand(&type1);
10454 auto param13 = model->addOperand(&type15);
10455 auto param14 = model->addOperand(&type15);
10456 auto param15 = model->addOperand(&type1);
10457 auto param16 = model->addOperand(&type1);
10458 auto layout = model->addOperand(&type9);
10459 auto featureMap = model->addOperand(&type71);
10460 auto param17 = model->addOperand(&type15);
10461 auto out = model->addOperand(&type71);
10462 // Phase 2, operations
10463 static _Float16 scores_init[] = {0.8999999761581421f, 0.10000000149011612f};
10464 model->setOperandValue(scores, scores_init, sizeof(_Float16) * 2);
10465 static _Float16 roi_init[] = {1.0f, 1.0f, 10.0f, 10.0f, 0.0f, 0.0f, 10.0f, 10.0f};
10466 model->setOperandValue(roi, roi_init, sizeof(_Float16) * 8);
10467 static int32_t param4_init[] = {0};
10468 model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
10469 static _Float16 param5_init[] = {0.30000001192092896f};
10470 model->setOperandValue(param5, param5_init, sizeof(_Float16) * 1);
10471 static int32_t param6_init[] = {-1};
10472 model->setOperandValue(param6, param6_init, sizeof(int32_t) * 1);
10473 static int32_t param7_init[] = {0};
10474 model->setOperandValue(param7, param7_init, sizeof(int32_t) * 1);
10475 static _Float16 param8_init[] = {0.4000000059604645f};
10476 model->setOperandValue(param8, param8_init, sizeof(_Float16) * 1);
10477 static _Float16 param9_init[] = {1.0f};
10478 model->setOperandValue(param9, param9_init, sizeof(_Float16) * 1);
10479 static _Float16 param10_init[] = {0.30000001192092896f};
10480 model->setOperandValue(param10, param10_init, sizeof(_Float16) * 1);
10481 static int32_t param11_init[] = {2};
10482 model->setOperandValue(param11, param11_init, sizeof(int32_t) * 1);
10483 static int32_t param12_init[] = {2};
10484 model->setOperandValue(param12, param12_init, sizeof(int32_t) * 1);
10485 static _Float16 param13_init[] = {2.0f};
10486 model->setOperandValue(param13, param13_init, sizeof(_Float16) * 1);
10487 static _Float16 param14_init[] = {2.0f};
10488 model->setOperandValue(param14, param14_init, sizeof(_Float16) * 1);
10489 static int32_t param15_init[] = {4};
10490 model->setOperandValue(param15, param15_init, sizeof(int32_t) * 1);
10491 static int32_t param16_init[] = {4};
10492 model->setOperandValue(param16, param16_init, sizeof(int32_t) * 1);
10493 static bool8 layout_init[] = {false};
10494 model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
10495 static _Float16 param17_init[] = {1.0f};
10496 model->setOperandValue(param17, param17_init, sizeof(_Float16) * 1);
10497 model->addOperation(ANEURALNETWORKS_BOX_WITH_NMS_LIMIT, {scores, roi, param4, param5, param6, param7, param8, param9, param10}, {scoresOut, roiOut, classesOut, batchSplitOut});
10498 model->addOperation(ANEURALNETWORKS_ROI_ALIGN, {in, roiOut, batchSplitOut, param11, param12, param13, param14, param15, param16, layout}, {featureMap});
10499 model->addOperation(ANEURALNETWORKS_SOFTMAX, {featureMap, param17}, {out});
10500 // Phase 3, inputs and outputs
10501 model->identifyInputsAndOutputs(
10502 {in},
10503 {scoresOut, classesOut, out});
10504 assert(model->isValid());
10505 }
10506
is_ignored_zero_sized_float16(int i)10507 inline bool is_ignored_zero_sized_float16(int i) {
10508 static std::set<int> ignore = {};
10509 return ignore.find(i) != ignore.end();
10510 }
10511
CreateModel_zero_sized_dynamic_output_shape(Model * model)10512 void CreateModel_zero_sized_dynamic_output_shape(Model *model) {
10513 OperandType type1(Type::INT32, {});
10514 OperandType type10(Type::TENSOR_FLOAT32, {1, 1, 1, 1});
10515 OperandType type11(Type::TENSOR_FLOAT32, {0, 2, 2, 1});
10516 OperandType type2(Type::FLOAT32, {});
10517 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
10518 OperandType type3(Type::TENSOR_FLOAT32, {1, 2});
10519 OperandType type4(Type::TENSOR_FLOAT32, {1, 8});
10520 OperandType type5(Type::TENSOR_FLOAT32, {0});
10521 OperandType type6(Type::TENSOR_INT32, {0});
10522 OperandType type7(Type::TENSOR_FLOAT32, {0, 4});
10523 OperandType type8(Type::TENSOR_INT32, {1});
10524 OperandType type9(Type::BOOL, {});
10525 // Phase 1, operands
10526 auto scores = model->addOperand(&type3);
10527 auto roi = model->addOperand(&type4);
10528 auto param4 = model->addOperand(&type8);
10529 auto param5 = model->addOperand(&type2);
10530 auto param6 = model->addOperand(&type1);
10531 auto param7 = model->addOperand(&type1);
10532 auto param8 = model->addOperand(&type2);
10533 auto param9 = model->addOperand(&type2);
10534 auto param10 = model->addOperand(&type2);
10535 auto scoresOut = model->addOperand(&type5);
10536 auto roiOut = model->addOperand(&type7);
10537 auto classesOut = model->addOperand(&type6);
10538 auto batchSplitOut = model->addOperand(&type6);
10539 auto in = model->addOperand(&type10);
10540 auto param11 = model->addOperand(&type1);
10541 auto param12 = model->addOperand(&type1);
10542 auto param13 = model->addOperand(&type2);
10543 auto param14 = model->addOperand(&type2);
10544 auto param15 = model->addOperand(&type1);
10545 auto param16 = model->addOperand(&type1);
10546 auto layout = model->addOperand(&type9);
10547 auto featureMap = model->addOperand(&type11);
10548 auto param17 = model->addOperand(&type2);
10549 auto out = model->addOperand(&type25);
10550 // Phase 2, operations
10551 static float scores_init[] = {0.9f, 0.1f};
10552 model->setOperandValue(scores, scores_init, sizeof(float) * 2);
10553 static float roi_init[] = {1.0f, 1.0f, 10.0f, 10.0f, 0.0f, 0.0f, 10.0f, 10.0f};
10554 model->setOperandValue(roi, roi_init, sizeof(float) * 8);
10555 static int32_t param4_init[] = {0};
10556 model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
10557 static float param5_init[] = {0.3f};
10558 model->setOperandValue(param5, param5_init, sizeof(float) * 1);
10559 static int32_t param6_init[] = {-1};
10560 model->setOperandValue(param6, param6_init, sizeof(int32_t) * 1);
10561 static int32_t param7_init[] = {0};
10562 model->setOperandValue(param7, param7_init, sizeof(int32_t) * 1);
10563 static float param8_init[] = {0.4f};
10564 model->setOperandValue(param8, param8_init, sizeof(float) * 1);
10565 static float param9_init[] = {1.0f};
10566 model->setOperandValue(param9, param9_init, sizeof(float) * 1);
10567 static float param10_init[] = {0.3f};
10568 model->setOperandValue(param10, param10_init, sizeof(float) * 1);
10569 static int32_t param11_init[] = {2};
10570 model->setOperandValue(param11, param11_init, sizeof(int32_t) * 1);
10571 static int32_t param12_init[] = {2};
10572 model->setOperandValue(param12, param12_init, sizeof(int32_t) * 1);
10573 static float param13_init[] = {2.0f};
10574 model->setOperandValue(param13, param13_init, sizeof(float) * 1);
10575 static float param14_init[] = {2.0f};
10576 model->setOperandValue(param14, param14_init, sizeof(float) * 1);
10577 static int32_t param15_init[] = {4};
10578 model->setOperandValue(param15, param15_init, sizeof(int32_t) * 1);
10579 static int32_t param16_init[] = {4};
10580 model->setOperandValue(param16, param16_init, sizeof(int32_t) * 1);
10581 static bool8 layout_init[] = {false};
10582 model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
10583 static float param17_init[] = {1.0f};
10584 model->setOperandValue(param17, param17_init, sizeof(float) * 1);
10585 model->addOperation(ANEURALNETWORKS_BOX_WITH_NMS_LIMIT, {scores, roi, param4, param5, param6, param7, param8, param9, param10}, {scoresOut, roiOut, classesOut, batchSplitOut});
10586 model->addOperation(ANEURALNETWORKS_ROI_ALIGN, {in, roiOut, batchSplitOut, param11, param12, param13, param14, param15, param16, layout}, {featureMap});
10587 model->addOperation(ANEURALNETWORKS_SOFTMAX, {featureMap, param17}, {out});
10588 // Phase 3, inputs and outputs
10589 model->identifyInputsAndOutputs(
10590 {in},
10591 {scoresOut, classesOut, out});
10592 assert(model->isValid());
10593 }
10594
is_ignored_zero_sized_dynamic_output_shape(int i)10595 inline bool is_ignored_zero_sized_dynamic_output_shape(int i) {
10596 static std::set<int> ignore = {};
10597 return ignore.find(i) != ignore.end();
10598 }
10599
CreateModel_zero_sized_dynamic_output_shape_relaxed(Model * model)10600 void CreateModel_zero_sized_dynamic_output_shape_relaxed(Model *model) {
10601 OperandType type1(Type::INT32, {});
10602 OperandType type10(Type::TENSOR_FLOAT32, {1, 1, 1, 1});
10603 OperandType type11(Type::TENSOR_FLOAT32, {0, 2, 2, 1});
10604 OperandType type2(Type::FLOAT32, {});
10605 OperandType type25(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
10606 OperandType type3(Type::TENSOR_FLOAT32, {1, 2});
10607 OperandType type4(Type::TENSOR_FLOAT32, {1, 8});
10608 OperandType type5(Type::TENSOR_FLOAT32, {0});
10609 OperandType type6(Type::TENSOR_INT32, {0});
10610 OperandType type7(Type::TENSOR_FLOAT32, {0, 4});
10611 OperandType type8(Type::TENSOR_INT32, {1});
10612 OperandType type9(Type::BOOL, {});
10613 // Phase 1, operands
10614 auto scores = model->addOperand(&type3);
10615 auto roi = model->addOperand(&type4);
10616 auto param4 = model->addOperand(&type8);
10617 auto param5 = model->addOperand(&type2);
10618 auto param6 = model->addOperand(&type1);
10619 auto param7 = model->addOperand(&type1);
10620 auto param8 = model->addOperand(&type2);
10621 auto param9 = model->addOperand(&type2);
10622 auto param10 = model->addOperand(&type2);
10623 auto scoresOut = model->addOperand(&type5);
10624 auto roiOut = model->addOperand(&type7);
10625 auto classesOut = model->addOperand(&type6);
10626 auto batchSplitOut = model->addOperand(&type6);
10627 auto in = model->addOperand(&type10);
10628 auto param11 = model->addOperand(&type1);
10629 auto param12 = model->addOperand(&type1);
10630 auto param13 = model->addOperand(&type2);
10631 auto param14 = model->addOperand(&type2);
10632 auto param15 = model->addOperand(&type1);
10633 auto param16 = model->addOperand(&type1);
10634 auto layout = model->addOperand(&type9);
10635 auto featureMap = model->addOperand(&type11);
10636 auto param17 = model->addOperand(&type2);
10637 auto out = model->addOperand(&type25);
10638 // Phase 2, operations
10639 static float scores_init[] = {0.9f, 0.1f};
10640 model->setOperandValue(scores, scores_init, sizeof(float) * 2);
10641 static float roi_init[] = {1.0f, 1.0f, 10.0f, 10.0f, 0.0f, 0.0f, 10.0f, 10.0f};
10642 model->setOperandValue(roi, roi_init, sizeof(float) * 8);
10643 static int32_t param4_init[] = {0};
10644 model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
10645 static float param5_init[] = {0.3f};
10646 model->setOperandValue(param5, param5_init, sizeof(float) * 1);
10647 static int32_t param6_init[] = {-1};
10648 model->setOperandValue(param6, param6_init, sizeof(int32_t) * 1);
10649 static int32_t param7_init[] = {0};
10650 model->setOperandValue(param7, param7_init, sizeof(int32_t) * 1);
10651 static float param8_init[] = {0.4f};
10652 model->setOperandValue(param8, param8_init, sizeof(float) * 1);
10653 static float param9_init[] = {1.0f};
10654 model->setOperandValue(param9, param9_init, sizeof(float) * 1);
10655 static float param10_init[] = {0.3f};
10656 model->setOperandValue(param10, param10_init, sizeof(float) * 1);
10657 static int32_t param11_init[] = {2};
10658 model->setOperandValue(param11, param11_init, sizeof(int32_t) * 1);
10659 static int32_t param12_init[] = {2};
10660 model->setOperandValue(param12, param12_init, sizeof(int32_t) * 1);
10661 static float param13_init[] = {2.0f};
10662 model->setOperandValue(param13, param13_init, sizeof(float) * 1);
10663 static float param14_init[] = {2.0f};
10664 model->setOperandValue(param14, param14_init, sizeof(float) * 1);
10665 static int32_t param15_init[] = {4};
10666 model->setOperandValue(param15, param15_init, sizeof(int32_t) * 1);
10667 static int32_t param16_init[] = {4};
10668 model->setOperandValue(param16, param16_init, sizeof(int32_t) * 1);
10669 static bool8 layout_init[] = {false};
10670 model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
10671 static float param17_init[] = {1.0f};
10672 model->setOperandValue(param17, param17_init, sizeof(float) * 1);
10673 model->addOperation(ANEURALNETWORKS_BOX_WITH_NMS_LIMIT, {scores, roi, param4, param5, param6, param7, param8, param9, param10}, {scoresOut, roiOut, classesOut, batchSplitOut});
10674 model->addOperation(ANEURALNETWORKS_ROI_ALIGN, {in, roiOut, batchSplitOut, param11, param12, param13, param14, param15, param16, layout}, {featureMap});
10675 model->addOperation(ANEURALNETWORKS_SOFTMAX, {featureMap, param17}, {out});
10676 // Phase 3, inputs and outputs
10677 model->identifyInputsAndOutputs(
10678 {in},
10679 {scoresOut, classesOut, out});
10680 // Phase 4: set relaxed execution
10681 model->relaxComputationFloat32toFloat16(true);
10682 assert(model->isValid());
10683 }
10684
is_ignored_zero_sized_dynamic_output_shape_relaxed(int i)10685 inline bool is_ignored_zero_sized_dynamic_output_shape_relaxed(int i) {
10686 static std::set<int> ignore = {};
10687 return ignore.find(i) != ignore.end();
10688 }
10689
CreateModel_zero_sized_dynamic_output_shape_quant8(Model * model)10690 void CreateModel_zero_sized_dynamic_output_shape_quant8(Model *model) {
10691 OperandType type1(Type::INT32, {});
10692 OperandType type2(Type::FLOAT32, {});
10693 OperandType type30(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.00390625f, 0);
10694 OperandType type6(Type::TENSOR_INT32, {0});
10695 OperandType type64(Type::TENSOR_QUANT8_ASYMM, {0, 2, 2, 1}, 0.1f, 128);
10696 OperandType type65(Type::TENSOR_QUANT8_ASYMM, {1, 1, 1, 1}, 0.1f, 128);
10697 OperandType type67(Type::TENSOR_QUANT16_ASYMM, {1, 8}, 0.125f, 0);
10698 OperandType type68(Type::TENSOR_QUANT16_ASYMM, {0, 4}, 0.125f, 0);
10699 OperandType type69(Type::TENSOR_QUANT8_ASYMM, {1, 2}, 0.1f, 128);
10700 OperandType type70(Type::TENSOR_QUANT8_ASYMM, {0}, 0.1f, 128);
10701 OperandType type8(Type::TENSOR_INT32, {1});
10702 OperandType type9(Type::BOOL, {});
10703 // Phase 1, operands
10704 auto scores = model->addOperand(&type69);
10705 auto roi = model->addOperand(&type67);
10706 auto param4 = model->addOperand(&type8);
10707 auto param5 = model->addOperand(&type2);
10708 auto param6 = model->addOperand(&type1);
10709 auto param7 = model->addOperand(&type1);
10710 auto param8 = model->addOperand(&type2);
10711 auto param9 = model->addOperand(&type2);
10712 auto param10 = model->addOperand(&type2);
10713 auto scoresOut = model->addOperand(&type70);
10714 auto roiOut = model->addOperand(&type68);
10715 auto classesOut = model->addOperand(&type6);
10716 auto batchSplitOut = model->addOperand(&type6);
10717 auto in = model->addOperand(&type65);
10718 auto param11 = model->addOperand(&type1);
10719 auto param12 = model->addOperand(&type1);
10720 auto param13 = model->addOperand(&type2);
10721 auto param14 = model->addOperand(&type2);
10722 auto param15 = model->addOperand(&type1);
10723 auto param16 = model->addOperand(&type1);
10724 auto layout = model->addOperand(&type9);
10725 auto featureMap = model->addOperand(&type64);
10726 auto param17 = model->addOperand(&type2);
10727 auto out = model->addOperand(&type30);
10728 // Phase 2, operations
10729 static uint8_t scores_init[] = {137, 129};
10730 model->setOperandValue(scores, scores_init, sizeof(uint8_t) * 2);
10731 static uint16_t roi_init[] = {8, 8, 80, 80, 0, 0, 80, 80};
10732 model->setOperandValue(roi, roi_init, sizeof(uint16_t) * 8);
10733 static int32_t param4_init[] = {0};
10734 model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
10735 static float param5_init[] = {0.3f};
10736 model->setOperandValue(param5, param5_init, sizeof(float) * 1);
10737 static int32_t param6_init[] = {-1};
10738 model->setOperandValue(param6, param6_init, sizeof(int32_t) * 1);
10739 static int32_t param7_init[] = {0};
10740 model->setOperandValue(param7, param7_init, sizeof(int32_t) * 1);
10741 static float param8_init[] = {0.4f};
10742 model->setOperandValue(param8, param8_init, sizeof(float) * 1);
10743 static float param9_init[] = {1.0f};
10744 model->setOperandValue(param9, param9_init, sizeof(float) * 1);
10745 static float param10_init[] = {0.3f};
10746 model->setOperandValue(param10, param10_init, sizeof(float) * 1);
10747 static int32_t param11_init[] = {2};
10748 model->setOperandValue(param11, param11_init, sizeof(int32_t) * 1);
10749 static int32_t param12_init[] = {2};
10750 model->setOperandValue(param12, param12_init, sizeof(int32_t) * 1);
10751 static float param13_init[] = {2.0f};
10752 model->setOperandValue(param13, param13_init, sizeof(float) * 1);
10753 static float param14_init[] = {2.0f};
10754 model->setOperandValue(param14, param14_init, sizeof(float) * 1);
10755 static int32_t param15_init[] = {4};
10756 model->setOperandValue(param15, param15_init, sizeof(int32_t) * 1);
10757 static int32_t param16_init[] = {4};
10758 model->setOperandValue(param16, param16_init, sizeof(int32_t) * 1);
10759 static bool8 layout_init[] = {false};
10760 model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
10761 static float param17_init[] = {1.0f};
10762 model->setOperandValue(param17, param17_init, sizeof(float) * 1);
10763 model->addOperation(ANEURALNETWORKS_BOX_WITH_NMS_LIMIT, {scores, roi, param4, param5, param6, param7, param8, param9, param10}, {scoresOut, roiOut, classesOut, batchSplitOut});
10764 model->addOperation(ANEURALNETWORKS_ROI_ALIGN, {in, roiOut, batchSplitOut, param11, param12, param13, param14, param15, param16, layout}, {featureMap});
10765 model->addOperation(ANEURALNETWORKS_SOFTMAX, {featureMap, param17}, {out});
10766 // Phase 3, inputs and outputs
10767 model->identifyInputsAndOutputs(
10768 {in},
10769 {scoresOut, classesOut, out});
10770 assert(model->isValid());
10771 }
10772
is_ignored_zero_sized_dynamic_output_shape_quant8(int i)10773 inline bool is_ignored_zero_sized_dynamic_output_shape_quant8(int i) {
10774 static std::set<int> ignore = {};
10775 return ignore.find(i) != ignore.end();
10776 }
10777
CreateModel_zero_sized_dynamic_output_shape_float16(Model * model)10778 void CreateModel_zero_sized_dynamic_output_shape_float16(Model *model) {
10779 OperandType type1(Type::INT32, {});
10780 OperandType type15(Type::FLOAT16, {});
10781 OperandType type27(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
10782 OperandType type28(Type::TENSOR_FLOAT16, {0});
10783 OperandType type6(Type::TENSOR_INT32, {0});
10784 OperandType type71(Type::TENSOR_FLOAT16, {0, 2, 2, 1});
10785 OperandType type72(Type::TENSOR_FLOAT16, {1, 1, 1, 1});
10786 OperandType type73(Type::TENSOR_FLOAT16, {1, 8});
10787 OperandType type74(Type::TENSOR_FLOAT16, {0, 4});
10788 OperandType type75(Type::TENSOR_FLOAT16, {1, 2});
10789 OperandType type8(Type::TENSOR_INT32, {1});
10790 OperandType type9(Type::BOOL, {});
10791 // Phase 1, operands
10792 auto scores = model->addOperand(&type75);
10793 auto roi = model->addOperand(&type73);
10794 auto param4 = model->addOperand(&type8);
10795 auto param5 = model->addOperand(&type15);
10796 auto param6 = model->addOperand(&type1);
10797 auto param7 = model->addOperand(&type1);
10798 auto param8 = model->addOperand(&type15);
10799 auto param9 = model->addOperand(&type15);
10800 auto param10 = model->addOperand(&type15);
10801 auto scoresOut = model->addOperand(&type28);
10802 auto roiOut = model->addOperand(&type74);
10803 auto classesOut = model->addOperand(&type6);
10804 auto batchSplitOut = model->addOperand(&type6);
10805 auto in = model->addOperand(&type72);
10806 auto param11 = model->addOperand(&type1);
10807 auto param12 = model->addOperand(&type1);
10808 auto param13 = model->addOperand(&type15);
10809 auto param14 = model->addOperand(&type15);
10810 auto param15 = model->addOperand(&type1);
10811 auto param16 = model->addOperand(&type1);
10812 auto layout = model->addOperand(&type9);
10813 auto featureMap = model->addOperand(&type71);
10814 auto param17 = model->addOperand(&type15);
10815 auto out = model->addOperand(&type27);
10816 // Phase 2, operations
10817 static _Float16 scores_init[] = {0.8999999761581421f, 0.10000000149011612f};
10818 model->setOperandValue(scores, scores_init, sizeof(_Float16) * 2);
10819 static _Float16 roi_init[] = {1.0f, 1.0f, 10.0f, 10.0f, 0.0f, 0.0f, 10.0f, 10.0f};
10820 model->setOperandValue(roi, roi_init, sizeof(_Float16) * 8);
10821 static int32_t param4_init[] = {0};
10822 model->setOperandValue(param4, param4_init, sizeof(int32_t) * 1);
10823 static _Float16 param5_init[] = {0.30000001192092896f};
10824 model->setOperandValue(param5, param5_init, sizeof(_Float16) * 1);
10825 static int32_t param6_init[] = {-1};
10826 model->setOperandValue(param6, param6_init, sizeof(int32_t) * 1);
10827 static int32_t param7_init[] = {0};
10828 model->setOperandValue(param7, param7_init, sizeof(int32_t) * 1);
10829 static _Float16 param8_init[] = {0.4000000059604645f};
10830 model->setOperandValue(param8, param8_init, sizeof(_Float16) * 1);
10831 static _Float16 param9_init[] = {1.0f};
10832 model->setOperandValue(param9, param9_init, sizeof(_Float16) * 1);
10833 static _Float16 param10_init[] = {0.30000001192092896f};
10834 model->setOperandValue(param10, param10_init, sizeof(_Float16) * 1);
10835 static int32_t param11_init[] = {2};
10836 model->setOperandValue(param11, param11_init, sizeof(int32_t) * 1);
10837 static int32_t param12_init[] = {2};
10838 model->setOperandValue(param12, param12_init, sizeof(int32_t) * 1);
10839 static _Float16 param13_init[] = {2.0f};
10840 model->setOperandValue(param13, param13_init, sizeof(_Float16) * 1);
10841 static _Float16 param14_init[] = {2.0f};
10842 model->setOperandValue(param14, param14_init, sizeof(_Float16) * 1);
10843 static int32_t param15_init[] = {4};
10844 model->setOperandValue(param15, param15_init, sizeof(int32_t) * 1);
10845 static int32_t param16_init[] = {4};
10846 model->setOperandValue(param16, param16_init, sizeof(int32_t) * 1);
10847 static bool8 layout_init[] = {false};
10848 model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
10849 static _Float16 param17_init[] = {1.0f};
10850 model->setOperandValue(param17, param17_init, sizeof(_Float16) * 1);
10851 model->addOperation(ANEURALNETWORKS_BOX_WITH_NMS_LIMIT, {scores, roi, param4, param5, param6, param7, param8, param9, param10}, {scoresOut, roiOut, classesOut, batchSplitOut});
10852 model->addOperation(ANEURALNETWORKS_ROI_ALIGN, {in, roiOut, batchSplitOut, param11, param12, param13, param14, param15, param16, layout}, {featureMap});
10853 model->addOperation(ANEURALNETWORKS_SOFTMAX, {featureMap, param17}, {out});
10854 // Phase 3, inputs and outputs
10855 model->identifyInputsAndOutputs(
10856 {in},
10857 {scoresOut, classesOut, out});
10858 assert(model->isValid());
10859 }
10860
is_ignored_zero_sized_dynamic_output_shape_float16(int i)10861 inline bool is_ignored_zero_sized_dynamic_output_shape_float16(int i) {
10862 static std::set<int> ignore = {};
10863 return ignore.find(i) != ignore.end();
10864 }
10865
10866