1 // Generated from rank.mod.py
2 // DO NOT EDIT
3 // clang-format off
4 #include "TestHarness.h"
5 using namespace test_helper;
6
7 namespace generated_tests::rank {
8
get_test_model_1d()9 const TestModel& get_test_model_1d() {
10 static TestModel model = {
11 .expectFailure = false,
12 .expectedMultinomialDistributionTolerance = 0,
13 .isRelaxed = false,
14 .main = {
15 .inputIndexes = {0},
16 .operands = {{ // input0
17 .channelQuant = {},
18 .data = TestBuffer::createFromVector<float>({5.0f, 7.0f, 10.0f}),
19 .dimensions = {3},
20 .isIgnored = false,
21 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
22 .numberOfConsumers = 1,
23 .scale = 0.0f,
24 .type = TestOperandType::TENSOR_FLOAT32,
25 .zeroPoint = 0
26 }, { // output0
27 .channelQuant = {},
28 .data = TestBuffer::createFromVector<int32_t>({1}),
29 .dimensions = {},
30 .isIgnored = false,
31 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
32 .numberOfConsumers = 0,
33 .scale = 0.0f,
34 .type = TestOperandType::INT32,
35 .zeroPoint = 0
36 }},
37 .operations = {{
38 .inputs = {0},
39 .outputs = {1},
40 .type = TestOperationType::RANK
41 }},
42 .outputIndexes = {1}
43 },
44 .minSupportedVersion = TestHalVersion::V1_3,
45 .referenced = {}
46 };
47 return model;
48 }
49
50 const auto dummy_test_model_1d = TestModelManager::get().add("rank_1d", get_test_model_1d());
51
52 } // namespace generated_tests::rank
53
54 namespace generated_tests::rank {
55
get_test_model_1d_all_inputs_as_internal()56 const TestModel& get_test_model_1d_all_inputs_as_internal() {
57 static TestModel model = {
58 .expectFailure = false,
59 .expectedMultinomialDistributionTolerance = 0,
60 .isRelaxed = false,
61 .main = {
62 .inputIndexes = {2},
63 .operands = {{ // input0
64 .channelQuant = {},
65 .data = TestBuffer::createFromVector<float>({}),
66 .dimensions = {3},
67 .isIgnored = false,
68 .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
69 .numberOfConsumers = 1,
70 .scale = 0.0f,
71 .type = TestOperandType::TENSOR_FLOAT32,
72 .zeroPoint = 0
73 }, { // output0
74 .channelQuant = {},
75 .data = TestBuffer::createFromVector<int32_t>({1}),
76 .dimensions = {},
77 .isIgnored = false,
78 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
79 .numberOfConsumers = 0,
80 .scale = 0.0f,
81 .type = TestOperandType::INT32,
82 .zeroPoint = 0
83 }, { // input0_new
84 .channelQuant = {},
85 .data = TestBuffer::createFromVector<float>({5.0f, 7.0f, 10.0f}),
86 .dimensions = {3},
87 .isIgnored = false,
88 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
89 .numberOfConsumers = 1,
90 .scale = 0.0f,
91 .type = TestOperandType::TENSOR_FLOAT32,
92 .zeroPoint = 0
93 }, { // placeholder
94 .channelQuant = {},
95 .data = TestBuffer::createFromVector<float>({0.0f}),
96 .dimensions = {1},
97 .isIgnored = false,
98 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
99 .numberOfConsumers = 1,
100 .scale = 0.0f,
101 .type = TestOperandType::TENSOR_FLOAT32,
102 .zeroPoint = 0
103 }, { // param
104 .channelQuant = {},
105 .data = TestBuffer::createFromVector<int32_t>({0}),
106 .dimensions = {},
107 .isIgnored = false,
108 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
109 .numberOfConsumers = 1,
110 .scale = 0.0f,
111 .type = TestOperandType::INT32,
112 .zeroPoint = 0
113 }},
114 .operations = {{
115 .inputs = {2, 3, 4},
116 .outputs = {0},
117 .type = TestOperationType::ADD
118 }, {
119 .inputs = {0},
120 .outputs = {1},
121 .type = TestOperationType::RANK
122 }},
123 .outputIndexes = {1}
124 },
125 .minSupportedVersion = TestHalVersion::V1_3,
126 .referenced = {}
127 };
128 return model;
129 }
130
131 const auto dummy_test_model_1d_all_inputs_as_internal = TestModelManager::get().add("rank_1d_all_inputs_as_internal", get_test_model_1d_all_inputs_as_internal());
132
133 } // namespace generated_tests::rank
134
135 namespace generated_tests::rank {
136
get_test_model_1d_int32()137 const TestModel& get_test_model_1d_int32() {
138 static TestModel model = {
139 .expectFailure = false,
140 .expectedMultinomialDistributionTolerance = 0,
141 .isRelaxed = false,
142 .main = {
143 .inputIndexes = {0},
144 .operands = {{ // input0
145 .channelQuant = {},
146 .data = TestBuffer::createFromVector<int32_t>({5, 7, 10}),
147 .dimensions = {3},
148 .isIgnored = false,
149 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
150 .numberOfConsumers = 1,
151 .scale = 0.0f,
152 .type = TestOperandType::TENSOR_INT32,
153 .zeroPoint = 0
154 }, { // output0
155 .channelQuant = {},
156 .data = TestBuffer::createFromVector<int32_t>({1}),
157 .dimensions = {},
158 .isIgnored = false,
159 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
160 .numberOfConsumers = 0,
161 .scale = 0.0f,
162 .type = TestOperandType::INT32,
163 .zeroPoint = 0
164 }},
165 .operations = {{
166 .inputs = {0},
167 .outputs = {1},
168 .type = TestOperationType::RANK
169 }},
170 .outputIndexes = {1}
171 },
172 .minSupportedVersion = TestHalVersion::V1_3,
173 .referenced = {}
174 };
175 return model;
176 }
177
178 const auto dummy_test_model_1d_int32 = TestModelManager::get().add("rank_1d_int32", get_test_model_1d_int32());
179
180 } // namespace generated_tests::rank
181
182 namespace generated_tests::rank {
183
get_test_model_1d_float16()184 const TestModel& get_test_model_1d_float16() {
185 static TestModel model = {
186 .expectFailure = false,
187 .expectedMultinomialDistributionTolerance = 0,
188 .isRelaxed = false,
189 .main = {
190 .inputIndexes = {0},
191 .operands = {{ // input0
192 .channelQuant = {},
193 .data = TestBuffer::createFromVector<_Float16>({5.0f, 7.0f, 10.0f}),
194 .dimensions = {3},
195 .isIgnored = false,
196 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
197 .numberOfConsumers = 1,
198 .scale = 0.0f,
199 .type = TestOperandType::TENSOR_FLOAT16,
200 .zeroPoint = 0
201 }, { // output0
202 .channelQuant = {},
203 .data = TestBuffer::createFromVector<int32_t>({1}),
204 .dimensions = {},
205 .isIgnored = false,
206 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
207 .numberOfConsumers = 0,
208 .scale = 0.0f,
209 .type = TestOperandType::INT32,
210 .zeroPoint = 0
211 }},
212 .operations = {{
213 .inputs = {0},
214 .outputs = {1},
215 .type = TestOperationType::RANK
216 }},
217 .outputIndexes = {1}
218 },
219 .minSupportedVersion = TestHalVersion::V1_3,
220 .referenced = {}
221 };
222 return model;
223 }
224
225 const auto dummy_test_model_1d_float16 = TestModelManager::get().add("rank_1d_float16", get_test_model_1d_float16());
226
227 } // namespace generated_tests::rank
228
229 namespace generated_tests::rank {
230
get_test_model_1d_float16_all_inputs_as_internal()231 const TestModel& get_test_model_1d_float16_all_inputs_as_internal() {
232 static TestModel model = {
233 .expectFailure = false,
234 .expectedMultinomialDistributionTolerance = 0,
235 .isRelaxed = false,
236 .main = {
237 .inputIndexes = {2},
238 .operands = {{ // input0
239 .channelQuant = {},
240 .data = TestBuffer::createFromVector<_Float16>({}),
241 .dimensions = {3},
242 .isIgnored = false,
243 .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
244 .numberOfConsumers = 1,
245 .scale = 0.0f,
246 .type = TestOperandType::TENSOR_FLOAT16,
247 .zeroPoint = 0
248 }, { // output0
249 .channelQuant = {},
250 .data = TestBuffer::createFromVector<int32_t>({1}),
251 .dimensions = {},
252 .isIgnored = false,
253 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
254 .numberOfConsumers = 0,
255 .scale = 0.0f,
256 .type = TestOperandType::INT32,
257 .zeroPoint = 0
258 }, { // input0_new
259 .channelQuant = {},
260 .data = TestBuffer::createFromVector<_Float16>({5.0f, 7.0f, 10.0f}),
261 .dimensions = {3},
262 .isIgnored = false,
263 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
264 .numberOfConsumers = 1,
265 .scale = 0.0f,
266 .type = TestOperandType::TENSOR_FLOAT16,
267 .zeroPoint = 0
268 }, { // placeholder1
269 .channelQuant = {},
270 .data = TestBuffer::createFromVector<_Float16>({0.0f}),
271 .dimensions = {1},
272 .isIgnored = false,
273 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
274 .numberOfConsumers = 1,
275 .scale = 0.0f,
276 .type = TestOperandType::TENSOR_FLOAT16,
277 .zeroPoint = 0
278 }, { // param1
279 .channelQuant = {},
280 .data = TestBuffer::createFromVector<int32_t>({0}),
281 .dimensions = {},
282 .isIgnored = false,
283 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
284 .numberOfConsumers = 1,
285 .scale = 0.0f,
286 .type = TestOperandType::INT32,
287 .zeroPoint = 0
288 }},
289 .operations = {{
290 .inputs = {2, 3, 4},
291 .outputs = {0},
292 .type = TestOperationType::ADD
293 }, {
294 .inputs = {0},
295 .outputs = {1},
296 .type = TestOperationType::RANK
297 }},
298 .outputIndexes = {1}
299 },
300 .minSupportedVersion = TestHalVersion::V1_3,
301 .referenced = {}
302 };
303 return model;
304 }
305
306 const auto dummy_test_model_1d_float16_all_inputs_as_internal = TestModelManager::get().add("rank_1d_float16_all_inputs_as_internal", get_test_model_1d_float16_all_inputs_as_internal());
307
308 } // namespace generated_tests::rank
309
310 namespace generated_tests::rank {
311
get_test_model_1d_quant8()312 const TestModel& get_test_model_1d_quant8() {
313 static TestModel model = {
314 .expectFailure = false,
315 .expectedMultinomialDistributionTolerance = 0,
316 .isRelaxed = false,
317 .main = {
318 .inputIndexes = {0},
319 .operands = {{ // input0
320 .channelQuant = {},
321 .data = TestBuffer::createFromVector<uint8_t>({178, 198, 228}),
322 .dimensions = {3},
323 .isIgnored = false,
324 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
325 .numberOfConsumers = 1,
326 .scale = 0.1f,
327 .type = TestOperandType::TENSOR_QUANT8_ASYMM,
328 .zeroPoint = 128
329 }, { // output0
330 .channelQuant = {},
331 .data = TestBuffer::createFromVector<int32_t>({1}),
332 .dimensions = {},
333 .isIgnored = false,
334 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
335 .numberOfConsumers = 0,
336 .scale = 0.0f,
337 .type = TestOperandType::INT32,
338 .zeroPoint = 0
339 }},
340 .operations = {{
341 .inputs = {0},
342 .outputs = {1},
343 .type = TestOperationType::RANK
344 }},
345 .outputIndexes = {1}
346 },
347 .minSupportedVersion = TestHalVersion::V1_3,
348 .referenced = {}
349 };
350 return model;
351 }
352
353 const auto dummy_test_model_1d_quant8 = TestModelManager::get().add("rank_1d_quant8", get_test_model_1d_quant8());
354
355 } // namespace generated_tests::rank
356
357 namespace generated_tests::rank {
358
get_test_model_1d_quant8_all_inputs_as_internal()359 const TestModel& get_test_model_1d_quant8_all_inputs_as_internal() {
360 static TestModel model = {
361 .expectFailure = false,
362 .expectedMultinomialDistributionTolerance = 0,
363 .isRelaxed = false,
364 .main = {
365 .inputIndexes = {2},
366 .operands = {{ // input0
367 .channelQuant = {},
368 .data = TestBuffer::createFromVector<uint8_t>({}),
369 .dimensions = {3},
370 .isIgnored = false,
371 .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
372 .numberOfConsumers = 1,
373 .scale = 0.1f,
374 .type = TestOperandType::TENSOR_QUANT8_ASYMM,
375 .zeroPoint = 128
376 }, { // output0
377 .channelQuant = {},
378 .data = TestBuffer::createFromVector<int32_t>({1}),
379 .dimensions = {},
380 .isIgnored = false,
381 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
382 .numberOfConsumers = 0,
383 .scale = 0.0f,
384 .type = TestOperandType::INT32,
385 .zeroPoint = 0
386 }, { // input0_new
387 .channelQuant = {},
388 .data = TestBuffer::createFromVector<uint8_t>({178, 198, 228}),
389 .dimensions = {3},
390 .isIgnored = false,
391 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
392 .numberOfConsumers = 1,
393 .scale = 0.1f,
394 .type = TestOperandType::TENSOR_QUANT8_ASYMM,
395 .zeroPoint = 128
396 }, { // placeholder2
397 .channelQuant = {},
398 .data = TestBuffer::createFromVector<uint8_t>({128}),
399 .dimensions = {1},
400 .isIgnored = false,
401 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
402 .numberOfConsumers = 1,
403 .scale = 0.1f,
404 .type = TestOperandType::TENSOR_QUANT8_ASYMM,
405 .zeroPoint = 128
406 }, { // param2
407 .channelQuant = {},
408 .data = TestBuffer::createFromVector<int32_t>({0}),
409 .dimensions = {},
410 .isIgnored = false,
411 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
412 .numberOfConsumers = 1,
413 .scale = 0.0f,
414 .type = TestOperandType::INT32,
415 .zeroPoint = 0
416 }},
417 .operations = {{
418 .inputs = {2, 3, 4},
419 .outputs = {0},
420 .type = TestOperationType::ADD
421 }, {
422 .inputs = {0},
423 .outputs = {1},
424 .type = TestOperationType::RANK
425 }},
426 .outputIndexes = {1}
427 },
428 .minSupportedVersion = TestHalVersion::V1_3,
429 .referenced = {}
430 };
431 return model;
432 }
433
434 const auto dummy_test_model_1d_quant8_all_inputs_as_internal = TestModelManager::get().add("rank_1d_quant8_all_inputs_as_internal", get_test_model_1d_quant8_all_inputs_as_internal());
435
436 } // namespace generated_tests::rank
437
438 namespace generated_tests::rank {
439
get_test_model_1d_quant8_signed()440 const TestModel& get_test_model_1d_quant8_signed() {
441 static TestModel model = {
442 .expectFailure = false,
443 .expectedMultinomialDistributionTolerance = 0,
444 .isRelaxed = false,
445 .main = {
446 .inputIndexes = {0},
447 .operands = {{ // input0
448 .channelQuant = {},
449 .data = TestBuffer::createFromVector<int8_t>({50, 70, 100}),
450 .dimensions = {3},
451 .isIgnored = false,
452 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
453 .numberOfConsumers = 1,
454 .scale = 0.1f,
455 .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED,
456 .zeroPoint = 0
457 }, { // output0
458 .channelQuant = {},
459 .data = TestBuffer::createFromVector<int32_t>({1}),
460 .dimensions = {},
461 .isIgnored = false,
462 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
463 .numberOfConsumers = 0,
464 .scale = 0.0f,
465 .type = TestOperandType::INT32,
466 .zeroPoint = 0
467 }},
468 .operations = {{
469 .inputs = {0},
470 .outputs = {1},
471 .type = TestOperationType::RANK
472 }},
473 .outputIndexes = {1}
474 },
475 .minSupportedVersion = TestHalVersion::V1_3,
476 .referenced = {}
477 };
478 return model;
479 }
480
481 const auto dummy_test_model_1d_quant8_signed = TestModelManager::get().add("rank_1d_quant8_signed", get_test_model_1d_quant8_signed());
482
483 } // namespace generated_tests::rank
484
485 namespace generated_tests::rank {
486
get_test_model_1d_quant8_signed_all_inputs_as_internal()487 const TestModel& get_test_model_1d_quant8_signed_all_inputs_as_internal() {
488 static TestModel model = {
489 .expectFailure = false,
490 .expectedMultinomialDistributionTolerance = 0,
491 .isRelaxed = false,
492 .main = {
493 .inputIndexes = {2},
494 .operands = {{ // input0
495 .channelQuant = {},
496 .data = TestBuffer::createFromVector<int8_t>({}),
497 .dimensions = {3},
498 .isIgnored = false,
499 .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
500 .numberOfConsumers = 1,
501 .scale = 0.1f,
502 .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED,
503 .zeroPoint = 0
504 }, { // output0
505 .channelQuant = {},
506 .data = TestBuffer::createFromVector<int32_t>({1}),
507 .dimensions = {},
508 .isIgnored = false,
509 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
510 .numberOfConsumers = 0,
511 .scale = 0.0f,
512 .type = TestOperandType::INT32,
513 .zeroPoint = 0
514 }, { // input0_new
515 .channelQuant = {},
516 .data = TestBuffer::createFromVector<int8_t>({50, 70, 100}),
517 .dimensions = {3},
518 .isIgnored = false,
519 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
520 .numberOfConsumers = 1,
521 .scale = 0.1f,
522 .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED,
523 .zeroPoint = 0
524 }, { // placeholder3
525 .channelQuant = {},
526 .data = TestBuffer::createFromVector<int8_t>({0}),
527 .dimensions = {1},
528 .isIgnored = false,
529 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
530 .numberOfConsumers = 1,
531 .scale = 0.1f,
532 .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED,
533 .zeroPoint = 0
534 }, { // param3
535 .channelQuant = {},
536 .data = TestBuffer::createFromVector<int32_t>({0}),
537 .dimensions = {},
538 .isIgnored = false,
539 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
540 .numberOfConsumers = 1,
541 .scale = 0.0f,
542 .type = TestOperandType::INT32,
543 .zeroPoint = 0
544 }},
545 .operations = {{
546 .inputs = {2, 3, 4},
547 .outputs = {0},
548 .type = TestOperationType::ADD
549 }, {
550 .inputs = {0},
551 .outputs = {1},
552 .type = TestOperationType::RANK
553 }},
554 .outputIndexes = {1}
555 },
556 .minSupportedVersion = TestHalVersion::V1_3,
557 .referenced = {}
558 };
559 return model;
560 }
561
562 const auto dummy_test_model_1d_quant8_signed_all_inputs_as_internal = TestModelManager::get().add("rank_1d_quant8_signed_all_inputs_as_internal", get_test_model_1d_quant8_signed_all_inputs_as_internal());
563
564 } // namespace generated_tests::rank
565
566 namespace generated_tests::rank {
567
get_test_model_1d_2()568 const TestModel& get_test_model_1d_2() {
569 static TestModel model = {
570 .expectFailure = false,
571 .expectedMultinomialDistributionTolerance = 0,
572 .isRelaxed = false,
573 .main = {
574 .inputIndexes = {0},
575 .operands = {{ // input01
576 .channelQuant = {},
577 .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
578 .dimensions = {2, 3},
579 .isIgnored = false,
580 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
581 .numberOfConsumers = 1,
582 .scale = 0.0f,
583 .type = TestOperandType::TENSOR_FLOAT32,
584 .zeroPoint = 0
585 }, { // output01
586 .channelQuant = {},
587 .data = TestBuffer::createFromVector<int32_t>({2}),
588 .dimensions = {},
589 .isIgnored = false,
590 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
591 .numberOfConsumers = 0,
592 .scale = 0.0f,
593 .type = TestOperandType::INT32,
594 .zeroPoint = 0
595 }},
596 .operations = {{
597 .inputs = {0},
598 .outputs = {1},
599 .type = TestOperationType::RANK
600 }},
601 .outputIndexes = {1}
602 },
603 .minSupportedVersion = TestHalVersion::V1_3,
604 .referenced = {}
605 };
606 return model;
607 }
608
609 const auto dummy_test_model_1d_2 = TestModelManager::get().add("rank_1d_2", get_test_model_1d_2());
610
611 } // namespace generated_tests::rank
612
613 namespace generated_tests::rank {
614
get_test_model_1d_all_inputs_as_internal_2()615 const TestModel& get_test_model_1d_all_inputs_as_internal_2() {
616 static TestModel model = {
617 .expectFailure = false,
618 .expectedMultinomialDistributionTolerance = 0,
619 .isRelaxed = false,
620 .main = {
621 .inputIndexes = {2},
622 .operands = {{ // input01
623 .channelQuant = {},
624 .data = TestBuffer::createFromVector<float>({}),
625 .dimensions = {2, 3},
626 .isIgnored = false,
627 .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
628 .numberOfConsumers = 1,
629 .scale = 0.0f,
630 .type = TestOperandType::TENSOR_FLOAT32,
631 .zeroPoint = 0
632 }, { // output01
633 .channelQuant = {},
634 .data = TestBuffer::createFromVector<int32_t>({2}),
635 .dimensions = {},
636 .isIgnored = false,
637 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
638 .numberOfConsumers = 0,
639 .scale = 0.0f,
640 .type = TestOperandType::INT32,
641 .zeroPoint = 0
642 }, { // input01_new
643 .channelQuant = {},
644 .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
645 .dimensions = {2, 3},
646 .isIgnored = false,
647 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
648 .numberOfConsumers = 1,
649 .scale = 0.0f,
650 .type = TestOperandType::TENSOR_FLOAT32,
651 .zeroPoint = 0
652 }, { // placeholder4
653 .channelQuant = {},
654 .data = TestBuffer::createFromVector<float>({0.0f}),
655 .dimensions = {1},
656 .isIgnored = false,
657 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
658 .numberOfConsumers = 1,
659 .scale = 0.0f,
660 .type = TestOperandType::TENSOR_FLOAT32,
661 .zeroPoint = 0
662 }, { // param4
663 .channelQuant = {},
664 .data = TestBuffer::createFromVector<int32_t>({0}),
665 .dimensions = {},
666 .isIgnored = false,
667 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
668 .numberOfConsumers = 1,
669 .scale = 0.0f,
670 .type = TestOperandType::INT32,
671 .zeroPoint = 0
672 }},
673 .operations = {{
674 .inputs = {2, 3, 4},
675 .outputs = {0},
676 .type = TestOperationType::ADD
677 }, {
678 .inputs = {0},
679 .outputs = {1},
680 .type = TestOperationType::RANK
681 }},
682 .outputIndexes = {1}
683 },
684 .minSupportedVersion = TestHalVersion::V1_3,
685 .referenced = {}
686 };
687 return model;
688 }
689
690 const auto dummy_test_model_1d_all_inputs_as_internal_2 = TestModelManager::get().add("rank_1d_all_inputs_as_internal_2", get_test_model_1d_all_inputs_as_internal_2());
691
692 } // namespace generated_tests::rank
693
694 namespace generated_tests::rank {
695
get_test_model_1d_int32_2()696 const TestModel& get_test_model_1d_int32_2() {
697 static TestModel model = {
698 .expectFailure = false,
699 .expectedMultinomialDistributionTolerance = 0,
700 .isRelaxed = false,
701 .main = {
702 .inputIndexes = {0},
703 .operands = {{ // input01
704 .channelQuant = {},
705 .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6}),
706 .dimensions = {2, 3},
707 .isIgnored = false,
708 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
709 .numberOfConsumers = 1,
710 .scale = 0.0f,
711 .type = TestOperandType::TENSOR_INT32,
712 .zeroPoint = 0
713 }, { // output01
714 .channelQuant = {},
715 .data = TestBuffer::createFromVector<int32_t>({2}),
716 .dimensions = {},
717 .isIgnored = false,
718 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
719 .numberOfConsumers = 0,
720 .scale = 0.0f,
721 .type = TestOperandType::INT32,
722 .zeroPoint = 0
723 }},
724 .operations = {{
725 .inputs = {0},
726 .outputs = {1},
727 .type = TestOperationType::RANK
728 }},
729 .outputIndexes = {1}
730 },
731 .minSupportedVersion = TestHalVersion::V1_3,
732 .referenced = {}
733 };
734 return model;
735 }
736
737 const auto dummy_test_model_1d_int32_2 = TestModelManager::get().add("rank_1d_int32_2", get_test_model_1d_int32_2());
738
739 } // namespace generated_tests::rank
740
741 namespace generated_tests::rank {
742
get_test_model_1d_float16_2()743 const TestModel& get_test_model_1d_float16_2() {
744 static TestModel model = {
745 .expectFailure = false,
746 .expectedMultinomialDistributionTolerance = 0,
747 .isRelaxed = false,
748 .main = {
749 .inputIndexes = {0},
750 .operands = {{ // input01
751 .channelQuant = {},
752 .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
753 .dimensions = {2, 3},
754 .isIgnored = false,
755 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
756 .numberOfConsumers = 1,
757 .scale = 0.0f,
758 .type = TestOperandType::TENSOR_FLOAT16,
759 .zeroPoint = 0
760 }, { // output01
761 .channelQuant = {},
762 .data = TestBuffer::createFromVector<int32_t>({2}),
763 .dimensions = {},
764 .isIgnored = false,
765 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
766 .numberOfConsumers = 0,
767 .scale = 0.0f,
768 .type = TestOperandType::INT32,
769 .zeroPoint = 0
770 }},
771 .operations = {{
772 .inputs = {0},
773 .outputs = {1},
774 .type = TestOperationType::RANK
775 }},
776 .outputIndexes = {1}
777 },
778 .minSupportedVersion = TestHalVersion::V1_3,
779 .referenced = {}
780 };
781 return model;
782 }
783
784 const auto dummy_test_model_1d_float16_2 = TestModelManager::get().add("rank_1d_float16_2", get_test_model_1d_float16_2());
785
786 } // namespace generated_tests::rank
787
788 namespace generated_tests::rank {
789
get_test_model_1d_float16_all_inputs_as_internal_2()790 const TestModel& get_test_model_1d_float16_all_inputs_as_internal_2() {
791 static TestModel model = {
792 .expectFailure = false,
793 .expectedMultinomialDistributionTolerance = 0,
794 .isRelaxed = false,
795 .main = {
796 .inputIndexes = {2},
797 .operands = {{ // input01
798 .channelQuant = {},
799 .data = TestBuffer::createFromVector<_Float16>({}),
800 .dimensions = {2, 3},
801 .isIgnored = false,
802 .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
803 .numberOfConsumers = 1,
804 .scale = 0.0f,
805 .type = TestOperandType::TENSOR_FLOAT16,
806 .zeroPoint = 0
807 }, { // output01
808 .channelQuant = {},
809 .data = TestBuffer::createFromVector<int32_t>({2}),
810 .dimensions = {},
811 .isIgnored = false,
812 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
813 .numberOfConsumers = 0,
814 .scale = 0.0f,
815 .type = TestOperandType::INT32,
816 .zeroPoint = 0
817 }, { // input01_new
818 .channelQuant = {},
819 .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
820 .dimensions = {2, 3},
821 .isIgnored = false,
822 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
823 .numberOfConsumers = 1,
824 .scale = 0.0f,
825 .type = TestOperandType::TENSOR_FLOAT16,
826 .zeroPoint = 0
827 }, { // placeholder5
828 .channelQuant = {},
829 .data = TestBuffer::createFromVector<_Float16>({0.0f}),
830 .dimensions = {1},
831 .isIgnored = false,
832 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
833 .numberOfConsumers = 1,
834 .scale = 0.0f,
835 .type = TestOperandType::TENSOR_FLOAT16,
836 .zeroPoint = 0
837 }, { // param5
838 .channelQuant = {},
839 .data = TestBuffer::createFromVector<int32_t>({0}),
840 .dimensions = {},
841 .isIgnored = false,
842 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
843 .numberOfConsumers = 1,
844 .scale = 0.0f,
845 .type = TestOperandType::INT32,
846 .zeroPoint = 0
847 }},
848 .operations = {{
849 .inputs = {2, 3, 4},
850 .outputs = {0},
851 .type = TestOperationType::ADD
852 }, {
853 .inputs = {0},
854 .outputs = {1},
855 .type = TestOperationType::RANK
856 }},
857 .outputIndexes = {1}
858 },
859 .minSupportedVersion = TestHalVersion::V1_3,
860 .referenced = {}
861 };
862 return model;
863 }
864
865 const auto dummy_test_model_1d_float16_all_inputs_as_internal_2 = TestModelManager::get().add("rank_1d_float16_all_inputs_as_internal_2", get_test_model_1d_float16_all_inputs_as_internal_2());
866
867 } // namespace generated_tests::rank
868
869 namespace generated_tests::rank {
870
get_test_model_1d_quant8_2()871 const TestModel& get_test_model_1d_quant8_2() {
872 static TestModel model = {
873 .expectFailure = false,
874 .expectedMultinomialDistributionTolerance = 0,
875 .isRelaxed = false,
876 .main = {
877 .inputIndexes = {0},
878 .operands = {{ // input01
879 .channelQuant = {},
880 .data = TestBuffer::createFromVector<uint8_t>({138, 148, 158, 168, 178, 188}),
881 .dimensions = {2, 3},
882 .isIgnored = false,
883 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
884 .numberOfConsumers = 1,
885 .scale = 0.1f,
886 .type = TestOperandType::TENSOR_QUANT8_ASYMM,
887 .zeroPoint = 128
888 }, { // output01
889 .channelQuant = {},
890 .data = TestBuffer::createFromVector<int32_t>({2}),
891 .dimensions = {},
892 .isIgnored = false,
893 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
894 .numberOfConsumers = 0,
895 .scale = 0.0f,
896 .type = TestOperandType::INT32,
897 .zeroPoint = 0
898 }},
899 .operations = {{
900 .inputs = {0},
901 .outputs = {1},
902 .type = TestOperationType::RANK
903 }},
904 .outputIndexes = {1}
905 },
906 .minSupportedVersion = TestHalVersion::V1_3,
907 .referenced = {}
908 };
909 return model;
910 }
911
912 const auto dummy_test_model_1d_quant8_2 = TestModelManager::get().add("rank_1d_quant8_2", get_test_model_1d_quant8_2());
913
914 } // namespace generated_tests::rank
915
916 namespace generated_tests::rank {
917
get_test_model_1d_quant8_all_inputs_as_internal_2()918 const TestModel& get_test_model_1d_quant8_all_inputs_as_internal_2() {
919 static TestModel model = {
920 .expectFailure = false,
921 .expectedMultinomialDistributionTolerance = 0,
922 .isRelaxed = false,
923 .main = {
924 .inputIndexes = {2},
925 .operands = {{ // input01
926 .channelQuant = {},
927 .data = TestBuffer::createFromVector<uint8_t>({}),
928 .dimensions = {2, 3},
929 .isIgnored = false,
930 .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
931 .numberOfConsumers = 1,
932 .scale = 0.1f,
933 .type = TestOperandType::TENSOR_QUANT8_ASYMM,
934 .zeroPoint = 128
935 }, { // output01
936 .channelQuant = {},
937 .data = TestBuffer::createFromVector<int32_t>({2}),
938 .dimensions = {},
939 .isIgnored = false,
940 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
941 .numberOfConsumers = 0,
942 .scale = 0.0f,
943 .type = TestOperandType::INT32,
944 .zeroPoint = 0
945 }, { // input01_new
946 .channelQuant = {},
947 .data = TestBuffer::createFromVector<uint8_t>({138, 148, 158, 168, 178, 188}),
948 .dimensions = {2, 3},
949 .isIgnored = false,
950 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
951 .numberOfConsumers = 1,
952 .scale = 0.1f,
953 .type = TestOperandType::TENSOR_QUANT8_ASYMM,
954 .zeroPoint = 128
955 }, { // placeholder6
956 .channelQuant = {},
957 .data = TestBuffer::createFromVector<uint8_t>({128}),
958 .dimensions = {1},
959 .isIgnored = false,
960 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
961 .numberOfConsumers = 1,
962 .scale = 0.1f,
963 .type = TestOperandType::TENSOR_QUANT8_ASYMM,
964 .zeroPoint = 128
965 }, { // param6
966 .channelQuant = {},
967 .data = TestBuffer::createFromVector<int32_t>({0}),
968 .dimensions = {},
969 .isIgnored = false,
970 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
971 .numberOfConsumers = 1,
972 .scale = 0.0f,
973 .type = TestOperandType::INT32,
974 .zeroPoint = 0
975 }},
976 .operations = {{
977 .inputs = {2, 3, 4},
978 .outputs = {0},
979 .type = TestOperationType::ADD
980 }, {
981 .inputs = {0},
982 .outputs = {1},
983 .type = TestOperationType::RANK
984 }},
985 .outputIndexes = {1}
986 },
987 .minSupportedVersion = TestHalVersion::V1_3,
988 .referenced = {}
989 };
990 return model;
991 }
992
993 const auto dummy_test_model_1d_quant8_all_inputs_as_internal_2 = TestModelManager::get().add("rank_1d_quant8_all_inputs_as_internal_2", get_test_model_1d_quant8_all_inputs_as_internal_2());
994
995 } // namespace generated_tests::rank
996
997 namespace generated_tests::rank {
998
get_test_model_1d_quant8_signed_2()999 const TestModel& get_test_model_1d_quant8_signed_2() {
1000 static TestModel model = {
1001 .expectFailure = false,
1002 .expectedMultinomialDistributionTolerance = 0,
1003 .isRelaxed = false,
1004 .main = {
1005 .inputIndexes = {0},
1006 .operands = {{ // input01
1007 .channelQuant = {},
1008 .data = TestBuffer::createFromVector<int8_t>({10, 20, 30, 40, 50, 60}),
1009 .dimensions = {2, 3},
1010 .isIgnored = false,
1011 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1012 .numberOfConsumers = 1,
1013 .scale = 0.1f,
1014 .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED,
1015 .zeroPoint = 0
1016 }, { // output01
1017 .channelQuant = {},
1018 .data = TestBuffer::createFromVector<int32_t>({2}),
1019 .dimensions = {},
1020 .isIgnored = false,
1021 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1022 .numberOfConsumers = 0,
1023 .scale = 0.0f,
1024 .type = TestOperandType::INT32,
1025 .zeroPoint = 0
1026 }},
1027 .operations = {{
1028 .inputs = {0},
1029 .outputs = {1},
1030 .type = TestOperationType::RANK
1031 }},
1032 .outputIndexes = {1}
1033 },
1034 .minSupportedVersion = TestHalVersion::V1_3,
1035 .referenced = {}
1036 };
1037 return model;
1038 }
1039
1040 const auto dummy_test_model_1d_quant8_signed_2 = TestModelManager::get().add("rank_1d_quant8_signed_2", get_test_model_1d_quant8_signed_2());
1041
1042 } // namespace generated_tests::rank
1043
1044 namespace generated_tests::rank {
1045
get_test_model_1d_quant8_signed_all_inputs_as_internal_2()1046 const TestModel& get_test_model_1d_quant8_signed_all_inputs_as_internal_2() {
1047 static TestModel model = {
1048 .expectFailure = false,
1049 .expectedMultinomialDistributionTolerance = 0,
1050 .isRelaxed = false,
1051 .main = {
1052 .inputIndexes = {2},
1053 .operands = {{ // input01
1054 .channelQuant = {},
1055 .data = TestBuffer::createFromVector<int8_t>({}),
1056 .dimensions = {2, 3},
1057 .isIgnored = false,
1058 .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
1059 .numberOfConsumers = 1,
1060 .scale = 0.1f,
1061 .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED,
1062 .zeroPoint = 0
1063 }, { // output01
1064 .channelQuant = {},
1065 .data = TestBuffer::createFromVector<int32_t>({2}),
1066 .dimensions = {},
1067 .isIgnored = false,
1068 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1069 .numberOfConsumers = 0,
1070 .scale = 0.0f,
1071 .type = TestOperandType::INT32,
1072 .zeroPoint = 0
1073 }, { // input01_new
1074 .channelQuant = {},
1075 .data = TestBuffer::createFromVector<int8_t>({10, 20, 30, 40, 50, 60}),
1076 .dimensions = {2, 3},
1077 .isIgnored = false,
1078 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1079 .numberOfConsumers = 1,
1080 .scale = 0.1f,
1081 .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED,
1082 .zeroPoint = 0
1083 }, { // placeholder7
1084 .channelQuant = {},
1085 .data = TestBuffer::createFromVector<int8_t>({0}),
1086 .dimensions = {1},
1087 .isIgnored = false,
1088 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1089 .numberOfConsumers = 1,
1090 .scale = 0.1f,
1091 .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED,
1092 .zeroPoint = 0
1093 }, { // param7
1094 .channelQuant = {},
1095 .data = TestBuffer::createFromVector<int32_t>({0}),
1096 .dimensions = {},
1097 .isIgnored = false,
1098 .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1099 .numberOfConsumers = 1,
1100 .scale = 0.0f,
1101 .type = TestOperandType::INT32,
1102 .zeroPoint = 0
1103 }},
1104 .operations = {{
1105 .inputs = {2, 3, 4},
1106 .outputs = {0},
1107 .type = TestOperationType::ADD
1108 }, {
1109 .inputs = {0},
1110 .outputs = {1},
1111 .type = TestOperationType::RANK
1112 }},
1113 .outputIndexes = {1}
1114 },
1115 .minSupportedVersion = TestHalVersion::V1_3,
1116 .referenced = {}
1117 };
1118 return model;
1119 }
1120
1121 const auto dummy_test_model_1d_quant8_signed_all_inputs_as_internal_2 = TestModelManager::get().add("rank_1d_quant8_signed_all_inputs_as_internal_2", get_test_model_1d_quant8_signed_all_inputs_as_internal_2());
1122
1123 } // namespace generated_tests::rank
1124
1125 namespace generated_tests::rank {
1126
get_test_model_internal_output()1127 const TestModel& get_test_model_internal_output() {
1128 static TestModel model = {
1129 .expectFailure = false,
1130 .expectedMultinomialDistributionTolerance = 0,
1131 .isRelaxed = false,
1132 .main = {
1133 .inputIndexes = {0, 2},
1134 .operands = {{ // input02
1135 .channelQuant = {},
1136 .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
1137 .dimensions = {2, 3},
1138 .isIgnored = false,
1139 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1140 .numberOfConsumers = 1,
1141 .scale = 0.0f,
1142 .type = TestOperandType::TENSOR_FLOAT32,
1143 .zeroPoint = 0
1144 }, { // rank_internal_result
1145 .channelQuant = {},
1146 .data = TestBuffer::createFromVector<int32_t>({}),
1147 .dimensions = {},
1148 .isIgnored = false,
1149 .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
1150 .numberOfConsumers = 1,
1151 .scale = 0.0f,
1152 .type = TestOperandType::INT32,
1153 .zeroPoint = 0
1154 }, { // input03
1155 .channelQuant = {},
1156 .data = TestBuffer::createFromVector<int32_t>({2, 3, 4}),
1157 .dimensions = {3},
1158 .isIgnored = false,
1159 .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1160 .numberOfConsumers = 1,
1161 .scale = 0.0f,
1162 .type = TestOperandType::TENSOR_INT32,
1163 .zeroPoint = 0
1164 }, { // output
1165 .channelQuant = {},
1166 .data = TestBuffer::createFromVector<int32_t>({2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}),
1167 .dimensions = {2, 3, 4},
1168 .isIgnored = false,
1169 .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1170 .numberOfConsumers = 0,
1171 .scale = 0.0f,
1172 .type = TestOperandType::TENSOR_INT32,
1173 .zeroPoint = 0
1174 }},
1175 .operations = {{
1176 .inputs = {0},
1177 .outputs = {1},
1178 .type = TestOperationType::RANK
1179 }, {
1180 .inputs = {2, 1},
1181 .outputs = {3},
1182 .type = TestOperationType::FILL
1183 }},
1184 .outputIndexes = {3}
1185 },
1186 .minSupportedVersion = TestHalVersion::V1_3,
1187 .referenced = {}
1188 };
1189 return model;
1190 }
1191
1192 const auto dummy_test_model_internal_output = TestModelManager::get().add("rank_internal_output", get_test_model_internal_output());
1193
1194 } // namespace generated_tests::rank
1195
1196