1 // clang-format off
2 // Generated file (from: gather.mod.py). Do not edit
3 // Create the model
createTestModel()4 Model createTestModel() {
5 const std::vector<Operand> operands = {
6 {
7 .type = OperandType::TENSOR_FLOAT32,
8 .dimensions = {2, 2},
9 .numberOfConsumers = 1,
10 .scale = 0.0f,
11 .zeroPoint = 0,
12 .lifetime = OperandLifeTime::MODEL_INPUT,
13 .location = {.poolIndex = 0, .offset = 0, .length = 0},
14 },
15 {
16 .type = OperandType::INT32,
17 .dimensions = {},
18 .numberOfConsumers = 1,
19 .scale = 0.0f,
20 .zeroPoint = 0,
21 .lifetime = OperandLifeTime::CONSTANT_COPY,
22 .location = {.poolIndex = 0, .offset = 0, .length = 4},
23 },
24 {
25 .type = OperandType::TENSOR_INT32,
26 .dimensions = {2},
27 .numberOfConsumers = 1,
28 .scale = 0.0f,
29 .zeroPoint = 0,
30 .lifetime = OperandLifeTime::CONSTANT_COPY,
31 .location = {.poolIndex = 0, .offset = 4, .length = 8},
32 },
33 {
34 .type = OperandType::TENSOR_FLOAT32,
35 .dimensions = {2, 2},
36 .numberOfConsumers = 0,
37 .scale = 0.0f,
38 .zeroPoint = 0,
39 .lifetime = OperandLifeTime::MODEL_OUTPUT,
40 .location = {.poolIndex = 0, .offset = 0, .length = 0},
41 }
42 };
43
44 const std::vector<Operation> operations = {
45 {
46 .type = OperationType::GATHER,
47 .inputs = {0, 1, 2},
48 .outputs = {3},
49 }
50 };
51
52 const std::vector<uint32_t> inputIndexes = {0};
53 const std::vector<uint32_t> outputIndexes = {3};
54 std::vector<uint8_t> operandValues = {
55 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
56 };
57 const std::vector<hidl_memory> pools = {};
58
59 return {
60 .operands = operands,
61 .operations = operations,
62 .inputIndexes = inputIndexes,
63 .outputIndexes = outputIndexes,
64 .operandValues = operandValues,
65 .pools = pools,
66 };
67 }
68
is_ignored(int i)69 inline bool is_ignored(int i) {
70 static std::set<int> ignore = {};
71 return ignore.find(i) != ignore.end();
72 }
73
74 // Create the model
createTestModel_relaxed()75 Model createTestModel_relaxed() {
76 const std::vector<Operand> operands = {
77 {
78 .type = OperandType::TENSOR_FLOAT32,
79 .dimensions = {2, 2},
80 .numberOfConsumers = 1,
81 .scale = 0.0f,
82 .zeroPoint = 0,
83 .lifetime = OperandLifeTime::MODEL_INPUT,
84 .location = {.poolIndex = 0, .offset = 0, .length = 0},
85 },
86 {
87 .type = OperandType::INT32,
88 .dimensions = {},
89 .numberOfConsumers = 1,
90 .scale = 0.0f,
91 .zeroPoint = 0,
92 .lifetime = OperandLifeTime::CONSTANT_COPY,
93 .location = {.poolIndex = 0, .offset = 0, .length = 4},
94 },
95 {
96 .type = OperandType::TENSOR_INT32,
97 .dimensions = {2},
98 .numberOfConsumers = 1,
99 .scale = 0.0f,
100 .zeroPoint = 0,
101 .lifetime = OperandLifeTime::CONSTANT_COPY,
102 .location = {.poolIndex = 0, .offset = 4, .length = 8},
103 },
104 {
105 .type = OperandType::TENSOR_FLOAT32,
106 .dimensions = {2, 2},
107 .numberOfConsumers = 0,
108 .scale = 0.0f,
109 .zeroPoint = 0,
110 .lifetime = OperandLifeTime::MODEL_OUTPUT,
111 .location = {.poolIndex = 0, .offset = 0, .length = 0},
112 }
113 };
114
115 const std::vector<Operation> operations = {
116 {
117 .type = OperationType::GATHER,
118 .inputs = {0, 1, 2},
119 .outputs = {3},
120 }
121 };
122
123 const std::vector<uint32_t> inputIndexes = {0};
124 const std::vector<uint32_t> outputIndexes = {3};
125 std::vector<uint8_t> operandValues = {
126 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
127 };
128 const std::vector<hidl_memory> pools = {};
129
130 return {
131 .operands = operands,
132 .operations = operations,
133 .inputIndexes = inputIndexes,
134 .outputIndexes = outputIndexes,
135 .operandValues = operandValues,
136 .pools = pools,
137 .relaxComputationFloat32toFloat16 = true,
138 };
139 }
140
is_ignored_relaxed(int i)141 inline bool is_ignored_relaxed(int i) {
142 static std::set<int> ignore = {};
143 return ignore.find(i) != ignore.end();
144 }
145
146 // Create the model
createTestModel_quant8()147 Model createTestModel_quant8() {
148 const std::vector<Operand> operands = {
149 {
150 .type = OperandType::TENSOR_QUANT8_ASYMM,
151 .dimensions = {2, 2},
152 .numberOfConsumers = 1,
153 .scale = 0.5f,
154 .zeroPoint = 127,
155 .lifetime = OperandLifeTime::MODEL_INPUT,
156 .location = {.poolIndex = 0, .offset = 0, .length = 0},
157 },
158 {
159 .type = OperandType::INT32,
160 .dimensions = {},
161 .numberOfConsumers = 1,
162 .scale = 0.0f,
163 .zeroPoint = 0,
164 .lifetime = OperandLifeTime::CONSTANT_COPY,
165 .location = {.poolIndex = 0, .offset = 0, .length = 4},
166 },
167 {
168 .type = OperandType::TENSOR_INT32,
169 .dimensions = {2},
170 .numberOfConsumers = 1,
171 .scale = 0.0f,
172 .zeroPoint = 0,
173 .lifetime = OperandLifeTime::CONSTANT_COPY,
174 .location = {.poolIndex = 0, .offset = 4, .length = 8},
175 },
176 {
177 .type = OperandType::TENSOR_QUANT8_ASYMM,
178 .dimensions = {2, 2},
179 .numberOfConsumers = 0,
180 .scale = 0.5f,
181 .zeroPoint = 127,
182 .lifetime = OperandLifeTime::MODEL_OUTPUT,
183 .location = {.poolIndex = 0, .offset = 0, .length = 0},
184 }
185 };
186
187 const std::vector<Operation> operations = {
188 {
189 .type = OperationType::GATHER,
190 .inputs = {0, 1, 2},
191 .outputs = {3},
192 }
193 };
194
195 const std::vector<uint32_t> inputIndexes = {0};
196 const std::vector<uint32_t> outputIndexes = {3};
197 std::vector<uint8_t> operandValues = {
198 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
199 };
200 const std::vector<hidl_memory> pools = {};
201
202 return {
203 .operands = operands,
204 .operations = operations,
205 .inputIndexes = inputIndexes,
206 .outputIndexes = outputIndexes,
207 .operandValues = operandValues,
208 .pools = pools,
209 };
210 }
211
is_ignored_quant8(int i)212 inline bool is_ignored_quant8(int i) {
213 static std::set<int> ignore = {};
214 return ignore.find(i) != ignore.end();
215 }
216
217 // Create the model
createTestModel_int32()218 Model createTestModel_int32() {
219 const std::vector<Operand> operands = {
220 {
221 .type = OperandType::TENSOR_INT32,
222 .dimensions = {2, 2},
223 .numberOfConsumers = 1,
224 .scale = 0.0f,
225 .zeroPoint = 0,
226 .lifetime = OperandLifeTime::MODEL_INPUT,
227 .location = {.poolIndex = 0, .offset = 0, .length = 0},
228 },
229 {
230 .type = OperandType::INT32,
231 .dimensions = {},
232 .numberOfConsumers = 1,
233 .scale = 0.0f,
234 .zeroPoint = 0,
235 .lifetime = OperandLifeTime::CONSTANT_COPY,
236 .location = {.poolIndex = 0, .offset = 0, .length = 4},
237 },
238 {
239 .type = OperandType::TENSOR_INT32,
240 .dimensions = {2},
241 .numberOfConsumers = 1,
242 .scale = 0.0f,
243 .zeroPoint = 0,
244 .lifetime = OperandLifeTime::CONSTANT_COPY,
245 .location = {.poolIndex = 0, .offset = 4, .length = 8},
246 },
247 {
248 .type = OperandType::TENSOR_INT32,
249 .dimensions = {2, 2},
250 .numberOfConsumers = 0,
251 .scale = 0.0f,
252 .zeroPoint = 0,
253 .lifetime = OperandLifeTime::MODEL_OUTPUT,
254 .location = {.poolIndex = 0, .offset = 0, .length = 0},
255 }
256 };
257
258 const std::vector<Operation> operations = {
259 {
260 .type = OperationType::GATHER,
261 .inputs = {0, 1, 2},
262 .outputs = {3},
263 }
264 };
265
266 const std::vector<uint32_t> inputIndexes = {0};
267 const std::vector<uint32_t> outputIndexes = {3};
268 std::vector<uint8_t> operandValues = {
269 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
270 };
271 const std::vector<hidl_memory> pools = {};
272
273 return {
274 .operands = operands,
275 .operations = operations,
276 .inputIndexes = inputIndexes,
277 .outputIndexes = outputIndexes,
278 .operandValues = operandValues,
279 .pools = pools,
280 };
281 }
282
is_ignored_int32(int i)283 inline bool is_ignored_int32(int i) {
284 static std::set<int> ignore = {};
285 return ignore.find(i) != ignore.end();
286 }
287
288 // Create the model
createTestModel_float16()289 Model createTestModel_float16() {
290 const std::vector<Operand> operands = {
291 {
292 .type = OperandType::TENSOR_FLOAT16,
293 .dimensions = {2, 2},
294 .numberOfConsumers = 1,
295 .scale = 0.0f,
296 .zeroPoint = 0,
297 .lifetime = OperandLifeTime::MODEL_INPUT,
298 .location = {.poolIndex = 0, .offset = 0, .length = 0},
299 },
300 {
301 .type = OperandType::INT32,
302 .dimensions = {},
303 .numberOfConsumers = 1,
304 .scale = 0.0f,
305 .zeroPoint = 0,
306 .lifetime = OperandLifeTime::CONSTANT_COPY,
307 .location = {.poolIndex = 0, .offset = 0, .length = 4},
308 },
309 {
310 .type = OperandType::TENSOR_INT32,
311 .dimensions = {2},
312 .numberOfConsumers = 1,
313 .scale = 0.0f,
314 .zeroPoint = 0,
315 .lifetime = OperandLifeTime::CONSTANT_COPY,
316 .location = {.poolIndex = 0, .offset = 4, .length = 8},
317 },
318 {
319 .type = OperandType::TENSOR_FLOAT16,
320 .dimensions = {2, 2},
321 .numberOfConsumers = 0,
322 .scale = 0.0f,
323 .zeroPoint = 0,
324 .lifetime = OperandLifeTime::MODEL_OUTPUT,
325 .location = {.poolIndex = 0, .offset = 0, .length = 0},
326 }
327 };
328
329 const std::vector<Operation> operations = {
330 {
331 .type = OperationType::GATHER,
332 .inputs = {0, 1, 2},
333 .outputs = {3},
334 }
335 };
336
337 const std::vector<uint32_t> inputIndexes = {0};
338 const std::vector<uint32_t> outputIndexes = {3};
339 std::vector<uint8_t> operandValues = {
340 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
341 };
342 const std::vector<hidl_memory> pools = {};
343
344 return {
345 .operands = operands,
346 .operations = operations,
347 .inputIndexes = inputIndexes,
348 .outputIndexes = outputIndexes,
349 .operandValues = operandValues,
350 .pools = pools,
351 };
352 }
353
is_ignored_float16(int i)354 inline bool is_ignored_float16(int i) {
355 static std::set<int> ignore = {};
356 return ignore.find(i) != ignore.end();
357 }
358
359 // Create the model
createTestModel_dynamic_output_shape()360 Model createTestModel_dynamic_output_shape() {
361 const std::vector<Operand> operands = {
362 {
363 .type = OperandType::TENSOR_FLOAT32,
364 .dimensions = {2, 2},
365 .numberOfConsumers = 1,
366 .scale = 0.0f,
367 .zeroPoint = 0,
368 .lifetime = OperandLifeTime::MODEL_INPUT,
369 .location = {.poolIndex = 0, .offset = 0, .length = 0},
370 },
371 {
372 .type = OperandType::INT32,
373 .dimensions = {},
374 .numberOfConsumers = 1,
375 .scale = 0.0f,
376 .zeroPoint = 0,
377 .lifetime = OperandLifeTime::CONSTANT_COPY,
378 .location = {.poolIndex = 0, .offset = 0, .length = 4},
379 },
380 {
381 .type = OperandType::TENSOR_INT32,
382 .dimensions = {2},
383 .numberOfConsumers = 1,
384 .scale = 0.0f,
385 .zeroPoint = 0,
386 .lifetime = OperandLifeTime::CONSTANT_COPY,
387 .location = {.poolIndex = 0, .offset = 4, .length = 8},
388 },
389 {
390 .type = OperandType::TENSOR_FLOAT32,
391 .dimensions = {0, 0},
392 .numberOfConsumers = 0,
393 .scale = 0.0f,
394 .zeroPoint = 0,
395 .lifetime = OperandLifeTime::MODEL_OUTPUT,
396 .location = {.poolIndex = 0, .offset = 0, .length = 0},
397 }
398 };
399
400 const std::vector<Operation> operations = {
401 {
402 .type = OperationType::GATHER,
403 .inputs = {0, 1, 2},
404 .outputs = {3},
405 }
406 };
407
408 const std::vector<uint32_t> inputIndexes = {0};
409 const std::vector<uint32_t> outputIndexes = {3};
410 std::vector<uint8_t> operandValues = {
411 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
412 };
413 const std::vector<hidl_memory> pools = {};
414
415 return {
416 .operands = operands,
417 .operations = operations,
418 .inputIndexes = inputIndexes,
419 .outputIndexes = outputIndexes,
420 .operandValues = operandValues,
421 .pools = pools,
422 };
423 }
424
is_ignored_dynamic_output_shape(int i)425 inline bool is_ignored_dynamic_output_shape(int i) {
426 static std::set<int> ignore = {};
427 return ignore.find(i) != ignore.end();
428 }
429
430 // Create the model
createTestModel_dynamic_output_shape_relaxed()431 Model createTestModel_dynamic_output_shape_relaxed() {
432 const std::vector<Operand> operands = {
433 {
434 .type = OperandType::TENSOR_FLOAT32,
435 .dimensions = {2, 2},
436 .numberOfConsumers = 1,
437 .scale = 0.0f,
438 .zeroPoint = 0,
439 .lifetime = OperandLifeTime::MODEL_INPUT,
440 .location = {.poolIndex = 0, .offset = 0, .length = 0},
441 },
442 {
443 .type = OperandType::INT32,
444 .dimensions = {},
445 .numberOfConsumers = 1,
446 .scale = 0.0f,
447 .zeroPoint = 0,
448 .lifetime = OperandLifeTime::CONSTANT_COPY,
449 .location = {.poolIndex = 0, .offset = 0, .length = 4},
450 },
451 {
452 .type = OperandType::TENSOR_INT32,
453 .dimensions = {2},
454 .numberOfConsumers = 1,
455 .scale = 0.0f,
456 .zeroPoint = 0,
457 .lifetime = OperandLifeTime::CONSTANT_COPY,
458 .location = {.poolIndex = 0, .offset = 4, .length = 8},
459 },
460 {
461 .type = OperandType::TENSOR_FLOAT32,
462 .dimensions = {0, 0},
463 .numberOfConsumers = 0,
464 .scale = 0.0f,
465 .zeroPoint = 0,
466 .lifetime = OperandLifeTime::MODEL_OUTPUT,
467 .location = {.poolIndex = 0, .offset = 0, .length = 0},
468 }
469 };
470
471 const std::vector<Operation> operations = {
472 {
473 .type = OperationType::GATHER,
474 .inputs = {0, 1, 2},
475 .outputs = {3},
476 }
477 };
478
479 const std::vector<uint32_t> inputIndexes = {0};
480 const std::vector<uint32_t> outputIndexes = {3};
481 std::vector<uint8_t> operandValues = {
482 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
483 };
484 const std::vector<hidl_memory> pools = {};
485
486 return {
487 .operands = operands,
488 .operations = operations,
489 .inputIndexes = inputIndexes,
490 .outputIndexes = outputIndexes,
491 .operandValues = operandValues,
492 .pools = pools,
493 .relaxComputationFloat32toFloat16 = true,
494 };
495 }
496
is_ignored_dynamic_output_shape_relaxed(int i)497 inline bool is_ignored_dynamic_output_shape_relaxed(int i) {
498 static std::set<int> ignore = {};
499 return ignore.find(i) != ignore.end();
500 }
501
502 // Create the model
createTestModel_dynamic_output_shape_quant8()503 Model createTestModel_dynamic_output_shape_quant8() {
504 const std::vector<Operand> operands = {
505 {
506 .type = OperandType::TENSOR_QUANT8_ASYMM,
507 .dimensions = {2, 2},
508 .numberOfConsumers = 1,
509 .scale = 0.5f,
510 .zeroPoint = 127,
511 .lifetime = OperandLifeTime::MODEL_INPUT,
512 .location = {.poolIndex = 0, .offset = 0, .length = 0},
513 },
514 {
515 .type = OperandType::INT32,
516 .dimensions = {},
517 .numberOfConsumers = 1,
518 .scale = 0.0f,
519 .zeroPoint = 0,
520 .lifetime = OperandLifeTime::CONSTANT_COPY,
521 .location = {.poolIndex = 0, .offset = 0, .length = 4},
522 },
523 {
524 .type = OperandType::TENSOR_INT32,
525 .dimensions = {2},
526 .numberOfConsumers = 1,
527 .scale = 0.0f,
528 .zeroPoint = 0,
529 .lifetime = OperandLifeTime::CONSTANT_COPY,
530 .location = {.poolIndex = 0, .offset = 4, .length = 8},
531 },
532 {
533 .type = OperandType::TENSOR_QUANT8_ASYMM,
534 .dimensions = {0, 0},
535 .numberOfConsumers = 0,
536 .scale = 0.5f,
537 .zeroPoint = 127,
538 .lifetime = OperandLifeTime::MODEL_OUTPUT,
539 .location = {.poolIndex = 0, .offset = 0, .length = 0},
540 }
541 };
542
543 const std::vector<Operation> operations = {
544 {
545 .type = OperationType::GATHER,
546 .inputs = {0, 1, 2},
547 .outputs = {3},
548 }
549 };
550
551 const std::vector<uint32_t> inputIndexes = {0};
552 const std::vector<uint32_t> outputIndexes = {3};
553 std::vector<uint8_t> operandValues = {
554 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
555 };
556 const std::vector<hidl_memory> pools = {};
557
558 return {
559 .operands = operands,
560 .operations = operations,
561 .inputIndexes = inputIndexes,
562 .outputIndexes = outputIndexes,
563 .operandValues = operandValues,
564 .pools = pools,
565 };
566 }
567
is_ignored_dynamic_output_shape_quant8(int i)568 inline bool is_ignored_dynamic_output_shape_quant8(int i) {
569 static std::set<int> ignore = {};
570 return ignore.find(i) != ignore.end();
571 }
572
573 // Create the model
createTestModel_dynamic_output_shape_int32()574 Model createTestModel_dynamic_output_shape_int32() {
575 const std::vector<Operand> operands = {
576 {
577 .type = OperandType::TENSOR_INT32,
578 .dimensions = {2, 2},
579 .numberOfConsumers = 1,
580 .scale = 0.0f,
581 .zeroPoint = 0,
582 .lifetime = OperandLifeTime::MODEL_INPUT,
583 .location = {.poolIndex = 0, .offset = 0, .length = 0},
584 },
585 {
586 .type = OperandType::INT32,
587 .dimensions = {},
588 .numberOfConsumers = 1,
589 .scale = 0.0f,
590 .zeroPoint = 0,
591 .lifetime = OperandLifeTime::CONSTANT_COPY,
592 .location = {.poolIndex = 0, .offset = 0, .length = 4},
593 },
594 {
595 .type = OperandType::TENSOR_INT32,
596 .dimensions = {2},
597 .numberOfConsumers = 1,
598 .scale = 0.0f,
599 .zeroPoint = 0,
600 .lifetime = OperandLifeTime::CONSTANT_COPY,
601 .location = {.poolIndex = 0, .offset = 4, .length = 8},
602 },
603 {
604 .type = OperandType::TENSOR_INT32,
605 .dimensions = {0, 0},
606 .numberOfConsumers = 0,
607 .scale = 0.0f,
608 .zeroPoint = 0,
609 .lifetime = OperandLifeTime::MODEL_OUTPUT,
610 .location = {.poolIndex = 0, .offset = 0, .length = 0},
611 }
612 };
613
614 const std::vector<Operation> operations = {
615 {
616 .type = OperationType::GATHER,
617 .inputs = {0, 1, 2},
618 .outputs = {3},
619 }
620 };
621
622 const std::vector<uint32_t> inputIndexes = {0};
623 const std::vector<uint32_t> outputIndexes = {3};
624 std::vector<uint8_t> operandValues = {
625 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
626 };
627 const std::vector<hidl_memory> pools = {};
628
629 return {
630 .operands = operands,
631 .operations = operations,
632 .inputIndexes = inputIndexes,
633 .outputIndexes = outputIndexes,
634 .operandValues = operandValues,
635 .pools = pools,
636 };
637 }
638
is_ignored_dynamic_output_shape_int32(int i)639 inline bool is_ignored_dynamic_output_shape_int32(int i) {
640 static std::set<int> ignore = {};
641 return ignore.find(i) != ignore.end();
642 }
643
644 // Create the model
createTestModel_dynamic_output_shape_float16()645 Model createTestModel_dynamic_output_shape_float16() {
646 const std::vector<Operand> operands = {
647 {
648 .type = OperandType::TENSOR_FLOAT16,
649 .dimensions = {2, 2},
650 .numberOfConsumers = 1,
651 .scale = 0.0f,
652 .zeroPoint = 0,
653 .lifetime = OperandLifeTime::MODEL_INPUT,
654 .location = {.poolIndex = 0, .offset = 0, .length = 0},
655 },
656 {
657 .type = OperandType::INT32,
658 .dimensions = {},
659 .numberOfConsumers = 1,
660 .scale = 0.0f,
661 .zeroPoint = 0,
662 .lifetime = OperandLifeTime::CONSTANT_COPY,
663 .location = {.poolIndex = 0, .offset = 0, .length = 4},
664 },
665 {
666 .type = OperandType::TENSOR_INT32,
667 .dimensions = {2},
668 .numberOfConsumers = 1,
669 .scale = 0.0f,
670 .zeroPoint = 0,
671 .lifetime = OperandLifeTime::CONSTANT_COPY,
672 .location = {.poolIndex = 0, .offset = 4, .length = 8},
673 },
674 {
675 .type = OperandType::TENSOR_FLOAT16,
676 .dimensions = {0, 0},
677 .numberOfConsumers = 0,
678 .scale = 0.0f,
679 .zeroPoint = 0,
680 .lifetime = OperandLifeTime::MODEL_OUTPUT,
681 .location = {.poolIndex = 0, .offset = 0, .length = 0},
682 }
683 };
684
685 const std::vector<Operation> operations = {
686 {
687 .type = OperationType::GATHER,
688 .inputs = {0, 1, 2},
689 .outputs = {3},
690 }
691 };
692
693 const std::vector<uint32_t> inputIndexes = {0};
694 const std::vector<uint32_t> outputIndexes = {3};
695 std::vector<uint8_t> operandValues = {
696 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
697 };
698 const std::vector<hidl_memory> pools = {};
699
700 return {
701 .operands = operands,
702 .operations = operations,
703 .inputIndexes = inputIndexes,
704 .outputIndexes = outputIndexes,
705 .operandValues = operandValues,
706 .pools = pools,
707 };
708 }
709
is_ignored_dynamic_output_shape_float16(int i)710 inline bool is_ignored_dynamic_output_shape_float16(int i) {
711 static std::set<int> ignore = {};
712 return ignore.find(i) != ignore.end();
713 }
714
715 // Create the model
createTestModel_2()716 Model createTestModel_2() {
717 const std::vector<Operand> operands = {
718 {
719 .type = OperandType::TENSOR_FLOAT32,
720 .dimensions = {2, 2},
721 .numberOfConsumers = 1,
722 .scale = 0.0f,
723 .zeroPoint = 0,
724 .lifetime = OperandLifeTime::MODEL_INPUT,
725 .location = {.poolIndex = 0, .offset = 0, .length = 0},
726 },
727 {
728 .type = OperandType::INT32,
729 .dimensions = {},
730 .numberOfConsumers = 1,
731 .scale = 0.0f,
732 .zeroPoint = 0,
733 .lifetime = OperandLifeTime::CONSTANT_COPY,
734 .location = {.poolIndex = 0, .offset = 0, .length = 4},
735 },
736 {
737 .type = OperandType::TENSOR_INT32,
738 .dimensions = {1},
739 .numberOfConsumers = 1,
740 .scale = 0.0f,
741 .zeroPoint = 0,
742 .lifetime = OperandLifeTime::CONSTANT_COPY,
743 .location = {.poolIndex = 0, .offset = 4, .length = 4},
744 },
745 {
746 .type = OperandType::TENSOR_FLOAT32,
747 .dimensions = {1, 2},
748 .numberOfConsumers = 0,
749 .scale = 0.0f,
750 .zeroPoint = 0,
751 .lifetime = OperandLifeTime::MODEL_OUTPUT,
752 .location = {.poolIndex = 0, .offset = 0, .length = 0},
753 }
754 };
755
756 const std::vector<Operation> operations = {
757 {
758 .type = OperationType::GATHER,
759 .inputs = {0, 1, 2},
760 .outputs = {3},
761 }
762 };
763
764 const std::vector<uint32_t> inputIndexes = {0};
765 const std::vector<uint32_t> outputIndexes = {3};
766 std::vector<uint8_t> operandValues = {
767 0, 0, 0, 0, 1, 0, 0, 0
768 };
769 const std::vector<hidl_memory> pools = {};
770
771 return {
772 .operands = operands,
773 .operations = operations,
774 .inputIndexes = inputIndexes,
775 .outputIndexes = outputIndexes,
776 .operandValues = operandValues,
777 .pools = pools,
778 };
779 }
780
is_ignored_2(int i)781 inline bool is_ignored_2(int i) {
782 static std::set<int> ignore = {};
783 return ignore.find(i) != ignore.end();
784 }
785
786 // Create the model
createTestModel_relaxed_2()787 Model createTestModel_relaxed_2() {
788 const std::vector<Operand> operands = {
789 {
790 .type = OperandType::TENSOR_FLOAT32,
791 .dimensions = {2, 2},
792 .numberOfConsumers = 1,
793 .scale = 0.0f,
794 .zeroPoint = 0,
795 .lifetime = OperandLifeTime::MODEL_INPUT,
796 .location = {.poolIndex = 0, .offset = 0, .length = 0},
797 },
798 {
799 .type = OperandType::INT32,
800 .dimensions = {},
801 .numberOfConsumers = 1,
802 .scale = 0.0f,
803 .zeroPoint = 0,
804 .lifetime = OperandLifeTime::CONSTANT_COPY,
805 .location = {.poolIndex = 0, .offset = 0, .length = 4},
806 },
807 {
808 .type = OperandType::TENSOR_INT32,
809 .dimensions = {1},
810 .numberOfConsumers = 1,
811 .scale = 0.0f,
812 .zeroPoint = 0,
813 .lifetime = OperandLifeTime::CONSTANT_COPY,
814 .location = {.poolIndex = 0, .offset = 4, .length = 4},
815 },
816 {
817 .type = OperandType::TENSOR_FLOAT32,
818 .dimensions = {1, 2},
819 .numberOfConsumers = 0,
820 .scale = 0.0f,
821 .zeroPoint = 0,
822 .lifetime = OperandLifeTime::MODEL_OUTPUT,
823 .location = {.poolIndex = 0, .offset = 0, .length = 0},
824 }
825 };
826
827 const std::vector<Operation> operations = {
828 {
829 .type = OperationType::GATHER,
830 .inputs = {0, 1, 2},
831 .outputs = {3},
832 }
833 };
834
835 const std::vector<uint32_t> inputIndexes = {0};
836 const std::vector<uint32_t> outputIndexes = {3};
837 std::vector<uint8_t> operandValues = {
838 0, 0, 0, 0, 1, 0, 0, 0
839 };
840 const std::vector<hidl_memory> pools = {};
841
842 return {
843 .operands = operands,
844 .operations = operations,
845 .inputIndexes = inputIndexes,
846 .outputIndexes = outputIndexes,
847 .operandValues = operandValues,
848 .pools = pools,
849 .relaxComputationFloat32toFloat16 = true,
850 };
851 }
852
is_ignored_relaxed_2(int i)853 inline bool is_ignored_relaxed_2(int i) {
854 static std::set<int> ignore = {};
855 return ignore.find(i) != ignore.end();
856 }
857
858 // Create the model
createTestModel_quant8_2()859 Model createTestModel_quant8_2() {
860 const std::vector<Operand> operands = {
861 {
862 .type = OperandType::TENSOR_QUANT8_ASYMM,
863 .dimensions = {2, 2},
864 .numberOfConsumers = 1,
865 .scale = 0.5f,
866 .zeroPoint = 127,
867 .lifetime = OperandLifeTime::MODEL_INPUT,
868 .location = {.poolIndex = 0, .offset = 0, .length = 0},
869 },
870 {
871 .type = OperandType::INT32,
872 .dimensions = {},
873 .numberOfConsumers = 1,
874 .scale = 0.0f,
875 .zeroPoint = 0,
876 .lifetime = OperandLifeTime::CONSTANT_COPY,
877 .location = {.poolIndex = 0, .offset = 0, .length = 4},
878 },
879 {
880 .type = OperandType::TENSOR_INT32,
881 .dimensions = {1},
882 .numberOfConsumers = 1,
883 .scale = 0.0f,
884 .zeroPoint = 0,
885 .lifetime = OperandLifeTime::CONSTANT_COPY,
886 .location = {.poolIndex = 0, .offset = 4, .length = 4},
887 },
888 {
889 .type = OperandType::TENSOR_QUANT8_ASYMM,
890 .dimensions = {1, 2},
891 .numberOfConsumers = 0,
892 .scale = 0.5f,
893 .zeroPoint = 127,
894 .lifetime = OperandLifeTime::MODEL_OUTPUT,
895 .location = {.poolIndex = 0, .offset = 0, .length = 0},
896 }
897 };
898
899 const std::vector<Operation> operations = {
900 {
901 .type = OperationType::GATHER,
902 .inputs = {0, 1, 2},
903 .outputs = {3},
904 }
905 };
906
907 const std::vector<uint32_t> inputIndexes = {0};
908 const std::vector<uint32_t> outputIndexes = {3};
909 std::vector<uint8_t> operandValues = {
910 0, 0, 0, 0, 1, 0, 0, 0
911 };
912 const std::vector<hidl_memory> pools = {};
913
914 return {
915 .operands = operands,
916 .operations = operations,
917 .inputIndexes = inputIndexes,
918 .outputIndexes = outputIndexes,
919 .operandValues = operandValues,
920 .pools = pools,
921 };
922 }
923
is_ignored_quant8_2(int i)924 inline bool is_ignored_quant8_2(int i) {
925 static std::set<int> ignore = {};
926 return ignore.find(i) != ignore.end();
927 }
928
929 // Create the model
createTestModel_int32_2()930 Model createTestModel_int32_2() {
931 const std::vector<Operand> operands = {
932 {
933 .type = OperandType::TENSOR_INT32,
934 .dimensions = {2, 2},
935 .numberOfConsumers = 1,
936 .scale = 0.0f,
937 .zeroPoint = 0,
938 .lifetime = OperandLifeTime::MODEL_INPUT,
939 .location = {.poolIndex = 0, .offset = 0, .length = 0},
940 },
941 {
942 .type = OperandType::INT32,
943 .dimensions = {},
944 .numberOfConsumers = 1,
945 .scale = 0.0f,
946 .zeroPoint = 0,
947 .lifetime = OperandLifeTime::CONSTANT_COPY,
948 .location = {.poolIndex = 0, .offset = 0, .length = 4},
949 },
950 {
951 .type = OperandType::TENSOR_INT32,
952 .dimensions = {1},
953 .numberOfConsumers = 1,
954 .scale = 0.0f,
955 .zeroPoint = 0,
956 .lifetime = OperandLifeTime::CONSTANT_COPY,
957 .location = {.poolIndex = 0, .offset = 4, .length = 4},
958 },
959 {
960 .type = OperandType::TENSOR_INT32,
961 .dimensions = {1, 2},
962 .numberOfConsumers = 0,
963 .scale = 0.0f,
964 .zeroPoint = 0,
965 .lifetime = OperandLifeTime::MODEL_OUTPUT,
966 .location = {.poolIndex = 0, .offset = 0, .length = 0},
967 }
968 };
969
970 const std::vector<Operation> operations = {
971 {
972 .type = OperationType::GATHER,
973 .inputs = {0, 1, 2},
974 .outputs = {3},
975 }
976 };
977
978 const std::vector<uint32_t> inputIndexes = {0};
979 const std::vector<uint32_t> outputIndexes = {3};
980 std::vector<uint8_t> operandValues = {
981 0, 0, 0, 0, 1, 0, 0, 0
982 };
983 const std::vector<hidl_memory> pools = {};
984
985 return {
986 .operands = operands,
987 .operations = operations,
988 .inputIndexes = inputIndexes,
989 .outputIndexes = outputIndexes,
990 .operandValues = operandValues,
991 .pools = pools,
992 };
993 }
994
is_ignored_int32_2(int i)995 inline bool is_ignored_int32_2(int i) {
996 static std::set<int> ignore = {};
997 return ignore.find(i) != ignore.end();
998 }
999
1000 // Create the model
createTestModel_float16_2()1001 Model createTestModel_float16_2() {
1002 const std::vector<Operand> operands = {
1003 {
1004 .type = OperandType::TENSOR_FLOAT16,
1005 .dimensions = {2, 2},
1006 .numberOfConsumers = 1,
1007 .scale = 0.0f,
1008 .zeroPoint = 0,
1009 .lifetime = OperandLifeTime::MODEL_INPUT,
1010 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1011 },
1012 {
1013 .type = OperandType::INT32,
1014 .dimensions = {},
1015 .numberOfConsumers = 1,
1016 .scale = 0.0f,
1017 .zeroPoint = 0,
1018 .lifetime = OperandLifeTime::CONSTANT_COPY,
1019 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1020 },
1021 {
1022 .type = OperandType::TENSOR_INT32,
1023 .dimensions = {1},
1024 .numberOfConsumers = 1,
1025 .scale = 0.0f,
1026 .zeroPoint = 0,
1027 .lifetime = OperandLifeTime::CONSTANT_COPY,
1028 .location = {.poolIndex = 0, .offset = 4, .length = 4},
1029 },
1030 {
1031 .type = OperandType::TENSOR_FLOAT16,
1032 .dimensions = {1, 2},
1033 .numberOfConsumers = 0,
1034 .scale = 0.0f,
1035 .zeroPoint = 0,
1036 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1037 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1038 }
1039 };
1040
1041 const std::vector<Operation> operations = {
1042 {
1043 .type = OperationType::GATHER,
1044 .inputs = {0, 1, 2},
1045 .outputs = {3},
1046 }
1047 };
1048
1049 const std::vector<uint32_t> inputIndexes = {0};
1050 const std::vector<uint32_t> outputIndexes = {3};
1051 std::vector<uint8_t> operandValues = {
1052 0, 0, 0, 0, 1, 0, 0, 0
1053 };
1054 const std::vector<hidl_memory> pools = {};
1055
1056 return {
1057 .operands = operands,
1058 .operations = operations,
1059 .inputIndexes = inputIndexes,
1060 .outputIndexes = outputIndexes,
1061 .operandValues = operandValues,
1062 .pools = pools,
1063 };
1064 }
1065
is_ignored_float16_2(int i)1066 inline bool is_ignored_float16_2(int i) {
1067 static std::set<int> ignore = {};
1068 return ignore.find(i) != ignore.end();
1069 }
1070
1071 // Create the model
createTestModel_dynamic_output_shape_2()1072 Model createTestModel_dynamic_output_shape_2() {
1073 const std::vector<Operand> operands = {
1074 {
1075 .type = OperandType::TENSOR_FLOAT32,
1076 .dimensions = {2, 2},
1077 .numberOfConsumers = 1,
1078 .scale = 0.0f,
1079 .zeroPoint = 0,
1080 .lifetime = OperandLifeTime::MODEL_INPUT,
1081 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1082 },
1083 {
1084 .type = OperandType::INT32,
1085 .dimensions = {},
1086 .numberOfConsumers = 1,
1087 .scale = 0.0f,
1088 .zeroPoint = 0,
1089 .lifetime = OperandLifeTime::CONSTANT_COPY,
1090 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1091 },
1092 {
1093 .type = OperandType::TENSOR_INT32,
1094 .dimensions = {1},
1095 .numberOfConsumers = 1,
1096 .scale = 0.0f,
1097 .zeroPoint = 0,
1098 .lifetime = OperandLifeTime::CONSTANT_COPY,
1099 .location = {.poolIndex = 0, .offset = 4, .length = 4},
1100 },
1101 {
1102 .type = OperandType::TENSOR_FLOAT32,
1103 .dimensions = {0, 0},
1104 .numberOfConsumers = 0,
1105 .scale = 0.0f,
1106 .zeroPoint = 0,
1107 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1108 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1109 }
1110 };
1111
1112 const std::vector<Operation> operations = {
1113 {
1114 .type = OperationType::GATHER,
1115 .inputs = {0, 1, 2},
1116 .outputs = {3},
1117 }
1118 };
1119
1120 const std::vector<uint32_t> inputIndexes = {0};
1121 const std::vector<uint32_t> outputIndexes = {3};
1122 std::vector<uint8_t> operandValues = {
1123 0, 0, 0, 0, 1, 0, 0, 0
1124 };
1125 const std::vector<hidl_memory> pools = {};
1126
1127 return {
1128 .operands = operands,
1129 .operations = operations,
1130 .inputIndexes = inputIndexes,
1131 .outputIndexes = outputIndexes,
1132 .operandValues = operandValues,
1133 .pools = pools,
1134 };
1135 }
1136
is_ignored_dynamic_output_shape_2(int i)1137 inline bool is_ignored_dynamic_output_shape_2(int i) {
1138 static std::set<int> ignore = {};
1139 return ignore.find(i) != ignore.end();
1140 }
1141
1142 // Create the model
createTestModel_dynamic_output_shape_relaxed_2()1143 Model createTestModel_dynamic_output_shape_relaxed_2() {
1144 const std::vector<Operand> operands = {
1145 {
1146 .type = OperandType::TENSOR_FLOAT32,
1147 .dimensions = {2, 2},
1148 .numberOfConsumers = 1,
1149 .scale = 0.0f,
1150 .zeroPoint = 0,
1151 .lifetime = OperandLifeTime::MODEL_INPUT,
1152 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1153 },
1154 {
1155 .type = OperandType::INT32,
1156 .dimensions = {},
1157 .numberOfConsumers = 1,
1158 .scale = 0.0f,
1159 .zeroPoint = 0,
1160 .lifetime = OperandLifeTime::CONSTANT_COPY,
1161 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1162 },
1163 {
1164 .type = OperandType::TENSOR_INT32,
1165 .dimensions = {1},
1166 .numberOfConsumers = 1,
1167 .scale = 0.0f,
1168 .zeroPoint = 0,
1169 .lifetime = OperandLifeTime::CONSTANT_COPY,
1170 .location = {.poolIndex = 0, .offset = 4, .length = 4},
1171 },
1172 {
1173 .type = OperandType::TENSOR_FLOAT32,
1174 .dimensions = {0, 0},
1175 .numberOfConsumers = 0,
1176 .scale = 0.0f,
1177 .zeroPoint = 0,
1178 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1179 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1180 }
1181 };
1182
1183 const std::vector<Operation> operations = {
1184 {
1185 .type = OperationType::GATHER,
1186 .inputs = {0, 1, 2},
1187 .outputs = {3},
1188 }
1189 };
1190
1191 const std::vector<uint32_t> inputIndexes = {0};
1192 const std::vector<uint32_t> outputIndexes = {3};
1193 std::vector<uint8_t> operandValues = {
1194 0, 0, 0, 0, 1, 0, 0, 0
1195 };
1196 const std::vector<hidl_memory> pools = {};
1197
1198 return {
1199 .operands = operands,
1200 .operations = operations,
1201 .inputIndexes = inputIndexes,
1202 .outputIndexes = outputIndexes,
1203 .operandValues = operandValues,
1204 .pools = pools,
1205 .relaxComputationFloat32toFloat16 = true,
1206 };
1207 }
1208
is_ignored_dynamic_output_shape_relaxed_2(int i)1209 inline bool is_ignored_dynamic_output_shape_relaxed_2(int i) {
1210 static std::set<int> ignore = {};
1211 return ignore.find(i) != ignore.end();
1212 }
1213
1214 // Create the model
createTestModel_dynamic_output_shape_quant8_2()1215 Model createTestModel_dynamic_output_shape_quant8_2() {
1216 const std::vector<Operand> operands = {
1217 {
1218 .type = OperandType::TENSOR_QUANT8_ASYMM,
1219 .dimensions = {2, 2},
1220 .numberOfConsumers = 1,
1221 .scale = 0.5f,
1222 .zeroPoint = 127,
1223 .lifetime = OperandLifeTime::MODEL_INPUT,
1224 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1225 },
1226 {
1227 .type = OperandType::INT32,
1228 .dimensions = {},
1229 .numberOfConsumers = 1,
1230 .scale = 0.0f,
1231 .zeroPoint = 0,
1232 .lifetime = OperandLifeTime::CONSTANT_COPY,
1233 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1234 },
1235 {
1236 .type = OperandType::TENSOR_INT32,
1237 .dimensions = {1},
1238 .numberOfConsumers = 1,
1239 .scale = 0.0f,
1240 .zeroPoint = 0,
1241 .lifetime = OperandLifeTime::CONSTANT_COPY,
1242 .location = {.poolIndex = 0, .offset = 4, .length = 4},
1243 },
1244 {
1245 .type = OperandType::TENSOR_QUANT8_ASYMM,
1246 .dimensions = {0, 0},
1247 .numberOfConsumers = 0,
1248 .scale = 0.5f,
1249 .zeroPoint = 127,
1250 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1251 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1252 }
1253 };
1254
1255 const std::vector<Operation> operations = {
1256 {
1257 .type = OperationType::GATHER,
1258 .inputs = {0, 1, 2},
1259 .outputs = {3},
1260 }
1261 };
1262
1263 const std::vector<uint32_t> inputIndexes = {0};
1264 const std::vector<uint32_t> outputIndexes = {3};
1265 std::vector<uint8_t> operandValues = {
1266 0, 0, 0, 0, 1, 0, 0, 0
1267 };
1268 const std::vector<hidl_memory> pools = {};
1269
1270 return {
1271 .operands = operands,
1272 .operations = operations,
1273 .inputIndexes = inputIndexes,
1274 .outputIndexes = outputIndexes,
1275 .operandValues = operandValues,
1276 .pools = pools,
1277 };
1278 }
1279
is_ignored_dynamic_output_shape_quant8_2(int i)1280 inline bool is_ignored_dynamic_output_shape_quant8_2(int i) {
1281 static std::set<int> ignore = {};
1282 return ignore.find(i) != ignore.end();
1283 }
1284
1285 // Create the model
createTestModel_dynamic_output_shape_int32_2()1286 Model createTestModel_dynamic_output_shape_int32_2() {
1287 const std::vector<Operand> operands = {
1288 {
1289 .type = OperandType::TENSOR_INT32,
1290 .dimensions = {2, 2},
1291 .numberOfConsumers = 1,
1292 .scale = 0.0f,
1293 .zeroPoint = 0,
1294 .lifetime = OperandLifeTime::MODEL_INPUT,
1295 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1296 },
1297 {
1298 .type = OperandType::INT32,
1299 .dimensions = {},
1300 .numberOfConsumers = 1,
1301 .scale = 0.0f,
1302 .zeroPoint = 0,
1303 .lifetime = OperandLifeTime::CONSTANT_COPY,
1304 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1305 },
1306 {
1307 .type = OperandType::TENSOR_INT32,
1308 .dimensions = {1},
1309 .numberOfConsumers = 1,
1310 .scale = 0.0f,
1311 .zeroPoint = 0,
1312 .lifetime = OperandLifeTime::CONSTANT_COPY,
1313 .location = {.poolIndex = 0, .offset = 4, .length = 4},
1314 },
1315 {
1316 .type = OperandType::TENSOR_INT32,
1317 .dimensions = {0, 0},
1318 .numberOfConsumers = 0,
1319 .scale = 0.0f,
1320 .zeroPoint = 0,
1321 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1322 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1323 }
1324 };
1325
1326 const std::vector<Operation> operations = {
1327 {
1328 .type = OperationType::GATHER,
1329 .inputs = {0, 1, 2},
1330 .outputs = {3},
1331 }
1332 };
1333
1334 const std::vector<uint32_t> inputIndexes = {0};
1335 const std::vector<uint32_t> outputIndexes = {3};
1336 std::vector<uint8_t> operandValues = {
1337 0, 0, 0, 0, 1, 0, 0, 0
1338 };
1339 const std::vector<hidl_memory> pools = {};
1340
1341 return {
1342 .operands = operands,
1343 .operations = operations,
1344 .inputIndexes = inputIndexes,
1345 .outputIndexes = outputIndexes,
1346 .operandValues = operandValues,
1347 .pools = pools,
1348 };
1349 }
1350
is_ignored_dynamic_output_shape_int32_2(int i)1351 inline bool is_ignored_dynamic_output_shape_int32_2(int i) {
1352 static std::set<int> ignore = {};
1353 return ignore.find(i) != ignore.end();
1354 }
1355
1356 // Create the model
createTestModel_dynamic_output_shape_float16_2()1357 Model createTestModel_dynamic_output_shape_float16_2() {
1358 const std::vector<Operand> operands = {
1359 {
1360 .type = OperandType::TENSOR_FLOAT16,
1361 .dimensions = {2, 2},
1362 .numberOfConsumers = 1,
1363 .scale = 0.0f,
1364 .zeroPoint = 0,
1365 .lifetime = OperandLifeTime::MODEL_INPUT,
1366 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1367 },
1368 {
1369 .type = OperandType::INT32,
1370 .dimensions = {},
1371 .numberOfConsumers = 1,
1372 .scale = 0.0f,
1373 .zeroPoint = 0,
1374 .lifetime = OperandLifeTime::CONSTANT_COPY,
1375 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1376 },
1377 {
1378 .type = OperandType::TENSOR_INT32,
1379 .dimensions = {1},
1380 .numberOfConsumers = 1,
1381 .scale = 0.0f,
1382 .zeroPoint = 0,
1383 .lifetime = OperandLifeTime::CONSTANT_COPY,
1384 .location = {.poolIndex = 0, .offset = 4, .length = 4},
1385 },
1386 {
1387 .type = OperandType::TENSOR_FLOAT16,
1388 .dimensions = {0, 0},
1389 .numberOfConsumers = 0,
1390 .scale = 0.0f,
1391 .zeroPoint = 0,
1392 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1393 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1394 }
1395 };
1396
1397 const std::vector<Operation> operations = {
1398 {
1399 .type = OperationType::GATHER,
1400 .inputs = {0, 1, 2},
1401 .outputs = {3},
1402 }
1403 };
1404
1405 const std::vector<uint32_t> inputIndexes = {0};
1406 const std::vector<uint32_t> outputIndexes = {3};
1407 std::vector<uint8_t> operandValues = {
1408 0, 0, 0, 0, 1, 0, 0, 0
1409 };
1410 const std::vector<hidl_memory> pools = {};
1411
1412 return {
1413 .operands = operands,
1414 .operations = operations,
1415 .inputIndexes = inputIndexes,
1416 .outputIndexes = outputIndexes,
1417 .operandValues = operandValues,
1418 .pools = pools,
1419 };
1420 }
1421
is_ignored_dynamic_output_shape_float16_2(int i)1422 inline bool is_ignored_dynamic_output_shape_float16_2(int i) {
1423 static std::set<int> ignore = {};
1424 return ignore.find(i) != ignore.end();
1425 }
1426
1427 // Create the model
createTestModel_3()1428 Model createTestModel_3() {
1429 const std::vector<Operand> operands = {
1430 {
1431 .type = OperandType::TENSOR_FLOAT32,
1432 .dimensions = {3},
1433 .numberOfConsumers = 1,
1434 .scale = 0.0f,
1435 .zeroPoint = 0,
1436 .lifetime = OperandLifeTime::MODEL_INPUT,
1437 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1438 },
1439 {
1440 .type = OperandType::INT32,
1441 .dimensions = {},
1442 .numberOfConsumers = 1,
1443 .scale = 0.0f,
1444 .zeroPoint = 0,
1445 .lifetime = OperandLifeTime::CONSTANT_COPY,
1446 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1447 },
1448 {
1449 .type = OperandType::TENSOR_INT32,
1450 .dimensions = {1},
1451 .numberOfConsumers = 1,
1452 .scale = 0.0f,
1453 .zeroPoint = 0,
1454 .lifetime = OperandLifeTime::CONSTANT_COPY,
1455 .location = {.poolIndex = 0, .offset = 4, .length = 4},
1456 },
1457 {
1458 .type = OperandType::TENSOR_FLOAT32,
1459 .dimensions = {1},
1460 .numberOfConsumers = 0,
1461 .scale = 0.0f,
1462 .zeroPoint = 0,
1463 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1464 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1465 }
1466 };
1467
1468 const std::vector<Operation> operations = {
1469 {
1470 .type = OperationType::GATHER,
1471 .inputs = {0, 1, 2},
1472 .outputs = {3},
1473 }
1474 };
1475
1476 const std::vector<uint32_t> inputIndexes = {0};
1477 const std::vector<uint32_t> outputIndexes = {3};
1478 std::vector<uint8_t> operandValues = {
1479 0, 0, 0, 0, 1, 0, 0, 0
1480 };
1481 const std::vector<hidl_memory> pools = {};
1482
1483 return {
1484 .operands = operands,
1485 .operations = operations,
1486 .inputIndexes = inputIndexes,
1487 .outputIndexes = outputIndexes,
1488 .operandValues = operandValues,
1489 .pools = pools,
1490 };
1491 }
1492
is_ignored_3(int i)1493 inline bool is_ignored_3(int i) {
1494 static std::set<int> ignore = {};
1495 return ignore.find(i) != ignore.end();
1496 }
1497
1498 // Create the model
createTestModel_relaxed_3()1499 Model createTestModel_relaxed_3() {
1500 const std::vector<Operand> operands = {
1501 {
1502 .type = OperandType::TENSOR_FLOAT32,
1503 .dimensions = {3},
1504 .numberOfConsumers = 1,
1505 .scale = 0.0f,
1506 .zeroPoint = 0,
1507 .lifetime = OperandLifeTime::MODEL_INPUT,
1508 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1509 },
1510 {
1511 .type = OperandType::INT32,
1512 .dimensions = {},
1513 .numberOfConsumers = 1,
1514 .scale = 0.0f,
1515 .zeroPoint = 0,
1516 .lifetime = OperandLifeTime::CONSTANT_COPY,
1517 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1518 },
1519 {
1520 .type = OperandType::TENSOR_INT32,
1521 .dimensions = {1},
1522 .numberOfConsumers = 1,
1523 .scale = 0.0f,
1524 .zeroPoint = 0,
1525 .lifetime = OperandLifeTime::CONSTANT_COPY,
1526 .location = {.poolIndex = 0, .offset = 4, .length = 4},
1527 },
1528 {
1529 .type = OperandType::TENSOR_FLOAT32,
1530 .dimensions = {1},
1531 .numberOfConsumers = 0,
1532 .scale = 0.0f,
1533 .zeroPoint = 0,
1534 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1535 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1536 }
1537 };
1538
1539 const std::vector<Operation> operations = {
1540 {
1541 .type = OperationType::GATHER,
1542 .inputs = {0, 1, 2},
1543 .outputs = {3},
1544 }
1545 };
1546
1547 const std::vector<uint32_t> inputIndexes = {0};
1548 const std::vector<uint32_t> outputIndexes = {3};
1549 std::vector<uint8_t> operandValues = {
1550 0, 0, 0, 0, 1, 0, 0, 0
1551 };
1552 const std::vector<hidl_memory> pools = {};
1553
1554 return {
1555 .operands = operands,
1556 .operations = operations,
1557 .inputIndexes = inputIndexes,
1558 .outputIndexes = outputIndexes,
1559 .operandValues = operandValues,
1560 .pools = pools,
1561 .relaxComputationFloat32toFloat16 = true,
1562 };
1563 }
1564
is_ignored_relaxed_3(int i)1565 inline bool is_ignored_relaxed_3(int i) {
1566 static std::set<int> ignore = {};
1567 return ignore.find(i) != ignore.end();
1568 }
1569
1570 // Create the model
createTestModel_quant8_3()1571 Model createTestModel_quant8_3() {
1572 const std::vector<Operand> operands = {
1573 {
1574 .type = OperandType::TENSOR_QUANT8_ASYMM,
1575 .dimensions = {3},
1576 .numberOfConsumers = 1,
1577 .scale = 0.5f,
1578 .zeroPoint = 127,
1579 .lifetime = OperandLifeTime::MODEL_INPUT,
1580 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1581 },
1582 {
1583 .type = OperandType::INT32,
1584 .dimensions = {},
1585 .numberOfConsumers = 1,
1586 .scale = 0.0f,
1587 .zeroPoint = 0,
1588 .lifetime = OperandLifeTime::CONSTANT_COPY,
1589 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1590 },
1591 {
1592 .type = OperandType::TENSOR_INT32,
1593 .dimensions = {1},
1594 .numberOfConsumers = 1,
1595 .scale = 0.0f,
1596 .zeroPoint = 0,
1597 .lifetime = OperandLifeTime::CONSTANT_COPY,
1598 .location = {.poolIndex = 0, .offset = 4, .length = 4},
1599 },
1600 {
1601 .type = OperandType::TENSOR_QUANT8_ASYMM,
1602 .dimensions = {1},
1603 .numberOfConsumers = 0,
1604 .scale = 0.5f,
1605 .zeroPoint = 127,
1606 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1607 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1608 }
1609 };
1610
1611 const std::vector<Operation> operations = {
1612 {
1613 .type = OperationType::GATHER,
1614 .inputs = {0, 1, 2},
1615 .outputs = {3},
1616 }
1617 };
1618
1619 const std::vector<uint32_t> inputIndexes = {0};
1620 const std::vector<uint32_t> outputIndexes = {3};
1621 std::vector<uint8_t> operandValues = {
1622 0, 0, 0, 0, 1, 0, 0, 0
1623 };
1624 const std::vector<hidl_memory> pools = {};
1625
1626 return {
1627 .operands = operands,
1628 .operations = operations,
1629 .inputIndexes = inputIndexes,
1630 .outputIndexes = outputIndexes,
1631 .operandValues = operandValues,
1632 .pools = pools,
1633 };
1634 }
1635
is_ignored_quant8_3(int i)1636 inline bool is_ignored_quant8_3(int i) {
1637 static std::set<int> ignore = {};
1638 return ignore.find(i) != ignore.end();
1639 }
1640
1641 // Create the model
createTestModel_int32_3()1642 Model createTestModel_int32_3() {
1643 const std::vector<Operand> operands = {
1644 {
1645 .type = OperandType::TENSOR_INT32,
1646 .dimensions = {3},
1647 .numberOfConsumers = 1,
1648 .scale = 0.0f,
1649 .zeroPoint = 0,
1650 .lifetime = OperandLifeTime::MODEL_INPUT,
1651 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1652 },
1653 {
1654 .type = OperandType::INT32,
1655 .dimensions = {},
1656 .numberOfConsumers = 1,
1657 .scale = 0.0f,
1658 .zeroPoint = 0,
1659 .lifetime = OperandLifeTime::CONSTANT_COPY,
1660 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1661 },
1662 {
1663 .type = OperandType::TENSOR_INT32,
1664 .dimensions = {1},
1665 .numberOfConsumers = 1,
1666 .scale = 0.0f,
1667 .zeroPoint = 0,
1668 .lifetime = OperandLifeTime::CONSTANT_COPY,
1669 .location = {.poolIndex = 0, .offset = 4, .length = 4},
1670 },
1671 {
1672 .type = OperandType::TENSOR_INT32,
1673 .dimensions = {1},
1674 .numberOfConsumers = 0,
1675 .scale = 0.0f,
1676 .zeroPoint = 0,
1677 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1678 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1679 }
1680 };
1681
1682 const std::vector<Operation> operations = {
1683 {
1684 .type = OperationType::GATHER,
1685 .inputs = {0, 1, 2},
1686 .outputs = {3},
1687 }
1688 };
1689
1690 const std::vector<uint32_t> inputIndexes = {0};
1691 const std::vector<uint32_t> outputIndexes = {3};
1692 std::vector<uint8_t> operandValues = {
1693 0, 0, 0, 0, 1, 0, 0, 0
1694 };
1695 const std::vector<hidl_memory> pools = {};
1696
1697 return {
1698 .operands = operands,
1699 .operations = operations,
1700 .inputIndexes = inputIndexes,
1701 .outputIndexes = outputIndexes,
1702 .operandValues = operandValues,
1703 .pools = pools,
1704 };
1705 }
1706
is_ignored_int32_3(int i)1707 inline bool is_ignored_int32_3(int i) {
1708 static std::set<int> ignore = {};
1709 return ignore.find(i) != ignore.end();
1710 }
1711
1712 // Create the model
createTestModel_float16_3()1713 Model createTestModel_float16_3() {
1714 const std::vector<Operand> operands = {
1715 {
1716 .type = OperandType::TENSOR_FLOAT16,
1717 .dimensions = {3},
1718 .numberOfConsumers = 1,
1719 .scale = 0.0f,
1720 .zeroPoint = 0,
1721 .lifetime = OperandLifeTime::MODEL_INPUT,
1722 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1723 },
1724 {
1725 .type = OperandType::INT32,
1726 .dimensions = {},
1727 .numberOfConsumers = 1,
1728 .scale = 0.0f,
1729 .zeroPoint = 0,
1730 .lifetime = OperandLifeTime::CONSTANT_COPY,
1731 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1732 },
1733 {
1734 .type = OperandType::TENSOR_INT32,
1735 .dimensions = {1},
1736 .numberOfConsumers = 1,
1737 .scale = 0.0f,
1738 .zeroPoint = 0,
1739 .lifetime = OperandLifeTime::CONSTANT_COPY,
1740 .location = {.poolIndex = 0, .offset = 4, .length = 4},
1741 },
1742 {
1743 .type = OperandType::TENSOR_FLOAT16,
1744 .dimensions = {1},
1745 .numberOfConsumers = 0,
1746 .scale = 0.0f,
1747 .zeroPoint = 0,
1748 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1749 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1750 }
1751 };
1752
1753 const std::vector<Operation> operations = {
1754 {
1755 .type = OperationType::GATHER,
1756 .inputs = {0, 1, 2},
1757 .outputs = {3},
1758 }
1759 };
1760
1761 const std::vector<uint32_t> inputIndexes = {0};
1762 const std::vector<uint32_t> outputIndexes = {3};
1763 std::vector<uint8_t> operandValues = {
1764 0, 0, 0, 0, 1, 0, 0, 0
1765 };
1766 const std::vector<hidl_memory> pools = {};
1767
1768 return {
1769 .operands = operands,
1770 .operations = operations,
1771 .inputIndexes = inputIndexes,
1772 .outputIndexes = outputIndexes,
1773 .operandValues = operandValues,
1774 .pools = pools,
1775 };
1776 }
1777
is_ignored_float16_3(int i)1778 inline bool is_ignored_float16_3(int i) {
1779 static std::set<int> ignore = {};
1780 return ignore.find(i) != ignore.end();
1781 }
1782
1783 // Create the model
createTestModel_dynamic_output_shape_3()1784 Model createTestModel_dynamic_output_shape_3() {
1785 const std::vector<Operand> operands = {
1786 {
1787 .type = OperandType::TENSOR_FLOAT32,
1788 .dimensions = {3},
1789 .numberOfConsumers = 1,
1790 .scale = 0.0f,
1791 .zeroPoint = 0,
1792 .lifetime = OperandLifeTime::MODEL_INPUT,
1793 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1794 },
1795 {
1796 .type = OperandType::INT32,
1797 .dimensions = {},
1798 .numberOfConsumers = 1,
1799 .scale = 0.0f,
1800 .zeroPoint = 0,
1801 .lifetime = OperandLifeTime::CONSTANT_COPY,
1802 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1803 },
1804 {
1805 .type = OperandType::TENSOR_INT32,
1806 .dimensions = {1},
1807 .numberOfConsumers = 1,
1808 .scale = 0.0f,
1809 .zeroPoint = 0,
1810 .lifetime = OperandLifeTime::CONSTANT_COPY,
1811 .location = {.poolIndex = 0, .offset = 4, .length = 4},
1812 },
1813 {
1814 .type = OperandType::TENSOR_FLOAT32,
1815 .dimensions = {0},
1816 .numberOfConsumers = 0,
1817 .scale = 0.0f,
1818 .zeroPoint = 0,
1819 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1820 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1821 }
1822 };
1823
1824 const std::vector<Operation> operations = {
1825 {
1826 .type = OperationType::GATHER,
1827 .inputs = {0, 1, 2},
1828 .outputs = {3},
1829 }
1830 };
1831
1832 const std::vector<uint32_t> inputIndexes = {0};
1833 const std::vector<uint32_t> outputIndexes = {3};
1834 std::vector<uint8_t> operandValues = {
1835 0, 0, 0, 0, 1, 0, 0, 0
1836 };
1837 const std::vector<hidl_memory> pools = {};
1838
1839 return {
1840 .operands = operands,
1841 .operations = operations,
1842 .inputIndexes = inputIndexes,
1843 .outputIndexes = outputIndexes,
1844 .operandValues = operandValues,
1845 .pools = pools,
1846 };
1847 }
1848
is_ignored_dynamic_output_shape_3(int i)1849 inline bool is_ignored_dynamic_output_shape_3(int i) {
1850 static std::set<int> ignore = {};
1851 return ignore.find(i) != ignore.end();
1852 }
1853
1854 // Create the model
createTestModel_dynamic_output_shape_relaxed_3()1855 Model createTestModel_dynamic_output_shape_relaxed_3() {
1856 const std::vector<Operand> operands = {
1857 {
1858 .type = OperandType::TENSOR_FLOAT32,
1859 .dimensions = {3},
1860 .numberOfConsumers = 1,
1861 .scale = 0.0f,
1862 .zeroPoint = 0,
1863 .lifetime = OperandLifeTime::MODEL_INPUT,
1864 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1865 },
1866 {
1867 .type = OperandType::INT32,
1868 .dimensions = {},
1869 .numberOfConsumers = 1,
1870 .scale = 0.0f,
1871 .zeroPoint = 0,
1872 .lifetime = OperandLifeTime::CONSTANT_COPY,
1873 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1874 },
1875 {
1876 .type = OperandType::TENSOR_INT32,
1877 .dimensions = {1},
1878 .numberOfConsumers = 1,
1879 .scale = 0.0f,
1880 .zeroPoint = 0,
1881 .lifetime = OperandLifeTime::CONSTANT_COPY,
1882 .location = {.poolIndex = 0, .offset = 4, .length = 4},
1883 },
1884 {
1885 .type = OperandType::TENSOR_FLOAT32,
1886 .dimensions = {0},
1887 .numberOfConsumers = 0,
1888 .scale = 0.0f,
1889 .zeroPoint = 0,
1890 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1891 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1892 }
1893 };
1894
1895 const std::vector<Operation> operations = {
1896 {
1897 .type = OperationType::GATHER,
1898 .inputs = {0, 1, 2},
1899 .outputs = {3},
1900 }
1901 };
1902
1903 const std::vector<uint32_t> inputIndexes = {0};
1904 const std::vector<uint32_t> outputIndexes = {3};
1905 std::vector<uint8_t> operandValues = {
1906 0, 0, 0, 0, 1, 0, 0, 0
1907 };
1908 const std::vector<hidl_memory> pools = {};
1909
1910 return {
1911 .operands = operands,
1912 .operations = operations,
1913 .inputIndexes = inputIndexes,
1914 .outputIndexes = outputIndexes,
1915 .operandValues = operandValues,
1916 .pools = pools,
1917 .relaxComputationFloat32toFloat16 = true,
1918 };
1919 }
1920
is_ignored_dynamic_output_shape_relaxed_3(int i)1921 inline bool is_ignored_dynamic_output_shape_relaxed_3(int i) {
1922 static std::set<int> ignore = {};
1923 return ignore.find(i) != ignore.end();
1924 }
1925
1926 // Create the model
createTestModel_dynamic_output_shape_quant8_3()1927 Model createTestModel_dynamic_output_shape_quant8_3() {
1928 const std::vector<Operand> operands = {
1929 {
1930 .type = OperandType::TENSOR_QUANT8_ASYMM,
1931 .dimensions = {3},
1932 .numberOfConsumers = 1,
1933 .scale = 0.5f,
1934 .zeroPoint = 127,
1935 .lifetime = OperandLifeTime::MODEL_INPUT,
1936 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1937 },
1938 {
1939 .type = OperandType::INT32,
1940 .dimensions = {},
1941 .numberOfConsumers = 1,
1942 .scale = 0.0f,
1943 .zeroPoint = 0,
1944 .lifetime = OperandLifeTime::CONSTANT_COPY,
1945 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1946 },
1947 {
1948 .type = OperandType::TENSOR_INT32,
1949 .dimensions = {1},
1950 .numberOfConsumers = 1,
1951 .scale = 0.0f,
1952 .zeroPoint = 0,
1953 .lifetime = OperandLifeTime::CONSTANT_COPY,
1954 .location = {.poolIndex = 0, .offset = 4, .length = 4},
1955 },
1956 {
1957 .type = OperandType::TENSOR_QUANT8_ASYMM,
1958 .dimensions = {0},
1959 .numberOfConsumers = 0,
1960 .scale = 0.5f,
1961 .zeroPoint = 127,
1962 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1963 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1964 }
1965 };
1966
1967 const std::vector<Operation> operations = {
1968 {
1969 .type = OperationType::GATHER,
1970 .inputs = {0, 1, 2},
1971 .outputs = {3},
1972 }
1973 };
1974
1975 const std::vector<uint32_t> inputIndexes = {0};
1976 const std::vector<uint32_t> outputIndexes = {3};
1977 std::vector<uint8_t> operandValues = {
1978 0, 0, 0, 0, 1, 0, 0, 0
1979 };
1980 const std::vector<hidl_memory> pools = {};
1981
1982 return {
1983 .operands = operands,
1984 .operations = operations,
1985 .inputIndexes = inputIndexes,
1986 .outputIndexes = outputIndexes,
1987 .operandValues = operandValues,
1988 .pools = pools,
1989 };
1990 }
1991
is_ignored_dynamic_output_shape_quant8_3(int i)1992 inline bool is_ignored_dynamic_output_shape_quant8_3(int i) {
1993 static std::set<int> ignore = {};
1994 return ignore.find(i) != ignore.end();
1995 }
1996
1997 // Create the model
createTestModel_dynamic_output_shape_int32_3()1998 Model createTestModel_dynamic_output_shape_int32_3() {
1999 const std::vector<Operand> operands = {
2000 {
2001 .type = OperandType::TENSOR_INT32,
2002 .dimensions = {3},
2003 .numberOfConsumers = 1,
2004 .scale = 0.0f,
2005 .zeroPoint = 0,
2006 .lifetime = OperandLifeTime::MODEL_INPUT,
2007 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2008 },
2009 {
2010 .type = OperandType::INT32,
2011 .dimensions = {},
2012 .numberOfConsumers = 1,
2013 .scale = 0.0f,
2014 .zeroPoint = 0,
2015 .lifetime = OperandLifeTime::CONSTANT_COPY,
2016 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2017 },
2018 {
2019 .type = OperandType::TENSOR_INT32,
2020 .dimensions = {1},
2021 .numberOfConsumers = 1,
2022 .scale = 0.0f,
2023 .zeroPoint = 0,
2024 .lifetime = OperandLifeTime::CONSTANT_COPY,
2025 .location = {.poolIndex = 0, .offset = 4, .length = 4},
2026 },
2027 {
2028 .type = OperandType::TENSOR_INT32,
2029 .dimensions = {0},
2030 .numberOfConsumers = 0,
2031 .scale = 0.0f,
2032 .zeroPoint = 0,
2033 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2034 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2035 }
2036 };
2037
2038 const std::vector<Operation> operations = {
2039 {
2040 .type = OperationType::GATHER,
2041 .inputs = {0, 1, 2},
2042 .outputs = {3},
2043 }
2044 };
2045
2046 const std::vector<uint32_t> inputIndexes = {0};
2047 const std::vector<uint32_t> outputIndexes = {3};
2048 std::vector<uint8_t> operandValues = {
2049 0, 0, 0, 0, 1, 0, 0, 0
2050 };
2051 const std::vector<hidl_memory> pools = {};
2052
2053 return {
2054 .operands = operands,
2055 .operations = operations,
2056 .inputIndexes = inputIndexes,
2057 .outputIndexes = outputIndexes,
2058 .operandValues = operandValues,
2059 .pools = pools,
2060 };
2061 }
2062
is_ignored_dynamic_output_shape_int32_3(int i)2063 inline bool is_ignored_dynamic_output_shape_int32_3(int i) {
2064 static std::set<int> ignore = {};
2065 return ignore.find(i) != ignore.end();
2066 }
2067
2068 // Create the model
createTestModel_dynamic_output_shape_float16_3()2069 Model createTestModel_dynamic_output_shape_float16_3() {
2070 const std::vector<Operand> operands = {
2071 {
2072 .type = OperandType::TENSOR_FLOAT16,
2073 .dimensions = {3},
2074 .numberOfConsumers = 1,
2075 .scale = 0.0f,
2076 .zeroPoint = 0,
2077 .lifetime = OperandLifeTime::MODEL_INPUT,
2078 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2079 },
2080 {
2081 .type = OperandType::INT32,
2082 .dimensions = {},
2083 .numberOfConsumers = 1,
2084 .scale = 0.0f,
2085 .zeroPoint = 0,
2086 .lifetime = OperandLifeTime::CONSTANT_COPY,
2087 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2088 },
2089 {
2090 .type = OperandType::TENSOR_INT32,
2091 .dimensions = {1},
2092 .numberOfConsumers = 1,
2093 .scale = 0.0f,
2094 .zeroPoint = 0,
2095 .lifetime = OperandLifeTime::CONSTANT_COPY,
2096 .location = {.poolIndex = 0, .offset = 4, .length = 4},
2097 },
2098 {
2099 .type = OperandType::TENSOR_FLOAT16,
2100 .dimensions = {0},
2101 .numberOfConsumers = 0,
2102 .scale = 0.0f,
2103 .zeroPoint = 0,
2104 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2105 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2106 }
2107 };
2108
2109 const std::vector<Operation> operations = {
2110 {
2111 .type = OperationType::GATHER,
2112 .inputs = {0, 1, 2},
2113 .outputs = {3},
2114 }
2115 };
2116
2117 const std::vector<uint32_t> inputIndexes = {0};
2118 const std::vector<uint32_t> outputIndexes = {3};
2119 std::vector<uint8_t> operandValues = {
2120 0, 0, 0, 0, 1, 0, 0, 0
2121 };
2122 const std::vector<hidl_memory> pools = {};
2123
2124 return {
2125 .operands = operands,
2126 .operations = operations,
2127 .inputIndexes = inputIndexes,
2128 .outputIndexes = outputIndexes,
2129 .operandValues = operandValues,
2130 .pools = pools,
2131 };
2132 }
2133
is_ignored_dynamic_output_shape_float16_3(int i)2134 inline bool is_ignored_dynamic_output_shape_float16_3(int i) {
2135 static std::set<int> ignore = {};
2136 return ignore.find(i) != ignore.end();
2137 }
2138
2139 // Create the model
createTestModel_4()2140 Model createTestModel_4() {
2141 const std::vector<Operand> operands = {
2142 {
2143 .type = OperandType::TENSOR_FLOAT32,
2144 .dimensions = {3},
2145 .numberOfConsumers = 1,
2146 .scale = 0.0f,
2147 .zeroPoint = 0,
2148 .lifetime = OperandLifeTime::MODEL_INPUT,
2149 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2150 },
2151 {
2152 .type = OperandType::INT32,
2153 .dimensions = {},
2154 .numberOfConsumers = 1,
2155 .scale = 0.0f,
2156 .zeroPoint = 0,
2157 .lifetime = OperandLifeTime::CONSTANT_COPY,
2158 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2159 },
2160 {
2161 .type = OperandType::TENSOR_INT32,
2162 .dimensions = {2},
2163 .numberOfConsumers = 1,
2164 .scale = 0.0f,
2165 .zeroPoint = 0,
2166 .lifetime = OperandLifeTime::CONSTANT_COPY,
2167 .location = {.poolIndex = 0, .offset = 4, .length = 8},
2168 },
2169 {
2170 .type = OperandType::TENSOR_FLOAT32,
2171 .dimensions = {2},
2172 .numberOfConsumers = 0,
2173 .scale = 0.0f,
2174 .zeroPoint = 0,
2175 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2176 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2177 }
2178 };
2179
2180 const std::vector<Operation> operations = {
2181 {
2182 .type = OperationType::GATHER,
2183 .inputs = {0, 1, 2},
2184 .outputs = {3},
2185 }
2186 };
2187
2188 const std::vector<uint32_t> inputIndexes = {0};
2189 const std::vector<uint32_t> outputIndexes = {3};
2190 std::vector<uint8_t> operandValues = {
2191 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
2192 };
2193 const std::vector<hidl_memory> pools = {};
2194
2195 return {
2196 .operands = operands,
2197 .operations = operations,
2198 .inputIndexes = inputIndexes,
2199 .outputIndexes = outputIndexes,
2200 .operandValues = operandValues,
2201 .pools = pools,
2202 };
2203 }
2204
is_ignored_4(int i)2205 inline bool is_ignored_4(int i) {
2206 static std::set<int> ignore = {};
2207 return ignore.find(i) != ignore.end();
2208 }
2209
2210 // Create the model
createTestModel_relaxed_4()2211 Model createTestModel_relaxed_4() {
2212 const std::vector<Operand> operands = {
2213 {
2214 .type = OperandType::TENSOR_FLOAT32,
2215 .dimensions = {3},
2216 .numberOfConsumers = 1,
2217 .scale = 0.0f,
2218 .zeroPoint = 0,
2219 .lifetime = OperandLifeTime::MODEL_INPUT,
2220 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2221 },
2222 {
2223 .type = OperandType::INT32,
2224 .dimensions = {},
2225 .numberOfConsumers = 1,
2226 .scale = 0.0f,
2227 .zeroPoint = 0,
2228 .lifetime = OperandLifeTime::CONSTANT_COPY,
2229 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2230 },
2231 {
2232 .type = OperandType::TENSOR_INT32,
2233 .dimensions = {2},
2234 .numberOfConsumers = 1,
2235 .scale = 0.0f,
2236 .zeroPoint = 0,
2237 .lifetime = OperandLifeTime::CONSTANT_COPY,
2238 .location = {.poolIndex = 0, .offset = 4, .length = 8},
2239 },
2240 {
2241 .type = OperandType::TENSOR_FLOAT32,
2242 .dimensions = {2},
2243 .numberOfConsumers = 0,
2244 .scale = 0.0f,
2245 .zeroPoint = 0,
2246 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2247 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2248 }
2249 };
2250
2251 const std::vector<Operation> operations = {
2252 {
2253 .type = OperationType::GATHER,
2254 .inputs = {0, 1, 2},
2255 .outputs = {3},
2256 }
2257 };
2258
2259 const std::vector<uint32_t> inputIndexes = {0};
2260 const std::vector<uint32_t> outputIndexes = {3};
2261 std::vector<uint8_t> operandValues = {
2262 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
2263 };
2264 const std::vector<hidl_memory> pools = {};
2265
2266 return {
2267 .operands = operands,
2268 .operations = operations,
2269 .inputIndexes = inputIndexes,
2270 .outputIndexes = outputIndexes,
2271 .operandValues = operandValues,
2272 .pools = pools,
2273 .relaxComputationFloat32toFloat16 = true,
2274 };
2275 }
2276
is_ignored_relaxed_4(int i)2277 inline bool is_ignored_relaxed_4(int i) {
2278 static std::set<int> ignore = {};
2279 return ignore.find(i) != ignore.end();
2280 }
2281
2282 // Create the model
createTestModel_quant8_4()2283 Model createTestModel_quant8_4() {
2284 const std::vector<Operand> operands = {
2285 {
2286 .type = OperandType::TENSOR_QUANT8_ASYMM,
2287 .dimensions = {3},
2288 .numberOfConsumers = 1,
2289 .scale = 0.5f,
2290 .zeroPoint = 127,
2291 .lifetime = OperandLifeTime::MODEL_INPUT,
2292 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2293 },
2294 {
2295 .type = OperandType::INT32,
2296 .dimensions = {},
2297 .numberOfConsumers = 1,
2298 .scale = 0.0f,
2299 .zeroPoint = 0,
2300 .lifetime = OperandLifeTime::CONSTANT_COPY,
2301 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2302 },
2303 {
2304 .type = OperandType::TENSOR_INT32,
2305 .dimensions = {2},
2306 .numberOfConsumers = 1,
2307 .scale = 0.0f,
2308 .zeroPoint = 0,
2309 .lifetime = OperandLifeTime::CONSTANT_COPY,
2310 .location = {.poolIndex = 0, .offset = 4, .length = 8},
2311 },
2312 {
2313 .type = OperandType::TENSOR_QUANT8_ASYMM,
2314 .dimensions = {2},
2315 .numberOfConsumers = 0,
2316 .scale = 0.5f,
2317 .zeroPoint = 127,
2318 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2319 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2320 }
2321 };
2322
2323 const std::vector<Operation> operations = {
2324 {
2325 .type = OperationType::GATHER,
2326 .inputs = {0, 1, 2},
2327 .outputs = {3},
2328 }
2329 };
2330
2331 const std::vector<uint32_t> inputIndexes = {0};
2332 const std::vector<uint32_t> outputIndexes = {3};
2333 std::vector<uint8_t> operandValues = {
2334 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
2335 };
2336 const std::vector<hidl_memory> pools = {};
2337
2338 return {
2339 .operands = operands,
2340 .operations = operations,
2341 .inputIndexes = inputIndexes,
2342 .outputIndexes = outputIndexes,
2343 .operandValues = operandValues,
2344 .pools = pools,
2345 };
2346 }
2347
is_ignored_quant8_4(int i)2348 inline bool is_ignored_quant8_4(int i) {
2349 static std::set<int> ignore = {};
2350 return ignore.find(i) != ignore.end();
2351 }
2352
2353 // Create the model
createTestModel_int32_4()2354 Model createTestModel_int32_4() {
2355 const std::vector<Operand> operands = {
2356 {
2357 .type = OperandType::TENSOR_INT32,
2358 .dimensions = {3},
2359 .numberOfConsumers = 1,
2360 .scale = 0.0f,
2361 .zeroPoint = 0,
2362 .lifetime = OperandLifeTime::MODEL_INPUT,
2363 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2364 },
2365 {
2366 .type = OperandType::INT32,
2367 .dimensions = {},
2368 .numberOfConsumers = 1,
2369 .scale = 0.0f,
2370 .zeroPoint = 0,
2371 .lifetime = OperandLifeTime::CONSTANT_COPY,
2372 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2373 },
2374 {
2375 .type = OperandType::TENSOR_INT32,
2376 .dimensions = {2},
2377 .numberOfConsumers = 1,
2378 .scale = 0.0f,
2379 .zeroPoint = 0,
2380 .lifetime = OperandLifeTime::CONSTANT_COPY,
2381 .location = {.poolIndex = 0, .offset = 4, .length = 8},
2382 },
2383 {
2384 .type = OperandType::TENSOR_INT32,
2385 .dimensions = {2},
2386 .numberOfConsumers = 0,
2387 .scale = 0.0f,
2388 .zeroPoint = 0,
2389 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2390 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2391 }
2392 };
2393
2394 const std::vector<Operation> operations = {
2395 {
2396 .type = OperationType::GATHER,
2397 .inputs = {0, 1, 2},
2398 .outputs = {3},
2399 }
2400 };
2401
2402 const std::vector<uint32_t> inputIndexes = {0};
2403 const std::vector<uint32_t> outputIndexes = {3};
2404 std::vector<uint8_t> operandValues = {
2405 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
2406 };
2407 const std::vector<hidl_memory> pools = {};
2408
2409 return {
2410 .operands = operands,
2411 .operations = operations,
2412 .inputIndexes = inputIndexes,
2413 .outputIndexes = outputIndexes,
2414 .operandValues = operandValues,
2415 .pools = pools,
2416 };
2417 }
2418
is_ignored_int32_4(int i)2419 inline bool is_ignored_int32_4(int i) {
2420 static std::set<int> ignore = {};
2421 return ignore.find(i) != ignore.end();
2422 }
2423
2424 // Create the model
createTestModel_float16_4()2425 Model createTestModel_float16_4() {
2426 const std::vector<Operand> operands = {
2427 {
2428 .type = OperandType::TENSOR_FLOAT16,
2429 .dimensions = {3},
2430 .numberOfConsumers = 1,
2431 .scale = 0.0f,
2432 .zeroPoint = 0,
2433 .lifetime = OperandLifeTime::MODEL_INPUT,
2434 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2435 },
2436 {
2437 .type = OperandType::INT32,
2438 .dimensions = {},
2439 .numberOfConsumers = 1,
2440 .scale = 0.0f,
2441 .zeroPoint = 0,
2442 .lifetime = OperandLifeTime::CONSTANT_COPY,
2443 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2444 },
2445 {
2446 .type = OperandType::TENSOR_INT32,
2447 .dimensions = {2},
2448 .numberOfConsumers = 1,
2449 .scale = 0.0f,
2450 .zeroPoint = 0,
2451 .lifetime = OperandLifeTime::CONSTANT_COPY,
2452 .location = {.poolIndex = 0, .offset = 4, .length = 8},
2453 },
2454 {
2455 .type = OperandType::TENSOR_FLOAT16,
2456 .dimensions = {2},
2457 .numberOfConsumers = 0,
2458 .scale = 0.0f,
2459 .zeroPoint = 0,
2460 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2461 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2462 }
2463 };
2464
2465 const std::vector<Operation> operations = {
2466 {
2467 .type = OperationType::GATHER,
2468 .inputs = {0, 1, 2},
2469 .outputs = {3},
2470 }
2471 };
2472
2473 const std::vector<uint32_t> inputIndexes = {0};
2474 const std::vector<uint32_t> outputIndexes = {3};
2475 std::vector<uint8_t> operandValues = {
2476 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
2477 };
2478 const std::vector<hidl_memory> pools = {};
2479
2480 return {
2481 .operands = operands,
2482 .operations = operations,
2483 .inputIndexes = inputIndexes,
2484 .outputIndexes = outputIndexes,
2485 .operandValues = operandValues,
2486 .pools = pools,
2487 };
2488 }
2489
is_ignored_float16_4(int i)2490 inline bool is_ignored_float16_4(int i) {
2491 static std::set<int> ignore = {};
2492 return ignore.find(i) != ignore.end();
2493 }
2494
2495 // Create the model
createTestModel_dynamic_output_shape_4()2496 Model createTestModel_dynamic_output_shape_4() {
2497 const std::vector<Operand> operands = {
2498 {
2499 .type = OperandType::TENSOR_FLOAT32,
2500 .dimensions = {3},
2501 .numberOfConsumers = 1,
2502 .scale = 0.0f,
2503 .zeroPoint = 0,
2504 .lifetime = OperandLifeTime::MODEL_INPUT,
2505 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2506 },
2507 {
2508 .type = OperandType::INT32,
2509 .dimensions = {},
2510 .numberOfConsumers = 1,
2511 .scale = 0.0f,
2512 .zeroPoint = 0,
2513 .lifetime = OperandLifeTime::CONSTANT_COPY,
2514 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2515 },
2516 {
2517 .type = OperandType::TENSOR_INT32,
2518 .dimensions = {2},
2519 .numberOfConsumers = 1,
2520 .scale = 0.0f,
2521 .zeroPoint = 0,
2522 .lifetime = OperandLifeTime::CONSTANT_COPY,
2523 .location = {.poolIndex = 0, .offset = 4, .length = 8},
2524 },
2525 {
2526 .type = OperandType::TENSOR_FLOAT32,
2527 .dimensions = {0},
2528 .numberOfConsumers = 0,
2529 .scale = 0.0f,
2530 .zeroPoint = 0,
2531 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2532 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2533 }
2534 };
2535
2536 const std::vector<Operation> operations = {
2537 {
2538 .type = OperationType::GATHER,
2539 .inputs = {0, 1, 2},
2540 .outputs = {3},
2541 }
2542 };
2543
2544 const std::vector<uint32_t> inputIndexes = {0};
2545 const std::vector<uint32_t> outputIndexes = {3};
2546 std::vector<uint8_t> operandValues = {
2547 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
2548 };
2549 const std::vector<hidl_memory> pools = {};
2550
2551 return {
2552 .operands = operands,
2553 .operations = operations,
2554 .inputIndexes = inputIndexes,
2555 .outputIndexes = outputIndexes,
2556 .operandValues = operandValues,
2557 .pools = pools,
2558 };
2559 }
2560
is_ignored_dynamic_output_shape_4(int i)2561 inline bool is_ignored_dynamic_output_shape_4(int i) {
2562 static std::set<int> ignore = {};
2563 return ignore.find(i) != ignore.end();
2564 }
2565
2566 // Create the model
createTestModel_dynamic_output_shape_relaxed_4()2567 Model createTestModel_dynamic_output_shape_relaxed_4() {
2568 const std::vector<Operand> operands = {
2569 {
2570 .type = OperandType::TENSOR_FLOAT32,
2571 .dimensions = {3},
2572 .numberOfConsumers = 1,
2573 .scale = 0.0f,
2574 .zeroPoint = 0,
2575 .lifetime = OperandLifeTime::MODEL_INPUT,
2576 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2577 },
2578 {
2579 .type = OperandType::INT32,
2580 .dimensions = {},
2581 .numberOfConsumers = 1,
2582 .scale = 0.0f,
2583 .zeroPoint = 0,
2584 .lifetime = OperandLifeTime::CONSTANT_COPY,
2585 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2586 },
2587 {
2588 .type = OperandType::TENSOR_INT32,
2589 .dimensions = {2},
2590 .numberOfConsumers = 1,
2591 .scale = 0.0f,
2592 .zeroPoint = 0,
2593 .lifetime = OperandLifeTime::CONSTANT_COPY,
2594 .location = {.poolIndex = 0, .offset = 4, .length = 8},
2595 },
2596 {
2597 .type = OperandType::TENSOR_FLOAT32,
2598 .dimensions = {0},
2599 .numberOfConsumers = 0,
2600 .scale = 0.0f,
2601 .zeroPoint = 0,
2602 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2603 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2604 }
2605 };
2606
2607 const std::vector<Operation> operations = {
2608 {
2609 .type = OperationType::GATHER,
2610 .inputs = {0, 1, 2},
2611 .outputs = {3},
2612 }
2613 };
2614
2615 const std::vector<uint32_t> inputIndexes = {0};
2616 const std::vector<uint32_t> outputIndexes = {3};
2617 std::vector<uint8_t> operandValues = {
2618 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
2619 };
2620 const std::vector<hidl_memory> pools = {};
2621
2622 return {
2623 .operands = operands,
2624 .operations = operations,
2625 .inputIndexes = inputIndexes,
2626 .outputIndexes = outputIndexes,
2627 .operandValues = operandValues,
2628 .pools = pools,
2629 .relaxComputationFloat32toFloat16 = true,
2630 };
2631 }
2632
is_ignored_dynamic_output_shape_relaxed_4(int i)2633 inline bool is_ignored_dynamic_output_shape_relaxed_4(int i) {
2634 static std::set<int> ignore = {};
2635 return ignore.find(i) != ignore.end();
2636 }
2637
2638 // Create the model
createTestModel_dynamic_output_shape_quant8_4()2639 Model createTestModel_dynamic_output_shape_quant8_4() {
2640 const std::vector<Operand> operands = {
2641 {
2642 .type = OperandType::TENSOR_QUANT8_ASYMM,
2643 .dimensions = {3},
2644 .numberOfConsumers = 1,
2645 .scale = 0.5f,
2646 .zeroPoint = 127,
2647 .lifetime = OperandLifeTime::MODEL_INPUT,
2648 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2649 },
2650 {
2651 .type = OperandType::INT32,
2652 .dimensions = {},
2653 .numberOfConsumers = 1,
2654 .scale = 0.0f,
2655 .zeroPoint = 0,
2656 .lifetime = OperandLifeTime::CONSTANT_COPY,
2657 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2658 },
2659 {
2660 .type = OperandType::TENSOR_INT32,
2661 .dimensions = {2},
2662 .numberOfConsumers = 1,
2663 .scale = 0.0f,
2664 .zeroPoint = 0,
2665 .lifetime = OperandLifeTime::CONSTANT_COPY,
2666 .location = {.poolIndex = 0, .offset = 4, .length = 8},
2667 },
2668 {
2669 .type = OperandType::TENSOR_QUANT8_ASYMM,
2670 .dimensions = {0},
2671 .numberOfConsumers = 0,
2672 .scale = 0.5f,
2673 .zeroPoint = 127,
2674 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2675 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2676 }
2677 };
2678
2679 const std::vector<Operation> operations = {
2680 {
2681 .type = OperationType::GATHER,
2682 .inputs = {0, 1, 2},
2683 .outputs = {3},
2684 }
2685 };
2686
2687 const std::vector<uint32_t> inputIndexes = {0};
2688 const std::vector<uint32_t> outputIndexes = {3};
2689 std::vector<uint8_t> operandValues = {
2690 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
2691 };
2692 const std::vector<hidl_memory> pools = {};
2693
2694 return {
2695 .operands = operands,
2696 .operations = operations,
2697 .inputIndexes = inputIndexes,
2698 .outputIndexes = outputIndexes,
2699 .operandValues = operandValues,
2700 .pools = pools,
2701 };
2702 }
2703
is_ignored_dynamic_output_shape_quant8_4(int i)2704 inline bool is_ignored_dynamic_output_shape_quant8_4(int i) {
2705 static std::set<int> ignore = {};
2706 return ignore.find(i) != ignore.end();
2707 }
2708
2709 // Create the model
createTestModel_dynamic_output_shape_int32_4()2710 Model createTestModel_dynamic_output_shape_int32_4() {
2711 const std::vector<Operand> operands = {
2712 {
2713 .type = OperandType::TENSOR_INT32,
2714 .dimensions = {3},
2715 .numberOfConsumers = 1,
2716 .scale = 0.0f,
2717 .zeroPoint = 0,
2718 .lifetime = OperandLifeTime::MODEL_INPUT,
2719 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2720 },
2721 {
2722 .type = OperandType::INT32,
2723 .dimensions = {},
2724 .numberOfConsumers = 1,
2725 .scale = 0.0f,
2726 .zeroPoint = 0,
2727 .lifetime = OperandLifeTime::CONSTANT_COPY,
2728 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2729 },
2730 {
2731 .type = OperandType::TENSOR_INT32,
2732 .dimensions = {2},
2733 .numberOfConsumers = 1,
2734 .scale = 0.0f,
2735 .zeroPoint = 0,
2736 .lifetime = OperandLifeTime::CONSTANT_COPY,
2737 .location = {.poolIndex = 0, .offset = 4, .length = 8},
2738 },
2739 {
2740 .type = OperandType::TENSOR_INT32,
2741 .dimensions = {0},
2742 .numberOfConsumers = 0,
2743 .scale = 0.0f,
2744 .zeroPoint = 0,
2745 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2746 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2747 }
2748 };
2749
2750 const std::vector<Operation> operations = {
2751 {
2752 .type = OperationType::GATHER,
2753 .inputs = {0, 1, 2},
2754 .outputs = {3},
2755 }
2756 };
2757
2758 const std::vector<uint32_t> inputIndexes = {0};
2759 const std::vector<uint32_t> outputIndexes = {3};
2760 std::vector<uint8_t> operandValues = {
2761 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
2762 };
2763 const std::vector<hidl_memory> pools = {};
2764
2765 return {
2766 .operands = operands,
2767 .operations = operations,
2768 .inputIndexes = inputIndexes,
2769 .outputIndexes = outputIndexes,
2770 .operandValues = operandValues,
2771 .pools = pools,
2772 };
2773 }
2774
is_ignored_dynamic_output_shape_int32_4(int i)2775 inline bool is_ignored_dynamic_output_shape_int32_4(int i) {
2776 static std::set<int> ignore = {};
2777 return ignore.find(i) != ignore.end();
2778 }
2779
2780 // Create the model
createTestModel_dynamic_output_shape_float16_4()2781 Model createTestModel_dynamic_output_shape_float16_4() {
2782 const std::vector<Operand> operands = {
2783 {
2784 .type = OperandType::TENSOR_FLOAT16,
2785 .dimensions = {3},
2786 .numberOfConsumers = 1,
2787 .scale = 0.0f,
2788 .zeroPoint = 0,
2789 .lifetime = OperandLifeTime::MODEL_INPUT,
2790 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2791 },
2792 {
2793 .type = OperandType::INT32,
2794 .dimensions = {},
2795 .numberOfConsumers = 1,
2796 .scale = 0.0f,
2797 .zeroPoint = 0,
2798 .lifetime = OperandLifeTime::CONSTANT_COPY,
2799 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2800 },
2801 {
2802 .type = OperandType::TENSOR_INT32,
2803 .dimensions = {2},
2804 .numberOfConsumers = 1,
2805 .scale = 0.0f,
2806 .zeroPoint = 0,
2807 .lifetime = OperandLifeTime::CONSTANT_COPY,
2808 .location = {.poolIndex = 0, .offset = 4, .length = 8},
2809 },
2810 {
2811 .type = OperandType::TENSOR_FLOAT16,
2812 .dimensions = {0},
2813 .numberOfConsumers = 0,
2814 .scale = 0.0f,
2815 .zeroPoint = 0,
2816 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2817 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2818 }
2819 };
2820
2821 const std::vector<Operation> operations = {
2822 {
2823 .type = OperationType::GATHER,
2824 .inputs = {0, 1, 2},
2825 .outputs = {3},
2826 }
2827 };
2828
2829 const std::vector<uint32_t> inputIndexes = {0};
2830 const std::vector<uint32_t> outputIndexes = {3};
2831 std::vector<uint8_t> operandValues = {
2832 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
2833 };
2834 const std::vector<hidl_memory> pools = {};
2835
2836 return {
2837 .operands = operands,
2838 .operations = operations,
2839 .inputIndexes = inputIndexes,
2840 .outputIndexes = outputIndexes,
2841 .operandValues = operandValues,
2842 .pools = pools,
2843 };
2844 }
2845
is_ignored_dynamic_output_shape_float16_4(int i)2846 inline bool is_ignored_dynamic_output_shape_float16_4(int i) {
2847 static std::set<int> ignore = {};
2848 return ignore.find(i) != ignore.end();
2849 }
2850
2851 // Create the model
createTestModel_5()2852 Model createTestModel_5() {
2853 const std::vector<Operand> operands = {
2854 {
2855 .type = OperandType::TENSOR_FLOAT32,
2856 .dimensions = {1, 2, 2},
2857 .numberOfConsumers = 1,
2858 .scale = 0.0f,
2859 .zeroPoint = 0,
2860 .lifetime = OperandLifeTime::MODEL_INPUT,
2861 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2862 },
2863 {
2864 .type = OperandType::INT32,
2865 .dimensions = {},
2866 .numberOfConsumers = 1,
2867 .scale = 0.0f,
2868 .zeroPoint = 0,
2869 .lifetime = OperandLifeTime::CONSTANT_COPY,
2870 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2871 },
2872 {
2873 .type = OperandType::TENSOR_INT32,
2874 .dimensions = {2},
2875 .numberOfConsumers = 1,
2876 .scale = 0.0f,
2877 .zeroPoint = 0,
2878 .lifetime = OperandLifeTime::CONSTANT_COPY,
2879 .location = {.poolIndex = 0, .offset = 4, .length = 8},
2880 },
2881 {
2882 .type = OperandType::TENSOR_FLOAT32,
2883 .dimensions = {2, 2, 2},
2884 .numberOfConsumers = 0,
2885 .scale = 0.0f,
2886 .zeroPoint = 0,
2887 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2888 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2889 }
2890 };
2891
2892 const std::vector<Operation> operations = {
2893 {
2894 .type = OperationType::GATHER,
2895 .inputs = {0, 1, 2},
2896 .outputs = {3},
2897 }
2898 };
2899
2900 const std::vector<uint32_t> inputIndexes = {0};
2901 const std::vector<uint32_t> outputIndexes = {3};
2902 std::vector<uint8_t> operandValues = {
2903 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
2904 };
2905 const std::vector<hidl_memory> pools = {};
2906
2907 return {
2908 .operands = operands,
2909 .operations = operations,
2910 .inputIndexes = inputIndexes,
2911 .outputIndexes = outputIndexes,
2912 .operandValues = operandValues,
2913 .pools = pools,
2914 };
2915 }
2916
is_ignored_5(int i)2917 inline bool is_ignored_5(int i) {
2918 static std::set<int> ignore = {};
2919 return ignore.find(i) != ignore.end();
2920 }
2921
2922 // Create the model
createTestModel_relaxed_5()2923 Model createTestModel_relaxed_5() {
2924 const std::vector<Operand> operands = {
2925 {
2926 .type = OperandType::TENSOR_FLOAT32,
2927 .dimensions = {1, 2, 2},
2928 .numberOfConsumers = 1,
2929 .scale = 0.0f,
2930 .zeroPoint = 0,
2931 .lifetime = OperandLifeTime::MODEL_INPUT,
2932 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2933 },
2934 {
2935 .type = OperandType::INT32,
2936 .dimensions = {},
2937 .numberOfConsumers = 1,
2938 .scale = 0.0f,
2939 .zeroPoint = 0,
2940 .lifetime = OperandLifeTime::CONSTANT_COPY,
2941 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2942 },
2943 {
2944 .type = OperandType::TENSOR_INT32,
2945 .dimensions = {2},
2946 .numberOfConsumers = 1,
2947 .scale = 0.0f,
2948 .zeroPoint = 0,
2949 .lifetime = OperandLifeTime::CONSTANT_COPY,
2950 .location = {.poolIndex = 0, .offset = 4, .length = 8},
2951 },
2952 {
2953 .type = OperandType::TENSOR_FLOAT32,
2954 .dimensions = {2, 2, 2},
2955 .numberOfConsumers = 0,
2956 .scale = 0.0f,
2957 .zeroPoint = 0,
2958 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2959 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2960 }
2961 };
2962
2963 const std::vector<Operation> operations = {
2964 {
2965 .type = OperationType::GATHER,
2966 .inputs = {0, 1, 2},
2967 .outputs = {3},
2968 }
2969 };
2970
2971 const std::vector<uint32_t> inputIndexes = {0};
2972 const std::vector<uint32_t> outputIndexes = {3};
2973 std::vector<uint8_t> operandValues = {
2974 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
2975 };
2976 const std::vector<hidl_memory> pools = {};
2977
2978 return {
2979 .operands = operands,
2980 .operations = operations,
2981 .inputIndexes = inputIndexes,
2982 .outputIndexes = outputIndexes,
2983 .operandValues = operandValues,
2984 .pools = pools,
2985 .relaxComputationFloat32toFloat16 = true,
2986 };
2987 }
2988
is_ignored_relaxed_5(int i)2989 inline bool is_ignored_relaxed_5(int i) {
2990 static std::set<int> ignore = {};
2991 return ignore.find(i) != ignore.end();
2992 }
2993
2994 // Create the model
createTestModel_quant8_5()2995 Model createTestModel_quant8_5() {
2996 const std::vector<Operand> operands = {
2997 {
2998 .type = OperandType::TENSOR_QUANT8_ASYMM,
2999 .dimensions = {1, 2, 2},
3000 .numberOfConsumers = 1,
3001 .scale = 0.5f,
3002 .zeroPoint = 127,
3003 .lifetime = OperandLifeTime::MODEL_INPUT,
3004 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3005 },
3006 {
3007 .type = OperandType::INT32,
3008 .dimensions = {},
3009 .numberOfConsumers = 1,
3010 .scale = 0.0f,
3011 .zeroPoint = 0,
3012 .lifetime = OperandLifeTime::CONSTANT_COPY,
3013 .location = {.poolIndex = 0, .offset = 0, .length = 4},
3014 },
3015 {
3016 .type = OperandType::TENSOR_INT32,
3017 .dimensions = {2},
3018 .numberOfConsumers = 1,
3019 .scale = 0.0f,
3020 .zeroPoint = 0,
3021 .lifetime = OperandLifeTime::CONSTANT_COPY,
3022 .location = {.poolIndex = 0, .offset = 4, .length = 8},
3023 },
3024 {
3025 .type = OperandType::TENSOR_QUANT8_ASYMM,
3026 .dimensions = {2, 2, 2},
3027 .numberOfConsumers = 0,
3028 .scale = 0.5f,
3029 .zeroPoint = 127,
3030 .lifetime = OperandLifeTime::MODEL_OUTPUT,
3031 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3032 }
3033 };
3034
3035 const std::vector<Operation> operations = {
3036 {
3037 .type = OperationType::GATHER,
3038 .inputs = {0, 1, 2},
3039 .outputs = {3},
3040 }
3041 };
3042
3043 const std::vector<uint32_t> inputIndexes = {0};
3044 const std::vector<uint32_t> outputIndexes = {3};
3045 std::vector<uint8_t> operandValues = {
3046 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
3047 };
3048 const std::vector<hidl_memory> pools = {};
3049
3050 return {
3051 .operands = operands,
3052 .operations = operations,
3053 .inputIndexes = inputIndexes,
3054 .outputIndexes = outputIndexes,
3055 .operandValues = operandValues,
3056 .pools = pools,
3057 };
3058 }
3059
is_ignored_quant8_5(int i)3060 inline bool is_ignored_quant8_5(int i) {
3061 static std::set<int> ignore = {};
3062 return ignore.find(i) != ignore.end();
3063 }
3064
3065 // Create the model
createTestModel_int32_5()3066 Model createTestModel_int32_5() {
3067 const std::vector<Operand> operands = {
3068 {
3069 .type = OperandType::TENSOR_INT32,
3070 .dimensions = {1, 2, 2},
3071 .numberOfConsumers = 1,
3072 .scale = 0.0f,
3073 .zeroPoint = 0,
3074 .lifetime = OperandLifeTime::MODEL_INPUT,
3075 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3076 },
3077 {
3078 .type = OperandType::INT32,
3079 .dimensions = {},
3080 .numberOfConsumers = 1,
3081 .scale = 0.0f,
3082 .zeroPoint = 0,
3083 .lifetime = OperandLifeTime::CONSTANT_COPY,
3084 .location = {.poolIndex = 0, .offset = 0, .length = 4},
3085 },
3086 {
3087 .type = OperandType::TENSOR_INT32,
3088 .dimensions = {2},
3089 .numberOfConsumers = 1,
3090 .scale = 0.0f,
3091 .zeroPoint = 0,
3092 .lifetime = OperandLifeTime::CONSTANT_COPY,
3093 .location = {.poolIndex = 0, .offset = 4, .length = 8},
3094 },
3095 {
3096 .type = OperandType::TENSOR_INT32,
3097 .dimensions = {2, 2, 2},
3098 .numberOfConsumers = 0,
3099 .scale = 0.0f,
3100 .zeroPoint = 0,
3101 .lifetime = OperandLifeTime::MODEL_OUTPUT,
3102 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3103 }
3104 };
3105
3106 const std::vector<Operation> operations = {
3107 {
3108 .type = OperationType::GATHER,
3109 .inputs = {0, 1, 2},
3110 .outputs = {3},
3111 }
3112 };
3113
3114 const std::vector<uint32_t> inputIndexes = {0};
3115 const std::vector<uint32_t> outputIndexes = {3};
3116 std::vector<uint8_t> operandValues = {
3117 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
3118 };
3119 const std::vector<hidl_memory> pools = {};
3120
3121 return {
3122 .operands = operands,
3123 .operations = operations,
3124 .inputIndexes = inputIndexes,
3125 .outputIndexes = outputIndexes,
3126 .operandValues = operandValues,
3127 .pools = pools,
3128 };
3129 }
3130
is_ignored_int32_5(int i)3131 inline bool is_ignored_int32_5(int i) {
3132 static std::set<int> ignore = {};
3133 return ignore.find(i) != ignore.end();
3134 }
3135
3136 // Create the model
createTestModel_float16_5()3137 Model createTestModel_float16_5() {
3138 const std::vector<Operand> operands = {
3139 {
3140 .type = OperandType::TENSOR_FLOAT16,
3141 .dimensions = {1, 2, 2},
3142 .numberOfConsumers = 1,
3143 .scale = 0.0f,
3144 .zeroPoint = 0,
3145 .lifetime = OperandLifeTime::MODEL_INPUT,
3146 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3147 },
3148 {
3149 .type = OperandType::INT32,
3150 .dimensions = {},
3151 .numberOfConsumers = 1,
3152 .scale = 0.0f,
3153 .zeroPoint = 0,
3154 .lifetime = OperandLifeTime::CONSTANT_COPY,
3155 .location = {.poolIndex = 0, .offset = 0, .length = 4},
3156 },
3157 {
3158 .type = OperandType::TENSOR_INT32,
3159 .dimensions = {2},
3160 .numberOfConsumers = 1,
3161 .scale = 0.0f,
3162 .zeroPoint = 0,
3163 .lifetime = OperandLifeTime::CONSTANT_COPY,
3164 .location = {.poolIndex = 0, .offset = 4, .length = 8},
3165 },
3166 {
3167 .type = OperandType::TENSOR_FLOAT16,
3168 .dimensions = {2, 2, 2},
3169 .numberOfConsumers = 0,
3170 .scale = 0.0f,
3171 .zeroPoint = 0,
3172 .lifetime = OperandLifeTime::MODEL_OUTPUT,
3173 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3174 }
3175 };
3176
3177 const std::vector<Operation> operations = {
3178 {
3179 .type = OperationType::GATHER,
3180 .inputs = {0, 1, 2},
3181 .outputs = {3},
3182 }
3183 };
3184
3185 const std::vector<uint32_t> inputIndexes = {0};
3186 const std::vector<uint32_t> outputIndexes = {3};
3187 std::vector<uint8_t> operandValues = {
3188 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
3189 };
3190 const std::vector<hidl_memory> pools = {};
3191
3192 return {
3193 .operands = operands,
3194 .operations = operations,
3195 .inputIndexes = inputIndexes,
3196 .outputIndexes = outputIndexes,
3197 .operandValues = operandValues,
3198 .pools = pools,
3199 };
3200 }
3201
is_ignored_float16_5(int i)3202 inline bool is_ignored_float16_5(int i) {
3203 static std::set<int> ignore = {};
3204 return ignore.find(i) != ignore.end();
3205 }
3206
3207 // Create the model
createTestModel_dynamic_output_shape_5()3208 Model createTestModel_dynamic_output_shape_5() {
3209 const std::vector<Operand> operands = {
3210 {
3211 .type = OperandType::TENSOR_FLOAT32,
3212 .dimensions = {1, 2, 2},
3213 .numberOfConsumers = 1,
3214 .scale = 0.0f,
3215 .zeroPoint = 0,
3216 .lifetime = OperandLifeTime::MODEL_INPUT,
3217 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3218 },
3219 {
3220 .type = OperandType::INT32,
3221 .dimensions = {},
3222 .numberOfConsumers = 1,
3223 .scale = 0.0f,
3224 .zeroPoint = 0,
3225 .lifetime = OperandLifeTime::CONSTANT_COPY,
3226 .location = {.poolIndex = 0, .offset = 0, .length = 4},
3227 },
3228 {
3229 .type = OperandType::TENSOR_INT32,
3230 .dimensions = {2},
3231 .numberOfConsumers = 1,
3232 .scale = 0.0f,
3233 .zeroPoint = 0,
3234 .lifetime = OperandLifeTime::CONSTANT_COPY,
3235 .location = {.poolIndex = 0, .offset = 4, .length = 8},
3236 },
3237 {
3238 .type = OperandType::TENSOR_FLOAT32,
3239 .dimensions = {0, 0, 0},
3240 .numberOfConsumers = 0,
3241 .scale = 0.0f,
3242 .zeroPoint = 0,
3243 .lifetime = OperandLifeTime::MODEL_OUTPUT,
3244 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3245 }
3246 };
3247
3248 const std::vector<Operation> operations = {
3249 {
3250 .type = OperationType::GATHER,
3251 .inputs = {0, 1, 2},
3252 .outputs = {3},
3253 }
3254 };
3255
3256 const std::vector<uint32_t> inputIndexes = {0};
3257 const std::vector<uint32_t> outputIndexes = {3};
3258 std::vector<uint8_t> operandValues = {
3259 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
3260 };
3261 const std::vector<hidl_memory> pools = {};
3262
3263 return {
3264 .operands = operands,
3265 .operations = operations,
3266 .inputIndexes = inputIndexes,
3267 .outputIndexes = outputIndexes,
3268 .operandValues = operandValues,
3269 .pools = pools,
3270 };
3271 }
3272
is_ignored_dynamic_output_shape_5(int i)3273 inline bool is_ignored_dynamic_output_shape_5(int i) {
3274 static std::set<int> ignore = {};
3275 return ignore.find(i) != ignore.end();
3276 }
3277
3278 // Create the model
createTestModel_dynamic_output_shape_relaxed_5()3279 Model createTestModel_dynamic_output_shape_relaxed_5() {
3280 const std::vector<Operand> operands = {
3281 {
3282 .type = OperandType::TENSOR_FLOAT32,
3283 .dimensions = {1, 2, 2},
3284 .numberOfConsumers = 1,
3285 .scale = 0.0f,
3286 .zeroPoint = 0,
3287 .lifetime = OperandLifeTime::MODEL_INPUT,
3288 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3289 },
3290 {
3291 .type = OperandType::INT32,
3292 .dimensions = {},
3293 .numberOfConsumers = 1,
3294 .scale = 0.0f,
3295 .zeroPoint = 0,
3296 .lifetime = OperandLifeTime::CONSTANT_COPY,
3297 .location = {.poolIndex = 0, .offset = 0, .length = 4},
3298 },
3299 {
3300 .type = OperandType::TENSOR_INT32,
3301 .dimensions = {2},
3302 .numberOfConsumers = 1,
3303 .scale = 0.0f,
3304 .zeroPoint = 0,
3305 .lifetime = OperandLifeTime::CONSTANT_COPY,
3306 .location = {.poolIndex = 0, .offset = 4, .length = 8},
3307 },
3308 {
3309 .type = OperandType::TENSOR_FLOAT32,
3310 .dimensions = {0, 0, 0},
3311 .numberOfConsumers = 0,
3312 .scale = 0.0f,
3313 .zeroPoint = 0,
3314 .lifetime = OperandLifeTime::MODEL_OUTPUT,
3315 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3316 }
3317 };
3318
3319 const std::vector<Operation> operations = {
3320 {
3321 .type = OperationType::GATHER,
3322 .inputs = {0, 1, 2},
3323 .outputs = {3},
3324 }
3325 };
3326
3327 const std::vector<uint32_t> inputIndexes = {0};
3328 const std::vector<uint32_t> outputIndexes = {3};
3329 std::vector<uint8_t> operandValues = {
3330 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
3331 };
3332 const std::vector<hidl_memory> pools = {};
3333
3334 return {
3335 .operands = operands,
3336 .operations = operations,
3337 .inputIndexes = inputIndexes,
3338 .outputIndexes = outputIndexes,
3339 .operandValues = operandValues,
3340 .pools = pools,
3341 .relaxComputationFloat32toFloat16 = true,
3342 };
3343 }
3344
is_ignored_dynamic_output_shape_relaxed_5(int i)3345 inline bool is_ignored_dynamic_output_shape_relaxed_5(int i) {
3346 static std::set<int> ignore = {};
3347 return ignore.find(i) != ignore.end();
3348 }
3349
3350 // Create the model
createTestModel_dynamic_output_shape_quant8_5()3351 Model createTestModel_dynamic_output_shape_quant8_5() {
3352 const std::vector<Operand> operands = {
3353 {
3354 .type = OperandType::TENSOR_QUANT8_ASYMM,
3355 .dimensions = {1, 2, 2},
3356 .numberOfConsumers = 1,
3357 .scale = 0.5f,
3358 .zeroPoint = 127,
3359 .lifetime = OperandLifeTime::MODEL_INPUT,
3360 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3361 },
3362 {
3363 .type = OperandType::INT32,
3364 .dimensions = {},
3365 .numberOfConsumers = 1,
3366 .scale = 0.0f,
3367 .zeroPoint = 0,
3368 .lifetime = OperandLifeTime::CONSTANT_COPY,
3369 .location = {.poolIndex = 0, .offset = 0, .length = 4},
3370 },
3371 {
3372 .type = OperandType::TENSOR_INT32,
3373 .dimensions = {2},
3374 .numberOfConsumers = 1,
3375 .scale = 0.0f,
3376 .zeroPoint = 0,
3377 .lifetime = OperandLifeTime::CONSTANT_COPY,
3378 .location = {.poolIndex = 0, .offset = 4, .length = 8},
3379 },
3380 {
3381 .type = OperandType::TENSOR_QUANT8_ASYMM,
3382 .dimensions = {0, 0, 0},
3383 .numberOfConsumers = 0,
3384 .scale = 0.5f,
3385 .zeroPoint = 127,
3386 .lifetime = OperandLifeTime::MODEL_OUTPUT,
3387 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3388 }
3389 };
3390
3391 const std::vector<Operation> operations = {
3392 {
3393 .type = OperationType::GATHER,
3394 .inputs = {0, 1, 2},
3395 .outputs = {3},
3396 }
3397 };
3398
3399 const std::vector<uint32_t> inputIndexes = {0};
3400 const std::vector<uint32_t> outputIndexes = {3};
3401 std::vector<uint8_t> operandValues = {
3402 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
3403 };
3404 const std::vector<hidl_memory> pools = {};
3405
3406 return {
3407 .operands = operands,
3408 .operations = operations,
3409 .inputIndexes = inputIndexes,
3410 .outputIndexes = outputIndexes,
3411 .operandValues = operandValues,
3412 .pools = pools,
3413 };
3414 }
3415
is_ignored_dynamic_output_shape_quant8_5(int i)3416 inline bool is_ignored_dynamic_output_shape_quant8_5(int i) {
3417 static std::set<int> ignore = {};
3418 return ignore.find(i) != ignore.end();
3419 }
3420
3421 // Create the model
createTestModel_dynamic_output_shape_int32_5()3422 Model createTestModel_dynamic_output_shape_int32_5() {
3423 const std::vector<Operand> operands = {
3424 {
3425 .type = OperandType::TENSOR_INT32,
3426 .dimensions = {1, 2, 2},
3427 .numberOfConsumers = 1,
3428 .scale = 0.0f,
3429 .zeroPoint = 0,
3430 .lifetime = OperandLifeTime::MODEL_INPUT,
3431 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3432 },
3433 {
3434 .type = OperandType::INT32,
3435 .dimensions = {},
3436 .numberOfConsumers = 1,
3437 .scale = 0.0f,
3438 .zeroPoint = 0,
3439 .lifetime = OperandLifeTime::CONSTANT_COPY,
3440 .location = {.poolIndex = 0, .offset = 0, .length = 4},
3441 },
3442 {
3443 .type = OperandType::TENSOR_INT32,
3444 .dimensions = {2},
3445 .numberOfConsumers = 1,
3446 .scale = 0.0f,
3447 .zeroPoint = 0,
3448 .lifetime = OperandLifeTime::CONSTANT_COPY,
3449 .location = {.poolIndex = 0, .offset = 4, .length = 8},
3450 },
3451 {
3452 .type = OperandType::TENSOR_INT32,
3453 .dimensions = {0, 0, 0},
3454 .numberOfConsumers = 0,
3455 .scale = 0.0f,
3456 .zeroPoint = 0,
3457 .lifetime = OperandLifeTime::MODEL_OUTPUT,
3458 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3459 }
3460 };
3461
3462 const std::vector<Operation> operations = {
3463 {
3464 .type = OperationType::GATHER,
3465 .inputs = {0, 1, 2},
3466 .outputs = {3},
3467 }
3468 };
3469
3470 const std::vector<uint32_t> inputIndexes = {0};
3471 const std::vector<uint32_t> outputIndexes = {3};
3472 std::vector<uint8_t> operandValues = {
3473 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
3474 };
3475 const std::vector<hidl_memory> pools = {};
3476
3477 return {
3478 .operands = operands,
3479 .operations = operations,
3480 .inputIndexes = inputIndexes,
3481 .outputIndexes = outputIndexes,
3482 .operandValues = operandValues,
3483 .pools = pools,
3484 };
3485 }
3486
is_ignored_dynamic_output_shape_int32_5(int i)3487 inline bool is_ignored_dynamic_output_shape_int32_5(int i) {
3488 static std::set<int> ignore = {};
3489 return ignore.find(i) != ignore.end();
3490 }
3491
3492 // Create the model
createTestModel_dynamic_output_shape_float16_5()3493 Model createTestModel_dynamic_output_shape_float16_5() {
3494 const std::vector<Operand> operands = {
3495 {
3496 .type = OperandType::TENSOR_FLOAT16,
3497 .dimensions = {1, 2, 2},
3498 .numberOfConsumers = 1,
3499 .scale = 0.0f,
3500 .zeroPoint = 0,
3501 .lifetime = OperandLifeTime::MODEL_INPUT,
3502 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3503 },
3504 {
3505 .type = OperandType::INT32,
3506 .dimensions = {},
3507 .numberOfConsumers = 1,
3508 .scale = 0.0f,
3509 .zeroPoint = 0,
3510 .lifetime = OperandLifeTime::CONSTANT_COPY,
3511 .location = {.poolIndex = 0, .offset = 0, .length = 4},
3512 },
3513 {
3514 .type = OperandType::TENSOR_INT32,
3515 .dimensions = {2},
3516 .numberOfConsumers = 1,
3517 .scale = 0.0f,
3518 .zeroPoint = 0,
3519 .lifetime = OperandLifeTime::CONSTANT_COPY,
3520 .location = {.poolIndex = 0, .offset = 4, .length = 8},
3521 },
3522 {
3523 .type = OperandType::TENSOR_FLOAT16,
3524 .dimensions = {0, 0, 0},
3525 .numberOfConsumers = 0,
3526 .scale = 0.0f,
3527 .zeroPoint = 0,
3528 .lifetime = OperandLifeTime::MODEL_OUTPUT,
3529 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3530 }
3531 };
3532
3533 const std::vector<Operation> operations = {
3534 {
3535 .type = OperationType::GATHER,
3536 .inputs = {0, 1, 2},
3537 .outputs = {3},
3538 }
3539 };
3540
3541 const std::vector<uint32_t> inputIndexes = {0};
3542 const std::vector<uint32_t> outputIndexes = {3};
3543 std::vector<uint8_t> operandValues = {
3544 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
3545 };
3546 const std::vector<hidl_memory> pools = {};
3547
3548 return {
3549 .operands = operands,
3550 .operations = operations,
3551 .inputIndexes = inputIndexes,
3552 .outputIndexes = outputIndexes,
3553 .operandValues = operandValues,
3554 .pools = pools,
3555 };
3556 }
3557
is_ignored_dynamic_output_shape_float16_5(int i)3558 inline bool is_ignored_dynamic_output_shape_float16_5(int i) {
3559 static std::set<int> ignore = {};
3560 return ignore.find(i) != ignore.end();
3561 }
3562
3563 // Create the model
createTestModel_6()3564 Model createTestModel_6() {
3565 const std::vector<Operand> operands = {
3566 {
3567 .type = OperandType::TENSOR_FLOAT32,
3568 .dimensions = {4, 1},
3569 .numberOfConsumers = 1,
3570 .scale = 0.0f,
3571 .zeroPoint = 0,
3572 .lifetime = OperandLifeTime::MODEL_INPUT,
3573 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3574 },
3575 {
3576 .type = OperandType::INT32,
3577 .dimensions = {},
3578 .numberOfConsumers = 1,
3579 .scale = 0.0f,
3580 .zeroPoint = 0,
3581 .lifetime = OperandLifeTime::CONSTANT_COPY,
3582 .location = {.poolIndex = 0, .offset = 0, .length = 4},
3583 },
3584 {
3585 .type = OperandType::TENSOR_INT32,
3586 .dimensions = {2},
3587 .numberOfConsumers = 1,
3588 .scale = 0.0f,
3589 .zeroPoint = 0,
3590 .lifetime = OperandLifeTime::CONSTANT_COPY,
3591 .location = {.poolIndex = 0, .offset = 4, .length = 8},
3592 },
3593 {
3594 .type = OperandType::TENSOR_FLOAT32,
3595 .dimensions = {2, 1},
3596 .numberOfConsumers = 0,
3597 .scale = 0.0f,
3598 .zeroPoint = 0,
3599 .lifetime = OperandLifeTime::MODEL_OUTPUT,
3600 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3601 }
3602 };
3603
3604 const std::vector<Operation> operations = {
3605 {
3606 .type = OperationType::GATHER,
3607 .inputs = {0, 1, 2},
3608 .outputs = {3},
3609 }
3610 };
3611
3612 const std::vector<uint32_t> inputIndexes = {0};
3613 const std::vector<uint32_t> outputIndexes = {3};
3614 std::vector<uint8_t> operandValues = {
3615 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0
3616 };
3617 const std::vector<hidl_memory> pools = {};
3618
3619 return {
3620 .operands = operands,
3621 .operations = operations,
3622 .inputIndexes = inputIndexes,
3623 .outputIndexes = outputIndexes,
3624 .operandValues = operandValues,
3625 .pools = pools,
3626 };
3627 }
3628
is_ignored_6(int i)3629 inline bool is_ignored_6(int i) {
3630 static std::set<int> ignore = {};
3631 return ignore.find(i) != ignore.end();
3632 }
3633
3634 // Create the model
createTestModel_relaxed_6()3635 Model createTestModel_relaxed_6() {
3636 const std::vector<Operand> operands = {
3637 {
3638 .type = OperandType::TENSOR_FLOAT32,
3639 .dimensions = {4, 1},
3640 .numberOfConsumers = 1,
3641 .scale = 0.0f,
3642 .zeroPoint = 0,
3643 .lifetime = OperandLifeTime::MODEL_INPUT,
3644 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3645 },
3646 {
3647 .type = OperandType::INT32,
3648 .dimensions = {},
3649 .numberOfConsumers = 1,
3650 .scale = 0.0f,
3651 .zeroPoint = 0,
3652 .lifetime = OperandLifeTime::CONSTANT_COPY,
3653 .location = {.poolIndex = 0, .offset = 0, .length = 4},
3654 },
3655 {
3656 .type = OperandType::TENSOR_INT32,
3657 .dimensions = {2},
3658 .numberOfConsumers = 1,
3659 .scale = 0.0f,
3660 .zeroPoint = 0,
3661 .lifetime = OperandLifeTime::CONSTANT_COPY,
3662 .location = {.poolIndex = 0, .offset = 4, .length = 8},
3663 },
3664 {
3665 .type = OperandType::TENSOR_FLOAT32,
3666 .dimensions = {2, 1},
3667 .numberOfConsumers = 0,
3668 .scale = 0.0f,
3669 .zeroPoint = 0,
3670 .lifetime = OperandLifeTime::MODEL_OUTPUT,
3671 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3672 }
3673 };
3674
3675 const std::vector<Operation> operations = {
3676 {
3677 .type = OperationType::GATHER,
3678 .inputs = {0, 1, 2},
3679 .outputs = {3},
3680 }
3681 };
3682
3683 const std::vector<uint32_t> inputIndexes = {0};
3684 const std::vector<uint32_t> outputIndexes = {3};
3685 std::vector<uint8_t> operandValues = {
3686 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0
3687 };
3688 const std::vector<hidl_memory> pools = {};
3689
3690 return {
3691 .operands = operands,
3692 .operations = operations,
3693 .inputIndexes = inputIndexes,
3694 .outputIndexes = outputIndexes,
3695 .operandValues = operandValues,
3696 .pools = pools,
3697 .relaxComputationFloat32toFloat16 = true,
3698 };
3699 }
3700
is_ignored_relaxed_6(int i)3701 inline bool is_ignored_relaxed_6(int i) {
3702 static std::set<int> ignore = {};
3703 return ignore.find(i) != ignore.end();
3704 }
3705
3706 // Create the model
createTestModel_quant8_6()3707 Model createTestModel_quant8_6() {
3708 const std::vector<Operand> operands = {
3709 {
3710 .type = OperandType::TENSOR_QUANT8_ASYMM,
3711 .dimensions = {4, 1},
3712 .numberOfConsumers = 1,
3713 .scale = 0.5f,
3714 .zeroPoint = 127,
3715 .lifetime = OperandLifeTime::MODEL_INPUT,
3716 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3717 },
3718 {
3719 .type = OperandType::INT32,
3720 .dimensions = {},
3721 .numberOfConsumers = 1,
3722 .scale = 0.0f,
3723 .zeroPoint = 0,
3724 .lifetime = OperandLifeTime::CONSTANT_COPY,
3725 .location = {.poolIndex = 0, .offset = 0, .length = 4},
3726 },
3727 {
3728 .type = OperandType::TENSOR_INT32,
3729 .dimensions = {2},
3730 .numberOfConsumers = 1,
3731 .scale = 0.0f,
3732 .zeroPoint = 0,
3733 .lifetime = OperandLifeTime::CONSTANT_COPY,
3734 .location = {.poolIndex = 0, .offset = 4, .length = 8},
3735 },
3736 {
3737 .type = OperandType::TENSOR_QUANT8_ASYMM,
3738 .dimensions = {2, 1},
3739 .numberOfConsumers = 0,
3740 .scale = 0.5f,
3741 .zeroPoint = 127,
3742 .lifetime = OperandLifeTime::MODEL_OUTPUT,
3743 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3744 }
3745 };
3746
3747 const std::vector<Operation> operations = {
3748 {
3749 .type = OperationType::GATHER,
3750 .inputs = {0, 1, 2},
3751 .outputs = {3},
3752 }
3753 };
3754
3755 const std::vector<uint32_t> inputIndexes = {0};
3756 const std::vector<uint32_t> outputIndexes = {3};
3757 std::vector<uint8_t> operandValues = {
3758 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0
3759 };
3760 const std::vector<hidl_memory> pools = {};
3761
3762 return {
3763 .operands = operands,
3764 .operations = operations,
3765 .inputIndexes = inputIndexes,
3766 .outputIndexes = outputIndexes,
3767 .operandValues = operandValues,
3768 .pools = pools,
3769 };
3770 }
3771
is_ignored_quant8_6(int i)3772 inline bool is_ignored_quant8_6(int i) {
3773 static std::set<int> ignore = {};
3774 return ignore.find(i) != ignore.end();
3775 }
3776
3777 // Create the model
createTestModel_int32_6()3778 Model createTestModel_int32_6() {
3779 const std::vector<Operand> operands = {
3780 {
3781 .type = OperandType::TENSOR_INT32,
3782 .dimensions = {4, 1},
3783 .numberOfConsumers = 1,
3784 .scale = 0.0f,
3785 .zeroPoint = 0,
3786 .lifetime = OperandLifeTime::MODEL_INPUT,
3787 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3788 },
3789 {
3790 .type = OperandType::INT32,
3791 .dimensions = {},
3792 .numberOfConsumers = 1,
3793 .scale = 0.0f,
3794 .zeroPoint = 0,
3795 .lifetime = OperandLifeTime::CONSTANT_COPY,
3796 .location = {.poolIndex = 0, .offset = 0, .length = 4},
3797 },
3798 {
3799 .type = OperandType::TENSOR_INT32,
3800 .dimensions = {2},
3801 .numberOfConsumers = 1,
3802 .scale = 0.0f,
3803 .zeroPoint = 0,
3804 .lifetime = OperandLifeTime::CONSTANT_COPY,
3805 .location = {.poolIndex = 0, .offset = 4, .length = 8},
3806 },
3807 {
3808 .type = OperandType::TENSOR_INT32,
3809 .dimensions = {2, 1},
3810 .numberOfConsumers = 0,
3811 .scale = 0.0f,
3812 .zeroPoint = 0,
3813 .lifetime = OperandLifeTime::MODEL_OUTPUT,
3814 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3815 }
3816 };
3817
3818 const std::vector<Operation> operations = {
3819 {
3820 .type = OperationType::GATHER,
3821 .inputs = {0, 1, 2},
3822 .outputs = {3},
3823 }
3824 };
3825
3826 const std::vector<uint32_t> inputIndexes = {0};
3827 const std::vector<uint32_t> outputIndexes = {3};
3828 std::vector<uint8_t> operandValues = {
3829 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0
3830 };
3831 const std::vector<hidl_memory> pools = {};
3832
3833 return {
3834 .operands = operands,
3835 .operations = operations,
3836 .inputIndexes = inputIndexes,
3837 .outputIndexes = outputIndexes,
3838 .operandValues = operandValues,
3839 .pools = pools,
3840 };
3841 }
3842
is_ignored_int32_6(int i)3843 inline bool is_ignored_int32_6(int i) {
3844 static std::set<int> ignore = {};
3845 return ignore.find(i) != ignore.end();
3846 }
3847
3848 // Create the model
createTestModel_float16_6()3849 Model createTestModel_float16_6() {
3850 const std::vector<Operand> operands = {
3851 {
3852 .type = OperandType::TENSOR_FLOAT16,
3853 .dimensions = {4, 1},
3854 .numberOfConsumers = 1,
3855 .scale = 0.0f,
3856 .zeroPoint = 0,
3857 .lifetime = OperandLifeTime::MODEL_INPUT,
3858 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3859 },
3860 {
3861 .type = OperandType::INT32,
3862 .dimensions = {},
3863 .numberOfConsumers = 1,
3864 .scale = 0.0f,
3865 .zeroPoint = 0,
3866 .lifetime = OperandLifeTime::CONSTANT_COPY,
3867 .location = {.poolIndex = 0, .offset = 0, .length = 4},
3868 },
3869 {
3870 .type = OperandType::TENSOR_INT32,
3871 .dimensions = {2},
3872 .numberOfConsumers = 1,
3873 .scale = 0.0f,
3874 .zeroPoint = 0,
3875 .lifetime = OperandLifeTime::CONSTANT_COPY,
3876 .location = {.poolIndex = 0, .offset = 4, .length = 8},
3877 },
3878 {
3879 .type = OperandType::TENSOR_FLOAT16,
3880 .dimensions = {2, 1},
3881 .numberOfConsumers = 0,
3882 .scale = 0.0f,
3883 .zeroPoint = 0,
3884 .lifetime = OperandLifeTime::MODEL_OUTPUT,
3885 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3886 }
3887 };
3888
3889 const std::vector<Operation> operations = {
3890 {
3891 .type = OperationType::GATHER,
3892 .inputs = {0, 1, 2},
3893 .outputs = {3},
3894 }
3895 };
3896
3897 const std::vector<uint32_t> inputIndexes = {0};
3898 const std::vector<uint32_t> outputIndexes = {3};
3899 std::vector<uint8_t> operandValues = {
3900 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0
3901 };
3902 const std::vector<hidl_memory> pools = {};
3903
3904 return {
3905 .operands = operands,
3906 .operations = operations,
3907 .inputIndexes = inputIndexes,
3908 .outputIndexes = outputIndexes,
3909 .operandValues = operandValues,
3910 .pools = pools,
3911 };
3912 }
3913
is_ignored_float16_6(int i)3914 inline bool is_ignored_float16_6(int i) {
3915 static std::set<int> ignore = {};
3916 return ignore.find(i) != ignore.end();
3917 }
3918
3919 // Create the model
createTestModel_dynamic_output_shape_6()3920 Model createTestModel_dynamic_output_shape_6() {
3921 const std::vector<Operand> operands = {
3922 {
3923 .type = OperandType::TENSOR_FLOAT32,
3924 .dimensions = {4, 1},
3925 .numberOfConsumers = 1,
3926 .scale = 0.0f,
3927 .zeroPoint = 0,
3928 .lifetime = OperandLifeTime::MODEL_INPUT,
3929 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3930 },
3931 {
3932 .type = OperandType::INT32,
3933 .dimensions = {},
3934 .numberOfConsumers = 1,
3935 .scale = 0.0f,
3936 .zeroPoint = 0,
3937 .lifetime = OperandLifeTime::CONSTANT_COPY,
3938 .location = {.poolIndex = 0, .offset = 0, .length = 4},
3939 },
3940 {
3941 .type = OperandType::TENSOR_INT32,
3942 .dimensions = {2},
3943 .numberOfConsumers = 1,
3944 .scale = 0.0f,
3945 .zeroPoint = 0,
3946 .lifetime = OperandLifeTime::CONSTANT_COPY,
3947 .location = {.poolIndex = 0, .offset = 4, .length = 8},
3948 },
3949 {
3950 .type = OperandType::TENSOR_FLOAT32,
3951 .dimensions = {0, 0},
3952 .numberOfConsumers = 0,
3953 .scale = 0.0f,
3954 .zeroPoint = 0,
3955 .lifetime = OperandLifeTime::MODEL_OUTPUT,
3956 .location = {.poolIndex = 0, .offset = 0, .length = 0},
3957 }
3958 };
3959
3960 const std::vector<Operation> operations = {
3961 {
3962 .type = OperationType::GATHER,
3963 .inputs = {0, 1, 2},
3964 .outputs = {3},
3965 }
3966 };
3967
3968 const std::vector<uint32_t> inputIndexes = {0};
3969 const std::vector<uint32_t> outputIndexes = {3};
3970 std::vector<uint8_t> operandValues = {
3971 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0
3972 };
3973 const std::vector<hidl_memory> pools = {};
3974
3975 return {
3976 .operands = operands,
3977 .operations = operations,
3978 .inputIndexes = inputIndexes,
3979 .outputIndexes = outputIndexes,
3980 .operandValues = operandValues,
3981 .pools = pools,
3982 };
3983 }
3984
is_ignored_dynamic_output_shape_6(int i)3985 inline bool is_ignored_dynamic_output_shape_6(int i) {
3986 static std::set<int> ignore = {};
3987 return ignore.find(i) != ignore.end();
3988 }
3989
3990 // Create the model
createTestModel_dynamic_output_shape_relaxed_6()3991 Model createTestModel_dynamic_output_shape_relaxed_6() {
3992 const std::vector<Operand> operands = {
3993 {
3994 .type = OperandType::TENSOR_FLOAT32,
3995 .dimensions = {4, 1},
3996 .numberOfConsumers = 1,
3997 .scale = 0.0f,
3998 .zeroPoint = 0,
3999 .lifetime = OperandLifeTime::MODEL_INPUT,
4000 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4001 },
4002 {
4003 .type = OperandType::INT32,
4004 .dimensions = {},
4005 .numberOfConsumers = 1,
4006 .scale = 0.0f,
4007 .zeroPoint = 0,
4008 .lifetime = OperandLifeTime::CONSTANT_COPY,
4009 .location = {.poolIndex = 0, .offset = 0, .length = 4},
4010 },
4011 {
4012 .type = OperandType::TENSOR_INT32,
4013 .dimensions = {2},
4014 .numberOfConsumers = 1,
4015 .scale = 0.0f,
4016 .zeroPoint = 0,
4017 .lifetime = OperandLifeTime::CONSTANT_COPY,
4018 .location = {.poolIndex = 0, .offset = 4, .length = 8},
4019 },
4020 {
4021 .type = OperandType::TENSOR_FLOAT32,
4022 .dimensions = {0, 0},
4023 .numberOfConsumers = 0,
4024 .scale = 0.0f,
4025 .zeroPoint = 0,
4026 .lifetime = OperandLifeTime::MODEL_OUTPUT,
4027 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4028 }
4029 };
4030
4031 const std::vector<Operation> operations = {
4032 {
4033 .type = OperationType::GATHER,
4034 .inputs = {0, 1, 2},
4035 .outputs = {3},
4036 }
4037 };
4038
4039 const std::vector<uint32_t> inputIndexes = {0};
4040 const std::vector<uint32_t> outputIndexes = {3};
4041 std::vector<uint8_t> operandValues = {
4042 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0
4043 };
4044 const std::vector<hidl_memory> pools = {};
4045
4046 return {
4047 .operands = operands,
4048 .operations = operations,
4049 .inputIndexes = inputIndexes,
4050 .outputIndexes = outputIndexes,
4051 .operandValues = operandValues,
4052 .pools = pools,
4053 .relaxComputationFloat32toFloat16 = true,
4054 };
4055 }
4056
is_ignored_dynamic_output_shape_relaxed_6(int i)4057 inline bool is_ignored_dynamic_output_shape_relaxed_6(int i) {
4058 static std::set<int> ignore = {};
4059 return ignore.find(i) != ignore.end();
4060 }
4061
4062 // Create the model
createTestModel_dynamic_output_shape_quant8_6()4063 Model createTestModel_dynamic_output_shape_quant8_6() {
4064 const std::vector<Operand> operands = {
4065 {
4066 .type = OperandType::TENSOR_QUANT8_ASYMM,
4067 .dimensions = {4, 1},
4068 .numberOfConsumers = 1,
4069 .scale = 0.5f,
4070 .zeroPoint = 127,
4071 .lifetime = OperandLifeTime::MODEL_INPUT,
4072 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4073 },
4074 {
4075 .type = OperandType::INT32,
4076 .dimensions = {},
4077 .numberOfConsumers = 1,
4078 .scale = 0.0f,
4079 .zeroPoint = 0,
4080 .lifetime = OperandLifeTime::CONSTANT_COPY,
4081 .location = {.poolIndex = 0, .offset = 0, .length = 4},
4082 },
4083 {
4084 .type = OperandType::TENSOR_INT32,
4085 .dimensions = {2},
4086 .numberOfConsumers = 1,
4087 .scale = 0.0f,
4088 .zeroPoint = 0,
4089 .lifetime = OperandLifeTime::CONSTANT_COPY,
4090 .location = {.poolIndex = 0, .offset = 4, .length = 8},
4091 },
4092 {
4093 .type = OperandType::TENSOR_QUANT8_ASYMM,
4094 .dimensions = {0, 0},
4095 .numberOfConsumers = 0,
4096 .scale = 0.5f,
4097 .zeroPoint = 127,
4098 .lifetime = OperandLifeTime::MODEL_OUTPUT,
4099 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4100 }
4101 };
4102
4103 const std::vector<Operation> operations = {
4104 {
4105 .type = OperationType::GATHER,
4106 .inputs = {0, 1, 2},
4107 .outputs = {3},
4108 }
4109 };
4110
4111 const std::vector<uint32_t> inputIndexes = {0};
4112 const std::vector<uint32_t> outputIndexes = {3};
4113 std::vector<uint8_t> operandValues = {
4114 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0
4115 };
4116 const std::vector<hidl_memory> pools = {};
4117
4118 return {
4119 .operands = operands,
4120 .operations = operations,
4121 .inputIndexes = inputIndexes,
4122 .outputIndexes = outputIndexes,
4123 .operandValues = operandValues,
4124 .pools = pools,
4125 };
4126 }
4127
is_ignored_dynamic_output_shape_quant8_6(int i)4128 inline bool is_ignored_dynamic_output_shape_quant8_6(int i) {
4129 static std::set<int> ignore = {};
4130 return ignore.find(i) != ignore.end();
4131 }
4132
4133 // Create the model
createTestModel_dynamic_output_shape_int32_6()4134 Model createTestModel_dynamic_output_shape_int32_6() {
4135 const std::vector<Operand> operands = {
4136 {
4137 .type = OperandType::TENSOR_INT32,
4138 .dimensions = {4, 1},
4139 .numberOfConsumers = 1,
4140 .scale = 0.0f,
4141 .zeroPoint = 0,
4142 .lifetime = OperandLifeTime::MODEL_INPUT,
4143 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4144 },
4145 {
4146 .type = OperandType::INT32,
4147 .dimensions = {},
4148 .numberOfConsumers = 1,
4149 .scale = 0.0f,
4150 .zeroPoint = 0,
4151 .lifetime = OperandLifeTime::CONSTANT_COPY,
4152 .location = {.poolIndex = 0, .offset = 0, .length = 4},
4153 },
4154 {
4155 .type = OperandType::TENSOR_INT32,
4156 .dimensions = {2},
4157 .numberOfConsumers = 1,
4158 .scale = 0.0f,
4159 .zeroPoint = 0,
4160 .lifetime = OperandLifeTime::CONSTANT_COPY,
4161 .location = {.poolIndex = 0, .offset = 4, .length = 8},
4162 },
4163 {
4164 .type = OperandType::TENSOR_INT32,
4165 .dimensions = {0, 0},
4166 .numberOfConsumers = 0,
4167 .scale = 0.0f,
4168 .zeroPoint = 0,
4169 .lifetime = OperandLifeTime::MODEL_OUTPUT,
4170 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4171 }
4172 };
4173
4174 const std::vector<Operation> operations = {
4175 {
4176 .type = OperationType::GATHER,
4177 .inputs = {0, 1, 2},
4178 .outputs = {3},
4179 }
4180 };
4181
4182 const std::vector<uint32_t> inputIndexes = {0};
4183 const std::vector<uint32_t> outputIndexes = {3};
4184 std::vector<uint8_t> operandValues = {
4185 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0
4186 };
4187 const std::vector<hidl_memory> pools = {};
4188
4189 return {
4190 .operands = operands,
4191 .operations = operations,
4192 .inputIndexes = inputIndexes,
4193 .outputIndexes = outputIndexes,
4194 .operandValues = operandValues,
4195 .pools = pools,
4196 };
4197 }
4198
is_ignored_dynamic_output_shape_int32_6(int i)4199 inline bool is_ignored_dynamic_output_shape_int32_6(int i) {
4200 static std::set<int> ignore = {};
4201 return ignore.find(i) != ignore.end();
4202 }
4203
4204 // Create the model
createTestModel_dynamic_output_shape_float16_6()4205 Model createTestModel_dynamic_output_shape_float16_6() {
4206 const std::vector<Operand> operands = {
4207 {
4208 .type = OperandType::TENSOR_FLOAT16,
4209 .dimensions = {4, 1},
4210 .numberOfConsumers = 1,
4211 .scale = 0.0f,
4212 .zeroPoint = 0,
4213 .lifetime = OperandLifeTime::MODEL_INPUT,
4214 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4215 },
4216 {
4217 .type = OperandType::INT32,
4218 .dimensions = {},
4219 .numberOfConsumers = 1,
4220 .scale = 0.0f,
4221 .zeroPoint = 0,
4222 .lifetime = OperandLifeTime::CONSTANT_COPY,
4223 .location = {.poolIndex = 0, .offset = 0, .length = 4},
4224 },
4225 {
4226 .type = OperandType::TENSOR_INT32,
4227 .dimensions = {2},
4228 .numberOfConsumers = 1,
4229 .scale = 0.0f,
4230 .zeroPoint = 0,
4231 .lifetime = OperandLifeTime::CONSTANT_COPY,
4232 .location = {.poolIndex = 0, .offset = 4, .length = 8},
4233 },
4234 {
4235 .type = OperandType::TENSOR_FLOAT16,
4236 .dimensions = {0, 0},
4237 .numberOfConsumers = 0,
4238 .scale = 0.0f,
4239 .zeroPoint = 0,
4240 .lifetime = OperandLifeTime::MODEL_OUTPUT,
4241 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4242 }
4243 };
4244
4245 const std::vector<Operation> operations = {
4246 {
4247 .type = OperationType::GATHER,
4248 .inputs = {0, 1, 2},
4249 .outputs = {3},
4250 }
4251 };
4252
4253 const std::vector<uint32_t> inputIndexes = {0};
4254 const std::vector<uint32_t> outputIndexes = {3};
4255 std::vector<uint8_t> operandValues = {
4256 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0
4257 };
4258 const std::vector<hidl_memory> pools = {};
4259
4260 return {
4261 .operands = operands,
4262 .operations = operations,
4263 .inputIndexes = inputIndexes,
4264 .outputIndexes = outputIndexes,
4265 .operandValues = operandValues,
4266 .pools = pools,
4267 };
4268 }
4269
is_ignored_dynamic_output_shape_float16_6(int i)4270 inline bool is_ignored_dynamic_output_shape_float16_6(int i) {
4271 static std::set<int> ignore = {};
4272 return ignore.find(i) != ignore.end();
4273 }
4274
4275 // Create the model
createTestModel_7()4276 Model createTestModel_7() {
4277 const std::vector<Operand> operands = {
4278 {
4279 .type = OperandType::TENSOR_FLOAT32,
4280 .dimensions = {1, 2, 3},
4281 .numberOfConsumers = 1,
4282 .scale = 0.0f,
4283 .zeroPoint = 0,
4284 .lifetime = OperandLifeTime::MODEL_INPUT,
4285 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4286 },
4287 {
4288 .type = OperandType::INT32,
4289 .dimensions = {},
4290 .numberOfConsumers = 1,
4291 .scale = 0.0f,
4292 .zeroPoint = 0,
4293 .lifetime = OperandLifeTime::CONSTANT_COPY,
4294 .location = {.poolIndex = 0, .offset = 0, .length = 4},
4295 },
4296 {
4297 .type = OperandType::TENSOR_INT32,
4298 .dimensions = {2},
4299 .numberOfConsumers = 1,
4300 .scale = 0.0f,
4301 .zeroPoint = 0,
4302 .lifetime = OperandLifeTime::CONSTANT_COPY,
4303 .location = {.poolIndex = 0, .offset = 4, .length = 8},
4304 },
4305 {
4306 .type = OperandType::TENSOR_FLOAT32,
4307 .dimensions = {1, 2, 3},
4308 .numberOfConsumers = 0,
4309 .scale = 0.0f,
4310 .zeroPoint = 0,
4311 .lifetime = OperandLifeTime::MODEL_OUTPUT,
4312 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4313 }
4314 };
4315
4316 const std::vector<Operation> operations = {
4317 {
4318 .type = OperationType::GATHER,
4319 .inputs = {0, 1, 2},
4320 .outputs = {3},
4321 }
4322 };
4323
4324 const std::vector<uint32_t> inputIndexes = {0};
4325 const std::vector<uint32_t> outputIndexes = {3};
4326 std::vector<uint8_t> operandValues = {
4327 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
4328 };
4329 const std::vector<hidl_memory> pools = {};
4330
4331 return {
4332 .operands = operands,
4333 .operations = operations,
4334 .inputIndexes = inputIndexes,
4335 .outputIndexes = outputIndexes,
4336 .operandValues = operandValues,
4337 .pools = pools,
4338 };
4339 }
4340
is_ignored_7(int i)4341 inline bool is_ignored_7(int i) {
4342 static std::set<int> ignore = {};
4343 return ignore.find(i) != ignore.end();
4344 }
4345
4346 // Create the model
createTestModel_relaxed_7()4347 Model createTestModel_relaxed_7() {
4348 const std::vector<Operand> operands = {
4349 {
4350 .type = OperandType::TENSOR_FLOAT32,
4351 .dimensions = {1, 2, 3},
4352 .numberOfConsumers = 1,
4353 .scale = 0.0f,
4354 .zeroPoint = 0,
4355 .lifetime = OperandLifeTime::MODEL_INPUT,
4356 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4357 },
4358 {
4359 .type = OperandType::INT32,
4360 .dimensions = {},
4361 .numberOfConsumers = 1,
4362 .scale = 0.0f,
4363 .zeroPoint = 0,
4364 .lifetime = OperandLifeTime::CONSTANT_COPY,
4365 .location = {.poolIndex = 0, .offset = 0, .length = 4},
4366 },
4367 {
4368 .type = OperandType::TENSOR_INT32,
4369 .dimensions = {2},
4370 .numberOfConsumers = 1,
4371 .scale = 0.0f,
4372 .zeroPoint = 0,
4373 .lifetime = OperandLifeTime::CONSTANT_COPY,
4374 .location = {.poolIndex = 0, .offset = 4, .length = 8},
4375 },
4376 {
4377 .type = OperandType::TENSOR_FLOAT32,
4378 .dimensions = {1, 2, 3},
4379 .numberOfConsumers = 0,
4380 .scale = 0.0f,
4381 .zeroPoint = 0,
4382 .lifetime = OperandLifeTime::MODEL_OUTPUT,
4383 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4384 }
4385 };
4386
4387 const std::vector<Operation> operations = {
4388 {
4389 .type = OperationType::GATHER,
4390 .inputs = {0, 1, 2},
4391 .outputs = {3},
4392 }
4393 };
4394
4395 const std::vector<uint32_t> inputIndexes = {0};
4396 const std::vector<uint32_t> outputIndexes = {3};
4397 std::vector<uint8_t> operandValues = {
4398 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
4399 };
4400 const std::vector<hidl_memory> pools = {};
4401
4402 return {
4403 .operands = operands,
4404 .operations = operations,
4405 .inputIndexes = inputIndexes,
4406 .outputIndexes = outputIndexes,
4407 .operandValues = operandValues,
4408 .pools = pools,
4409 .relaxComputationFloat32toFloat16 = true,
4410 };
4411 }
4412
is_ignored_relaxed_7(int i)4413 inline bool is_ignored_relaxed_7(int i) {
4414 static std::set<int> ignore = {};
4415 return ignore.find(i) != ignore.end();
4416 }
4417
4418 // Create the model
createTestModel_quant8_7()4419 Model createTestModel_quant8_7() {
4420 const std::vector<Operand> operands = {
4421 {
4422 .type = OperandType::TENSOR_QUANT8_ASYMM,
4423 .dimensions = {1, 2, 3},
4424 .numberOfConsumers = 1,
4425 .scale = 0.5f,
4426 .zeroPoint = 127,
4427 .lifetime = OperandLifeTime::MODEL_INPUT,
4428 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4429 },
4430 {
4431 .type = OperandType::INT32,
4432 .dimensions = {},
4433 .numberOfConsumers = 1,
4434 .scale = 0.0f,
4435 .zeroPoint = 0,
4436 .lifetime = OperandLifeTime::CONSTANT_COPY,
4437 .location = {.poolIndex = 0, .offset = 0, .length = 4},
4438 },
4439 {
4440 .type = OperandType::TENSOR_INT32,
4441 .dimensions = {2},
4442 .numberOfConsumers = 1,
4443 .scale = 0.0f,
4444 .zeroPoint = 0,
4445 .lifetime = OperandLifeTime::CONSTANT_COPY,
4446 .location = {.poolIndex = 0, .offset = 4, .length = 8},
4447 },
4448 {
4449 .type = OperandType::TENSOR_QUANT8_ASYMM,
4450 .dimensions = {1, 2, 3},
4451 .numberOfConsumers = 0,
4452 .scale = 0.5f,
4453 .zeroPoint = 127,
4454 .lifetime = OperandLifeTime::MODEL_OUTPUT,
4455 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4456 }
4457 };
4458
4459 const std::vector<Operation> operations = {
4460 {
4461 .type = OperationType::GATHER,
4462 .inputs = {0, 1, 2},
4463 .outputs = {3},
4464 }
4465 };
4466
4467 const std::vector<uint32_t> inputIndexes = {0};
4468 const std::vector<uint32_t> outputIndexes = {3};
4469 std::vector<uint8_t> operandValues = {
4470 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
4471 };
4472 const std::vector<hidl_memory> pools = {};
4473
4474 return {
4475 .operands = operands,
4476 .operations = operations,
4477 .inputIndexes = inputIndexes,
4478 .outputIndexes = outputIndexes,
4479 .operandValues = operandValues,
4480 .pools = pools,
4481 };
4482 }
4483
is_ignored_quant8_7(int i)4484 inline bool is_ignored_quant8_7(int i) {
4485 static std::set<int> ignore = {};
4486 return ignore.find(i) != ignore.end();
4487 }
4488
4489 // Create the model
createTestModel_int32_7()4490 Model createTestModel_int32_7() {
4491 const std::vector<Operand> operands = {
4492 {
4493 .type = OperandType::TENSOR_INT32,
4494 .dimensions = {1, 2, 3},
4495 .numberOfConsumers = 1,
4496 .scale = 0.0f,
4497 .zeroPoint = 0,
4498 .lifetime = OperandLifeTime::MODEL_INPUT,
4499 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4500 },
4501 {
4502 .type = OperandType::INT32,
4503 .dimensions = {},
4504 .numberOfConsumers = 1,
4505 .scale = 0.0f,
4506 .zeroPoint = 0,
4507 .lifetime = OperandLifeTime::CONSTANT_COPY,
4508 .location = {.poolIndex = 0, .offset = 0, .length = 4},
4509 },
4510 {
4511 .type = OperandType::TENSOR_INT32,
4512 .dimensions = {2},
4513 .numberOfConsumers = 1,
4514 .scale = 0.0f,
4515 .zeroPoint = 0,
4516 .lifetime = OperandLifeTime::CONSTANT_COPY,
4517 .location = {.poolIndex = 0, .offset = 4, .length = 8},
4518 },
4519 {
4520 .type = OperandType::TENSOR_INT32,
4521 .dimensions = {1, 2, 3},
4522 .numberOfConsumers = 0,
4523 .scale = 0.0f,
4524 .zeroPoint = 0,
4525 .lifetime = OperandLifeTime::MODEL_OUTPUT,
4526 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4527 }
4528 };
4529
4530 const std::vector<Operation> operations = {
4531 {
4532 .type = OperationType::GATHER,
4533 .inputs = {0, 1, 2},
4534 .outputs = {3},
4535 }
4536 };
4537
4538 const std::vector<uint32_t> inputIndexes = {0};
4539 const std::vector<uint32_t> outputIndexes = {3};
4540 std::vector<uint8_t> operandValues = {
4541 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
4542 };
4543 const std::vector<hidl_memory> pools = {};
4544
4545 return {
4546 .operands = operands,
4547 .operations = operations,
4548 .inputIndexes = inputIndexes,
4549 .outputIndexes = outputIndexes,
4550 .operandValues = operandValues,
4551 .pools = pools,
4552 };
4553 }
4554
is_ignored_int32_7(int i)4555 inline bool is_ignored_int32_7(int i) {
4556 static std::set<int> ignore = {};
4557 return ignore.find(i) != ignore.end();
4558 }
4559
4560 // Create the model
createTestModel_float16_7()4561 Model createTestModel_float16_7() {
4562 const std::vector<Operand> operands = {
4563 {
4564 .type = OperandType::TENSOR_FLOAT16,
4565 .dimensions = {1, 2, 3},
4566 .numberOfConsumers = 1,
4567 .scale = 0.0f,
4568 .zeroPoint = 0,
4569 .lifetime = OperandLifeTime::MODEL_INPUT,
4570 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4571 },
4572 {
4573 .type = OperandType::INT32,
4574 .dimensions = {},
4575 .numberOfConsumers = 1,
4576 .scale = 0.0f,
4577 .zeroPoint = 0,
4578 .lifetime = OperandLifeTime::CONSTANT_COPY,
4579 .location = {.poolIndex = 0, .offset = 0, .length = 4},
4580 },
4581 {
4582 .type = OperandType::TENSOR_INT32,
4583 .dimensions = {2},
4584 .numberOfConsumers = 1,
4585 .scale = 0.0f,
4586 .zeroPoint = 0,
4587 .lifetime = OperandLifeTime::CONSTANT_COPY,
4588 .location = {.poolIndex = 0, .offset = 4, .length = 8},
4589 },
4590 {
4591 .type = OperandType::TENSOR_FLOAT16,
4592 .dimensions = {1, 2, 3},
4593 .numberOfConsumers = 0,
4594 .scale = 0.0f,
4595 .zeroPoint = 0,
4596 .lifetime = OperandLifeTime::MODEL_OUTPUT,
4597 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4598 }
4599 };
4600
4601 const std::vector<Operation> operations = {
4602 {
4603 .type = OperationType::GATHER,
4604 .inputs = {0, 1, 2},
4605 .outputs = {3},
4606 }
4607 };
4608
4609 const std::vector<uint32_t> inputIndexes = {0};
4610 const std::vector<uint32_t> outputIndexes = {3};
4611 std::vector<uint8_t> operandValues = {
4612 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
4613 };
4614 const std::vector<hidl_memory> pools = {};
4615
4616 return {
4617 .operands = operands,
4618 .operations = operations,
4619 .inputIndexes = inputIndexes,
4620 .outputIndexes = outputIndexes,
4621 .operandValues = operandValues,
4622 .pools = pools,
4623 };
4624 }
4625
is_ignored_float16_7(int i)4626 inline bool is_ignored_float16_7(int i) {
4627 static std::set<int> ignore = {};
4628 return ignore.find(i) != ignore.end();
4629 }
4630
4631 // Create the model
createTestModel_dynamic_output_shape_7()4632 Model createTestModel_dynamic_output_shape_7() {
4633 const std::vector<Operand> operands = {
4634 {
4635 .type = OperandType::TENSOR_FLOAT32,
4636 .dimensions = {1, 2, 3},
4637 .numberOfConsumers = 1,
4638 .scale = 0.0f,
4639 .zeroPoint = 0,
4640 .lifetime = OperandLifeTime::MODEL_INPUT,
4641 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4642 },
4643 {
4644 .type = OperandType::INT32,
4645 .dimensions = {},
4646 .numberOfConsumers = 1,
4647 .scale = 0.0f,
4648 .zeroPoint = 0,
4649 .lifetime = OperandLifeTime::CONSTANT_COPY,
4650 .location = {.poolIndex = 0, .offset = 0, .length = 4},
4651 },
4652 {
4653 .type = OperandType::TENSOR_INT32,
4654 .dimensions = {2},
4655 .numberOfConsumers = 1,
4656 .scale = 0.0f,
4657 .zeroPoint = 0,
4658 .lifetime = OperandLifeTime::CONSTANT_COPY,
4659 .location = {.poolIndex = 0, .offset = 4, .length = 8},
4660 },
4661 {
4662 .type = OperandType::TENSOR_FLOAT32,
4663 .dimensions = {0, 0, 0},
4664 .numberOfConsumers = 0,
4665 .scale = 0.0f,
4666 .zeroPoint = 0,
4667 .lifetime = OperandLifeTime::MODEL_OUTPUT,
4668 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4669 }
4670 };
4671
4672 const std::vector<Operation> operations = {
4673 {
4674 .type = OperationType::GATHER,
4675 .inputs = {0, 1, 2},
4676 .outputs = {3},
4677 }
4678 };
4679
4680 const std::vector<uint32_t> inputIndexes = {0};
4681 const std::vector<uint32_t> outputIndexes = {3};
4682 std::vector<uint8_t> operandValues = {
4683 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
4684 };
4685 const std::vector<hidl_memory> pools = {};
4686
4687 return {
4688 .operands = operands,
4689 .operations = operations,
4690 .inputIndexes = inputIndexes,
4691 .outputIndexes = outputIndexes,
4692 .operandValues = operandValues,
4693 .pools = pools,
4694 };
4695 }
4696
is_ignored_dynamic_output_shape_7(int i)4697 inline bool is_ignored_dynamic_output_shape_7(int i) {
4698 static std::set<int> ignore = {};
4699 return ignore.find(i) != ignore.end();
4700 }
4701
4702 // Create the model
createTestModel_dynamic_output_shape_relaxed_7()4703 Model createTestModel_dynamic_output_shape_relaxed_7() {
4704 const std::vector<Operand> operands = {
4705 {
4706 .type = OperandType::TENSOR_FLOAT32,
4707 .dimensions = {1, 2, 3},
4708 .numberOfConsumers = 1,
4709 .scale = 0.0f,
4710 .zeroPoint = 0,
4711 .lifetime = OperandLifeTime::MODEL_INPUT,
4712 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4713 },
4714 {
4715 .type = OperandType::INT32,
4716 .dimensions = {},
4717 .numberOfConsumers = 1,
4718 .scale = 0.0f,
4719 .zeroPoint = 0,
4720 .lifetime = OperandLifeTime::CONSTANT_COPY,
4721 .location = {.poolIndex = 0, .offset = 0, .length = 4},
4722 },
4723 {
4724 .type = OperandType::TENSOR_INT32,
4725 .dimensions = {2},
4726 .numberOfConsumers = 1,
4727 .scale = 0.0f,
4728 .zeroPoint = 0,
4729 .lifetime = OperandLifeTime::CONSTANT_COPY,
4730 .location = {.poolIndex = 0, .offset = 4, .length = 8},
4731 },
4732 {
4733 .type = OperandType::TENSOR_FLOAT32,
4734 .dimensions = {0, 0, 0},
4735 .numberOfConsumers = 0,
4736 .scale = 0.0f,
4737 .zeroPoint = 0,
4738 .lifetime = OperandLifeTime::MODEL_OUTPUT,
4739 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4740 }
4741 };
4742
4743 const std::vector<Operation> operations = {
4744 {
4745 .type = OperationType::GATHER,
4746 .inputs = {0, 1, 2},
4747 .outputs = {3},
4748 }
4749 };
4750
4751 const std::vector<uint32_t> inputIndexes = {0};
4752 const std::vector<uint32_t> outputIndexes = {3};
4753 std::vector<uint8_t> operandValues = {
4754 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
4755 };
4756 const std::vector<hidl_memory> pools = {};
4757
4758 return {
4759 .operands = operands,
4760 .operations = operations,
4761 .inputIndexes = inputIndexes,
4762 .outputIndexes = outputIndexes,
4763 .operandValues = operandValues,
4764 .pools = pools,
4765 .relaxComputationFloat32toFloat16 = true,
4766 };
4767 }
4768
is_ignored_dynamic_output_shape_relaxed_7(int i)4769 inline bool is_ignored_dynamic_output_shape_relaxed_7(int i) {
4770 static std::set<int> ignore = {};
4771 return ignore.find(i) != ignore.end();
4772 }
4773
4774 // Create the model
createTestModel_dynamic_output_shape_quant8_7()4775 Model createTestModel_dynamic_output_shape_quant8_7() {
4776 const std::vector<Operand> operands = {
4777 {
4778 .type = OperandType::TENSOR_QUANT8_ASYMM,
4779 .dimensions = {1, 2, 3},
4780 .numberOfConsumers = 1,
4781 .scale = 0.5f,
4782 .zeroPoint = 127,
4783 .lifetime = OperandLifeTime::MODEL_INPUT,
4784 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4785 },
4786 {
4787 .type = OperandType::INT32,
4788 .dimensions = {},
4789 .numberOfConsumers = 1,
4790 .scale = 0.0f,
4791 .zeroPoint = 0,
4792 .lifetime = OperandLifeTime::CONSTANT_COPY,
4793 .location = {.poolIndex = 0, .offset = 0, .length = 4},
4794 },
4795 {
4796 .type = OperandType::TENSOR_INT32,
4797 .dimensions = {2},
4798 .numberOfConsumers = 1,
4799 .scale = 0.0f,
4800 .zeroPoint = 0,
4801 .lifetime = OperandLifeTime::CONSTANT_COPY,
4802 .location = {.poolIndex = 0, .offset = 4, .length = 8},
4803 },
4804 {
4805 .type = OperandType::TENSOR_QUANT8_ASYMM,
4806 .dimensions = {0, 0, 0},
4807 .numberOfConsumers = 0,
4808 .scale = 0.5f,
4809 .zeroPoint = 127,
4810 .lifetime = OperandLifeTime::MODEL_OUTPUT,
4811 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4812 }
4813 };
4814
4815 const std::vector<Operation> operations = {
4816 {
4817 .type = OperationType::GATHER,
4818 .inputs = {0, 1, 2},
4819 .outputs = {3},
4820 }
4821 };
4822
4823 const std::vector<uint32_t> inputIndexes = {0};
4824 const std::vector<uint32_t> outputIndexes = {3};
4825 std::vector<uint8_t> operandValues = {
4826 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
4827 };
4828 const std::vector<hidl_memory> pools = {};
4829
4830 return {
4831 .operands = operands,
4832 .operations = operations,
4833 .inputIndexes = inputIndexes,
4834 .outputIndexes = outputIndexes,
4835 .operandValues = operandValues,
4836 .pools = pools,
4837 };
4838 }
4839
is_ignored_dynamic_output_shape_quant8_7(int i)4840 inline bool is_ignored_dynamic_output_shape_quant8_7(int i) {
4841 static std::set<int> ignore = {};
4842 return ignore.find(i) != ignore.end();
4843 }
4844
4845 // Create the model
createTestModel_dynamic_output_shape_int32_7()4846 Model createTestModel_dynamic_output_shape_int32_7() {
4847 const std::vector<Operand> operands = {
4848 {
4849 .type = OperandType::TENSOR_INT32,
4850 .dimensions = {1, 2, 3},
4851 .numberOfConsumers = 1,
4852 .scale = 0.0f,
4853 .zeroPoint = 0,
4854 .lifetime = OperandLifeTime::MODEL_INPUT,
4855 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4856 },
4857 {
4858 .type = OperandType::INT32,
4859 .dimensions = {},
4860 .numberOfConsumers = 1,
4861 .scale = 0.0f,
4862 .zeroPoint = 0,
4863 .lifetime = OperandLifeTime::CONSTANT_COPY,
4864 .location = {.poolIndex = 0, .offset = 0, .length = 4},
4865 },
4866 {
4867 .type = OperandType::TENSOR_INT32,
4868 .dimensions = {2},
4869 .numberOfConsumers = 1,
4870 .scale = 0.0f,
4871 .zeroPoint = 0,
4872 .lifetime = OperandLifeTime::CONSTANT_COPY,
4873 .location = {.poolIndex = 0, .offset = 4, .length = 8},
4874 },
4875 {
4876 .type = OperandType::TENSOR_INT32,
4877 .dimensions = {0, 0, 0},
4878 .numberOfConsumers = 0,
4879 .scale = 0.0f,
4880 .zeroPoint = 0,
4881 .lifetime = OperandLifeTime::MODEL_OUTPUT,
4882 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4883 }
4884 };
4885
4886 const std::vector<Operation> operations = {
4887 {
4888 .type = OperationType::GATHER,
4889 .inputs = {0, 1, 2},
4890 .outputs = {3},
4891 }
4892 };
4893
4894 const std::vector<uint32_t> inputIndexes = {0};
4895 const std::vector<uint32_t> outputIndexes = {3};
4896 std::vector<uint8_t> operandValues = {
4897 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
4898 };
4899 const std::vector<hidl_memory> pools = {};
4900
4901 return {
4902 .operands = operands,
4903 .operations = operations,
4904 .inputIndexes = inputIndexes,
4905 .outputIndexes = outputIndexes,
4906 .operandValues = operandValues,
4907 .pools = pools,
4908 };
4909 }
4910
is_ignored_dynamic_output_shape_int32_7(int i)4911 inline bool is_ignored_dynamic_output_shape_int32_7(int i) {
4912 static std::set<int> ignore = {};
4913 return ignore.find(i) != ignore.end();
4914 }
4915
4916 // Create the model
createTestModel_dynamic_output_shape_float16_7()4917 Model createTestModel_dynamic_output_shape_float16_7() {
4918 const std::vector<Operand> operands = {
4919 {
4920 .type = OperandType::TENSOR_FLOAT16,
4921 .dimensions = {1, 2, 3},
4922 .numberOfConsumers = 1,
4923 .scale = 0.0f,
4924 .zeroPoint = 0,
4925 .lifetime = OperandLifeTime::MODEL_INPUT,
4926 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4927 },
4928 {
4929 .type = OperandType::INT32,
4930 .dimensions = {},
4931 .numberOfConsumers = 1,
4932 .scale = 0.0f,
4933 .zeroPoint = 0,
4934 .lifetime = OperandLifeTime::CONSTANT_COPY,
4935 .location = {.poolIndex = 0, .offset = 0, .length = 4},
4936 },
4937 {
4938 .type = OperandType::TENSOR_INT32,
4939 .dimensions = {2},
4940 .numberOfConsumers = 1,
4941 .scale = 0.0f,
4942 .zeroPoint = 0,
4943 .lifetime = OperandLifeTime::CONSTANT_COPY,
4944 .location = {.poolIndex = 0, .offset = 4, .length = 8},
4945 },
4946 {
4947 .type = OperandType::TENSOR_FLOAT16,
4948 .dimensions = {0, 0, 0},
4949 .numberOfConsumers = 0,
4950 .scale = 0.0f,
4951 .zeroPoint = 0,
4952 .lifetime = OperandLifeTime::MODEL_OUTPUT,
4953 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4954 }
4955 };
4956
4957 const std::vector<Operation> operations = {
4958 {
4959 .type = OperationType::GATHER,
4960 .inputs = {0, 1, 2},
4961 .outputs = {3},
4962 }
4963 };
4964
4965 const std::vector<uint32_t> inputIndexes = {0};
4966 const std::vector<uint32_t> outputIndexes = {3};
4967 std::vector<uint8_t> operandValues = {
4968 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
4969 };
4970 const std::vector<hidl_memory> pools = {};
4971
4972 return {
4973 .operands = operands,
4974 .operations = operations,
4975 .inputIndexes = inputIndexes,
4976 .outputIndexes = outputIndexes,
4977 .operandValues = operandValues,
4978 .pools = pools,
4979 };
4980 }
4981
is_ignored_dynamic_output_shape_float16_7(int i)4982 inline bool is_ignored_dynamic_output_shape_float16_7(int i) {
4983 static std::set<int> ignore = {};
4984 return ignore.find(i) != ignore.end();
4985 }
4986
4987 // Create the model
createTestModel_8()4988 Model createTestModel_8() {
4989 const std::vector<Operand> operands = {
4990 {
4991 .type = OperandType::TENSOR_FLOAT32,
4992 .dimensions = {1, 2, 3},
4993 .numberOfConsumers = 1,
4994 .scale = 0.0f,
4995 .zeroPoint = 0,
4996 .lifetime = OperandLifeTime::MODEL_INPUT,
4997 .location = {.poolIndex = 0, .offset = 0, .length = 0},
4998 },
4999 {
5000 .type = OperandType::INT32,
5001 .dimensions = {},
5002 .numberOfConsumers = 1,
5003 .scale = 0.0f,
5004 .zeroPoint = 0,
5005 .lifetime = OperandLifeTime::CONSTANT_COPY,
5006 .location = {.poolIndex = 0, .offset = 0, .length = 4},
5007 },
5008 {
5009 .type = OperandType::TENSOR_INT32,
5010 .dimensions = {2},
5011 .numberOfConsumers = 1,
5012 .scale = 0.0f,
5013 .zeroPoint = 0,
5014 .lifetime = OperandLifeTime::CONSTANT_COPY,
5015 .location = {.poolIndex = 0, .offset = 4, .length = 8},
5016 },
5017 {
5018 .type = OperandType::TENSOR_FLOAT32,
5019 .dimensions = {1, 2, 2},
5020 .numberOfConsumers = 0,
5021 .scale = 0.0f,
5022 .zeroPoint = 0,
5023 .lifetime = OperandLifeTime::MODEL_OUTPUT,
5024 .location = {.poolIndex = 0, .offset = 0, .length = 0},
5025 }
5026 };
5027
5028 const std::vector<Operation> operations = {
5029 {
5030 .type = OperationType::GATHER,
5031 .inputs = {0, 1, 2},
5032 .outputs = {3},
5033 }
5034 };
5035
5036 const std::vector<uint32_t> inputIndexes = {0};
5037 const std::vector<uint32_t> outputIndexes = {3};
5038 std::vector<uint8_t> operandValues = {
5039 255, 255, 255, 255, 2, 0, 0, 0, 0, 0, 0, 0
5040 };
5041 const std::vector<hidl_memory> pools = {};
5042
5043 return {
5044 .operands = operands,
5045 .operations = operations,
5046 .inputIndexes = inputIndexes,
5047 .outputIndexes = outputIndexes,
5048 .operandValues = operandValues,
5049 .pools = pools,
5050 };
5051 }
5052
is_ignored_8(int i)5053 inline bool is_ignored_8(int i) {
5054 static std::set<int> ignore = {};
5055 return ignore.find(i) != ignore.end();
5056 }
5057
5058 // Create the model
createTestModel_relaxed_8()5059 Model createTestModel_relaxed_8() {
5060 const std::vector<Operand> operands = {
5061 {
5062 .type = OperandType::TENSOR_FLOAT32,
5063 .dimensions = {1, 2, 3},
5064 .numberOfConsumers = 1,
5065 .scale = 0.0f,
5066 .zeroPoint = 0,
5067 .lifetime = OperandLifeTime::MODEL_INPUT,
5068 .location = {.poolIndex = 0, .offset = 0, .length = 0},
5069 },
5070 {
5071 .type = OperandType::INT32,
5072 .dimensions = {},
5073 .numberOfConsumers = 1,
5074 .scale = 0.0f,
5075 .zeroPoint = 0,
5076 .lifetime = OperandLifeTime::CONSTANT_COPY,
5077 .location = {.poolIndex = 0, .offset = 0, .length = 4},
5078 },
5079 {
5080 .type = OperandType::TENSOR_INT32,
5081 .dimensions = {2},
5082 .numberOfConsumers = 1,
5083 .scale = 0.0f,
5084 .zeroPoint = 0,
5085 .lifetime = OperandLifeTime::CONSTANT_COPY,
5086 .location = {.poolIndex = 0, .offset = 4, .length = 8},
5087 },
5088 {
5089 .type = OperandType::TENSOR_FLOAT32,
5090 .dimensions = {1, 2, 2},
5091 .numberOfConsumers = 0,
5092 .scale = 0.0f,
5093 .zeroPoint = 0,
5094 .lifetime = OperandLifeTime::MODEL_OUTPUT,
5095 .location = {.poolIndex = 0, .offset = 0, .length = 0},
5096 }
5097 };
5098
5099 const std::vector<Operation> operations = {
5100 {
5101 .type = OperationType::GATHER,
5102 .inputs = {0, 1, 2},
5103 .outputs = {3},
5104 }
5105 };
5106
5107 const std::vector<uint32_t> inputIndexes = {0};
5108 const std::vector<uint32_t> outputIndexes = {3};
5109 std::vector<uint8_t> operandValues = {
5110 255, 255, 255, 255, 2, 0, 0, 0, 0, 0, 0, 0
5111 };
5112 const std::vector<hidl_memory> pools = {};
5113
5114 return {
5115 .operands = operands,
5116 .operations = operations,
5117 .inputIndexes = inputIndexes,
5118 .outputIndexes = outputIndexes,
5119 .operandValues = operandValues,
5120 .pools = pools,
5121 .relaxComputationFloat32toFloat16 = true,
5122 };
5123 }
5124
is_ignored_relaxed_8(int i)5125 inline bool is_ignored_relaxed_8(int i) {
5126 static std::set<int> ignore = {};
5127 return ignore.find(i) != ignore.end();
5128 }
5129
5130 // Create the model
createTestModel_quant8_8()5131 Model createTestModel_quant8_8() {
5132 const std::vector<Operand> operands = {
5133 {
5134 .type = OperandType::TENSOR_QUANT8_ASYMM,
5135 .dimensions = {1, 2, 3},
5136 .numberOfConsumers = 1,
5137 .scale = 0.5f,
5138 .zeroPoint = 127,
5139 .lifetime = OperandLifeTime::MODEL_INPUT,
5140 .location = {.poolIndex = 0, .offset = 0, .length = 0},
5141 },
5142 {
5143 .type = OperandType::INT32,
5144 .dimensions = {},
5145 .numberOfConsumers = 1,
5146 .scale = 0.0f,
5147 .zeroPoint = 0,
5148 .lifetime = OperandLifeTime::CONSTANT_COPY,
5149 .location = {.poolIndex = 0, .offset = 0, .length = 4},
5150 },
5151 {
5152 .type = OperandType::TENSOR_INT32,
5153 .dimensions = {2},
5154 .numberOfConsumers = 1,
5155 .scale = 0.0f,
5156 .zeroPoint = 0,
5157 .lifetime = OperandLifeTime::CONSTANT_COPY,
5158 .location = {.poolIndex = 0, .offset = 4, .length = 8},
5159 },
5160 {
5161 .type = OperandType::TENSOR_QUANT8_ASYMM,
5162 .dimensions = {1, 2, 2},
5163 .numberOfConsumers = 0,
5164 .scale = 0.5f,
5165 .zeroPoint = 127,
5166 .lifetime = OperandLifeTime::MODEL_OUTPUT,
5167 .location = {.poolIndex = 0, .offset = 0, .length = 0},
5168 }
5169 };
5170
5171 const std::vector<Operation> operations = {
5172 {
5173 .type = OperationType::GATHER,
5174 .inputs = {0, 1, 2},
5175 .outputs = {3},
5176 }
5177 };
5178
5179 const std::vector<uint32_t> inputIndexes = {0};
5180 const std::vector<uint32_t> outputIndexes = {3};
5181 std::vector<uint8_t> operandValues = {
5182 255, 255, 255, 255, 2, 0, 0, 0, 0, 0, 0, 0
5183 };
5184 const std::vector<hidl_memory> pools = {};
5185
5186 return {
5187 .operands = operands,
5188 .operations = operations,
5189 .inputIndexes = inputIndexes,
5190 .outputIndexes = outputIndexes,
5191 .operandValues = operandValues,
5192 .pools = pools,
5193 };
5194 }
5195
is_ignored_quant8_8(int i)5196 inline bool is_ignored_quant8_8(int i) {
5197 static std::set<int> ignore = {};
5198 return ignore.find(i) != ignore.end();
5199 }
5200
5201 // Create the model
createTestModel_int32_8()5202 Model createTestModel_int32_8() {
5203 const std::vector<Operand> operands = {
5204 {
5205 .type = OperandType::TENSOR_INT32,
5206 .dimensions = {1, 2, 3},
5207 .numberOfConsumers = 1,
5208 .scale = 0.0f,
5209 .zeroPoint = 0,
5210 .lifetime = OperandLifeTime::MODEL_INPUT,
5211 .location = {.poolIndex = 0, .offset = 0, .length = 0},
5212 },
5213 {
5214 .type = OperandType::INT32,
5215 .dimensions = {},
5216 .numberOfConsumers = 1,
5217 .scale = 0.0f,
5218 .zeroPoint = 0,
5219 .lifetime = OperandLifeTime::CONSTANT_COPY,
5220 .location = {.poolIndex = 0, .offset = 0, .length = 4},
5221 },
5222 {
5223 .type = OperandType::TENSOR_INT32,
5224 .dimensions = {2},
5225 .numberOfConsumers = 1,
5226 .scale = 0.0f,
5227 .zeroPoint = 0,
5228 .lifetime = OperandLifeTime::CONSTANT_COPY,
5229 .location = {.poolIndex = 0, .offset = 4, .length = 8},
5230 },
5231 {
5232 .type = OperandType::TENSOR_INT32,
5233 .dimensions = {1, 2, 2},
5234 .numberOfConsumers = 0,
5235 .scale = 0.0f,
5236 .zeroPoint = 0,
5237 .lifetime = OperandLifeTime::MODEL_OUTPUT,
5238 .location = {.poolIndex = 0, .offset = 0, .length = 0},
5239 }
5240 };
5241
5242 const std::vector<Operation> operations = {
5243 {
5244 .type = OperationType::GATHER,
5245 .inputs = {0, 1, 2},
5246 .outputs = {3},
5247 }
5248 };
5249
5250 const std::vector<uint32_t> inputIndexes = {0};
5251 const std::vector<uint32_t> outputIndexes = {3};
5252 std::vector<uint8_t> operandValues = {
5253 255, 255, 255, 255, 2, 0, 0, 0, 0, 0, 0, 0
5254 };
5255 const std::vector<hidl_memory> pools = {};
5256
5257 return {
5258 .operands = operands,
5259 .operations = operations,
5260 .inputIndexes = inputIndexes,
5261 .outputIndexes = outputIndexes,
5262 .operandValues = operandValues,
5263 .pools = pools,
5264 };
5265 }
5266
is_ignored_int32_8(int i)5267 inline bool is_ignored_int32_8(int i) {
5268 static std::set<int> ignore = {};
5269 return ignore.find(i) != ignore.end();
5270 }
5271
5272 // Create the model
createTestModel_float16_8()5273 Model createTestModel_float16_8() {
5274 const std::vector<Operand> operands = {
5275 {
5276 .type = OperandType::TENSOR_FLOAT16,
5277 .dimensions = {1, 2, 3},
5278 .numberOfConsumers = 1,
5279 .scale = 0.0f,
5280 .zeroPoint = 0,
5281 .lifetime = OperandLifeTime::MODEL_INPUT,
5282 .location = {.poolIndex = 0, .offset = 0, .length = 0},
5283 },
5284 {
5285 .type = OperandType::INT32,
5286 .dimensions = {},
5287 .numberOfConsumers = 1,
5288 .scale = 0.0f,
5289 .zeroPoint = 0,
5290 .lifetime = OperandLifeTime::CONSTANT_COPY,
5291 .location = {.poolIndex = 0, .offset = 0, .length = 4},
5292 },
5293 {
5294 .type = OperandType::TENSOR_INT32,
5295 .dimensions = {2},
5296 .numberOfConsumers = 1,
5297 .scale = 0.0f,
5298 .zeroPoint = 0,
5299 .lifetime = OperandLifeTime::CONSTANT_COPY,
5300 .location = {.poolIndex = 0, .offset = 4, .length = 8},
5301 },
5302 {
5303 .type = OperandType::TENSOR_FLOAT16,
5304 .dimensions = {1, 2, 2},
5305 .numberOfConsumers = 0,
5306 .scale = 0.0f,
5307 .zeroPoint = 0,
5308 .lifetime = OperandLifeTime::MODEL_OUTPUT,
5309 .location = {.poolIndex = 0, .offset = 0, .length = 0},
5310 }
5311 };
5312
5313 const std::vector<Operation> operations = {
5314 {
5315 .type = OperationType::GATHER,
5316 .inputs = {0, 1, 2},
5317 .outputs = {3},
5318 }
5319 };
5320
5321 const std::vector<uint32_t> inputIndexes = {0};
5322 const std::vector<uint32_t> outputIndexes = {3};
5323 std::vector<uint8_t> operandValues = {
5324 255, 255, 255, 255, 2, 0, 0, 0, 0, 0, 0, 0
5325 };
5326 const std::vector<hidl_memory> pools = {};
5327
5328 return {
5329 .operands = operands,
5330 .operations = operations,
5331 .inputIndexes = inputIndexes,
5332 .outputIndexes = outputIndexes,
5333 .operandValues = operandValues,
5334 .pools = pools,
5335 };
5336 }
5337
is_ignored_float16_8(int i)5338 inline bool is_ignored_float16_8(int i) {
5339 static std::set<int> ignore = {};
5340 return ignore.find(i) != ignore.end();
5341 }
5342
5343 // Create the model
createTestModel_dynamic_output_shape_8()5344 Model createTestModel_dynamic_output_shape_8() {
5345 const std::vector<Operand> operands = {
5346 {
5347 .type = OperandType::TENSOR_FLOAT32,
5348 .dimensions = {1, 2, 3},
5349 .numberOfConsumers = 1,
5350 .scale = 0.0f,
5351 .zeroPoint = 0,
5352 .lifetime = OperandLifeTime::MODEL_INPUT,
5353 .location = {.poolIndex = 0, .offset = 0, .length = 0},
5354 },
5355 {
5356 .type = OperandType::INT32,
5357 .dimensions = {},
5358 .numberOfConsumers = 1,
5359 .scale = 0.0f,
5360 .zeroPoint = 0,
5361 .lifetime = OperandLifeTime::CONSTANT_COPY,
5362 .location = {.poolIndex = 0, .offset = 0, .length = 4},
5363 },
5364 {
5365 .type = OperandType::TENSOR_INT32,
5366 .dimensions = {2},
5367 .numberOfConsumers = 1,
5368 .scale = 0.0f,
5369 .zeroPoint = 0,
5370 .lifetime = OperandLifeTime::CONSTANT_COPY,
5371 .location = {.poolIndex = 0, .offset = 4, .length = 8},
5372 },
5373 {
5374 .type = OperandType::TENSOR_FLOAT32,
5375 .dimensions = {0, 0, 0},
5376 .numberOfConsumers = 0,
5377 .scale = 0.0f,
5378 .zeroPoint = 0,
5379 .lifetime = OperandLifeTime::MODEL_OUTPUT,
5380 .location = {.poolIndex = 0, .offset = 0, .length = 0},
5381 }
5382 };
5383
5384 const std::vector<Operation> operations = {
5385 {
5386 .type = OperationType::GATHER,
5387 .inputs = {0, 1, 2},
5388 .outputs = {3},
5389 }
5390 };
5391
5392 const std::vector<uint32_t> inputIndexes = {0};
5393 const std::vector<uint32_t> outputIndexes = {3};
5394 std::vector<uint8_t> operandValues = {
5395 255, 255, 255, 255, 2, 0, 0, 0, 0, 0, 0, 0
5396 };
5397 const std::vector<hidl_memory> pools = {};
5398
5399 return {
5400 .operands = operands,
5401 .operations = operations,
5402 .inputIndexes = inputIndexes,
5403 .outputIndexes = outputIndexes,
5404 .operandValues = operandValues,
5405 .pools = pools,
5406 };
5407 }
5408
is_ignored_dynamic_output_shape_8(int i)5409 inline bool is_ignored_dynamic_output_shape_8(int i) {
5410 static std::set<int> ignore = {};
5411 return ignore.find(i) != ignore.end();
5412 }
5413
5414 // Create the model
createTestModel_dynamic_output_shape_relaxed_8()5415 Model createTestModel_dynamic_output_shape_relaxed_8() {
5416 const std::vector<Operand> operands = {
5417 {
5418 .type = OperandType::TENSOR_FLOAT32,
5419 .dimensions = {1, 2, 3},
5420 .numberOfConsumers = 1,
5421 .scale = 0.0f,
5422 .zeroPoint = 0,
5423 .lifetime = OperandLifeTime::MODEL_INPUT,
5424 .location = {.poolIndex = 0, .offset = 0, .length = 0},
5425 },
5426 {
5427 .type = OperandType::INT32,
5428 .dimensions = {},
5429 .numberOfConsumers = 1,
5430 .scale = 0.0f,
5431 .zeroPoint = 0,
5432 .lifetime = OperandLifeTime::CONSTANT_COPY,
5433 .location = {.poolIndex = 0, .offset = 0, .length = 4},
5434 },
5435 {
5436 .type = OperandType::TENSOR_INT32,
5437 .dimensions = {2},
5438 .numberOfConsumers = 1,
5439 .scale = 0.0f,
5440 .zeroPoint = 0,
5441 .lifetime = OperandLifeTime::CONSTANT_COPY,
5442 .location = {.poolIndex = 0, .offset = 4, .length = 8},
5443 },
5444 {
5445 .type = OperandType::TENSOR_FLOAT32,
5446 .dimensions = {0, 0, 0},
5447 .numberOfConsumers = 0,
5448 .scale = 0.0f,
5449 .zeroPoint = 0,
5450 .lifetime = OperandLifeTime::MODEL_OUTPUT,
5451 .location = {.poolIndex = 0, .offset = 0, .length = 0},
5452 }
5453 };
5454
5455 const std::vector<Operation> operations = {
5456 {
5457 .type = OperationType::GATHER,
5458 .inputs = {0, 1, 2},
5459 .outputs = {3},
5460 }
5461 };
5462
5463 const std::vector<uint32_t> inputIndexes = {0};
5464 const std::vector<uint32_t> outputIndexes = {3};
5465 std::vector<uint8_t> operandValues = {
5466 255, 255, 255, 255, 2, 0, 0, 0, 0, 0, 0, 0
5467 };
5468 const std::vector<hidl_memory> pools = {};
5469
5470 return {
5471 .operands = operands,
5472 .operations = operations,
5473 .inputIndexes = inputIndexes,
5474 .outputIndexes = outputIndexes,
5475 .operandValues = operandValues,
5476 .pools = pools,
5477 .relaxComputationFloat32toFloat16 = true,
5478 };
5479 }
5480
is_ignored_dynamic_output_shape_relaxed_8(int i)5481 inline bool is_ignored_dynamic_output_shape_relaxed_8(int i) {
5482 static std::set<int> ignore = {};
5483 return ignore.find(i) != ignore.end();
5484 }
5485
5486 // Create the model
createTestModel_dynamic_output_shape_quant8_8()5487 Model createTestModel_dynamic_output_shape_quant8_8() {
5488 const std::vector<Operand> operands = {
5489 {
5490 .type = OperandType::TENSOR_QUANT8_ASYMM,
5491 .dimensions = {1, 2, 3},
5492 .numberOfConsumers = 1,
5493 .scale = 0.5f,
5494 .zeroPoint = 127,
5495 .lifetime = OperandLifeTime::MODEL_INPUT,
5496 .location = {.poolIndex = 0, .offset = 0, .length = 0},
5497 },
5498 {
5499 .type = OperandType::INT32,
5500 .dimensions = {},
5501 .numberOfConsumers = 1,
5502 .scale = 0.0f,
5503 .zeroPoint = 0,
5504 .lifetime = OperandLifeTime::CONSTANT_COPY,
5505 .location = {.poolIndex = 0, .offset = 0, .length = 4},
5506 },
5507 {
5508 .type = OperandType::TENSOR_INT32,
5509 .dimensions = {2},
5510 .numberOfConsumers = 1,
5511 .scale = 0.0f,
5512 .zeroPoint = 0,
5513 .lifetime = OperandLifeTime::CONSTANT_COPY,
5514 .location = {.poolIndex = 0, .offset = 4, .length = 8},
5515 },
5516 {
5517 .type = OperandType::TENSOR_QUANT8_ASYMM,
5518 .dimensions = {0, 0, 0},
5519 .numberOfConsumers = 0,
5520 .scale = 0.5f,
5521 .zeroPoint = 127,
5522 .lifetime = OperandLifeTime::MODEL_OUTPUT,
5523 .location = {.poolIndex = 0, .offset = 0, .length = 0},
5524 }
5525 };
5526
5527 const std::vector<Operation> operations = {
5528 {
5529 .type = OperationType::GATHER,
5530 .inputs = {0, 1, 2},
5531 .outputs = {3},
5532 }
5533 };
5534
5535 const std::vector<uint32_t> inputIndexes = {0};
5536 const std::vector<uint32_t> outputIndexes = {3};
5537 std::vector<uint8_t> operandValues = {
5538 255, 255, 255, 255, 2, 0, 0, 0, 0, 0, 0, 0
5539 };
5540 const std::vector<hidl_memory> pools = {};
5541
5542 return {
5543 .operands = operands,
5544 .operations = operations,
5545 .inputIndexes = inputIndexes,
5546 .outputIndexes = outputIndexes,
5547 .operandValues = operandValues,
5548 .pools = pools,
5549 };
5550 }
5551
is_ignored_dynamic_output_shape_quant8_8(int i)5552 inline bool is_ignored_dynamic_output_shape_quant8_8(int i) {
5553 static std::set<int> ignore = {};
5554 return ignore.find(i) != ignore.end();
5555 }
5556
5557 // Create the model
createTestModel_dynamic_output_shape_int32_8()5558 Model createTestModel_dynamic_output_shape_int32_8() {
5559 const std::vector<Operand> operands = {
5560 {
5561 .type = OperandType::TENSOR_INT32,
5562 .dimensions = {1, 2, 3},
5563 .numberOfConsumers = 1,
5564 .scale = 0.0f,
5565 .zeroPoint = 0,
5566 .lifetime = OperandLifeTime::MODEL_INPUT,
5567 .location = {.poolIndex = 0, .offset = 0, .length = 0},
5568 },
5569 {
5570 .type = OperandType::INT32,
5571 .dimensions = {},
5572 .numberOfConsumers = 1,
5573 .scale = 0.0f,
5574 .zeroPoint = 0,
5575 .lifetime = OperandLifeTime::CONSTANT_COPY,
5576 .location = {.poolIndex = 0, .offset = 0, .length = 4},
5577 },
5578 {
5579 .type = OperandType::TENSOR_INT32,
5580 .dimensions = {2},
5581 .numberOfConsumers = 1,
5582 .scale = 0.0f,
5583 .zeroPoint = 0,
5584 .lifetime = OperandLifeTime::CONSTANT_COPY,
5585 .location = {.poolIndex = 0, .offset = 4, .length = 8},
5586 },
5587 {
5588 .type = OperandType::TENSOR_INT32,
5589 .dimensions = {0, 0, 0},
5590 .numberOfConsumers = 0,
5591 .scale = 0.0f,
5592 .zeroPoint = 0,
5593 .lifetime = OperandLifeTime::MODEL_OUTPUT,
5594 .location = {.poolIndex = 0, .offset = 0, .length = 0},
5595 }
5596 };
5597
5598 const std::vector<Operation> operations = {
5599 {
5600 .type = OperationType::GATHER,
5601 .inputs = {0, 1, 2},
5602 .outputs = {3},
5603 }
5604 };
5605
5606 const std::vector<uint32_t> inputIndexes = {0};
5607 const std::vector<uint32_t> outputIndexes = {3};
5608 std::vector<uint8_t> operandValues = {
5609 255, 255, 255, 255, 2, 0, 0, 0, 0, 0, 0, 0
5610 };
5611 const std::vector<hidl_memory> pools = {};
5612
5613 return {
5614 .operands = operands,
5615 .operations = operations,
5616 .inputIndexes = inputIndexes,
5617 .outputIndexes = outputIndexes,
5618 .operandValues = operandValues,
5619 .pools = pools,
5620 };
5621 }
5622
is_ignored_dynamic_output_shape_int32_8(int i)5623 inline bool is_ignored_dynamic_output_shape_int32_8(int i) {
5624 static std::set<int> ignore = {};
5625 return ignore.find(i) != ignore.end();
5626 }
5627
5628 // Create the model
createTestModel_dynamic_output_shape_float16_8()5629 Model createTestModel_dynamic_output_shape_float16_8() {
5630 const std::vector<Operand> operands = {
5631 {
5632 .type = OperandType::TENSOR_FLOAT16,
5633 .dimensions = {1, 2, 3},
5634 .numberOfConsumers = 1,
5635 .scale = 0.0f,
5636 .zeroPoint = 0,
5637 .lifetime = OperandLifeTime::MODEL_INPUT,
5638 .location = {.poolIndex = 0, .offset = 0, .length = 0},
5639 },
5640 {
5641 .type = OperandType::INT32,
5642 .dimensions = {},
5643 .numberOfConsumers = 1,
5644 .scale = 0.0f,
5645 .zeroPoint = 0,
5646 .lifetime = OperandLifeTime::CONSTANT_COPY,
5647 .location = {.poolIndex = 0, .offset = 0, .length = 4},
5648 },
5649 {
5650 .type = OperandType::TENSOR_INT32,
5651 .dimensions = {2},
5652 .numberOfConsumers = 1,
5653 .scale = 0.0f,
5654 .zeroPoint = 0,
5655 .lifetime = OperandLifeTime::CONSTANT_COPY,
5656 .location = {.poolIndex = 0, .offset = 4, .length = 8},
5657 },
5658 {
5659 .type = OperandType::TENSOR_FLOAT16,
5660 .dimensions = {0, 0, 0},
5661 .numberOfConsumers = 0,
5662 .scale = 0.0f,
5663 .zeroPoint = 0,
5664 .lifetime = OperandLifeTime::MODEL_OUTPUT,
5665 .location = {.poolIndex = 0, .offset = 0, .length = 0},
5666 }
5667 };
5668
5669 const std::vector<Operation> operations = {
5670 {
5671 .type = OperationType::GATHER,
5672 .inputs = {0, 1, 2},
5673 .outputs = {3},
5674 }
5675 };
5676
5677 const std::vector<uint32_t> inputIndexes = {0};
5678 const std::vector<uint32_t> outputIndexes = {3};
5679 std::vector<uint8_t> operandValues = {
5680 255, 255, 255, 255, 2, 0, 0, 0, 0, 0, 0, 0
5681 };
5682 const std::vector<hidl_memory> pools = {};
5683
5684 return {
5685 .operands = operands,
5686 .operations = operations,
5687 .inputIndexes = inputIndexes,
5688 .outputIndexes = outputIndexes,
5689 .operandValues = operandValues,
5690 .pools = pools,
5691 };
5692 }
5693
is_ignored_dynamic_output_shape_float16_8(int i)5694 inline bool is_ignored_dynamic_output_shape_float16_8(int i) {
5695 static std::set<int> ignore = {};
5696 return ignore.find(i) != ignore.end();
5697 }
5698
5699