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