1 // clang-format off
2 // Generated file (from: reduce_sum.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 = {3, 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::TENSOR_INT32,
17             .dimensions = {1},
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::BOOL,
26             .dimensions = {},
27             .numberOfConsumers = 1,
28             .scale = 0.0f,
29             .zeroPoint = 0,
30             .lifetime = OperandLifeTime::CONSTANT_COPY,
31             .location = {.poolIndex = 0, .offset = 4, .length = 1},
32         },
33         {
34             .type = OperandType::TENSOR_FLOAT32,
35             .dimensions = {3},
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::REDUCE_SUM,
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       255, 255, 255, 255, 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 = {3, 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::TENSOR_INT32,
88             .dimensions = {1},
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::BOOL,
97             .dimensions = {},
98             .numberOfConsumers = 1,
99             .scale = 0.0f,
100             .zeroPoint = 0,
101             .lifetime = OperandLifeTime::CONSTANT_COPY,
102             .location = {.poolIndex = 0, .offset = 4, .length = 1},
103         },
104         {
105             .type = OperandType::TENSOR_FLOAT32,
106             .dimensions = {3},
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::REDUCE_SUM,
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       255, 255, 255, 255, 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 = {3, 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::TENSOR_INT32,
160             .dimensions = {1},
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::BOOL,
169             .dimensions = {},
170             .numberOfConsumers = 1,
171             .scale = 0.0f,
172             .zeroPoint = 0,
173             .lifetime = OperandLifeTime::CONSTANT_COPY,
174             .location = {.poolIndex = 0, .offset = 4, .length = 1},
175         },
176         {
177             .type = OperandType::TENSOR_FLOAT16,
178             .dimensions = {3},
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::REDUCE_SUM,
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       255, 255, 255, 255, 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 = {3, 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::TENSOR_INT32,
231             .dimensions = {1},
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::BOOL,
240             .dimensions = {},
241             .numberOfConsumers = 1,
242             .scale = 0.0f,
243             .zeroPoint = 0,
244             .lifetime = OperandLifeTime::CONSTANT_COPY,
245             .location = {.poolIndex = 0, .offset = 4, .length = 1},
246         },
247         {
248             .type = OperandType::TENSOR_FLOAT32,
249             .dimensions = {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::REDUCE_SUM,
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       255, 255, 255, 255, 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 = {3, 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::TENSOR_INT32,
302             .dimensions = {1},
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::BOOL,
311             .dimensions = {},
312             .numberOfConsumers = 1,
313             .scale = 0.0f,
314             .zeroPoint = 0,
315             .lifetime = OperandLifeTime::CONSTANT_COPY,
316             .location = {.poolIndex = 0, .offset = 4, .length = 1},
317         },
318         {
319             .type = OperandType::TENSOR_FLOAT32,
320             .dimensions = {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::REDUCE_SUM,
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       255, 255, 255, 255, 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 = {3, 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::TENSOR_INT32,
374             .dimensions = {1},
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::BOOL,
383             .dimensions = {},
384             .numberOfConsumers = 1,
385             .scale = 0.0f,
386             .zeroPoint = 0,
387             .lifetime = OperandLifeTime::CONSTANT_COPY,
388             .location = {.poolIndex = 0, .offset = 4, .length = 1},
389         },
390         {
391             .type = OperandType::TENSOR_FLOAT16,
392             .dimensions = {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::REDUCE_SUM,
404             .inputs = {0, 1, 2},
405             .outputs = {3},
406         }
407     };
408 
409     const std::vector<uint32_t> inputIndexes = {0};
410     const std::vector<uint32_t> outputIndexes = {3};
411     std::vector<uint8_t> operandValues = {
412       255, 255, 255, 255, 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 = {1},
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::TENSOR_INT32,
445             .dimensions = {1},
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::BOOL,
454             .dimensions = {},
455             .numberOfConsumers = 1,
456             .scale = 0.0f,
457             .zeroPoint = 0,
458             .lifetime = OperandLifeTime::CONSTANT_COPY,
459             .location = {.poolIndex = 0, .offset = 4, .length = 1},
460         },
461         {
462             .type = OperandType::TENSOR_FLOAT32,
463             .dimensions = {1},
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::REDUCE_SUM,
475             .inputs = {0, 1, 2},
476             .outputs = {3},
477         }
478     };
479 
480     const std::vector<uint32_t> inputIndexes = {0};
481     const std::vector<uint32_t> outputIndexes = {3};
482     std::vector<uint8_t> operandValues = {
483       0, 0, 0, 0, 1
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 = {1},
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::TENSOR_INT32,
516             .dimensions = {1},
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::BOOL,
525             .dimensions = {},
526             .numberOfConsumers = 1,
527             .scale = 0.0f,
528             .zeroPoint = 0,
529             .lifetime = OperandLifeTime::CONSTANT_COPY,
530             .location = {.poolIndex = 0, .offset = 4, .length = 1},
531         },
532         {
533             .type = OperandType::TENSOR_FLOAT32,
534             .dimensions = {1},
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::REDUCE_SUM,
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
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 = {1},
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::TENSOR_INT32,
588             .dimensions = {1},
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::BOOL,
597             .dimensions = {},
598             .numberOfConsumers = 1,
599             .scale = 0.0f,
600             .zeroPoint = 0,
601             .lifetime = OperandLifeTime::CONSTANT_COPY,
602             .location = {.poolIndex = 0, .offset = 4, .length = 1},
603         },
604         {
605             .type = OperandType::TENSOR_FLOAT16,
606             .dimensions = {1},
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::REDUCE_SUM,
618             .inputs = {0, 1, 2},
619             .outputs = {3},
620         }
621     };
622 
623     const std::vector<uint32_t> inputIndexes = {0};
624     const std::vector<uint32_t> outputIndexes = {3};
625     std::vector<uint8_t> operandValues = {
626       0, 0, 0, 0, 1
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 = {1},
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::TENSOR_INT32,
659             .dimensions = {1},
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::BOOL,
668             .dimensions = {},
669             .numberOfConsumers = 1,
670             .scale = 0.0f,
671             .zeroPoint = 0,
672             .lifetime = OperandLifeTime::CONSTANT_COPY,
673             .location = {.poolIndex = 0, .offset = 4, .length = 1},
674         },
675         {
676             .type = OperandType::TENSOR_FLOAT32,
677             .dimensions = {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::REDUCE_SUM,
689             .inputs = {0, 1, 2},
690             .outputs = {3},
691         }
692     };
693 
694     const std::vector<uint32_t> inputIndexes = {0};
695     const std::vector<uint32_t> outputIndexes = {3};
696     std::vector<uint8_t> operandValues = {
697       0, 0, 0, 0, 1
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 = {1},
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::TENSOR_INT32,
730             .dimensions = {1},
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::BOOL,
739             .dimensions = {},
740             .numberOfConsumers = 1,
741             .scale = 0.0f,
742             .zeroPoint = 0,
743             .lifetime = OperandLifeTime::CONSTANT_COPY,
744             .location = {.poolIndex = 0, .offset = 4, .length = 1},
745         },
746         {
747             .type = OperandType::TENSOR_FLOAT32,
748             .dimensions = {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::REDUCE_SUM,
760             .inputs = {0, 1, 2},
761             .outputs = {3},
762         }
763     };
764 
765     const std::vector<uint32_t> inputIndexes = {0};
766     const std::vector<uint32_t> outputIndexes = {3};
767     std::vector<uint8_t> operandValues = {
768       0, 0, 0, 0, 1
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 = {1},
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::TENSOR_INT32,
802             .dimensions = {1},
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::BOOL,
811             .dimensions = {},
812             .numberOfConsumers = 1,
813             .scale = 0.0f,
814             .zeroPoint = 0,
815             .lifetime = OperandLifeTime::CONSTANT_COPY,
816             .location = {.poolIndex = 0, .offset = 4, .length = 1},
817         },
818         {
819             .type = OperandType::TENSOR_FLOAT16,
820             .dimensions = {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::REDUCE_SUM,
832             .inputs = {0, 1, 2},
833             .outputs = {3},
834         }
835     };
836 
837     const std::vector<uint32_t> inputIndexes = {0};
838     const std::vector<uint32_t> outputIndexes = {3};
839     std::vector<uint8_t> operandValues = {
840       0, 0, 0, 0, 1
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 = {4, 3, 2},
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::TENSOR_INT32,
873             .dimensions = {4},
874             .numberOfConsumers = 1,
875             .scale = 0.0f,
876             .zeroPoint = 0,
877             .lifetime = OperandLifeTime::CONSTANT_COPY,
878             .location = {.poolIndex = 0, .offset = 0, .length = 16},
879         },
880         {
881             .type = OperandType::BOOL,
882             .dimensions = {},
883             .numberOfConsumers = 1,
884             .scale = 0.0f,
885             .zeroPoint = 0,
886             .lifetime = OperandLifeTime::CONSTANT_COPY,
887             .location = {.poolIndex = 0, .offset = 16, .length = 1},
888         },
889         {
890             .type = OperandType::TENSOR_FLOAT32,
891             .dimensions = {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::REDUCE_SUM,
903             .inputs = {0, 1, 2},
904             .outputs = {3},
905         }
906     };
907 
908     const std::vector<uint32_t> inputIndexes = {0};
909     const std::vector<uint32_t> outputIndexes = {3};
910     std::vector<uint8_t> operandValues = {
911       1, 0, 0, 0, 0, 0, 0, 0, 253, 255, 255, 255, 253, 255, 255, 255, 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 = {4, 3, 2},
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::TENSOR_INT32,
944             .dimensions = {4},
945             .numberOfConsumers = 1,
946             .scale = 0.0f,
947             .zeroPoint = 0,
948             .lifetime = OperandLifeTime::CONSTANT_COPY,
949             .location = {.poolIndex = 0, .offset = 0, .length = 16},
950         },
951         {
952             .type = OperandType::BOOL,
953             .dimensions = {},
954             .numberOfConsumers = 1,
955             .scale = 0.0f,
956             .zeroPoint = 0,
957             .lifetime = OperandLifeTime::CONSTANT_COPY,
958             .location = {.poolIndex = 0, .offset = 16, .length = 1},
959         },
960         {
961             .type = OperandType::TENSOR_FLOAT32,
962             .dimensions = {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::REDUCE_SUM,
974             .inputs = {0, 1, 2},
975             .outputs = {3},
976         }
977     };
978 
979     const std::vector<uint32_t> inputIndexes = {0};
980     const std::vector<uint32_t> outputIndexes = {3};
981     std::vector<uint8_t> operandValues = {
982       1, 0, 0, 0, 0, 0, 0, 0, 253, 255, 255, 255, 253, 255, 255, 255, 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 = {4, 3, 2},
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::TENSOR_INT32,
1016             .dimensions = {4},
1017             .numberOfConsumers = 1,
1018             .scale = 0.0f,
1019             .zeroPoint = 0,
1020             .lifetime = OperandLifeTime::CONSTANT_COPY,
1021             .location = {.poolIndex = 0, .offset = 0, .length = 16},
1022         },
1023         {
1024             .type = OperandType::BOOL,
1025             .dimensions = {},
1026             .numberOfConsumers = 1,
1027             .scale = 0.0f,
1028             .zeroPoint = 0,
1029             .lifetime = OperandLifeTime::CONSTANT_COPY,
1030             .location = {.poolIndex = 0, .offset = 16, .length = 1},
1031         },
1032         {
1033             .type = OperandType::TENSOR_FLOAT16,
1034             .dimensions = {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::REDUCE_SUM,
1046             .inputs = {0, 1, 2},
1047             .outputs = {3},
1048         }
1049     };
1050 
1051     const std::vector<uint32_t> inputIndexes = {0};
1052     const std::vector<uint32_t> outputIndexes = {3};
1053     std::vector<uint8_t> operandValues = {
1054       1, 0, 0, 0, 0, 0, 0, 0, 253, 255, 255, 255, 253, 255, 255, 255, 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 = {4, 3, 2},
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::TENSOR_INT32,
1087             .dimensions = {4},
1088             .numberOfConsumers = 1,
1089             .scale = 0.0f,
1090             .zeroPoint = 0,
1091             .lifetime = OperandLifeTime::CONSTANT_COPY,
1092             .location = {.poolIndex = 0, .offset = 0, .length = 16},
1093         },
1094         {
1095             .type = OperandType::BOOL,
1096             .dimensions = {},
1097             .numberOfConsumers = 1,
1098             .scale = 0.0f,
1099             .zeroPoint = 0,
1100             .lifetime = OperandLifeTime::CONSTANT_COPY,
1101             .location = {.poolIndex = 0, .offset = 16, .length = 1},
1102         },
1103         {
1104             .type = OperandType::TENSOR_FLOAT32,
1105             .dimensions = {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::REDUCE_SUM,
1117             .inputs = {0, 1, 2},
1118             .outputs = {3},
1119         }
1120     };
1121 
1122     const std::vector<uint32_t> inputIndexes = {0};
1123     const std::vector<uint32_t> outputIndexes = {3};
1124     std::vector<uint8_t> operandValues = {
1125       1, 0, 0, 0, 0, 0, 0, 0, 253, 255, 255, 255, 253, 255, 255, 255, 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 = {4, 3, 2},
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::TENSOR_INT32,
1158             .dimensions = {4},
1159             .numberOfConsumers = 1,
1160             .scale = 0.0f,
1161             .zeroPoint = 0,
1162             .lifetime = OperandLifeTime::CONSTANT_COPY,
1163             .location = {.poolIndex = 0, .offset = 0, .length = 16},
1164         },
1165         {
1166             .type = OperandType::BOOL,
1167             .dimensions = {},
1168             .numberOfConsumers = 1,
1169             .scale = 0.0f,
1170             .zeroPoint = 0,
1171             .lifetime = OperandLifeTime::CONSTANT_COPY,
1172             .location = {.poolIndex = 0, .offset = 16, .length = 1},
1173         },
1174         {
1175             .type = OperandType::TENSOR_FLOAT32,
1176             .dimensions = {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::REDUCE_SUM,
1188             .inputs = {0, 1, 2},
1189             .outputs = {3},
1190         }
1191     };
1192 
1193     const std::vector<uint32_t> inputIndexes = {0};
1194     const std::vector<uint32_t> outputIndexes = {3};
1195     std::vector<uint8_t> operandValues = {
1196       1, 0, 0, 0, 0, 0, 0, 0, 253, 255, 255, 255, 253, 255, 255, 255, 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 = {4, 3, 2},
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::TENSOR_INT32,
1230             .dimensions = {4},
1231             .numberOfConsumers = 1,
1232             .scale = 0.0f,
1233             .zeroPoint = 0,
1234             .lifetime = OperandLifeTime::CONSTANT_COPY,
1235             .location = {.poolIndex = 0, .offset = 0, .length = 16},
1236         },
1237         {
1238             .type = OperandType::BOOL,
1239             .dimensions = {},
1240             .numberOfConsumers = 1,
1241             .scale = 0.0f,
1242             .zeroPoint = 0,
1243             .lifetime = OperandLifeTime::CONSTANT_COPY,
1244             .location = {.poolIndex = 0, .offset = 16, .length = 1},
1245         },
1246         {
1247             .type = OperandType::TENSOR_FLOAT16,
1248             .dimensions = {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::REDUCE_SUM,
1260             .inputs = {0, 1, 2},
1261             .outputs = {3},
1262         }
1263     };
1264 
1265     const std::vector<uint32_t> inputIndexes = {0};
1266     const std::vector<uint32_t> outputIndexes = {3};
1267     std::vector<uint8_t> operandValues = {
1268       1, 0, 0, 0, 0, 0, 0, 0, 253, 255, 255, 255, 253, 255, 255, 255, 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 = {4, 3, 2},
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::TENSOR_INT32,
1301             .dimensions = {2},
1302             .numberOfConsumers = 1,
1303             .scale = 0.0f,
1304             .zeroPoint = 0,
1305             .lifetime = OperandLifeTime::CONSTANT_COPY,
1306             .location = {.poolIndex = 0, .offset = 0, .length = 8},
1307         },
1308         {
1309             .type = OperandType::BOOL,
1310             .dimensions = {},
1311             .numberOfConsumers = 1,
1312             .scale = 0.0f,
1313             .zeroPoint = 0,
1314             .lifetime = OperandLifeTime::CONSTANT_COPY,
1315             .location = {.poolIndex = 0, .offset = 8, .length = 1},
1316         },
1317         {
1318             .type = OperandType::TENSOR_FLOAT32,
1319             .dimensions = {1, 3, 1},
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::REDUCE_SUM,
1331             .inputs = {0, 1, 2},
1332             .outputs = {3},
1333         }
1334     };
1335 
1336     const std::vector<uint32_t> inputIndexes = {0};
1337     const std::vector<uint32_t> outputIndexes = {3};
1338     std::vector<uint8_t> operandValues = {
1339       0, 0, 0, 0, 2, 0, 0, 0, 1
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 = {4, 3, 2},
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::TENSOR_INT32,
1372             .dimensions = {2},
1373             .numberOfConsumers = 1,
1374             .scale = 0.0f,
1375             .zeroPoint = 0,
1376             .lifetime = OperandLifeTime::CONSTANT_COPY,
1377             .location = {.poolIndex = 0, .offset = 0, .length = 8},
1378         },
1379         {
1380             .type = OperandType::BOOL,
1381             .dimensions = {},
1382             .numberOfConsumers = 1,
1383             .scale = 0.0f,
1384             .zeroPoint = 0,
1385             .lifetime = OperandLifeTime::CONSTANT_COPY,
1386             .location = {.poolIndex = 0, .offset = 8, .length = 1},
1387         },
1388         {
1389             .type = OperandType::TENSOR_FLOAT32,
1390             .dimensions = {1, 3, 1},
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::REDUCE_SUM,
1402             .inputs = {0, 1, 2},
1403             .outputs = {3},
1404         }
1405     };
1406 
1407     const std::vector<uint32_t> inputIndexes = {0};
1408     const std::vector<uint32_t> outputIndexes = {3};
1409     std::vector<uint8_t> operandValues = {
1410       0, 0, 0, 0, 2, 0, 0, 0, 1
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 = {4, 3, 2},
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::TENSOR_INT32,
1444             .dimensions = {2},
1445             .numberOfConsumers = 1,
1446             .scale = 0.0f,
1447             .zeroPoint = 0,
1448             .lifetime = OperandLifeTime::CONSTANT_COPY,
1449             .location = {.poolIndex = 0, .offset = 0, .length = 8},
1450         },
1451         {
1452             .type = OperandType::BOOL,
1453             .dimensions = {},
1454             .numberOfConsumers = 1,
1455             .scale = 0.0f,
1456             .zeroPoint = 0,
1457             .lifetime = OperandLifeTime::CONSTANT_COPY,
1458             .location = {.poolIndex = 0, .offset = 8, .length = 1},
1459         },
1460         {
1461             .type = OperandType::TENSOR_FLOAT16,
1462             .dimensions = {1, 3, 1},
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::REDUCE_SUM,
1474             .inputs = {0, 1, 2},
1475             .outputs = {3},
1476         }
1477     };
1478 
1479     const std::vector<uint32_t> inputIndexes = {0};
1480     const std::vector<uint32_t> outputIndexes = {3};
1481     std::vector<uint8_t> operandValues = {
1482       0, 0, 0, 0, 2, 0, 0, 0, 1
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 = {4, 3, 2},
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::TENSOR_INT32,
1515             .dimensions = {2},
1516             .numberOfConsumers = 1,
1517             .scale = 0.0f,
1518             .zeroPoint = 0,
1519             .lifetime = OperandLifeTime::CONSTANT_COPY,
1520             .location = {.poolIndex = 0, .offset = 0, .length = 8},
1521         },
1522         {
1523             .type = OperandType::BOOL,
1524             .dimensions = {},
1525             .numberOfConsumers = 1,
1526             .scale = 0.0f,
1527             .zeroPoint = 0,
1528             .lifetime = OperandLifeTime::CONSTANT_COPY,
1529             .location = {.poolIndex = 0, .offset = 8, .length = 1},
1530         },
1531         {
1532             .type = OperandType::TENSOR_FLOAT32,
1533             .dimensions = {0, 0, 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::REDUCE_SUM,
1545             .inputs = {0, 1, 2},
1546             .outputs = {3},
1547         }
1548     };
1549 
1550     const std::vector<uint32_t> inputIndexes = {0};
1551     const std::vector<uint32_t> outputIndexes = {3};
1552     std::vector<uint8_t> operandValues = {
1553       0, 0, 0, 0, 2, 0, 0, 0, 1
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 = {4, 3, 2},
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::TENSOR_INT32,
1586             .dimensions = {2},
1587             .numberOfConsumers = 1,
1588             .scale = 0.0f,
1589             .zeroPoint = 0,
1590             .lifetime = OperandLifeTime::CONSTANT_COPY,
1591             .location = {.poolIndex = 0, .offset = 0, .length = 8},
1592         },
1593         {
1594             .type = OperandType::BOOL,
1595             .dimensions = {},
1596             .numberOfConsumers = 1,
1597             .scale = 0.0f,
1598             .zeroPoint = 0,
1599             .lifetime = OperandLifeTime::CONSTANT_COPY,
1600             .location = {.poolIndex = 0, .offset = 8, .length = 1},
1601         },
1602         {
1603             .type = OperandType::TENSOR_FLOAT32,
1604             .dimensions = {0, 0, 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::REDUCE_SUM,
1616             .inputs = {0, 1, 2},
1617             .outputs = {3},
1618         }
1619     };
1620 
1621     const std::vector<uint32_t> inputIndexes = {0};
1622     const std::vector<uint32_t> outputIndexes = {3};
1623     std::vector<uint8_t> operandValues = {
1624       0, 0, 0, 0, 2, 0, 0, 0, 1
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 = {4, 3, 2},
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::TENSOR_INT32,
1658             .dimensions = {2},
1659             .numberOfConsumers = 1,
1660             .scale = 0.0f,
1661             .zeroPoint = 0,
1662             .lifetime = OperandLifeTime::CONSTANT_COPY,
1663             .location = {.poolIndex = 0, .offset = 0, .length = 8},
1664         },
1665         {
1666             .type = OperandType::BOOL,
1667             .dimensions = {},
1668             .numberOfConsumers = 1,
1669             .scale = 0.0f,
1670             .zeroPoint = 0,
1671             .lifetime = OperandLifeTime::CONSTANT_COPY,
1672             .location = {.poolIndex = 0, .offset = 8, .length = 1},
1673         },
1674         {
1675             .type = OperandType::TENSOR_FLOAT16,
1676             .dimensions = {0, 0, 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::REDUCE_SUM,
1688             .inputs = {0, 1, 2},
1689             .outputs = {3},
1690         }
1691     };
1692 
1693     const std::vector<uint32_t> inputIndexes = {0};
1694     const std::vector<uint32_t> outputIndexes = {3};
1695     std::vector<uint8_t> operandValues = {
1696       0, 0, 0, 0, 2, 0, 0, 0, 1
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