1 // clang-format off
2 // Generated file (from: topk_v2.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_FLOAT32,
26 .dimensions = {2, 2},
27 .numberOfConsumers = 0,
28 .scale = 0.0f,
29 .zeroPoint = 0,
30 .lifetime = OperandLifeTime::MODEL_OUTPUT,
31 .location = {.poolIndex = 0, .offset = 0, .length = 0},
32 },
33 {
34 .type = OperandType::TENSOR_INT32,
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::TOPK_V2,
47 .inputs = {0, 1},
48 .outputs = {2, 3},
49 }
50 };
51
52 const std::vector<uint32_t> inputIndexes = {0};
53 const std::vector<uint32_t> outputIndexes = {2, 3};
54 std::vector<uint8_t> operandValues = {
55 2, 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_FLOAT32,
97 .dimensions = {2, 2},
98 .numberOfConsumers = 0,
99 .scale = 0.0f,
100 .zeroPoint = 0,
101 .lifetime = OperandLifeTime::MODEL_OUTPUT,
102 .location = {.poolIndex = 0, .offset = 0, .length = 0},
103 },
104 {
105 .type = OperandType::TENSOR_INT32,
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::TOPK_V2,
118 .inputs = {0, 1},
119 .outputs = {2, 3},
120 }
121 };
122
123 const std::vector<uint32_t> inputIndexes = {0};
124 const std::vector<uint32_t> outputIndexes = {2, 3};
125 std::vector<uint8_t> operandValues = {
126 2, 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_float16()147 Model createTestModel_float16() {
148 const std::vector<Operand> operands = {
149 {
150 .type = OperandType::TENSOR_FLOAT16,
151 .dimensions = {2, 2},
152 .numberOfConsumers = 1,
153 .scale = 0.0f,
154 .zeroPoint = 0,
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_FLOAT16,
169 .dimensions = {2, 2},
170 .numberOfConsumers = 0,
171 .scale = 0.0f,
172 .zeroPoint = 0,
173 .lifetime = OperandLifeTime::MODEL_OUTPUT,
174 .location = {.poolIndex = 0, .offset = 0, .length = 0},
175 },
176 {
177 .type = OperandType::TENSOR_INT32,
178 .dimensions = {2, 2},
179 .numberOfConsumers = 0,
180 .scale = 0.0f,
181 .zeroPoint = 0,
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::TOPK_V2,
190 .inputs = {0, 1},
191 .outputs = {2, 3},
192 }
193 };
194
195 const std::vector<uint32_t> inputIndexes = {0};
196 const std::vector<uint32_t> outputIndexes = {2, 3};
197 std::vector<uint8_t> operandValues = {
198 2, 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_float16(int i)212 inline bool is_ignored_float16(int i) {
213 static std::set<int> ignore = {};
214 return ignore.find(i) != ignore.end();
215 }
216
217 // Create the model
createTestModel_dynamic_output_shape()218 Model createTestModel_dynamic_output_shape() {
219 const std::vector<Operand> operands = {
220 {
221 .type = OperandType::TENSOR_FLOAT32,
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_FLOAT32,
240 .dimensions = {0, 0},
241 .numberOfConsumers = 0,
242 .scale = 0.0f,
243 .zeroPoint = 0,
244 .lifetime = OperandLifeTime::MODEL_OUTPUT,
245 .location = {.poolIndex = 0, .offset = 0, .length = 0},
246 },
247 {
248 .type = OperandType::TENSOR_INT32,
249 .dimensions = {0, 0},
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::TOPK_V2,
261 .inputs = {0, 1},
262 .outputs = {2, 3},
263 }
264 };
265
266 const std::vector<uint32_t> inputIndexes = {0};
267 const std::vector<uint32_t> outputIndexes = {2, 3};
268 std::vector<uint8_t> operandValues = {
269 2, 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_dynamic_output_shape(int i)283 inline bool is_ignored_dynamic_output_shape(int i) {
284 static std::set<int> ignore = {};
285 return ignore.find(i) != ignore.end();
286 }
287
288 // Create the model
createTestModel_dynamic_output_shape_relaxed()289 Model createTestModel_dynamic_output_shape_relaxed() {
290 const std::vector<Operand> operands = {
291 {
292 .type = OperandType::TENSOR_FLOAT32,
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_FLOAT32,
311 .dimensions = {0, 0},
312 .numberOfConsumers = 0,
313 .scale = 0.0f,
314 .zeroPoint = 0,
315 .lifetime = OperandLifeTime::MODEL_OUTPUT,
316 .location = {.poolIndex = 0, .offset = 0, .length = 0},
317 },
318 {
319 .type = OperandType::TENSOR_INT32,
320 .dimensions = {0, 0},
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::TOPK_V2,
332 .inputs = {0, 1},
333 .outputs = {2, 3},
334 }
335 };
336
337 const std::vector<uint32_t> inputIndexes = {0};
338 const std::vector<uint32_t> outputIndexes = {2, 3};
339 std::vector<uint8_t> operandValues = {
340 2, 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 .relaxComputationFloat32toFloat16 = true,
352 };
353 }
354
is_ignored_dynamic_output_shape_relaxed(int i)355 inline bool is_ignored_dynamic_output_shape_relaxed(int i) {
356 static std::set<int> ignore = {};
357 return ignore.find(i) != ignore.end();
358 }
359
360 // Create the model
createTestModel_dynamic_output_shape_float16()361 Model createTestModel_dynamic_output_shape_float16() {
362 const std::vector<Operand> operands = {
363 {
364 .type = OperandType::TENSOR_FLOAT16,
365 .dimensions = {2, 2},
366 .numberOfConsumers = 1,
367 .scale = 0.0f,
368 .zeroPoint = 0,
369 .lifetime = OperandLifeTime::MODEL_INPUT,
370 .location = {.poolIndex = 0, .offset = 0, .length = 0},
371 },
372 {
373 .type = OperandType::INT32,
374 .dimensions = {},
375 .numberOfConsumers = 1,
376 .scale = 0.0f,
377 .zeroPoint = 0,
378 .lifetime = OperandLifeTime::CONSTANT_COPY,
379 .location = {.poolIndex = 0, .offset = 0, .length = 4},
380 },
381 {
382 .type = OperandType::TENSOR_FLOAT16,
383 .dimensions = {0, 0},
384 .numberOfConsumers = 0,
385 .scale = 0.0f,
386 .zeroPoint = 0,
387 .lifetime = OperandLifeTime::MODEL_OUTPUT,
388 .location = {.poolIndex = 0, .offset = 0, .length = 0},
389 },
390 {
391 .type = OperandType::TENSOR_INT32,
392 .dimensions = {0, 0},
393 .numberOfConsumers = 0,
394 .scale = 0.0f,
395 .zeroPoint = 0,
396 .lifetime = OperandLifeTime::MODEL_OUTPUT,
397 .location = {.poolIndex = 0, .offset = 0, .length = 0},
398 }
399 };
400
401 const std::vector<Operation> operations = {
402 {
403 .type = OperationType::TOPK_V2,
404 .inputs = {0, 1},
405 .outputs = {2, 3},
406 }
407 };
408
409 const std::vector<uint32_t> inputIndexes = {0};
410 const std::vector<uint32_t> outputIndexes = {2, 3};
411 std::vector<uint8_t> operandValues = {
412 2, 0, 0, 0
413 };
414 const std::vector<hidl_memory> pools = {};
415
416 return {
417 .operands = operands,
418 .operations = operations,
419 .inputIndexes = inputIndexes,
420 .outputIndexes = outputIndexes,
421 .operandValues = operandValues,
422 .pools = pools,
423 };
424 }
425
is_ignored_dynamic_output_shape_float16(int i)426 inline bool is_ignored_dynamic_output_shape_float16(int i) {
427 static std::set<int> ignore = {};
428 return ignore.find(i) != ignore.end();
429 }
430
431 // Create the model
createTestModel_2()432 Model createTestModel_2() {
433 const std::vector<Operand> operands = {
434 {
435 .type = OperandType::TENSOR_FLOAT32,
436 .dimensions = {2, 3},
437 .numberOfConsumers = 1,
438 .scale = 0.0f,
439 .zeroPoint = 0,
440 .lifetime = OperandLifeTime::MODEL_INPUT,
441 .location = {.poolIndex = 0, .offset = 0, .length = 0},
442 },
443 {
444 .type = OperandType::INT32,
445 .dimensions = {},
446 .numberOfConsumers = 1,
447 .scale = 0.0f,
448 .zeroPoint = 0,
449 .lifetime = OperandLifeTime::CONSTANT_COPY,
450 .location = {.poolIndex = 0, .offset = 0, .length = 4},
451 },
452 {
453 .type = OperandType::TENSOR_FLOAT32,
454 .dimensions = {2, 2},
455 .numberOfConsumers = 0,
456 .scale = 0.0f,
457 .zeroPoint = 0,
458 .lifetime = OperandLifeTime::MODEL_OUTPUT,
459 .location = {.poolIndex = 0, .offset = 0, .length = 0},
460 },
461 {
462 .type = OperandType::TENSOR_INT32,
463 .dimensions = {2, 2},
464 .numberOfConsumers = 0,
465 .scale = 0.0f,
466 .zeroPoint = 0,
467 .lifetime = OperandLifeTime::MODEL_OUTPUT,
468 .location = {.poolIndex = 0, .offset = 0, .length = 0},
469 }
470 };
471
472 const std::vector<Operation> operations = {
473 {
474 .type = OperationType::TOPK_V2,
475 .inputs = {0, 1},
476 .outputs = {2, 3},
477 }
478 };
479
480 const std::vector<uint32_t> inputIndexes = {0};
481 const std::vector<uint32_t> outputIndexes = {2, 3};
482 std::vector<uint8_t> operandValues = {
483 2, 0, 0, 0
484 };
485 const std::vector<hidl_memory> pools = {};
486
487 return {
488 .operands = operands,
489 .operations = operations,
490 .inputIndexes = inputIndexes,
491 .outputIndexes = outputIndexes,
492 .operandValues = operandValues,
493 .pools = pools,
494 };
495 }
496
is_ignored_2(int i)497 inline bool is_ignored_2(int i) {
498 static std::set<int> ignore = {};
499 return ignore.find(i) != ignore.end();
500 }
501
502 // Create the model
createTestModel_relaxed_2()503 Model createTestModel_relaxed_2() {
504 const std::vector<Operand> operands = {
505 {
506 .type = OperandType::TENSOR_FLOAT32,
507 .dimensions = {2, 3},
508 .numberOfConsumers = 1,
509 .scale = 0.0f,
510 .zeroPoint = 0,
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_FLOAT32,
525 .dimensions = {2, 2},
526 .numberOfConsumers = 0,
527 .scale = 0.0f,
528 .zeroPoint = 0,
529 .lifetime = OperandLifeTime::MODEL_OUTPUT,
530 .location = {.poolIndex = 0, .offset = 0, .length = 0},
531 },
532 {
533 .type = OperandType::TENSOR_INT32,
534 .dimensions = {2, 2},
535 .numberOfConsumers = 0,
536 .scale = 0.0f,
537 .zeroPoint = 0,
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::TOPK_V2,
546 .inputs = {0, 1},
547 .outputs = {2, 3},
548 }
549 };
550
551 const std::vector<uint32_t> inputIndexes = {0};
552 const std::vector<uint32_t> outputIndexes = {2, 3};
553 std::vector<uint8_t> operandValues = {
554 2, 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 .relaxComputationFloat32toFloat16 = true,
566 };
567 }
568
is_ignored_relaxed_2(int i)569 inline bool is_ignored_relaxed_2(int i) {
570 static std::set<int> ignore = {};
571 return ignore.find(i) != ignore.end();
572 }
573
574 // Create the model
createTestModel_float16_2()575 Model createTestModel_float16_2() {
576 const std::vector<Operand> operands = {
577 {
578 .type = OperandType::TENSOR_FLOAT16,
579 .dimensions = {2, 3},
580 .numberOfConsumers = 1,
581 .scale = 0.0f,
582 .zeroPoint = 0,
583 .lifetime = OperandLifeTime::MODEL_INPUT,
584 .location = {.poolIndex = 0, .offset = 0, .length = 0},
585 },
586 {
587 .type = OperandType::INT32,
588 .dimensions = {},
589 .numberOfConsumers = 1,
590 .scale = 0.0f,
591 .zeroPoint = 0,
592 .lifetime = OperandLifeTime::CONSTANT_COPY,
593 .location = {.poolIndex = 0, .offset = 0, .length = 4},
594 },
595 {
596 .type = OperandType::TENSOR_FLOAT16,
597 .dimensions = {2, 2},
598 .numberOfConsumers = 0,
599 .scale = 0.0f,
600 .zeroPoint = 0,
601 .lifetime = OperandLifeTime::MODEL_OUTPUT,
602 .location = {.poolIndex = 0, .offset = 0, .length = 0},
603 },
604 {
605 .type = OperandType::TENSOR_INT32,
606 .dimensions = {2, 2},
607 .numberOfConsumers = 0,
608 .scale = 0.0f,
609 .zeroPoint = 0,
610 .lifetime = OperandLifeTime::MODEL_OUTPUT,
611 .location = {.poolIndex = 0, .offset = 0, .length = 0},
612 }
613 };
614
615 const std::vector<Operation> operations = {
616 {
617 .type = OperationType::TOPK_V2,
618 .inputs = {0, 1},
619 .outputs = {2, 3},
620 }
621 };
622
623 const std::vector<uint32_t> inputIndexes = {0};
624 const std::vector<uint32_t> outputIndexes = {2, 3};
625 std::vector<uint8_t> operandValues = {
626 2, 0, 0, 0
627 };
628 const std::vector<hidl_memory> pools = {};
629
630 return {
631 .operands = operands,
632 .operations = operations,
633 .inputIndexes = inputIndexes,
634 .outputIndexes = outputIndexes,
635 .operandValues = operandValues,
636 .pools = pools,
637 };
638 }
639
is_ignored_float16_2(int i)640 inline bool is_ignored_float16_2(int i) {
641 static std::set<int> ignore = {};
642 return ignore.find(i) != ignore.end();
643 }
644
645 // Create the model
createTestModel_dynamic_output_shape_2()646 Model createTestModel_dynamic_output_shape_2() {
647 const std::vector<Operand> operands = {
648 {
649 .type = OperandType::TENSOR_FLOAT32,
650 .dimensions = {2, 3},
651 .numberOfConsumers = 1,
652 .scale = 0.0f,
653 .zeroPoint = 0,
654 .lifetime = OperandLifeTime::MODEL_INPUT,
655 .location = {.poolIndex = 0, .offset = 0, .length = 0},
656 },
657 {
658 .type = OperandType::INT32,
659 .dimensions = {},
660 .numberOfConsumers = 1,
661 .scale = 0.0f,
662 .zeroPoint = 0,
663 .lifetime = OperandLifeTime::CONSTANT_COPY,
664 .location = {.poolIndex = 0, .offset = 0, .length = 4},
665 },
666 {
667 .type = OperandType::TENSOR_FLOAT32,
668 .dimensions = {0, 0},
669 .numberOfConsumers = 0,
670 .scale = 0.0f,
671 .zeroPoint = 0,
672 .lifetime = OperandLifeTime::MODEL_OUTPUT,
673 .location = {.poolIndex = 0, .offset = 0, .length = 0},
674 },
675 {
676 .type = OperandType::TENSOR_INT32,
677 .dimensions = {0, 0},
678 .numberOfConsumers = 0,
679 .scale = 0.0f,
680 .zeroPoint = 0,
681 .lifetime = OperandLifeTime::MODEL_OUTPUT,
682 .location = {.poolIndex = 0, .offset = 0, .length = 0},
683 }
684 };
685
686 const std::vector<Operation> operations = {
687 {
688 .type = OperationType::TOPK_V2,
689 .inputs = {0, 1},
690 .outputs = {2, 3},
691 }
692 };
693
694 const std::vector<uint32_t> inputIndexes = {0};
695 const std::vector<uint32_t> outputIndexes = {2, 3};
696 std::vector<uint8_t> operandValues = {
697 2, 0, 0, 0
698 };
699 const std::vector<hidl_memory> pools = {};
700
701 return {
702 .operands = operands,
703 .operations = operations,
704 .inputIndexes = inputIndexes,
705 .outputIndexes = outputIndexes,
706 .operandValues = operandValues,
707 .pools = pools,
708 };
709 }
710
is_ignored_dynamic_output_shape_2(int i)711 inline bool is_ignored_dynamic_output_shape_2(int i) {
712 static std::set<int> ignore = {};
713 return ignore.find(i) != ignore.end();
714 }
715
716 // Create the model
createTestModel_dynamic_output_shape_relaxed_2()717 Model createTestModel_dynamic_output_shape_relaxed_2() {
718 const std::vector<Operand> operands = {
719 {
720 .type = OperandType::TENSOR_FLOAT32,
721 .dimensions = {2, 3},
722 .numberOfConsumers = 1,
723 .scale = 0.0f,
724 .zeroPoint = 0,
725 .lifetime = OperandLifeTime::MODEL_INPUT,
726 .location = {.poolIndex = 0, .offset = 0, .length = 0},
727 },
728 {
729 .type = OperandType::INT32,
730 .dimensions = {},
731 .numberOfConsumers = 1,
732 .scale = 0.0f,
733 .zeroPoint = 0,
734 .lifetime = OperandLifeTime::CONSTANT_COPY,
735 .location = {.poolIndex = 0, .offset = 0, .length = 4},
736 },
737 {
738 .type = OperandType::TENSOR_FLOAT32,
739 .dimensions = {0, 0},
740 .numberOfConsumers = 0,
741 .scale = 0.0f,
742 .zeroPoint = 0,
743 .lifetime = OperandLifeTime::MODEL_OUTPUT,
744 .location = {.poolIndex = 0, .offset = 0, .length = 0},
745 },
746 {
747 .type = OperandType::TENSOR_INT32,
748 .dimensions = {0, 0},
749 .numberOfConsumers = 0,
750 .scale = 0.0f,
751 .zeroPoint = 0,
752 .lifetime = OperandLifeTime::MODEL_OUTPUT,
753 .location = {.poolIndex = 0, .offset = 0, .length = 0},
754 }
755 };
756
757 const std::vector<Operation> operations = {
758 {
759 .type = OperationType::TOPK_V2,
760 .inputs = {0, 1},
761 .outputs = {2, 3},
762 }
763 };
764
765 const std::vector<uint32_t> inputIndexes = {0};
766 const std::vector<uint32_t> outputIndexes = {2, 3};
767 std::vector<uint8_t> operandValues = {
768 2, 0, 0, 0
769 };
770 const std::vector<hidl_memory> pools = {};
771
772 return {
773 .operands = operands,
774 .operations = operations,
775 .inputIndexes = inputIndexes,
776 .outputIndexes = outputIndexes,
777 .operandValues = operandValues,
778 .pools = pools,
779 .relaxComputationFloat32toFloat16 = true,
780 };
781 }
782
is_ignored_dynamic_output_shape_relaxed_2(int i)783 inline bool is_ignored_dynamic_output_shape_relaxed_2(int i) {
784 static std::set<int> ignore = {};
785 return ignore.find(i) != ignore.end();
786 }
787
788 // Create the model
createTestModel_dynamic_output_shape_float16_2()789 Model createTestModel_dynamic_output_shape_float16_2() {
790 const std::vector<Operand> operands = {
791 {
792 .type = OperandType::TENSOR_FLOAT16,
793 .dimensions = {2, 3},
794 .numberOfConsumers = 1,
795 .scale = 0.0f,
796 .zeroPoint = 0,
797 .lifetime = OperandLifeTime::MODEL_INPUT,
798 .location = {.poolIndex = 0, .offset = 0, .length = 0},
799 },
800 {
801 .type = OperandType::INT32,
802 .dimensions = {},
803 .numberOfConsumers = 1,
804 .scale = 0.0f,
805 .zeroPoint = 0,
806 .lifetime = OperandLifeTime::CONSTANT_COPY,
807 .location = {.poolIndex = 0, .offset = 0, .length = 4},
808 },
809 {
810 .type = OperandType::TENSOR_FLOAT16,
811 .dimensions = {0, 0},
812 .numberOfConsumers = 0,
813 .scale = 0.0f,
814 .zeroPoint = 0,
815 .lifetime = OperandLifeTime::MODEL_OUTPUT,
816 .location = {.poolIndex = 0, .offset = 0, .length = 0},
817 },
818 {
819 .type = OperandType::TENSOR_INT32,
820 .dimensions = {0, 0},
821 .numberOfConsumers = 0,
822 .scale = 0.0f,
823 .zeroPoint = 0,
824 .lifetime = OperandLifeTime::MODEL_OUTPUT,
825 .location = {.poolIndex = 0, .offset = 0, .length = 0},
826 }
827 };
828
829 const std::vector<Operation> operations = {
830 {
831 .type = OperationType::TOPK_V2,
832 .inputs = {0, 1},
833 .outputs = {2, 3},
834 }
835 };
836
837 const std::vector<uint32_t> inputIndexes = {0};
838 const std::vector<uint32_t> outputIndexes = {2, 3};
839 std::vector<uint8_t> operandValues = {
840 2, 0, 0, 0
841 };
842 const std::vector<hidl_memory> pools = {};
843
844 return {
845 .operands = operands,
846 .operations = operations,
847 .inputIndexes = inputIndexes,
848 .outputIndexes = outputIndexes,
849 .operandValues = operandValues,
850 .pools = pools,
851 };
852 }
853
is_ignored_dynamic_output_shape_float16_2(int i)854 inline bool is_ignored_dynamic_output_shape_float16_2(int i) {
855 static std::set<int> ignore = {};
856 return ignore.find(i) != ignore.end();
857 }
858
859 // Create the model
createTestModel_3()860 Model createTestModel_3() {
861 const std::vector<Operand> operands = {
862 {
863 .type = OperandType::TENSOR_FLOAT32,
864 .dimensions = {2, 4},
865 .numberOfConsumers = 1,
866 .scale = 0.0f,
867 .zeroPoint = 0,
868 .lifetime = OperandLifeTime::MODEL_INPUT,
869 .location = {.poolIndex = 0, .offset = 0, .length = 0},
870 },
871 {
872 .type = OperandType::INT32,
873 .dimensions = {},
874 .numberOfConsumers = 1,
875 .scale = 0.0f,
876 .zeroPoint = 0,
877 .lifetime = OperandLifeTime::CONSTANT_COPY,
878 .location = {.poolIndex = 0, .offset = 0, .length = 4},
879 },
880 {
881 .type = OperandType::TENSOR_FLOAT32,
882 .dimensions = {2, 2},
883 .numberOfConsumers = 0,
884 .scale = 0.0f,
885 .zeroPoint = 0,
886 .lifetime = OperandLifeTime::MODEL_OUTPUT,
887 .location = {.poolIndex = 0, .offset = 0, .length = 0},
888 },
889 {
890 .type = OperandType::TENSOR_INT32,
891 .dimensions = {2, 2},
892 .numberOfConsumers = 0,
893 .scale = 0.0f,
894 .zeroPoint = 0,
895 .lifetime = OperandLifeTime::MODEL_OUTPUT,
896 .location = {.poolIndex = 0, .offset = 0, .length = 0},
897 }
898 };
899
900 const std::vector<Operation> operations = {
901 {
902 .type = OperationType::TOPK_V2,
903 .inputs = {0, 1},
904 .outputs = {2, 3},
905 }
906 };
907
908 const std::vector<uint32_t> inputIndexes = {0};
909 const std::vector<uint32_t> outputIndexes = {2, 3};
910 std::vector<uint8_t> operandValues = {
911 2, 0, 0, 0
912 };
913 const std::vector<hidl_memory> pools = {};
914
915 return {
916 .operands = operands,
917 .operations = operations,
918 .inputIndexes = inputIndexes,
919 .outputIndexes = outputIndexes,
920 .operandValues = operandValues,
921 .pools = pools,
922 };
923 }
924
is_ignored_3(int i)925 inline bool is_ignored_3(int i) {
926 static std::set<int> ignore = {};
927 return ignore.find(i) != ignore.end();
928 }
929
930 // Create the model
createTestModel_relaxed_3()931 Model createTestModel_relaxed_3() {
932 const std::vector<Operand> operands = {
933 {
934 .type = OperandType::TENSOR_FLOAT32,
935 .dimensions = {2, 4},
936 .numberOfConsumers = 1,
937 .scale = 0.0f,
938 .zeroPoint = 0,
939 .lifetime = OperandLifeTime::MODEL_INPUT,
940 .location = {.poolIndex = 0, .offset = 0, .length = 0},
941 },
942 {
943 .type = OperandType::INT32,
944 .dimensions = {},
945 .numberOfConsumers = 1,
946 .scale = 0.0f,
947 .zeroPoint = 0,
948 .lifetime = OperandLifeTime::CONSTANT_COPY,
949 .location = {.poolIndex = 0, .offset = 0, .length = 4},
950 },
951 {
952 .type = OperandType::TENSOR_FLOAT32,
953 .dimensions = {2, 2},
954 .numberOfConsumers = 0,
955 .scale = 0.0f,
956 .zeroPoint = 0,
957 .lifetime = OperandLifeTime::MODEL_OUTPUT,
958 .location = {.poolIndex = 0, .offset = 0, .length = 0},
959 },
960 {
961 .type = OperandType::TENSOR_INT32,
962 .dimensions = {2, 2},
963 .numberOfConsumers = 0,
964 .scale = 0.0f,
965 .zeroPoint = 0,
966 .lifetime = OperandLifeTime::MODEL_OUTPUT,
967 .location = {.poolIndex = 0, .offset = 0, .length = 0},
968 }
969 };
970
971 const std::vector<Operation> operations = {
972 {
973 .type = OperationType::TOPK_V2,
974 .inputs = {0, 1},
975 .outputs = {2, 3},
976 }
977 };
978
979 const std::vector<uint32_t> inputIndexes = {0};
980 const std::vector<uint32_t> outputIndexes = {2, 3};
981 std::vector<uint8_t> operandValues = {
982 2, 0, 0, 0
983 };
984 const std::vector<hidl_memory> pools = {};
985
986 return {
987 .operands = operands,
988 .operations = operations,
989 .inputIndexes = inputIndexes,
990 .outputIndexes = outputIndexes,
991 .operandValues = operandValues,
992 .pools = pools,
993 .relaxComputationFloat32toFloat16 = true,
994 };
995 }
996
is_ignored_relaxed_3(int i)997 inline bool is_ignored_relaxed_3(int i) {
998 static std::set<int> ignore = {};
999 return ignore.find(i) != ignore.end();
1000 }
1001
1002 // Create the model
createTestModel_float16_3()1003 Model createTestModel_float16_3() {
1004 const std::vector<Operand> operands = {
1005 {
1006 .type = OperandType::TENSOR_FLOAT16,
1007 .dimensions = {2, 4},
1008 .numberOfConsumers = 1,
1009 .scale = 0.0f,
1010 .zeroPoint = 0,
1011 .lifetime = OperandLifeTime::MODEL_INPUT,
1012 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1013 },
1014 {
1015 .type = OperandType::INT32,
1016 .dimensions = {},
1017 .numberOfConsumers = 1,
1018 .scale = 0.0f,
1019 .zeroPoint = 0,
1020 .lifetime = OperandLifeTime::CONSTANT_COPY,
1021 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1022 },
1023 {
1024 .type = OperandType::TENSOR_FLOAT16,
1025 .dimensions = {2, 2},
1026 .numberOfConsumers = 0,
1027 .scale = 0.0f,
1028 .zeroPoint = 0,
1029 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1030 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1031 },
1032 {
1033 .type = OperandType::TENSOR_INT32,
1034 .dimensions = {2, 2},
1035 .numberOfConsumers = 0,
1036 .scale = 0.0f,
1037 .zeroPoint = 0,
1038 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1039 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1040 }
1041 };
1042
1043 const std::vector<Operation> operations = {
1044 {
1045 .type = OperationType::TOPK_V2,
1046 .inputs = {0, 1},
1047 .outputs = {2, 3},
1048 }
1049 };
1050
1051 const std::vector<uint32_t> inputIndexes = {0};
1052 const std::vector<uint32_t> outputIndexes = {2, 3};
1053 std::vector<uint8_t> operandValues = {
1054 2, 0, 0, 0
1055 };
1056 const std::vector<hidl_memory> pools = {};
1057
1058 return {
1059 .operands = operands,
1060 .operations = operations,
1061 .inputIndexes = inputIndexes,
1062 .outputIndexes = outputIndexes,
1063 .operandValues = operandValues,
1064 .pools = pools,
1065 };
1066 }
1067
is_ignored_float16_3(int i)1068 inline bool is_ignored_float16_3(int i) {
1069 static std::set<int> ignore = {};
1070 return ignore.find(i) != ignore.end();
1071 }
1072
1073 // Create the model
createTestModel_dynamic_output_shape_3()1074 Model createTestModel_dynamic_output_shape_3() {
1075 const std::vector<Operand> operands = {
1076 {
1077 .type = OperandType::TENSOR_FLOAT32,
1078 .dimensions = {2, 4},
1079 .numberOfConsumers = 1,
1080 .scale = 0.0f,
1081 .zeroPoint = 0,
1082 .lifetime = OperandLifeTime::MODEL_INPUT,
1083 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1084 },
1085 {
1086 .type = OperandType::INT32,
1087 .dimensions = {},
1088 .numberOfConsumers = 1,
1089 .scale = 0.0f,
1090 .zeroPoint = 0,
1091 .lifetime = OperandLifeTime::CONSTANT_COPY,
1092 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1093 },
1094 {
1095 .type = OperandType::TENSOR_FLOAT32,
1096 .dimensions = {0, 0},
1097 .numberOfConsumers = 0,
1098 .scale = 0.0f,
1099 .zeroPoint = 0,
1100 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1101 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1102 },
1103 {
1104 .type = OperandType::TENSOR_INT32,
1105 .dimensions = {0, 0},
1106 .numberOfConsumers = 0,
1107 .scale = 0.0f,
1108 .zeroPoint = 0,
1109 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1110 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1111 }
1112 };
1113
1114 const std::vector<Operation> operations = {
1115 {
1116 .type = OperationType::TOPK_V2,
1117 .inputs = {0, 1},
1118 .outputs = {2, 3},
1119 }
1120 };
1121
1122 const std::vector<uint32_t> inputIndexes = {0};
1123 const std::vector<uint32_t> outputIndexes = {2, 3};
1124 std::vector<uint8_t> operandValues = {
1125 2, 0, 0, 0
1126 };
1127 const std::vector<hidl_memory> pools = {};
1128
1129 return {
1130 .operands = operands,
1131 .operations = operations,
1132 .inputIndexes = inputIndexes,
1133 .outputIndexes = outputIndexes,
1134 .operandValues = operandValues,
1135 .pools = pools,
1136 };
1137 }
1138
is_ignored_dynamic_output_shape_3(int i)1139 inline bool is_ignored_dynamic_output_shape_3(int i) {
1140 static std::set<int> ignore = {};
1141 return ignore.find(i) != ignore.end();
1142 }
1143
1144 // Create the model
createTestModel_dynamic_output_shape_relaxed_3()1145 Model createTestModel_dynamic_output_shape_relaxed_3() {
1146 const std::vector<Operand> operands = {
1147 {
1148 .type = OperandType::TENSOR_FLOAT32,
1149 .dimensions = {2, 4},
1150 .numberOfConsumers = 1,
1151 .scale = 0.0f,
1152 .zeroPoint = 0,
1153 .lifetime = OperandLifeTime::MODEL_INPUT,
1154 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1155 },
1156 {
1157 .type = OperandType::INT32,
1158 .dimensions = {},
1159 .numberOfConsumers = 1,
1160 .scale = 0.0f,
1161 .zeroPoint = 0,
1162 .lifetime = OperandLifeTime::CONSTANT_COPY,
1163 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1164 },
1165 {
1166 .type = OperandType::TENSOR_FLOAT32,
1167 .dimensions = {0, 0},
1168 .numberOfConsumers = 0,
1169 .scale = 0.0f,
1170 .zeroPoint = 0,
1171 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1172 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1173 },
1174 {
1175 .type = OperandType::TENSOR_INT32,
1176 .dimensions = {0, 0},
1177 .numberOfConsumers = 0,
1178 .scale = 0.0f,
1179 .zeroPoint = 0,
1180 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1181 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1182 }
1183 };
1184
1185 const std::vector<Operation> operations = {
1186 {
1187 .type = OperationType::TOPK_V2,
1188 .inputs = {0, 1},
1189 .outputs = {2, 3},
1190 }
1191 };
1192
1193 const std::vector<uint32_t> inputIndexes = {0};
1194 const std::vector<uint32_t> outputIndexes = {2, 3};
1195 std::vector<uint8_t> operandValues = {
1196 2, 0, 0, 0
1197 };
1198 const std::vector<hidl_memory> pools = {};
1199
1200 return {
1201 .operands = operands,
1202 .operations = operations,
1203 .inputIndexes = inputIndexes,
1204 .outputIndexes = outputIndexes,
1205 .operandValues = operandValues,
1206 .pools = pools,
1207 .relaxComputationFloat32toFloat16 = true,
1208 };
1209 }
1210
is_ignored_dynamic_output_shape_relaxed_3(int i)1211 inline bool is_ignored_dynamic_output_shape_relaxed_3(int i) {
1212 static std::set<int> ignore = {};
1213 return ignore.find(i) != ignore.end();
1214 }
1215
1216 // Create the model
createTestModel_dynamic_output_shape_float16_3()1217 Model createTestModel_dynamic_output_shape_float16_3() {
1218 const std::vector<Operand> operands = {
1219 {
1220 .type = OperandType::TENSOR_FLOAT16,
1221 .dimensions = {2, 4},
1222 .numberOfConsumers = 1,
1223 .scale = 0.0f,
1224 .zeroPoint = 0,
1225 .lifetime = OperandLifeTime::MODEL_INPUT,
1226 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1227 },
1228 {
1229 .type = OperandType::INT32,
1230 .dimensions = {},
1231 .numberOfConsumers = 1,
1232 .scale = 0.0f,
1233 .zeroPoint = 0,
1234 .lifetime = OperandLifeTime::CONSTANT_COPY,
1235 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1236 },
1237 {
1238 .type = OperandType::TENSOR_FLOAT16,
1239 .dimensions = {0, 0},
1240 .numberOfConsumers = 0,
1241 .scale = 0.0f,
1242 .zeroPoint = 0,
1243 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1244 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1245 },
1246 {
1247 .type = OperandType::TENSOR_INT32,
1248 .dimensions = {0, 0},
1249 .numberOfConsumers = 0,
1250 .scale = 0.0f,
1251 .zeroPoint = 0,
1252 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1253 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1254 }
1255 };
1256
1257 const std::vector<Operation> operations = {
1258 {
1259 .type = OperationType::TOPK_V2,
1260 .inputs = {0, 1},
1261 .outputs = {2, 3},
1262 }
1263 };
1264
1265 const std::vector<uint32_t> inputIndexes = {0};
1266 const std::vector<uint32_t> outputIndexes = {2, 3};
1267 std::vector<uint8_t> operandValues = {
1268 2, 0, 0, 0
1269 };
1270 const std::vector<hidl_memory> pools = {};
1271
1272 return {
1273 .operands = operands,
1274 .operations = operations,
1275 .inputIndexes = inputIndexes,
1276 .outputIndexes = outputIndexes,
1277 .operandValues = operandValues,
1278 .pools = pools,
1279 };
1280 }
1281
is_ignored_dynamic_output_shape_float16_3(int i)1282 inline bool is_ignored_dynamic_output_shape_float16_3(int i) {
1283 static std::set<int> ignore = {};
1284 return ignore.find(i) != ignore.end();
1285 }
1286
1287 // Create the model
createTestModel_4()1288 Model createTestModel_4() {
1289 const std::vector<Operand> operands = {
1290 {
1291 .type = OperandType::TENSOR_FLOAT32,
1292 .dimensions = {8},
1293 .numberOfConsumers = 1,
1294 .scale = 0.0f,
1295 .zeroPoint = 0,
1296 .lifetime = OperandLifeTime::MODEL_INPUT,
1297 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1298 },
1299 {
1300 .type = OperandType::INT32,
1301 .dimensions = {},
1302 .numberOfConsumers = 1,
1303 .scale = 0.0f,
1304 .zeroPoint = 0,
1305 .lifetime = OperandLifeTime::CONSTANT_COPY,
1306 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1307 },
1308 {
1309 .type = OperandType::TENSOR_FLOAT32,
1310 .dimensions = {2},
1311 .numberOfConsumers = 0,
1312 .scale = 0.0f,
1313 .zeroPoint = 0,
1314 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1315 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1316 },
1317 {
1318 .type = OperandType::TENSOR_INT32,
1319 .dimensions = {2},
1320 .numberOfConsumers = 0,
1321 .scale = 0.0f,
1322 .zeroPoint = 0,
1323 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1324 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1325 }
1326 };
1327
1328 const std::vector<Operation> operations = {
1329 {
1330 .type = OperationType::TOPK_V2,
1331 .inputs = {0, 1},
1332 .outputs = {2, 3},
1333 }
1334 };
1335
1336 const std::vector<uint32_t> inputIndexes = {0};
1337 const std::vector<uint32_t> outputIndexes = {2, 3};
1338 std::vector<uint8_t> operandValues = {
1339 2, 0, 0, 0
1340 };
1341 const std::vector<hidl_memory> pools = {};
1342
1343 return {
1344 .operands = operands,
1345 .operations = operations,
1346 .inputIndexes = inputIndexes,
1347 .outputIndexes = outputIndexes,
1348 .operandValues = operandValues,
1349 .pools = pools,
1350 };
1351 }
1352
is_ignored_4(int i)1353 inline bool is_ignored_4(int i) {
1354 static std::set<int> ignore = {};
1355 return ignore.find(i) != ignore.end();
1356 }
1357
1358 // Create the model
createTestModel_relaxed_4()1359 Model createTestModel_relaxed_4() {
1360 const std::vector<Operand> operands = {
1361 {
1362 .type = OperandType::TENSOR_FLOAT32,
1363 .dimensions = {8},
1364 .numberOfConsumers = 1,
1365 .scale = 0.0f,
1366 .zeroPoint = 0,
1367 .lifetime = OperandLifeTime::MODEL_INPUT,
1368 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1369 },
1370 {
1371 .type = OperandType::INT32,
1372 .dimensions = {},
1373 .numberOfConsumers = 1,
1374 .scale = 0.0f,
1375 .zeroPoint = 0,
1376 .lifetime = OperandLifeTime::CONSTANT_COPY,
1377 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1378 },
1379 {
1380 .type = OperandType::TENSOR_FLOAT32,
1381 .dimensions = {2},
1382 .numberOfConsumers = 0,
1383 .scale = 0.0f,
1384 .zeroPoint = 0,
1385 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1386 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1387 },
1388 {
1389 .type = OperandType::TENSOR_INT32,
1390 .dimensions = {2},
1391 .numberOfConsumers = 0,
1392 .scale = 0.0f,
1393 .zeroPoint = 0,
1394 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1395 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1396 }
1397 };
1398
1399 const std::vector<Operation> operations = {
1400 {
1401 .type = OperationType::TOPK_V2,
1402 .inputs = {0, 1},
1403 .outputs = {2, 3},
1404 }
1405 };
1406
1407 const std::vector<uint32_t> inputIndexes = {0};
1408 const std::vector<uint32_t> outputIndexes = {2, 3};
1409 std::vector<uint8_t> operandValues = {
1410 2, 0, 0, 0
1411 };
1412 const std::vector<hidl_memory> pools = {};
1413
1414 return {
1415 .operands = operands,
1416 .operations = operations,
1417 .inputIndexes = inputIndexes,
1418 .outputIndexes = outputIndexes,
1419 .operandValues = operandValues,
1420 .pools = pools,
1421 .relaxComputationFloat32toFloat16 = true,
1422 };
1423 }
1424
is_ignored_relaxed_4(int i)1425 inline bool is_ignored_relaxed_4(int i) {
1426 static std::set<int> ignore = {};
1427 return ignore.find(i) != ignore.end();
1428 }
1429
1430 // Create the model
createTestModel_float16_4()1431 Model createTestModel_float16_4() {
1432 const std::vector<Operand> operands = {
1433 {
1434 .type = OperandType::TENSOR_FLOAT16,
1435 .dimensions = {8},
1436 .numberOfConsumers = 1,
1437 .scale = 0.0f,
1438 .zeroPoint = 0,
1439 .lifetime = OperandLifeTime::MODEL_INPUT,
1440 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1441 },
1442 {
1443 .type = OperandType::INT32,
1444 .dimensions = {},
1445 .numberOfConsumers = 1,
1446 .scale = 0.0f,
1447 .zeroPoint = 0,
1448 .lifetime = OperandLifeTime::CONSTANT_COPY,
1449 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1450 },
1451 {
1452 .type = OperandType::TENSOR_FLOAT16,
1453 .dimensions = {2},
1454 .numberOfConsumers = 0,
1455 .scale = 0.0f,
1456 .zeroPoint = 0,
1457 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1458 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1459 },
1460 {
1461 .type = OperandType::TENSOR_INT32,
1462 .dimensions = {2},
1463 .numberOfConsumers = 0,
1464 .scale = 0.0f,
1465 .zeroPoint = 0,
1466 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1467 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1468 }
1469 };
1470
1471 const std::vector<Operation> operations = {
1472 {
1473 .type = OperationType::TOPK_V2,
1474 .inputs = {0, 1},
1475 .outputs = {2, 3},
1476 }
1477 };
1478
1479 const std::vector<uint32_t> inputIndexes = {0};
1480 const std::vector<uint32_t> outputIndexes = {2, 3};
1481 std::vector<uint8_t> operandValues = {
1482 2, 0, 0, 0
1483 };
1484 const std::vector<hidl_memory> pools = {};
1485
1486 return {
1487 .operands = operands,
1488 .operations = operations,
1489 .inputIndexes = inputIndexes,
1490 .outputIndexes = outputIndexes,
1491 .operandValues = operandValues,
1492 .pools = pools,
1493 };
1494 }
1495
is_ignored_float16_4(int i)1496 inline bool is_ignored_float16_4(int i) {
1497 static std::set<int> ignore = {};
1498 return ignore.find(i) != ignore.end();
1499 }
1500
1501 // Create the model
createTestModel_dynamic_output_shape_4()1502 Model createTestModel_dynamic_output_shape_4() {
1503 const std::vector<Operand> operands = {
1504 {
1505 .type = OperandType::TENSOR_FLOAT32,
1506 .dimensions = {8},
1507 .numberOfConsumers = 1,
1508 .scale = 0.0f,
1509 .zeroPoint = 0,
1510 .lifetime = OperandLifeTime::MODEL_INPUT,
1511 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1512 },
1513 {
1514 .type = OperandType::INT32,
1515 .dimensions = {},
1516 .numberOfConsumers = 1,
1517 .scale = 0.0f,
1518 .zeroPoint = 0,
1519 .lifetime = OperandLifeTime::CONSTANT_COPY,
1520 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1521 },
1522 {
1523 .type = OperandType::TENSOR_FLOAT32,
1524 .dimensions = {0},
1525 .numberOfConsumers = 0,
1526 .scale = 0.0f,
1527 .zeroPoint = 0,
1528 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1529 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1530 },
1531 {
1532 .type = OperandType::TENSOR_INT32,
1533 .dimensions = {0},
1534 .numberOfConsumers = 0,
1535 .scale = 0.0f,
1536 .zeroPoint = 0,
1537 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1538 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1539 }
1540 };
1541
1542 const std::vector<Operation> operations = {
1543 {
1544 .type = OperationType::TOPK_V2,
1545 .inputs = {0, 1},
1546 .outputs = {2, 3},
1547 }
1548 };
1549
1550 const std::vector<uint32_t> inputIndexes = {0};
1551 const std::vector<uint32_t> outputIndexes = {2, 3};
1552 std::vector<uint8_t> operandValues = {
1553 2, 0, 0, 0
1554 };
1555 const std::vector<hidl_memory> pools = {};
1556
1557 return {
1558 .operands = operands,
1559 .operations = operations,
1560 .inputIndexes = inputIndexes,
1561 .outputIndexes = outputIndexes,
1562 .operandValues = operandValues,
1563 .pools = pools,
1564 };
1565 }
1566
is_ignored_dynamic_output_shape_4(int i)1567 inline bool is_ignored_dynamic_output_shape_4(int i) {
1568 static std::set<int> ignore = {};
1569 return ignore.find(i) != ignore.end();
1570 }
1571
1572 // Create the model
createTestModel_dynamic_output_shape_relaxed_4()1573 Model createTestModel_dynamic_output_shape_relaxed_4() {
1574 const std::vector<Operand> operands = {
1575 {
1576 .type = OperandType::TENSOR_FLOAT32,
1577 .dimensions = {8},
1578 .numberOfConsumers = 1,
1579 .scale = 0.0f,
1580 .zeroPoint = 0,
1581 .lifetime = OperandLifeTime::MODEL_INPUT,
1582 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1583 },
1584 {
1585 .type = OperandType::INT32,
1586 .dimensions = {},
1587 .numberOfConsumers = 1,
1588 .scale = 0.0f,
1589 .zeroPoint = 0,
1590 .lifetime = OperandLifeTime::CONSTANT_COPY,
1591 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1592 },
1593 {
1594 .type = OperandType::TENSOR_FLOAT32,
1595 .dimensions = {0},
1596 .numberOfConsumers = 0,
1597 .scale = 0.0f,
1598 .zeroPoint = 0,
1599 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1600 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1601 },
1602 {
1603 .type = OperandType::TENSOR_INT32,
1604 .dimensions = {0},
1605 .numberOfConsumers = 0,
1606 .scale = 0.0f,
1607 .zeroPoint = 0,
1608 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1609 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1610 }
1611 };
1612
1613 const std::vector<Operation> operations = {
1614 {
1615 .type = OperationType::TOPK_V2,
1616 .inputs = {0, 1},
1617 .outputs = {2, 3},
1618 }
1619 };
1620
1621 const std::vector<uint32_t> inputIndexes = {0};
1622 const std::vector<uint32_t> outputIndexes = {2, 3};
1623 std::vector<uint8_t> operandValues = {
1624 2, 0, 0, 0
1625 };
1626 const std::vector<hidl_memory> pools = {};
1627
1628 return {
1629 .operands = operands,
1630 .operations = operations,
1631 .inputIndexes = inputIndexes,
1632 .outputIndexes = outputIndexes,
1633 .operandValues = operandValues,
1634 .pools = pools,
1635 .relaxComputationFloat32toFloat16 = true,
1636 };
1637 }
1638
is_ignored_dynamic_output_shape_relaxed_4(int i)1639 inline bool is_ignored_dynamic_output_shape_relaxed_4(int i) {
1640 static std::set<int> ignore = {};
1641 return ignore.find(i) != ignore.end();
1642 }
1643
1644 // Create the model
createTestModel_dynamic_output_shape_float16_4()1645 Model createTestModel_dynamic_output_shape_float16_4() {
1646 const std::vector<Operand> operands = {
1647 {
1648 .type = OperandType::TENSOR_FLOAT16,
1649 .dimensions = {8},
1650 .numberOfConsumers = 1,
1651 .scale = 0.0f,
1652 .zeroPoint = 0,
1653 .lifetime = OperandLifeTime::MODEL_INPUT,
1654 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1655 },
1656 {
1657 .type = OperandType::INT32,
1658 .dimensions = {},
1659 .numberOfConsumers = 1,
1660 .scale = 0.0f,
1661 .zeroPoint = 0,
1662 .lifetime = OperandLifeTime::CONSTANT_COPY,
1663 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1664 },
1665 {
1666 .type = OperandType::TENSOR_FLOAT16,
1667 .dimensions = {0},
1668 .numberOfConsumers = 0,
1669 .scale = 0.0f,
1670 .zeroPoint = 0,
1671 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1672 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1673 },
1674 {
1675 .type = OperandType::TENSOR_INT32,
1676 .dimensions = {0},
1677 .numberOfConsumers = 0,
1678 .scale = 0.0f,
1679 .zeroPoint = 0,
1680 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1681 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1682 }
1683 };
1684
1685 const std::vector<Operation> operations = {
1686 {
1687 .type = OperationType::TOPK_V2,
1688 .inputs = {0, 1},
1689 .outputs = {2, 3},
1690 }
1691 };
1692
1693 const std::vector<uint32_t> inputIndexes = {0};
1694 const std::vector<uint32_t> outputIndexes = {2, 3};
1695 std::vector<uint8_t> operandValues = {
1696 2, 0, 0, 0
1697 };
1698 const std::vector<hidl_memory> pools = {};
1699
1700 return {
1701 .operands = operands,
1702 .operations = operations,
1703 .inputIndexes = inputIndexes,
1704 .outputIndexes = outputIndexes,
1705 .operandValues = operandValues,
1706 .pools = pools,
1707 };
1708 }
1709
is_ignored_dynamic_output_shape_float16_4(int i)1710 inline bool is_ignored_dynamic_output_shape_float16_4(int i) {
1711 static std::set<int> ignore = {};
1712 return ignore.find(i) != ignore.end();
1713 }
1714
1715 // Create the model
createTestModel_5()1716 Model createTestModel_5() {
1717 const std::vector<Operand> operands = {
1718 {
1719 .type = OperandType::TENSOR_QUANT8_ASYMM,
1720 .dimensions = {2, 3},
1721 .numberOfConsumers = 1,
1722 .scale = 2.0f,
1723 .zeroPoint = 128,
1724 .lifetime = OperandLifeTime::MODEL_INPUT,
1725 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1726 },
1727 {
1728 .type = OperandType::INT32,
1729 .dimensions = {},
1730 .numberOfConsumers = 1,
1731 .scale = 0.0f,
1732 .zeroPoint = 0,
1733 .lifetime = OperandLifeTime::CONSTANT_COPY,
1734 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1735 },
1736 {
1737 .type = OperandType::TENSOR_QUANT8_ASYMM,
1738 .dimensions = {2, 2},
1739 .numberOfConsumers = 0,
1740 .scale = 2.0f,
1741 .zeroPoint = 128,
1742 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1743 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1744 },
1745 {
1746 .type = OperandType::TENSOR_INT32,
1747 .dimensions = {2, 2},
1748 .numberOfConsumers = 0,
1749 .scale = 0.0f,
1750 .zeroPoint = 0,
1751 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1752 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1753 }
1754 };
1755
1756 const std::vector<Operation> operations = {
1757 {
1758 .type = OperationType::TOPK_V2,
1759 .inputs = {0, 1},
1760 .outputs = {2, 3},
1761 }
1762 };
1763
1764 const std::vector<uint32_t> inputIndexes = {0};
1765 const std::vector<uint32_t> outputIndexes = {2, 3};
1766 std::vector<uint8_t> operandValues = {
1767 2, 0, 0, 0
1768 };
1769 const std::vector<hidl_memory> pools = {};
1770
1771 return {
1772 .operands = operands,
1773 .operations = operations,
1774 .inputIndexes = inputIndexes,
1775 .outputIndexes = outputIndexes,
1776 .operandValues = operandValues,
1777 .pools = pools,
1778 };
1779 }
1780
is_ignored_5(int i)1781 inline bool is_ignored_5(int i) {
1782 static std::set<int> ignore = {};
1783 return ignore.find(i) != ignore.end();
1784 }
1785
1786 // Create the model
createTestModel_relaxed_5()1787 Model createTestModel_relaxed_5() {
1788 const std::vector<Operand> operands = {
1789 {
1790 .type = OperandType::TENSOR_QUANT8_ASYMM,
1791 .dimensions = {2, 3},
1792 .numberOfConsumers = 1,
1793 .scale = 2.0f,
1794 .zeroPoint = 128,
1795 .lifetime = OperandLifeTime::MODEL_INPUT,
1796 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1797 },
1798 {
1799 .type = OperandType::INT32,
1800 .dimensions = {},
1801 .numberOfConsumers = 1,
1802 .scale = 0.0f,
1803 .zeroPoint = 0,
1804 .lifetime = OperandLifeTime::CONSTANT_COPY,
1805 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1806 },
1807 {
1808 .type = OperandType::TENSOR_QUANT8_ASYMM,
1809 .dimensions = {2, 2},
1810 .numberOfConsumers = 0,
1811 .scale = 2.0f,
1812 .zeroPoint = 128,
1813 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1814 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1815 },
1816 {
1817 .type = OperandType::TENSOR_INT32,
1818 .dimensions = {2, 2},
1819 .numberOfConsumers = 0,
1820 .scale = 0.0f,
1821 .zeroPoint = 0,
1822 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1823 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1824 }
1825 };
1826
1827 const std::vector<Operation> operations = {
1828 {
1829 .type = OperationType::TOPK_V2,
1830 .inputs = {0, 1},
1831 .outputs = {2, 3},
1832 }
1833 };
1834
1835 const std::vector<uint32_t> inputIndexes = {0};
1836 const std::vector<uint32_t> outputIndexes = {2, 3};
1837 std::vector<uint8_t> operandValues = {
1838 2, 0, 0, 0
1839 };
1840 const std::vector<hidl_memory> pools = {};
1841
1842 return {
1843 .operands = operands,
1844 .operations = operations,
1845 .inputIndexes = inputIndexes,
1846 .outputIndexes = outputIndexes,
1847 .operandValues = operandValues,
1848 .pools = pools,
1849 .relaxComputationFloat32toFloat16 = true,
1850 };
1851 }
1852
is_ignored_relaxed_5(int i)1853 inline bool is_ignored_relaxed_5(int i) {
1854 static std::set<int> ignore = {};
1855 return ignore.find(i) != ignore.end();
1856 }
1857
1858 // Create the model
createTestModel_float16_5()1859 Model createTestModel_float16_5() {
1860 const std::vector<Operand> operands = {
1861 {
1862 .type = OperandType::TENSOR_QUANT8_ASYMM,
1863 .dimensions = {2, 3},
1864 .numberOfConsumers = 1,
1865 .scale = 2.0f,
1866 .zeroPoint = 128,
1867 .lifetime = OperandLifeTime::MODEL_INPUT,
1868 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1869 },
1870 {
1871 .type = OperandType::INT32,
1872 .dimensions = {},
1873 .numberOfConsumers = 1,
1874 .scale = 0.0f,
1875 .zeroPoint = 0,
1876 .lifetime = OperandLifeTime::CONSTANT_COPY,
1877 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1878 },
1879 {
1880 .type = OperandType::TENSOR_QUANT8_ASYMM,
1881 .dimensions = {2, 2},
1882 .numberOfConsumers = 0,
1883 .scale = 2.0f,
1884 .zeroPoint = 128,
1885 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1886 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1887 },
1888 {
1889 .type = OperandType::TENSOR_INT32,
1890 .dimensions = {2, 2},
1891 .numberOfConsumers = 0,
1892 .scale = 0.0f,
1893 .zeroPoint = 0,
1894 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1895 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1896 }
1897 };
1898
1899 const std::vector<Operation> operations = {
1900 {
1901 .type = OperationType::TOPK_V2,
1902 .inputs = {0, 1},
1903 .outputs = {2, 3},
1904 }
1905 };
1906
1907 const std::vector<uint32_t> inputIndexes = {0};
1908 const std::vector<uint32_t> outputIndexes = {2, 3};
1909 std::vector<uint8_t> operandValues = {
1910 2, 0, 0, 0
1911 };
1912 const std::vector<hidl_memory> pools = {};
1913
1914 return {
1915 .operands = operands,
1916 .operations = operations,
1917 .inputIndexes = inputIndexes,
1918 .outputIndexes = outputIndexes,
1919 .operandValues = operandValues,
1920 .pools = pools,
1921 };
1922 }
1923
is_ignored_float16_5(int i)1924 inline bool is_ignored_float16_5(int i) {
1925 static std::set<int> ignore = {};
1926 return ignore.find(i) != ignore.end();
1927 }
1928
1929 // Create the model
createTestModel_dynamic_output_shape_5()1930 Model createTestModel_dynamic_output_shape_5() {
1931 const std::vector<Operand> operands = {
1932 {
1933 .type = OperandType::TENSOR_QUANT8_ASYMM,
1934 .dimensions = {2, 3},
1935 .numberOfConsumers = 1,
1936 .scale = 2.0f,
1937 .zeroPoint = 128,
1938 .lifetime = OperandLifeTime::MODEL_INPUT,
1939 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1940 },
1941 {
1942 .type = OperandType::INT32,
1943 .dimensions = {},
1944 .numberOfConsumers = 1,
1945 .scale = 0.0f,
1946 .zeroPoint = 0,
1947 .lifetime = OperandLifeTime::CONSTANT_COPY,
1948 .location = {.poolIndex = 0, .offset = 0, .length = 4},
1949 },
1950 {
1951 .type = OperandType::TENSOR_QUANT8_ASYMM,
1952 .dimensions = {0, 0},
1953 .numberOfConsumers = 0,
1954 .scale = 2.0f,
1955 .zeroPoint = 128,
1956 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1957 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1958 },
1959 {
1960 .type = OperandType::TENSOR_INT32,
1961 .dimensions = {0, 0},
1962 .numberOfConsumers = 0,
1963 .scale = 0.0f,
1964 .zeroPoint = 0,
1965 .lifetime = OperandLifeTime::MODEL_OUTPUT,
1966 .location = {.poolIndex = 0, .offset = 0, .length = 0},
1967 }
1968 };
1969
1970 const std::vector<Operation> operations = {
1971 {
1972 .type = OperationType::TOPK_V2,
1973 .inputs = {0, 1},
1974 .outputs = {2, 3},
1975 }
1976 };
1977
1978 const std::vector<uint32_t> inputIndexes = {0};
1979 const std::vector<uint32_t> outputIndexes = {2, 3};
1980 std::vector<uint8_t> operandValues = {
1981 2, 0, 0, 0
1982 };
1983 const std::vector<hidl_memory> pools = {};
1984
1985 return {
1986 .operands = operands,
1987 .operations = operations,
1988 .inputIndexes = inputIndexes,
1989 .outputIndexes = outputIndexes,
1990 .operandValues = operandValues,
1991 .pools = pools,
1992 };
1993 }
1994
is_ignored_dynamic_output_shape_5(int i)1995 inline bool is_ignored_dynamic_output_shape_5(int i) {
1996 static std::set<int> ignore = {};
1997 return ignore.find(i) != ignore.end();
1998 }
1999
2000 // Create the model
createTestModel_dynamic_output_shape_relaxed_5()2001 Model createTestModel_dynamic_output_shape_relaxed_5() {
2002 const std::vector<Operand> operands = {
2003 {
2004 .type = OperandType::TENSOR_QUANT8_ASYMM,
2005 .dimensions = {2, 3},
2006 .numberOfConsumers = 1,
2007 .scale = 2.0f,
2008 .zeroPoint = 128,
2009 .lifetime = OperandLifeTime::MODEL_INPUT,
2010 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2011 },
2012 {
2013 .type = OperandType::INT32,
2014 .dimensions = {},
2015 .numberOfConsumers = 1,
2016 .scale = 0.0f,
2017 .zeroPoint = 0,
2018 .lifetime = OperandLifeTime::CONSTANT_COPY,
2019 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2020 },
2021 {
2022 .type = OperandType::TENSOR_QUANT8_ASYMM,
2023 .dimensions = {0, 0},
2024 .numberOfConsumers = 0,
2025 .scale = 2.0f,
2026 .zeroPoint = 128,
2027 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2028 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2029 },
2030 {
2031 .type = OperandType::TENSOR_INT32,
2032 .dimensions = {0, 0},
2033 .numberOfConsumers = 0,
2034 .scale = 0.0f,
2035 .zeroPoint = 0,
2036 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2037 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2038 }
2039 };
2040
2041 const std::vector<Operation> operations = {
2042 {
2043 .type = OperationType::TOPK_V2,
2044 .inputs = {0, 1},
2045 .outputs = {2, 3},
2046 }
2047 };
2048
2049 const std::vector<uint32_t> inputIndexes = {0};
2050 const std::vector<uint32_t> outputIndexes = {2, 3};
2051 std::vector<uint8_t> operandValues = {
2052 2, 0, 0, 0
2053 };
2054 const std::vector<hidl_memory> pools = {};
2055
2056 return {
2057 .operands = operands,
2058 .operations = operations,
2059 .inputIndexes = inputIndexes,
2060 .outputIndexes = outputIndexes,
2061 .operandValues = operandValues,
2062 .pools = pools,
2063 .relaxComputationFloat32toFloat16 = true,
2064 };
2065 }
2066
is_ignored_dynamic_output_shape_relaxed_5(int i)2067 inline bool is_ignored_dynamic_output_shape_relaxed_5(int i) {
2068 static std::set<int> ignore = {};
2069 return ignore.find(i) != ignore.end();
2070 }
2071
2072 // Create the model
createTestModel_dynamic_output_shape_float16_5()2073 Model createTestModel_dynamic_output_shape_float16_5() {
2074 const std::vector<Operand> operands = {
2075 {
2076 .type = OperandType::TENSOR_QUANT8_ASYMM,
2077 .dimensions = {2, 3},
2078 .numberOfConsumers = 1,
2079 .scale = 2.0f,
2080 .zeroPoint = 128,
2081 .lifetime = OperandLifeTime::MODEL_INPUT,
2082 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2083 },
2084 {
2085 .type = OperandType::INT32,
2086 .dimensions = {},
2087 .numberOfConsumers = 1,
2088 .scale = 0.0f,
2089 .zeroPoint = 0,
2090 .lifetime = OperandLifeTime::CONSTANT_COPY,
2091 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2092 },
2093 {
2094 .type = OperandType::TENSOR_QUANT8_ASYMM,
2095 .dimensions = {0, 0},
2096 .numberOfConsumers = 0,
2097 .scale = 2.0f,
2098 .zeroPoint = 128,
2099 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2100 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2101 },
2102 {
2103 .type = OperandType::TENSOR_INT32,
2104 .dimensions = {0, 0},
2105 .numberOfConsumers = 0,
2106 .scale = 0.0f,
2107 .zeroPoint = 0,
2108 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2109 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2110 }
2111 };
2112
2113 const std::vector<Operation> operations = {
2114 {
2115 .type = OperationType::TOPK_V2,
2116 .inputs = {0, 1},
2117 .outputs = {2, 3},
2118 }
2119 };
2120
2121 const std::vector<uint32_t> inputIndexes = {0};
2122 const std::vector<uint32_t> outputIndexes = {2, 3};
2123 std::vector<uint8_t> operandValues = {
2124 2, 0, 0, 0
2125 };
2126 const std::vector<hidl_memory> pools = {};
2127
2128 return {
2129 .operands = operands,
2130 .operations = operations,
2131 .inputIndexes = inputIndexes,
2132 .outputIndexes = outputIndexes,
2133 .operandValues = operandValues,
2134 .pools = pools,
2135 };
2136 }
2137
is_ignored_dynamic_output_shape_float16_5(int i)2138 inline bool is_ignored_dynamic_output_shape_float16_5(int i) {
2139 static std::set<int> ignore = {};
2140 return ignore.find(i) != ignore.end();
2141 }
2142
2143 // Create the model
createTestModel_6()2144 Model createTestModel_6() {
2145 const std::vector<Operand> operands = {
2146 {
2147 .type = OperandType::TENSOR_INT32,
2148 .dimensions = {2, 3},
2149 .numberOfConsumers = 1,
2150 .scale = 0.0f,
2151 .zeroPoint = 0,
2152 .lifetime = OperandLifeTime::MODEL_INPUT,
2153 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2154 },
2155 {
2156 .type = OperandType::INT32,
2157 .dimensions = {},
2158 .numberOfConsumers = 1,
2159 .scale = 0.0f,
2160 .zeroPoint = 0,
2161 .lifetime = OperandLifeTime::CONSTANT_COPY,
2162 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2163 },
2164 {
2165 .type = OperandType::TENSOR_INT32,
2166 .dimensions = {2, 2},
2167 .numberOfConsumers = 0,
2168 .scale = 0.0f,
2169 .zeroPoint = 0,
2170 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2171 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2172 },
2173 {
2174 .type = OperandType::TENSOR_INT32,
2175 .dimensions = {2, 2},
2176 .numberOfConsumers = 0,
2177 .scale = 0.0f,
2178 .zeroPoint = 0,
2179 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2180 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2181 }
2182 };
2183
2184 const std::vector<Operation> operations = {
2185 {
2186 .type = OperationType::TOPK_V2,
2187 .inputs = {0, 1},
2188 .outputs = {2, 3},
2189 }
2190 };
2191
2192 const std::vector<uint32_t> inputIndexes = {0};
2193 const std::vector<uint32_t> outputIndexes = {2, 3};
2194 std::vector<uint8_t> operandValues = {
2195 2, 0, 0, 0
2196 };
2197 const std::vector<hidl_memory> pools = {};
2198
2199 return {
2200 .operands = operands,
2201 .operations = operations,
2202 .inputIndexes = inputIndexes,
2203 .outputIndexes = outputIndexes,
2204 .operandValues = operandValues,
2205 .pools = pools,
2206 };
2207 }
2208
is_ignored_6(int i)2209 inline bool is_ignored_6(int i) {
2210 static std::set<int> ignore = {};
2211 return ignore.find(i) != ignore.end();
2212 }
2213
2214 // Create the model
createTestModel_relaxed_6()2215 Model createTestModel_relaxed_6() {
2216 const std::vector<Operand> operands = {
2217 {
2218 .type = OperandType::TENSOR_INT32,
2219 .dimensions = {2, 3},
2220 .numberOfConsumers = 1,
2221 .scale = 0.0f,
2222 .zeroPoint = 0,
2223 .lifetime = OperandLifeTime::MODEL_INPUT,
2224 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2225 },
2226 {
2227 .type = OperandType::INT32,
2228 .dimensions = {},
2229 .numberOfConsumers = 1,
2230 .scale = 0.0f,
2231 .zeroPoint = 0,
2232 .lifetime = OperandLifeTime::CONSTANT_COPY,
2233 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2234 },
2235 {
2236 .type = OperandType::TENSOR_INT32,
2237 .dimensions = {2, 2},
2238 .numberOfConsumers = 0,
2239 .scale = 0.0f,
2240 .zeroPoint = 0,
2241 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2242 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2243 },
2244 {
2245 .type = OperandType::TENSOR_INT32,
2246 .dimensions = {2, 2},
2247 .numberOfConsumers = 0,
2248 .scale = 0.0f,
2249 .zeroPoint = 0,
2250 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2251 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2252 }
2253 };
2254
2255 const std::vector<Operation> operations = {
2256 {
2257 .type = OperationType::TOPK_V2,
2258 .inputs = {0, 1},
2259 .outputs = {2, 3},
2260 }
2261 };
2262
2263 const std::vector<uint32_t> inputIndexes = {0};
2264 const std::vector<uint32_t> outputIndexes = {2, 3};
2265 std::vector<uint8_t> operandValues = {
2266 2, 0, 0, 0
2267 };
2268 const std::vector<hidl_memory> pools = {};
2269
2270 return {
2271 .operands = operands,
2272 .operations = operations,
2273 .inputIndexes = inputIndexes,
2274 .outputIndexes = outputIndexes,
2275 .operandValues = operandValues,
2276 .pools = pools,
2277 .relaxComputationFloat32toFloat16 = true,
2278 };
2279 }
2280
is_ignored_relaxed_6(int i)2281 inline bool is_ignored_relaxed_6(int i) {
2282 static std::set<int> ignore = {};
2283 return ignore.find(i) != ignore.end();
2284 }
2285
2286 // Create the model
createTestModel_float16_6()2287 Model createTestModel_float16_6() {
2288 const std::vector<Operand> operands = {
2289 {
2290 .type = OperandType::TENSOR_INT32,
2291 .dimensions = {2, 3},
2292 .numberOfConsumers = 1,
2293 .scale = 0.0f,
2294 .zeroPoint = 0,
2295 .lifetime = OperandLifeTime::MODEL_INPUT,
2296 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2297 },
2298 {
2299 .type = OperandType::INT32,
2300 .dimensions = {},
2301 .numberOfConsumers = 1,
2302 .scale = 0.0f,
2303 .zeroPoint = 0,
2304 .lifetime = OperandLifeTime::CONSTANT_COPY,
2305 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2306 },
2307 {
2308 .type = OperandType::TENSOR_INT32,
2309 .dimensions = {2, 2},
2310 .numberOfConsumers = 0,
2311 .scale = 0.0f,
2312 .zeroPoint = 0,
2313 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2314 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2315 },
2316 {
2317 .type = OperandType::TENSOR_INT32,
2318 .dimensions = {2, 2},
2319 .numberOfConsumers = 0,
2320 .scale = 0.0f,
2321 .zeroPoint = 0,
2322 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2323 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2324 }
2325 };
2326
2327 const std::vector<Operation> operations = {
2328 {
2329 .type = OperationType::TOPK_V2,
2330 .inputs = {0, 1},
2331 .outputs = {2, 3},
2332 }
2333 };
2334
2335 const std::vector<uint32_t> inputIndexes = {0};
2336 const std::vector<uint32_t> outputIndexes = {2, 3};
2337 std::vector<uint8_t> operandValues = {
2338 2, 0, 0, 0
2339 };
2340 const std::vector<hidl_memory> pools = {};
2341
2342 return {
2343 .operands = operands,
2344 .operations = operations,
2345 .inputIndexes = inputIndexes,
2346 .outputIndexes = outputIndexes,
2347 .operandValues = operandValues,
2348 .pools = pools,
2349 };
2350 }
2351
is_ignored_float16_6(int i)2352 inline bool is_ignored_float16_6(int i) {
2353 static std::set<int> ignore = {};
2354 return ignore.find(i) != ignore.end();
2355 }
2356
2357 // Create the model
createTestModel_dynamic_output_shape_6()2358 Model createTestModel_dynamic_output_shape_6() {
2359 const std::vector<Operand> operands = {
2360 {
2361 .type = OperandType::TENSOR_INT32,
2362 .dimensions = {2, 3},
2363 .numberOfConsumers = 1,
2364 .scale = 0.0f,
2365 .zeroPoint = 0,
2366 .lifetime = OperandLifeTime::MODEL_INPUT,
2367 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2368 },
2369 {
2370 .type = OperandType::INT32,
2371 .dimensions = {},
2372 .numberOfConsumers = 1,
2373 .scale = 0.0f,
2374 .zeroPoint = 0,
2375 .lifetime = OperandLifeTime::CONSTANT_COPY,
2376 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2377 },
2378 {
2379 .type = OperandType::TENSOR_INT32,
2380 .dimensions = {0, 0},
2381 .numberOfConsumers = 0,
2382 .scale = 0.0f,
2383 .zeroPoint = 0,
2384 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2385 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2386 },
2387 {
2388 .type = OperandType::TENSOR_INT32,
2389 .dimensions = {0, 0},
2390 .numberOfConsumers = 0,
2391 .scale = 0.0f,
2392 .zeroPoint = 0,
2393 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2394 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2395 }
2396 };
2397
2398 const std::vector<Operation> operations = {
2399 {
2400 .type = OperationType::TOPK_V2,
2401 .inputs = {0, 1},
2402 .outputs = {2, 3},
2403 }
2404 };
2405
2406 const std::vector<uint32_t> inputIndexes = {0};
2407 const std::vector<uint32_t> outputIndexes = {2, 3};
2408 std::vector<uint8_t> operandValues = {
2409 2, 0, 0, 0
2410 };
2411 const std::vector<hidl_memory> pools = {};
2412
2413 return {
2414 .operands = operands,
2415 .operations = operations,
2416 .inputIndexes = inputIndexes,
2417 .outputIndexes = outputIndexes,
2418 .operandValues = operandValues,
2419 .pools = pools,
2420 };
2421 }
2422
is_ignored_dynamic_output_shape_6(int i)2423 inline bool is_ignored_dynamic_output_shape_6(int i) {
2424 static std::set<int> ignore = {};
2425 return ignore.find(i) != ignore.end();
2426 }
2427
2428 // Create the model
createTestModel_dynamic_output_shape_relaxed_6()2429 Model createTestModel_dynamic_output_shape_relaxed_6() {
2430 const std::vector<Operand> operands = {
2431 {
2432 .type = OperandType::TENSOR_INT32,
2433 .dimensions = {2, 3},
2434 .numberOfConsumers = 1,
2435 .scale = 0.0f,
2436 .zeroPoint = 0,
2437 .lifetime = OperandLifeTime::MODEL_INPUT,
2438 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2439 },
2440 {
2441 .type = OperandType::INT32,
2442 .dimensions = {},
2443 .numberOfConsumers = 1,
2444 .scale = 0.0f,
2445 .zeroPoint = 0,
2446 .lifetime = OperandLifeTime::CONSTANT_COPY,
2447 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2448 },
2449 {
2450 .type = OperandType::TENSOR_INT32,
2451 .dimensions = {0, 0},
2452 .numberOfConsumers = 0,
2453 .scale = 0.0f,
2454 .zeroPoint = 0,
2455 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2456 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2457 },
2458 {
2459 .type = OperandType::TENSOR_INT32,
2460 .dimensions = {0, 0},
2461 .numberOfConsumers = 0,
2462 .scale = 0.0f,
2463 .zeroPoint = 0,
2464 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2465 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2466 }
2467 };
2468
2469 const std::vector<Operation> operations = {
2470 {
2471 .type = OperationType::TOPK_V2,
2472 .inputs = {0, 1},
2473 .outputs = {2, 3},
2474 }
2475 };
2476
2477 const std::vector<uint32_t> inputIndexes = {0};
2478 const std::vector<uint32_t> outputIndexes = {2, 3};
2479 std::vector<uint8_t> operandValues = {
2480 2, 0, 0, 0
2481 };
2482 const std::vector<hidl_memory> pools = {};
2483
2484 return {
2485 .operands = operands,
2486 .operations = operations,
2487 .inputIndexes = inputIndexes,
2488 .outputIndexes = outputIndexes,
2489 .operandValues = operandValues,
2490 .pools = pools,
2491 .relaxComputationFloat32toFloat16 = true,
2492 };
2493 }
2494
is_ignored_dynamic_output_shape_relaxed_6(int i)2495 inline bool is_ignored_dynamic_output_shape_relaxed_6(int i) {
2496 static std::set<int> ignore = {};
2497 return ignore.find(i) != ignore.end();
2498 }
2499
2500 // Create the model
createTestModel_dynamic_output_shape_float16_6()2501 Model createTestModel_dynamic_output_shape_float16_6() {
2502 const std::vector<Operand> operands = {
2503 {
2504 .type = OperandType::TENSOR_INT32,
2505 .dimensions = {2, 3},
2506 .numberOfConsumers = 1,
2507 .scale = 0.0f,
2508 .zeroPoint = 0,
2509 .lifetime = OperandLifeTime::MODEL_INPUT,
2510 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2511 },
2512 {
2513 .type = OperandType::INT32,
2514 .dimensions = {},
2515 .numberOfConsumers = 1,
2516 .scale = 0.0f,
2517 .zeroPoint = 0,
2518 .lifetime = OperandLifeTime::CONSTANT_COPY,
2519 .location = {.poolIndex = 0, .offset = 0, .length = 4},
2520 },
2521 {
2522 .type = OperandType::TENSOR_INT32,
2523 .dimensions = {0, 0},
2524 .numberOfConsumers = 0,
2525 .scale = 0.0f,
2526 .zeroPoint = 0,
2527 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2528 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2529 },
2530 {
2531 .type = OperandType::TENSOR_INT32,
2532 .dimensions = {0, 0},
2533 .numberOfConsumers = 0,
2534 .scale = 0.0f,
2535 .zeroPoint = 0,
2536 .lifetime = OperandLifeTime::MODEL_OUTPUT,
2537 .location = {.poolIndex = 0, .offset = 0, .length = 0},
2538 }
2539 };
2540
2541 const std::vector<Operation> operations = {
2542 {
2543 .type = OperationType::TOPK_V2,
2544 .inputs = {0, 1},
2545 .outputs = {2, 3},
2546 }
2547 };
2548
2549 const std::vector<uint32_t> inputIndexes = {0};
2550 const std::vector<uint32_t> outputIndexes = {2, 3};
2551 std::vector<uint8_t> operandValues = {
2552 2, 0, 0, 0
2553 };
2554 const std::vector<hidl_memory> pools = {};
2555
2556 return {
2557 .operands = operands,
2558 .operations = operations,
2559 .inputIndexes = inputIndexes,
2560 .outputIndexes = outputIndexes,
2561 .operandValues = operandValues,
2562 .pools = pools,
2563 };
2564 }
2565
is_ignored_dynamic_output_shape_float16_6(int i)2566 inline bool is_ignored_dynamic_output_shape_float16_6(int i) {
2567 static std::set<int> ignore = {};
2568 return ignore.find(i) != ignore.end();
2569 }
2570
2571