• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Generated from cast.mod.py
2 // DO NOT EDIT
3 // clang-format off
4 #include "TestHarness.h"
5 using namespace test_helper;
6 
7 namespace generated_tests::cast {
8 
get_test_model_float16_to_float16()9 const TestModel& get_test_model_float16_to_float16() {
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<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
19                             .dimensions = {2, 3},
20                             .isIgnored = false,
21                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
22                             .numberOfConsumers = 1,
23                             .scale = 0.0f,
24                             .type = TestOperandType::TENSOR_FLOAT16,
25                             .zeroPoint = 0
26                         }, { // output0
27                             .channelQuant = {},
28                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
29                             .dimensions = {2, 3},
30                             .isIgnored = false,
31                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
32                             .numberOfConsumers = 0,
33                             .scale = 0.0f,
34                             .type = TestOperandType::TENSOR_FLOAT16,
35                             .zeroPoint = 0
36                         }},
37                 .operations = {{
38                             .inputs = {0},
39                             .outputs = {1},
40                             .type = TestOperationType::CAST
41                         }},
42                 .outputIndexes = {1}
43             },
44         .minSupportedVersion = TestHalVersion::V1_2,
45         .referenced = {}
46     };
47     return model;
48 }
49 
50 const auto dummy_test_model_float16_to_float16 = TestModelManager::get().add("cast_float16_to_float16", get_test_model_float16_to_float16());
51 
52 }  // namespace generated_tests::cast
53 
54 namespace generated_tests::cast {
55 
get_test_model_float16_to_float16_all_inputs_as_internal()56 const TestModel& get_test_model_float16_to_float16_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<_Float16>({}),
66                             .dimensions = {2, 3},
67                             .isIgnored = false,
68                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
69                             .numberOfConsumers = 1,
70                             .scale = 0.0f,
71                             .type = TestOperandType::TENSOR_FLOAT16,
72                             .zeroPoint = 0
73                         }, { // output0
74                             .channelQuant = {},
75                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
76                             .dimensions = {2, 3},
77                             .isIgnored = false,
78                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
79                             .numberOfConsumers = 0,
80                             .scale = 0.0f,
81                             .type = TestOperandType::TENSOR_FLOAT16,
82                             .zeroPoint = 0
83                         }, { // input0_new
84                             .channelQuant = {},
85                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
86                             .dimensions = {2, 3},
87                             .isIgnored = false,
88                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
89                             .numberOfConsumers = 1,
90                             .scale = 0.0f,
91                             .type = TestOperandType::TENSOR_FLOAT16,
92                             .zeroPoint = 0
93                         }, { // placeholder
94                             .channelQuant = {},
95                             .data = TestBuffer::createFromVector<_Float16>({0.0f}),
96                             .dimensions = {1},
97                             .isIgnored = false,
98                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
99                             .numberOfConsumers = 1,
100                             .scale = 0.0f,
101                             .type = TestOperandType::TENSOR_FLOAT16,
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::CAST
122                         }},
123                 .outputIndexes = {1}
124             },
125         .minSupportedVersion = TestHalVersion::V1_2,
126         .referenced = {}
127     };
128     return model;
129 }
130 
131 const auto dummy_test_model_float16_to_float16_all_inputs_as_internal = TestModelManager::get().add("cast_float16_to_float16_all_inputs_as_internal", get_test_model_float16_to_float16_all_inputs_as_internal());
132 
133 }  // namespace generated_tests::cast
134 
135 namespace generated_tests::cast {
136 
get_test_model_float16_to_float32()137 const TestModel& get_test_model_float16_to_float32() {
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<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
147                             .dimensions = {2, 3},
148                             .isIgnored = false,
149                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
150                             .numberOfConsumers = 1,
151                             .scale = 0.0f,
152                             .type = TestOperandType::TENSOR_FLOAT16,
153                             .zeroPoint = 0
154                         }, { // output01
155                             .channelQuant = {},
156                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
157                             .dimensions = {2, 3},
158                             .isIgnored = false,
159                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
160                             .numberOfConsumers = 0,
161                             .scale = 0.0f,
162                             .type = TestOperandType::TENSOR_FLOAT32,
163                             .zeroPoint = 0
164                         }},
165                 .operations = {{
166                             .inputs = {0},
167                             .outputs = {1},
168                             .type = TestOperationType::CAST
169                         }},
170                 .outputIndexes = {1}
171             },
172         .minSupportedVersion = TestHalVersion::V1_2,
173         .referenced = {}
174     };
175     return model;
176 }
177 
178 const auto dummy_test_model_float16_to_float32 = TestModelManager::get().add("cast_float16_to_float32", get_test_model_float16_to_float32());
179 
180 }  // namespace generated_tests::cast
181 
182 namespace generated_tests::cast {
183 
get_test_model_float16_to_float32_all_inputs_as_internal()184 const TestModel& get_test_model_float16_to_float32_all_inputs_as_internal() {
185     static TestModel model = {
186         .expectFailure = false,
187         .expectedMultinomialDistributionTolerance = 0,
188         .isRelaxed = false,
189         .main = {
190                 .inputIndexes = {2},
191                 .operands = {{ // input0
192                             .channelQuant = {},
193                             .data = TestBuffer::createFromVector<_Float16>({}),
194                             .dimensions = {2, 3},
195                             .isIgnored = false,
196                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
197                             .numberOfConsumers = 1,
198                             .scale = 0.0f,
199                             .type = TestOperandType::TENSOR_FLOAT16,
200                             .zeroPoint = 0
201                         }, { // output01
202                             .channelQuant = {},
203                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
204                             .dimensions = {2, 3},
205                             .isIgnored = false,
206                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
207                             .numberOfConsumers = 0,
208                             .scale = 0.0f,
209                             .type = TestOperandType::TENSOR_FLOAT32,
210                             .zeroPoint = 0
211                         }, { // input0_new
212                             .channelQuant = {},
213                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
214                             .dimensions = {2, 3},
215                             .isIgnored = false,
216                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
217                             .numberOfConsumers = 1,
218                             .scale = 0.0f,
219                             .type = TestOperandType::TENSOR_FLOAT16,
220                             .zeroPoint = 0
221                         }, { // placeholder1
222                             .channelQuant = {},
223                             .data = TestBuffer::createFromVector<_Float16>({0.0f}),
224                             .dimensions = {1},
225                             .isIgnored = false,
226                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
227                             .numberOfConsumers = 1,
228                             .scale = 0.0f,
229                             .type = TestOperandType::TENSOR_FLOAT16,
230                             .zeroPoint = 0
231                         }, { // param1
232                             .channelQuant = {},
233                             .data = TestBuffer::createFromVector<int32_t>({0}),
234                             .dimensions = {},
235                             .isIgnored = false,
236                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
237                             .numberOfConsumers = 1,
238                             .scale = 0.0f,
239                             .type = TestOperandType::INT32,
240                             .zeroPoint = 0
241                         }},
242                 .operations = {{
243                             .inputs = {2, 3, 4},
244                             .outputs = {0},
245                             .type = TestOperationType::ADD
246                         }, {
247                             .inputs = {0},
248                             .outputs = {1},
249                             .type = TestOperationType::CAST
250                         }},
251                 .outputIndexes = {1}
252             },
253         .minSupportedVersion = TestHalVersion::V1_2,
254         .referenced = {}
255     };
256     return model;
257 }
258 
259 const auto dummy_test_model_float16_to_float32_all_inputs_as_internal = TestModelManager::get().add("cast_float16_to_float32_all_inputs_as_internal", get_test_model_float16_to_float32_all_inputs_as_internal());
260 
261 }  // namespace generated_tests::cast
262 
263 namespace generated_tests::cast {
264 
get_test_model_float16_to_float32_relaxed()265 const TestModel& get_test_model_float16_to_float32_relaxed() {
266     static TestModel model = {
267         .expectFailure = false,
268         .expectedMultinomialDistributionTolerance = 0,
269         .isRelaxed = true,
270         .main = {
271                 .inputIndexes = {0},
272                 .operands = {{ // input0
273                             .channelQuant = {},
274                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
275                             .dimensions = {2, 3},
276                             .isIgnored = false,
277                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
278                             .numberOfConsumers = 1,
279                             .scale = 0.0f,
280                             .type = TestOperandType::TENSOR_FLOAT16,
281                             .zeroPoint = 0
282                         }, { // output01
283                             .channelQuant = {},
284                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
285                             .dimensions = {2, 3},
286                             .isIgnored = false,
287                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
288                             .numberOfConsumers = 0,
289                             .scale = 0.0f,
290                             .type = TestOperandType::TENSOR_FLOAT32,
291                             .zeroPoint = 0
292                         }},
293                 .operations = {{
294                             .inputs = {0},
295                             .outputs = {1},
296                             .type = TestOperationType::CAST
297                         }},
298                 .outputIndexes = {1}
299             },
300         .minSupportedVersion = TestHalVersion::UNKNOWN,
301         .referenced = {}
302     };
303     return model;
304 }
305 
306 const auto dummy_test_model_float16_to_float32_relaxed = TestModelManager::get().add("cast_float16_to_float32_relaxed", get_test_model_float16_to_float32_relaxed());
307 
308 }  // namespace generated_tests::cast
309 
310 namespace generated_tests::cast {
311 
get_test_model_float16_to_float32_relaxed_all_inputs_as_internal()312 const TestModel& get_test_model_float16_to_float32_relaxed_all_inputs_as_internal() {
313     static TestModel model = {
314         .expectFailure = false,
315         .expectedMultinomialDistributionTolerance = 0,
316         .isRelaxed = true,
317         .main = {
318                 .inputIndexes = {2},
319                 .operands = {{ // input0
320                             .channelQuant = {},
321                             .data = TestBuffer::createFromVector<_Float16>({}),
322                             .dimensions = {2, 3},
323                             .isIgnored = false,
324                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
325                             .numberOfConsumers = 1,
326                             .scale = 0.0f,
327                             .type = TestOperandType::TENSOR_FLOAT16,
328                             .zeroPoint = 0
329                         }, { // output01
330                             .channelQuant = {},
331                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
332                             .dimensions = {2, 3},
333                             .isIgnored = false,
334                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
335                             .numberOfConsumers = 0,
336                             .scale = 0.0f,
337                             .type = TestOperandType::TENSOR_FLOAT32,
338                             .zeroPoint = 0
339                         }, { // input0_new
340                             .channelQuant = {},
341                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
342                             .dimensions = {2, 3},
343                             .isIgnored = false,
344                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
345                             .numberOfConsumers = 1,
346                             .scale = 0.0f,
347                             .type = TestOperandType::TENSOR_FLOAT16,
348                             .zeroPoint = 0
349                         }, { // placeholder2
350                             .channelQuant = {},
351                             .data = TestBuffer::createFromVector<_Float16>({0.0f}),
352                             .dimensions = {1},
353                             .isIgnored = false,
354                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
355                             .numberOfConsumers = 1,
356                             .scale = 0.0f,
357                             .type = TestOperandType::TENSOR_FLOAT16,
358                             .zeroPoint = 0
359                         }, { // param2
360                             .channelQuant = {},
361                             .data = TestBuffer::createFromVector<int32_t>({0}),
362                             .dimensions = {},
363                             .isIgnored = false,
364                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
365                             .numberOfConsumers = 1,
366                             .scale = 0.0f,
367                             .type = TestOperandType::INT32,
368                             .zeroPoint = 0
369                         }},
370                 .operations = {{
371                             .inputs = {2, 3, 4},
372                             .outputs = {0},
373                             .type = TestOperationType::ADD
374                         }, {
375                             .inputs = {0},
376                             .outputs = {1},
377                             .type = TestOperationType::CAST
378                         }},
379                 .outputIndexes = {1}
380             },
381         .minSupportedVersion = TestHalVersion::UNKNOWN,
382         .referenced = {}
383     };
384     return model;
385 }
386 
387 const auto dummy_test_model_float16_to_float32_relaxed_all_inputs_as_internal = TestModelManager::get().add("cast_float16_to_float32_relaxed_all_inputs_as_internal", get_test_model_float16_to_float32_relaxed_all_inputs_as_internal());
388 
389 }  // namespace generated_tests::cast
390 
391 namespace generated_tests::cast {
392 
get_test_model_float16_to_int32()393 const TestModel& get_test_model_float16_to_int32() {
394     static TestModel model = {
395         .expectFailure = false,
396         .expectedMultinomialDistributionTolerance = 0,
397         .isRelaxed = false,
398         .main = {
399                 .inputIndexes = {0},
400                 .operands = {{ // input0
401                             .channelQuant = {},
402                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
403                             .dimensions = {2, 3},
404                             .isIgnored = false,
405                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
406                             .numberOfConsumers = 1,
407                             .scale = 0.0f,
408                             .type = TestOperandType::TENSOR_FLOAT16,
409                             .zeroPoint = 0
410                         }, { // output02
411                             .channelQuant = {},
412                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6}),
413                             .dimensions = {2, 3},
414                             .isIgnored = false,
415                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
416                             .numberOfConsumers = 0,
417                             .scale = 0.0f,
418                             .type = TestOperandType::TENSOR_INT32,
419                             .zeroPoint = 0
420                         }},
421                 .operations = {{
422                             .inputs = {0},
423                             .outputs = {1},
424                             .type = TestOperationType::CAST
425                         }},
426                 .outputIndexes = {1}
427             },
428         .minSupportedVersion = TestHalVersion::V1_2,
429         .referenced = {}
430     };
431     return model;
432 }
433 
434 const auto dummy_test_model_float16_to_int32 = TestModelManager::get().add("cast_float16_to_int32", get_test_model_float16_to_int32());
435 
436 }  // namespace generated_tests::cast
437 
438 namespace generated_tests::cast {
439 
get_test_model_float16_to_int32_all_inputs_as_internal()440 const TestModel& get_test_model_float16_to_int32_all_inputs_as_internal() {
441     static TestModel model = {
442         .expectFailure = false,
443         .expectedMultinomialDistributionTolerance = 0,
444         .isRelaxed = false,
445         .main = {
446                 .inputIndexes = {2},
447                 .operands = {{ // input0
448                             .channelQuant = {},
449                             .data = TestBuffer::createFromVector<_Float16>({}),
450                             .dimensions = {2, 3},
451                             .isIgnored = false,
452                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
453                             .numberOfConsumers = 1,
454                             .scale = 0.0f,
455                             .type = TestOperandType::TENSOR_FLOAT16,
456                             .zeroPoint = 0
457                         }, { // output02
458                             .channelQuant = {},
459                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6}),
460                             .dimensions = {2, 3},
461                             .isIgnored = false,
462                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
463                             .numberOfConsumers = 0,
464                             .scale = 0.0f,
465                             .type = TestOperandType::TENSOR_INT32,
466                             .zeroPoint = 0
467                         }, { // input0_new
468                             .channelQuant = {},
469                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
470                             .dimensions = {2, 3},
471                             .isIgnored = false,
472                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
473                             .numberOfConsumers = 1,
474                             .scale = 0.0f,
475                             .type = TestOperandType::TENSOR_FLOAT16,
476                             .zeroPoint = 0
477                         }, { // placeholder3
478                             .channelQuant = {},
479                             .data = TestBuffer::createFromVector<_Float16>({0.0f}),
480                             .dimensions = {1},
481                             .isIgnored = false,
482                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
483                             .numberOfConsumers = 1,
484                             .scale = 0.0f,
485                             .type = TestOperandType::TENSOR_FLOAT16,
486                             .zeroPoint = 0
487                         }, { // param3
488                             .channelQuant = {},
489                             .data = TestBuffer::createFromVector<int32_t>({0}),
490                             .dimensions = {},
491                             .isIgnored = false,
492                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
493                             .numberOfConsumers = 1,
494                             .scale = 0.0f,
495                             .type = TestOperandType::INT32,
496                             .zeroPoint = 0
497                         }},
498                 .operations = {{
499                             .inputs = {2, 3, 4},
500                             .outputs = {0},
501                             .type = TestOperationType::ADD
502                         }, {
503                             .inputs = {0},
504                             .outputs = {1},
505                             .type = TestOperationType::CAST
506                         }},
507                 .outputIndexes = {1}
508             },
509         .minSupportedVersion = TestHalVersion::V1_2,
510         .referenced = {}
511     };
512     return model;
513 }
514 
515 const auto dummy_test_model_float16_to_int32_all_inputs_as_internal = TestModelManager::get().add("cast_float16_to_int32_all_inputs_as_internal", get_test_model_float16_to_int32_all_inputs_as_internal());
516 
517 }  // namespace generated_tests::cast
518 
519 namespace generated_tests::cast {
520 
get_test_model_float16_to_quant8()521 const TestModel& get_test_model_float16_to_quant8() {
522     static TestModel model = {
523         .expectFailure = false,
524         .expectedMultinomialDistributionTolerance = 0,
525         .isRelaxed = false,
526         .main = {
527                 .inputIndexes = {0},
528                 .operands = {{ // input0
529                             .channelQuant = {},
530                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
531                             .dimensions = {2, 3},
532                             .isIgnored = false,
533                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
534                             .numberOfConsumers = 1,
535                             .scale = 0.0f,
536                             .type = TestOperandType::TENSOR_FLOAT16,
537                             .zeroPoint = 0
538                         }, { // output03
539                             .channelQuant = {},
540                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}),
541                             .dimensions = {2, 3},
542                             .isIgnored = false,
543                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
544                             .numberOfConsumers = 0,
545                             .scale = 4.0f,
546                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
547                             .zeroPoint = 100
548                         }},
549                 .operations = {{
550                             .inputs = {0},
551                             .outputs = {1},
552                             .type = TestOperationType::CAST
553                         }},
554                 .outputIndexes = {1}
555             },
556         .minSupportedVersion = TestHalVersion::V1_2,
557         .referenced = {}
558     };
559     return model;
560 }
561 
562 const auto dummy_test_model_float16_to_quant8 = TestModelManager::get().add("cast_float16_to_quant8", get_test_model_float16_to_quant8());
563 
564 }  // namespace generated_tests::cast
565 
566 namespace generated_tests::cast {
567 
get_test_model_float16_to_quant8_all_inputs_as_internal()568 const TestModel& get_test_model_float16_to_quant8_all_inputs_as_internal() {
569     static TestModel model = {
570         .expectFailure = false,
571         .expectedMultinomialDistributionTolerance = 0,
572         .isRelaxed = false,
573         .main = {
574                 .inputIndexes = {2},
575                 .operands = {{ // input0
576                             .channelQuant = {},
577                             .data = TestBuffer::createFromVector<_Float16>({}),
578                             .dimensions = {2, 3},
579                             .isIgnored = false,
580                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
581                             .numberOfConsumers = 1,
582                             .scale = 0.0f,
583                             .type = TestOperandType::TENSOR_FLOAT16,
584                             .zeroPoint = 0
585                         }, { // output03
586                             .channelQuant = {},
587                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}),
588                             .dimensions = {2, 3},
589                             .isIgnored = false,
590                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
591                             .numberOfConsumers = 0,
592                             .scale = 4.0f,
593                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
594                             .zeroPoint = 100
595                         }, { // input0_new
596                             .channelQuant = {},
597                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
598                             .dimensions = {2, 3},
599                             .isIgnored = false,
600                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
601                             .numberOfConsumers = 1,
602                             .scale = 0.0f,
603                             .type = TestOperandType::TENSOR_FLOAT16,
604                             .zeroPoint = 0
605                         }, { // placeholder4
606                             .channelQuant = {},
607                             .data = TestBuffer::createFromVector<_Float16>({0.0f}),
608                             .dimensions = {1},
609                             .isIgnored = false,
610                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
611                             .numberOfConsumers = 1,
612                             .scale = 0.0f,
613                             .type = TestOperandType::TENSOR_FLOAT16,
614                             .zeroPoint = 0
615                         }, { // param4
616                             .channelQuant = {},
617                             .data = TestBuffer::createFromVector<int32_t>({0}),
618                             .dimensions = {},
619                             .isIgnored = false,
620                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
621                             .numberOfConsumers = 1,
622                             .scale = 0.0f,
623                             .type = TestOperandType::INT32,
624                             .zeroPoint = 0
625                         }},
626                 .operations = {{
627                             .inputs = {2, 3, 4},
628                             .outputs = {0},
629                             .type = TestOperationType::ADD
630                         }, {
631                             .inputs = {0},
632                             .outputs = {1},
633                             .type = TestOperationType::CAST
634                         }},
635                 .outputIndexes = {1}
636             },
637         .minSupportedVersion = TestHalVersion::V1_2,
638         .referenced = {}
639     };
640     return model;
641 }
642 
643 const auto dummy_test_model_float16_to_quant8_all_inputs_as_internal = TestModelManager::get().add("cast_float16_to_quant8_all_inputs_as_internal", get_test_model_float16_to_quant8_all_inputs_as_internal());
644 
645 }  // namespace generated_tests::cast
646 
647 namespace generated_tests::cast {
648 
get_test_model_float32_to_float16()649 const TestModel& get_test_model_float32_to_float16() {
650     static TestModel model = {
651         .expectFailure = false,
652         .expectedMultinomialDistributionTolerance = 0,
653         .isRelaxed = false,
654         .main = {
655                 .inputIndexes = {0},
656                 .operands = {{ // input01
657                             .channelQuant = {},
658                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
659                             .dimensions = {2, 3},
660                             .isIgnored = false,
661                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
662                             .numberOfConsumers = 1,
663                             .scale = 0.0f,
664                             .type = TestOperandType::TENSOR_FLOAT32,
665                             .zeroPoint = 0
666                         }, { // output0
667                             .channelQuant = {},
668                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
669                             .dimensions = {2, 3},
670                             .isIgnored = false,
671                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
672                             .numberOfConsumers = 0,
673                             .scale = 0.0f,
674                             .type = TestOperandType::TENSOR_FLOAT16,
675                             .zeroPoint = 0
676                         }},
677                 .operations = {{
678                             .inputs = {0},
679                             .outputs = {1},
680                             .type = TestOperationType::CAST
681                         }},
682                 .outputIndexes = {1}
683             },
684         .minSupportedVersion = TestHalVersion::V1_2,
685         .referenced = {}
686     };
687     return model;
688 }
689 
690 const auto dummy_test_model_float32_to_float16 = TestModelManager::get().add("cast_float32_to_float16", get_test_model_float32_to_float16());
691 
692 }  // namespace generated_tests::cast
693 
694 namespace generated_tests::cast {
695 
get_test_model_float32_to_float16_all_inputs_as_internal()696 const TestModel& get_test_model_float32_to_float16_all_inputs_as_internal() {
697     static TestModel model = {
698         .expectFailure = false,
699         .expectedMultinomialDistributionTolerance = 0,
700         .isRelaxed = false,
701         .main = {
702                 .inputIndexes = {2},
703                 .operands = {{ // input01
704                             .channelQuant = {},
705                             .data = TestBuffer::createFromVector<float>({}),
706                             .dimensions = {2, 3},
707                             .isIgnored = false,
708                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
709                             .numberOfConsumers = 1,
710                             .scale = 0.0f,
711                             .type = TestOperandType::TENSOR_FLOAT32,
712                             .zeroPoint = 0
713                         }, { // output0
714                             .channelQuant = {},
715                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
716                             .dimensions = {2, 3},
717                             .isIgnored = false,
718                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
719                             .numberOfConsumers = 0,
720                             .scale = 0.0f,
721                             .type = TestOperandType::TENSOR_FLOAT16,
722                             .zeroPoint = 0
723                         }, { // input01_new
724                             .channelQuant = {},
725                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
726                             .dimensions = {2, 3},
727                             .isIgnored = false,
728                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
729                             .numberOfConsumers = 1,
730                             .scale = 0.0f,
731                             .type = TestOperandType::TENSOR_FLOAT32,
732                             .zeroPoint = 0
733                         }, { // placeholder5
734                             .channelQuant = {},
735                             .data = TestBuffer::createFromVector<float>({0.0f}),
736                             .dimensions = {1},
737                             .isIgnored = false,
738                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
739                             .numberOfConsumers = 1,
740                             .scale = 0.0f,
741                             .type = TestOperandType::TENSOR_FLOAT32,
742                             .zeroPoint = 0
743                         }, { // param5
744                             .channelQuant = {},
745                             .data = TestBuffer::createFromVector<int32_t>({0}),
746                             .dimensions = {},
747                             .isIgnored = false,
748                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
749                             .numberOfConsumers = 1,
750                             .scale = 0.0f,
751                             .type = TestOperandType::INT32,
752                             .zeroPoint = 0
753                         }},
754                 .operations = {{
755                             .inputs = {2, 3, 4},
756                             .outputs = {0},
757                             .type = TestOperationType::ADD
758                         }, {
759                             .inputs = {0},
760                             .outputs = {1},
761                             .type = TestOperationType::CAST
762                         }},
763                 .outputIndexes = {1}
764             },
765         .minSupportedVersion = TestHalVersion::V1_2,
766         .referenced = {}
767     };
768     return model;
769 }
770 
771 const auto dummy_test_model_float32_to_float16_all_inputs_as_internal = TestModelManager::get().add("cast_float32_to_float16_all_inputs_as_internal", get_test_model_float32_to_float16_all_inputs_as_internal());
772 
773 }  // namespace generated_tests::cast
774 
775 namespace generated_tests::cast {
776 
get_test_model_float32_to_float16_relaxed()777 const TestModel& get_test_model_float32_to_float16_relaxed() {
778     static TestModel model = {
779         .expectFailure = false,
780         .expectedMultinomialDistributionTolerance = 0,
781         .isRelaxed = true,
782         .main = {
783                 .inputIndexes = {0},
784                 .operands = {{ // input01
785                             .channelQuant = {},
786                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
787                             .dimensions = {2, 3},
788                             .isIgnored = false,
789                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
790                             .numberOfConsumers = 1,
791                             .scale = 0.0f,
792                             .type = TestOperandType::TENSOR_FLOAT32,
793                             .zeroPoint = 0
794                         }, { // output0
795                             .channelQuant = {},
796                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
797                             .dimensions = {2, 3},
798                             .isIgnored = false,
799                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
800                             .numberOfConsumers = 0,
801                             .scale = 0.0f,
802                             .type = TestOperandType::TENSOR_FLOAT16,
803                             .zeroPoint = 0
804                         }},
805                 .operations = {{
806                             .inputs = {0},
807                             .outputs = {1},
808                             .type = TestOperationType::CAST
809                         }},
810                 .outputIndexes = {1}
811             },
812         .minSupportedVersion = TestHalVersion::UNKNOWN,
813         .referenced = {}
814     };
815     return model;
816 }
817 
818 const auto dummy_test_model_float32_to_float16_relaxed = TestModelManager::get().add("cast_float32_to_float16_relaxed", get_test_model_float32_to_float16_relaxed());
819 
820 }  // namespace generated_tests::cast
821 
822 namespace generated_tests::cast {
823 
get_test_model_float32_to_float16_relaxed_all_inputs_as_internal()824 const TestModel& get_test_model_float32_to_float16_relaxed_all_inputs_as_internal() {
825     static TestModel model = {
826         .expectFailure = false,
827         .expectedMultinomialDistributionTolerance = 0,
828         .isRelaxed = true,
829         .main = {
830                 .inputIndexes = {2},
831                 .operands = {{ // input01
832                             .channelQuant = {},
833                             .data = TestBuffer::createFromVector<float>({}),
834                             .dimensions = {2, 3},
835                             .isIgnored = false,
836                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
837                             .numberOfConsumers = 1,
838                             .scale = 0.0f,
839                             .type = TestOperandType::TENSOR_FLOAT32,
840                             .zeroPoint = 0
841                         }, { // output0
842                             .channelQuant = {},
843                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
844                             .dimensions = {2, 3},
845                             .isIgnored = false,
846                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
847                             .numberOfConsumers = 0,
848                             .scale = 0.0f,
849                             .type = TestOperandType::TENSOR_FLOAT16,
850                             .zeroPoint = 0
851                         }, { // input01_new
852                             .channelQuant = {},
853                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
854                             .dimensions = {2, 3},
855                             .isIgnored = false,
856                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
857                             .numberOfConsumers = 1,
858                             .scale = 0.0f,
859                             .type = TestOperandType::TENSOR_FLOAT32,
860                             .zeroPoint = 0
861                         }, { // placeholder6
862                             .channelQuant = {},
863                             .data = TestBuffer::createFromVector<float>({0.0f}),
864                             .dimensions = {1},
865                             .isIgnored = false,
866                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
867                             .numberOfConsumers = 1,
868                             .scale = 0.0f,
869                             .type = TestOperandType::TENSOR_FLOAT32,
870                             .zeroPoint = 0
871                         }, { // param6
872                             .channelQuant = {},
873                             .data = TestBuffer::createFromVector<int32_t>({0}),
874                             .dimensions = {},
875                             .isIgnored = false,
876                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
877                             .numberOfConsumers = 1,
878                             .scale = 0.0f,
879                             .type = TestOperandType::INT32,
880                             .zeroPoint = 0
881                         }},
882                 .operations = {{
883                             .inputs = {2, 3, 4},
884                             .outputs = {0},
885                             .type = TestOperationType::ADD
886                         }, {
887                             .inputs = {0},
888                             .outputs = {1},
889                             .type = TestOperationType::CAST
890                         }},
891                 .outputIndexes = {1}
892             },
893         .minSupportedVersion = TestHalVersion::UNKNOWN,
894         .referenced = {}
895     };
896     return model;
897 }
898 
899 const auto dummy_test_model_float32_to_float16_relaxed_all_inputs_as_internal = TestModelManager::get().add("cast_float32_to_float16_relaxed_all_inputs_as_internal", get_test_model_float32_to_float16_relaxed_all_inputs_as_internal());
900 
901 }  // namespace generated_tests::cast
902 
903 namespace generated_tests::cast {
904 
get_test_model_float32_to_float32()905 const TestModel& get_test_model_float32_to_float32() {
906     static TestModel model = {
907         .expectFailure = false,
908         .expectedMultinomialDistributionTolerance = 0,
909         .isRelaxed = false,
910         .main = {
911                 .inputIndexes = {0},
912                 .operands = {{ // input01
913                             .channelQuant = {},
914                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
915                             .dimensions = {2, 3},
916                             .isIgnored = false,
917                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
918                             .numberOfConsumers = 1,
919                             .scale = 0.0f,
920                             .type = TestOperandType::TENSOR_FLOAT32,
921                             .zeroPoint = 0
922                         }, { // output01
923                             .channelQuant = {},
924                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
925                             .dimensions = {2, 3},
926                             .isIgnored = false,
927                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
928                             .numberOfConsumers = 0,
929                             .scale = 0.0f,
930                             .type = TestOperandType::TENSOR_FLOAT32,
931                             .zeroPoint = 0
932                         }},
933                 .operations = {{
934                             .inputs = {0},
935                             .outputs = {1},
936                             .type = TestOperationType::CAST
937                         }},
938                 .outputIndexes = {1}
939             },
940         .minSupportedVersion = TestHalVersion::V1_2,
941         .referenced = {}
942     };
943     return model;
944 }
945 
946 const auto dummy_test_model_float32_to_float32 = TestModelManager::get().add("cast_float32_to_float32", get_test_model_float32_to_float32());
947 
948 }  // namespace generated_tests::cast
949 
950 namespace generated_tests::cast {
951 
get_test_model_float32_to_float32_all_inputs_as_internal()952 const TestModel& get_test_model_float32_to_float32_all_inputs_as_internal() {
953     static TestModel model = {
954         .expectFailure = false,
955         .expectedMultinomialDistributionTolerance = 0,
956         .isRelaxed = false,
957         .main = {
958                 .inputIndexes = {2},
959                 .operands = {{ // input01
960                             .channelQuant = {},
961                             .data = TestBuffer::createFromVector<float>({}),
962                             .dimensions = {2, 3},
963                             .isIgnored = false,
964                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
965                             .numberOfConsumers = 1,
966                             .scale = 0.0f,
967                             .type = TestOperandType::TENSOR_FLOAT32,
968                             .zeroPoint = 0
969                         }, { // output01
970                             .channelQuant = {},
971                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
972                             .dimensions = {2, 3},
973                             .isIgnored = false,
974                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
975                             .numberOfConsumers = 0,
976                             .scale = 0.0f,
977                             .type = TestOperandType::TENSOR_FLOAT32,
978                             .zeroPoint = 0
979                         }, { // input01_new
980                             .channelQuant = {},
981                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
982                             .dimensions = {2, 3},
983                             .isIgnored = false,
984                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
985                             .numberOfConsumers = 1,
986                             .scale = 0.0f,
987                             .type = TestOperandType::TENSOR_FLOAT32,
988                             .zeroPoint = 0
989                         }, { // placeholder7
990                             .channelQuant = {},
991                             .data = TestBuffer::createFromVector<float>({0.0f}),
992                             .dimensions = {1},
993                             .isIgnored = false,
994                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
995                             .numberOfConsumers = 1,
996                             .scale = 0.0f,
997                             .type = TestOperandType::TENSOR_FLOAT32,
998                             .zeroPoint = 0
999                         }, { // param7
1000                             .channelQuant = {},
1001                             .data = TestBuffer::createFromVector<int32_t>({0}),
1002                             .dimensions = {},
1003                             .isIgnored = false,
1004                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1005                             .numberOfConsumers = 1,
1006                             .scale = 0.0f,
1007                             .type = TestOperandType::INT32,
1008                             .zeroPoint = 0
1009                         }},
1010                 .operations = {{
1011                             .inputs = {2, 3, 4},
1012                             .outputs = {0},
1013                             .type = TestOperationType::ADD
1014                         }, {
1015                             .inputs = {0},
1016                             .outputs = {1},
1017                             .type = TestOperationType::CAST
1018                         }},
1019                 .outputIndexes = {1}
1020             },
1021         .minSupportedVersion = TestHalVersion::V1_2,
1022         .referenced = {}
1023     };
1024     return model;
1025 }
1026 
1027 const auto dummy_test_model_float32_to_float32_all_inputs_as_internal = TestModelManager::get().add("cast_float32_to_float32_all_inputs_as_internal", get_test_model_float32_to_float32_all_inputs_as_internal());
1028 
1029 }  // namespace generated_tests::cast
1030 
1031 namespace generated_tests::cast {
1032 
get_test_model_float32_to_float32_relaxed()1033 const TestModel& get_test_model_float32_to_float32_relaxed() {
1034     static TestModel model = {
1035         .expectFailure = false,
1036         .expectedMultinomialDistributionTolerance = 0,
1037         .isRelaxed = true,
1038         .main = {
1039                 .inputIndexes = {0},
1040                 .operands = {{ // input01
1041                             .channelQuant = {},
1042                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
1043                             .dimensions = {2, 3},
1044                             .isIgnored = false,
1045                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1046                             .numberOfConsumers = 1,
1047                             .scale = 0.0f,
1048                             .type = TestOperandType::TENSOR_FLOAT32,
1049                             .zeroPoint = 0
1050                         }, { // output01
1051                             .channelQuant = {},
1052                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
1053                             .dimensions = {2, 3},
1054                             .isIgnored = false,
1055                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1056                             .numberOfConsumers = 0,
1057                             .scale = 0.0f,
1058                             .type = TestOperandType::TENSOR_FLOAT32,
1059                             .zeroPoint = 0
1060                         }},
1061                 .operations = {{
1062                             .inputs = {0},
1063                             .outputs = {1},
1064                             .type = TestOperationType::CAST
1065                         }},
1066                 .outputIndexes = {1}
1067             },
1068         .minSupportedVersion = TestHalVersion::UNKNOWN,
1069         .referenced = {}
1070     };
1071     return model;
1072 }
1073 
1074 const auto dummy_test_model_float32_to_float32_relaxed = TestModelManager::get().add("cast_float32_to_float32_relaxed", get_test_model_float32_to_float32_relaxed());
1075 
1076 }  // namespace generated_tests::cast
1077 
1078 namespace generated_tests::cast {
1079 
get_test_model_float32_to_float32_relaxed_all_inputs_as_internal()1080 const TestModel& get_test_model_float32_to_float32_relaxed_all_inputs_as_internal() {
1081     static TestModel model = {
1082         .expectFailure = false,
1083         .expectedMultinomialDistributionTolerance = 0,
1084         .isRelaxed = true,
1085         .main = {
1086                 .inputIndexes = {2},
1087                 .operands = {{ // input01
1088                             .channelQuant = {},
1089                             .data = TestBuffer::createFromVector<float>({}),
1090                             .dimensions = {2, 3},
1091                             .isIgnored = false,
1092                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
1093                             .numberOfConsumers = 1,
1094                             .scale = 0.0f,
1095                             .type = TestOperandType::TENSOR_FLOAT32,
1096                             .zeroPoint = 0
1097                         }, { // output01
1098                             .channelQuant = {},
1099                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
1100                             .dimensions = {2, 3},
1101                             .isIgnored = false,
1102                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1103                             .numberOfConsumers = 0,
1104                             .scale = 0.0f,
1105                             .type = TestOperandType::TENSOR_FLOAT32,
1106                             .zeroPoint = 0
1107                         }, { // input01_new
1108                             .channelQuant = {},
1109                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
1110                             .dimensions = {2, 3},
1111                             .isIgnored = false,
1112                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1113                             .numberOfConsumers = 1,
1114                             .scale = 0.0f,
1115                             .type = TestOperandType::TENSOR_FLOAT32,
1116                             .zeroPoint = 0
1117                         }, { // placeholder8
1118                             .channelQuant = {},
1119                             .data = TestBuffer::createFromVector<float>({0.0f}),
1120                             .dimensions = {1},
1121                             .isIgnored = false,
1122                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1123                             .numberOfConsumers = 1,
1124                             .scale = 0.0f,
1125                             .type = TestOperandType::TENSOR_FLOAT32,
1126                             .zeroPoint = 0
1127                         }, { // param8
1128                             .channelQuant = {},
1129                             .data = TestBuffer::createFromVector<int32_t>({0}),
1130                             .dimensions = {},
1131                             .isIgnored = false,
1132                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1133                             .numberOfConsumers = 1,
1134                             .scale = 0.0f,
1135                             .type = TestOperandType::INT32,
1136                             .zeroPoint = 0
1137                         }},
1138                 .operations = {{
1139                             .inputs = {2, 3, 4},
1140                             .outputs = {0},
1141                             .type = TestOperationType::ADD
1142                         }, {
1143                             .inputs = {0},
1144                             .outputs = {1},
1145                             .type = TestOperationType::CAST
1146                         }},
1147                 .outputIndexes = {1}
1148             },
1149         .minSupportedVersion = TestHalVersion::UNKNOWN,
1150         .referenced = {}
1151     };
1152     return model;
1153 }
1154 
1155 const auto dummy_test_model_float32_to_float32_relaxed_all_inputs_as_internal = TestModelManager::get().add("cast_float32_to_float32_relaxed_all_inputs_as_internal", get_test_model_float32_to_float32_relaxed_all_inputs_as_internal());
1156 
1157 }  // namespace generated_tests::cast
1158 
1159 namespace generated_tests::cast {
1160 
get_test_model_float32_to_int32()1161 const TestModel& get_test_model_float32_to_int32() {
1162     static TestModel model = {
1163         .expectFailure = false,
1164         .expectedMultinomialDistributionTolerance = 0,
1165         .isRelaxed = false,
1166         .main = {
1167                 .inputIndexes = {0},
1168                 .operands = {{ // input01
1169                             .channelQuant = {},
1170                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
1171                             .dimensions = {2, 3},
1172                             .isIgnored = false,
1173                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1174                             .numberOfConsumers = 1,
1175                             .scale = 0.0f,
1176                             .type = TestOperandType::TENSOR_FLOAT32,
1177                             .zeroPoint = 0
1178                         }, { // output02
1179                             .channelQuant = {},
1180                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6}),
1181                             .dimensions = {2, 3},
1182                             .isIgnored = false,
1183                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1184                             .numberOfConsumers = 0,
1185                             .scale = 0.0f,
1186                             .type = TestOperandType::TENSOR_INT32,
1187                             .zeroPoint = 0
1188                         }},
1189                 .operations = {{
1190                             .inputs = {0},
1191                             .outputs = {1},
1192                             .type = TestOperationType::CAST
1193                         }},
1194                 .outputIndexes = {1}
1195             },
1196         .minSupportedVersion = TestHalVersion::V1_2,
1197         .referenced = {}
1198     };
1199     return model;
1200 }
1201 
1202 const auto dummy_test_model_float32_to_int32 = TestModelManager::get().add("cast_float32_to_int32", get_test_model_float32_to_int32());
1203 
1204 }  // namespace generated_tests::cast
1205 
1206 namespace generated_tests::cast {
1207 
get_test_model_float32_to_int32_all_inputs_as_internal()1208 const TestModel& get_test_model_float32_to_int32_all_inputs_as_internal() {
1209     static TestModel model = {
1210         .expectFailure = false,
1211         .expectedMultinomialDistributionTolerance = 0,
1212         .isRelaxed = false,
1213         .main = {
1214                 .inputIndexes = {2},
1215                 .operands = {{ // input01
1216                             .channelQuant = {},
1217                             .data = TestBuffer::createFromVector<float>({}),
1218                             .dimensions = {2, 3},
1219                             .isIgnored = false,
1220                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
1221                             .numberOfConsumers = 1,
1222                             .scale = 0.0f,
1223                             .type = TestOperandType::TENSOR_FLOAT32,
1224                             .zeroPoint = 0
1225                         }, { // output02
1226                             .channelQuant = {},
1227                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6}),
1228                             .dimensions = {2, 3},
1229                             .isIgnored = false,
1230                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1231                             .numberOfConsumers = 0,
1232                             .scale = 0.0f,
1233                             .type = TestOperandType::TENSOR_INT32,
1234                             .zeroPoint = 0
1235                         }, { // input01_new
1236                             .channelQuant = {},
1237                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
1238                             .dimensions = {2, 3},
1239                             .isIgnored = false,
1240                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1241                             .numberOfConsumers = 1,
1242                             .scale = 0.0f,
1243                             .type = TestOperandType::TENSOR_FLOAT32,
1244                             .zeroPoint = 0
1245                         }, { // placeholder9
1246                             .channelQuant = {},
1247                             .data = TestBuffer::createFromVector<float>({0.0f}),
1248                             .dimensions = {1},
1249                             .isIgnored = false,
1250                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1251                             .numberOfConsumers = 1,
1252                             .scale = 0.0f,
1253                             .type = TestOperandType::TENSOR_FLOAT32,
1254                             .zeroPoint = 0
1255                         }, { // param9
1256                             .channelQuant = {},
1257                             .data = TestBuffer::createFromVector<int32_t>({0}),
1258                             .dimensions = {},
1259                             .isIgnored = false,
1260                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1261                             .numberOfConsumers = 1,
1262                             .scale = 0.0f,
1263                             .type = TestOperandType::INT32,
1264                             .zeroPoint = 0
1265                         }},
1266                 .operations = {{
1267                             .inputs = {2, 3, 4},
1268                             .outputs = {0},
1269                             .type = TestOperationType::ADD
1270                         }, {
1271                             .inputs = {0},
1272                             .outputs = {1},
1273                             .type = TestOperationType::CAST
1274                         }},
1275                 .outputIndexes = {1}
1276             },
1277         .minSupportedVersion = TestHalVersion::V1_2,
1278         .referenced = {}
1279     };
1280     return model;
1281 }
1282 
1283 const auto dummy_test_model_float32_to_int32_all_inputs_as_internal = TestModelManager::get().add("cast_float32_to_int32_all_inputs_as_internal", get_test_model_float32_to_int32_all_inputs_as_internal());
1284 
1285 }  // namespace generated_tests::cast
1286 
1287 namespace generated_tests::cast {
1288 
get_test_model_float32_to_int32_relaxed()1289 const TestModel& get_test_model_float32_to_int32_relaxed() {
1290     static TestModel model = {
1291         .expectFailure = false,
1292         .expectedMultinomialDistributionTolerance = 0,
1293         .isRelaxed = true,
1294         .main = {
1295                 .inputIndexes = {0},
1296                 .operands = {{ // input01
1297                             .channelQuant = {},
1298                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
1299                             .dimensions = {2, 3},
1300                             .isIgnored = false,
1301                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1302                             .numberOfConsumers = 1,
1303                             .scale = 0.0f,
1304                             .type = TestOperandType::TENSOR_FLOAT32,
1305                             .zeroPoint = 0
1306                         }, { // output02
1307                             .channelQuant = {},
1308                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6}),
1309                             .dimensions = {2, 3},
1310                             .isIgnored = false,
1311                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1312                             .numberOfConsumers = 0,
1313                             .scale = 0.0f,
1314                             .type = TestOperandType::TENSOR_INT32,
1315                             .zeroPoint = 0
1316                         }},
1317                 .operations = {{
1318                             .inputs = {0},
1319                             .outputs = {1},
1320                             .type = TestOperationType::CAST
1321                         }},
1322                 .outputIndexes = {1}
1323             },
1324         .minSupportedVersion = TestHalVersion::UNKNOWN,
1325         .referenced = {}
1326     };
1327     return model;
1328 }
1329 
1330 const auto dummy_test_model_float32_to_int32_relaxed = TestModelManager::get().add("cast_float32_to_int32_relaxed", get_test_model_float32_to_int32_relaxed());
1331 
1332 }  // namespace generated_tests::cast
1333 
1334 namespace generated_tests::cast {
1335 
get_test_model_float32_to_int32_relaxed_all_inputs_as_internal()1336 const TestModel& get_test_model_float32_to_int32_relaxed_all_inputs_as_internal() {
1337     static TestModel model = {
1338         .expectFailure = false,
1339         .expectedMultinomialDistributionTolerance = 0,
1340         .isRelaxed = true,
1341         .main = {
1342                 .inputIndexes = {2},
1343                 .operands = {{ // input01
1344                             .channelQuant = {},
1345                             .data = TestBuffer::createFromVector<float>({}),
1346                             .dimensions = {2, 3},
1347                             .isIgnored = false,
1348                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
1349                             .numberOfConsumers = 1,
1350                             .scale = 0.0f,
1351                             .type = TestOperandType::TENSOR_FLOAT32,
1352                             .zeroPoint = 0
1353                         }, { // output02
1354                             .channelQuant = {},
1355                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6}),
1356                             .dimensions = {2, 3},
1357                             .isIgnored = false,
1358                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1359                             .numberOfConsumers = 0,
1360                             .scale = 0.0f,
1361                             .type = TestOperandType::TENSOR_INT32,
1362                             .zeroPoint = 0
1363                         }, { // input01_new
1364                             .channelQuant = {},
1365                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
1366                             .dimensions = {2, 3},
1367                             .isIgnored = false,
1368                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1369                             .numberOfConsumers = 1,
1370                             .scale = 0.0f,
1371                             .type = TestOperandType::TENSOR_FLOAT32,
1372                             .zeroPoint = 0
1373                         }, { // placeholder10
1374                             .channelQuant = {},
1375                             .data = TestBuffer::createFromVector<float>({0.0f}),
1376                             .dimensions = {1},
1377                             .isIgnored = false,
1378                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1379                             .numberOfConsumers = 1,
1380                             .scale = 0.0f,
1381                             .type = TestOperandType::TENSOR_FLOAT32,
1382                             .zeroPoint = 0
1383                         }, { // param10
1384                             .channelQuant = {},
1385                             .data = TestBuffer::createFromVector<int32_t>({0}),
1386                             .dimensions = {},
1387                             .isIgnored = false,
1388                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1389                             .numberOfConsumers = 1,
1390                             .scale = 0.0f,
1391                             .type = TestOperandType::INT32,
1392                             .zeroPoint = 0
1393                         }},
1394                 .operations = {{
1395                             .inputs = {2, 3, 4},
1396                             .outputs = {0},
1397                             .type = TestOperationType::ADD
1398                         }, {
1399                             .inputs = {0},
1400                             .outputs = {1},
1401                             .type = TestOperationType::CAST
1402                         }},
1403                 .outputIndexes = {1}
1404             },
1405         .minSupportedVersion = TestHalVersion::UNKNOWN,
1406         .referenced = {}
1407     };
1408     return model;
1409 }
1410 
1411 const auto dummy_test_model_float32_to_int32_relaxed_all_inputs_as_internal = TestModelManager::get().add("cast_float32_to_int32_relaxed_all_inputs_as_internal", get_test_model_float32_to_int32_relaxed_all_inputs_as_internal());
1412 
1413 }  // namespace generated_tests::cast
1414 
1415 namespace generated_tests::cast {
1416 
get_test_model_float32_to_quant8()1417 const TestModel& get_test_model_float32_to_quant8() {
1418     static TestModel model = {
1419         .expectFailure = false,
1420         .expectedMultinomialDistributionTolerance = 0,
1421         .isRelaxed = false,
1422         .main = {
1423                 .inputIndexes = {0},
1424                 .operands = {{ // input01
1425                             .channelQuant = {},
1426                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
1427                             .dimensions = {2, 3},
1428                             .isIgnored = false,
1429                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1430                             .numberOfConsumers = 1,
1431                             .scale = 0.0f,
1432                             .type = TestOperandType::TENSOR_FLOAT32,
1433                             .zeroPoint = 0
1434                         }, { // output03
1435                             .channelQuant = {},
1436                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}),
1437                             .dimensions = {2, 3},
1438                             .isIgnored = false,
1439                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1440                             .numberOfConsumers = 0,
1441                             .scale = 4.0f,
1442                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
1443                             .zeroPoint = 100
1444                         }},
1445                 .operations = {{
1446                             .inputs = {0},
1447                             .outputs = {1},
1448                             .type = TestOperationType::CAST
1449                         }},
1450                 .outputIndexes = {1}
1451             },
1452         .minSupportedVersion = TestHalVersion::V1_2,
1453         .referenced = {}
1454     };
1455     return model;
1456 }
1457 
1458 const auto dummy_test_model_float32_to_quant8 = TestModelManager::get().add("cast_float32_to_quant8", get_test_model_float32_to_quant8());
1459 
1460 }  // namespace generated_tests::cast
1461 
1462 namespace generated_tests::cast {
1463 
get_test_model_float32_to_quant8_all_inputs_as_internal()1464 const TestModel& get_test_model_float32_to_quant8_all_inputs_as_internal() {
1465     static TestModel model = {
1466         .expectFailure = false,
1467         .expectedMultinomialDistributionTolerance = 0,
1468         .isRelaxed = false,
1469         .main = {
1470                 .inputIndexes = {2},
1471                 .operands = {{ // input01
1472                             .channelQuant = {},
1473                             .data = TestBuffer::createFromVector<float>({}),
1474                             .dimensions = {2, 3},
1475                             .isIgnored = false,
1476                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
1477                             .numberOfConsumers = 1,
1478                             .scale = 0.0f,
1479                             .type = TestOperandType::TENSOR_FLOAT32,
1480                             .zeroPoint = 0
1481                         }, { // output03
1482                             .channelQuant = {},
1483                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}),
1484                             .dimensions = {2, 3},
1485                             .isIgnored = false,
1486                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1487                             .numberOfConsumers = 0,
1488                             .scale = 4.0f,
1489                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
1490                             .zeroPoint = 100
1491                         }, { // input01_new
1492                             .channelQuant = {},
1493                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
1494                             .dimensions = {2, 3},
1495                             .isIgnored = false,
1496                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1497                             .numberOfConsumers = 1,
1498                             .scale = 0.0f,
1499                             .type = TestOperandType::TENSOR_FLOAT32,
1500                             .zeroPoint = 0
1501                         }, { // placeholder11
1502                             .channelQuant = {},
1503                             .data = TestBuffer::createFromVector<float>({0.0f}),
1504                             .dimensions = {1},
1505                             .isIgnored = false,
1506                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1507                             .numberOfConsumers = 1,
1508                             .scale = 0.0f,
1509                             .type = TestOperandType::TENSOR_FLOAT32,
1510                             .zeroPoint = 0
1511                         }, { // param11
1512                             .channelQuant = {},
1513                             .data = TestBuffer::createFromVector<int32_t>({0}),
1514                             .dimensions = {},
1515                             .isIgnored = false,
1516                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1517                             .numberOfConsumers = 1,
1518                             .scale = 0.0f,
1519                             .type = TestOperandType::INT32,
1520                             .zeroPoint = 0
1521                         }},
1522                 .operations = {{
1523                             .inputs = {2, 3, 4},
1524                             .outputs = {0},
1525                             .type = TestOperationType::ADD
1526                         }, {
1527                             .inputs = {0},
1528                             .outputs = {1},
1529                             .type = TestOperationType::CAST
1530                         }},
1531                 .outputIndexes = {1}
1532             },
1533         .minSupportedVersion = TestHalVersion::V1_2,
1534         .referenced = {}
1535     };
1536     return model;
1537 }
1538 
1539 const auto dummy_test_model_float32_to_quant8_all_inputs_as_internal = TestModelManager::get().add("cast_float32_to_quant8_all_inputs_as_internal", get_test_model_float32_to_quant8_all_inputs_as_internal());
1540 
1541 }  // namespace generated_tests::cast
1542 
1543 namespace generated_tests::cast {
1544 
get_test_model_float32_to_quant8_relaxed()1545 const TestModel& get_test_model_float32_to_quant8_relaxed() {
1546     static TestModel model = {
1547         .expectFailure = false,
1548         .expectedMultinomialDistributionTolerance = 0,
1549         .isRelaxed = true,
1550         .main = {
1551                 .inputIndexes = {0},
1552                 .operands = {{ // input01
1553                             .channelQuant = {},
1554                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
1555                             .dimensions = {2, 3},
1556                             .isIgnored = false,
1557                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1558                             .numberOfConsumers = 1,
1559                             .scale = 0.0f,
1560                             .type = TestOperandType::TENSOR_FLOAT32,
1561                             .zeroPoint = 0
1562                         }, { // output03
1563                             .channelQuant = {},
1564                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}),
1565                             .dimensions = {2, 3},
1566                             .isIgnored = false,
1567                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1568                             .numberOfConsumers = 0,
1569                             .scale = 4.0f,
1570                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
1571                             .zeroPoint = 100
1572                         }},
1573                 .operations = {{
1574                             .inputs = {0},
1575                             .outputs = {1},
1576                             .type = TestOperationType::CAST
1577                         }},
1578                 .outputIndexes = {1}
1579             },
1580         .minSupportedVersion = TestHalVersion::UNKNOWN,
1581         .referenced = {}
1582     };
1583     return model;
1584 }
1585 
1586 const auto dummy_test_model_float32_to_quant8_relaxed = TestModelManager::get().add("cast_float32_to_quant8_relaxed", get_test_model_float32_to_quant8_relaxed());
1587 
1588 }  // namespace generated_tests::cast
1589 
1590 namespace generated_tests::cast {
1591 
get_test_model_float32_to_quant8_relaxed_all_inputs_as_internal()1592 const TestModel& get_test_model_float32_to_quant8_relaxed_all_inputs_as_internal() {
1593     static TestModel model = {
1594         .expectFailure = false,
1595         .expectedMultinomialDistributionTolerance = 0,
1596         .isRelaxed = true,
1597         .main = {
1598                 .inputIndexes = {2},
1599                 .operands = {{ // input01
1600                             .channelQuant = {},
1601                             .data = TestBuffer::createFromVector<float>({}),
1602                             .dimensions = {2, 3},
1603                             .isIgnored = false,
1604                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
1605                             .numberOfConsumers = 1,
1606                             .scale = 0.0f,
1607                             .type = TestOperandType::TENSOR_FLOAT32,
1608                             .zeroPoint = 0
1609                         }, { // output03
1610                             .channelQuant = {},
1611                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}),
1612                             .dimensions = {2, 3},
1613                             .isIgnored = false,
1614                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1615                             .numberOfConsumers = 0,
1616                             .scale = 4.0f,
1617                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
1618                             .zeroPoint = 100
1619                         }, { // input01_new
1620                             .channelQuant = {},
1621                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
1622                             .dimensions = {2, 3},
1623                             .isIgnored = false,
1624                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1625                             .numberOfConsumers = 1,
1626                             .scale = 0.0f,
1627                             .type = TestOperandType::TENSOR_FLOAT32,
1628                             .zeroPoint = 0
1629                         }, { // placeholder12
1630                             .channelQuant = {},
1631                             .data = TestBuffer::createFromVector<float>({0.0f}),
1632                             .dimensions = {1},
1633                             .isIgnored = false,
1634                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1635                             .numberOfConsumers = 1,
1636                             .scale = 0.0f,
1637                             .type = TestOperandType::TENSOR_FLOAT32,
1638                             .zeroPoint = 0
1639                         }, { // param12
1640                             .channelQuant = {},
1641                             .data = TestBuffer::createFromVector<int32_t>({0}),
1642                             .dimensions = {},
1643                             .isIgnored = false,
1644                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1645                             .numberOfConsumers = 1,
1646                             .scale = 0.0f,
1647                             .type = TestOperandType::INT32,
1648                             .zeroPoint = 0
1649                         }},
1650                 .operations = {{
1651                             .inputs = {2, 3, 4},
1652                             .outputs = {0},
1653                             .type = TestOperationType::ADD
1654                         }, {
1655                             .inputs = {0},
1656                             .outputs = {1},
1657                             .type = TestOperationType::CAST
1658                         }},
1659                 .outputIndexes = {1}
1660             },
1661         .minSupportedVersion = TestHalVersion::UNKNOWN,
1662         .referenced = {}
1663     };
1664     return model;
1665 }
1666 
1667 const auto dummy_test_model_float32_to_quant8_relaxed_all_inputs_as_internal = TestModelManager::get().add("cast_float32_to_quant8_relaxed_all_inputs_as_internal", get_test_model_float32_to_quant8_relaxed_all_inputs_as_internal());
1668 
1669 }  // namespace generated_tests::cast
1670 
1671 namespace generated_tests::cast {
1672 
get_test_model_int32_to_float16()1673 const TestModel& get_test_model_int32_to_float16() {
1674     static TestModel model = {
1675         .expectFailure = false,
1676         .expectedMultinomialDistributionTolerance = 0,
1677         .isRelaxed = false,
1678         .main = {
1679                 .inputIndexes = {0},
1680                 .operands = {{ // input02
1681                             .channelQuant = {},
1682                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6}),
1683                             .dimensions = {2, 3},
1684                             .isIgnored = false,
1685                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1686                             .numberOfConsumers = 1,
1687                             .scale = 0.0f,
1688                             .type = TestOperandType::TENSOR_INT32,
1689                             .zeroPoint = 0
1690                         }, { // output0
1691                             .channelQuant = {},
1692                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
1693                             .dimensions = {2, 3},
1694                             .isIgnored = false,
1695                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1696                             .numberOfConsumers = 0,
1697                             .scale = 0.0f,
1698                             .type = TestOperandType::TENSOR_FLOAT16,
1699                             .zeroPoint = 0
1700                         }},
1701                 .operations = {{
1702                             .inputs = {0},
1703                             .outputs = {1},
1704                             .type = TestOperationType::CAST
1705                         }},
1706                 .outputIndexes = {1}
1707             },
1708         .minSupportedVersion = TestHalVersion::V1_2,
1709         .referenced = {}
1710     };
1711     return model;
1712 }
1713 
1714 const auto dummy_test_model_int32_to_float16 = TestModelManager::get().add("cast_int32_to_float16", get_test_model_int32_to_float16());
1715 
1716 }  // namespace generated_tests::cast
1717 
1718 namespace generated_tests::cast {
1719 
get_test_model_int32_to_float32()1720 const TestModel& get_test_model_int32_to_float32() {
1721     static TestModel model = {
1722         .expectFailure = false,
1723         .expectedMultinomialDistributionTolerance = 0,
1724         .isRelaxed = false,
1725         .main = {
1726                 .inputIndexes = {0},
1727                 .operands = {{ // input02
1728                             .channelQuant = {},
1729                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6}),
1730                             .dimensions = {2, 3},
1731                             .isIgnored = false,
1732                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1733                             .numberOfConsumers = 1,
1734                             .scale = 0.0f,
1735                             .type = TestOperandType::TENSOR_INT32,
1736                             .zeroPoint = 0
1737                         }, { // output01
1738                             .channelQuant = {},
1739                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
1740                             .dimensions = {2, 3},
1741                             .isIgnored = false,
1742                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1743                             .numberOfConsumers = 0,
1744                             .scale = 0.0f,
1745                             .type = TestOperandType::TENSOR_FLOAT32,
1746                             .zeroPoint = 0
1747                         }},
1748                 .operations = {{
1749                             .inputs = {0},
1750                             .outputs = {1},
1751                             .type = TestOperationType::CAST
1752                         }},
1753                 .outputIndexes = {1}
1754             },
1755         .minSupportedVersion = TestHalVersion::V1_2,
1756         .referenced = {}
1757     };
1758     return model;
1759 }
1760 
1761 const auto dummy_test_model_int32_to_float32 = TestModelManager::get().add("cast_int32_to_float32", get_test_model_int32_to_float32());
1762 
1763 }  // namespace generated_tests::cast
1764 
1765 namespace generated_tests::cast {
1766 
get_test_model_int32_to_float32_relaxed()1767 const TestModel& get_test_model_int32_to_float32_relaxed() {
1768     static TestModel model = {
1769         .expectFailure = false,
1770         .expectedMultinomialDistributionTolerance = 0,
1771         .isRelaxed = true,
1772         .main = {
1773                 .inputIndexes = {0},
1774                 .operands = {{ // input02
1775                             .channelQuant = {},
1776                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6}),
1777                             .dimensions = {2, 3},
1778                             .isIgnored = false,
1779                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1780                             .numberOfConsumers = 1,
1781                             .scale = 0.0f,
1782                             .type = TestOperandType::TENSOR_INT32,
1783                             .zeroPoint = 0
1784                         }, { // output01
1785                             .channelQuant = {},
1786                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
1787                             .dimensions = {2, 3},
1788                             .isIgnored = false,
1789                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1790                             .numberOfConsumers = 0,
1791                             .scale = 0.0f,
1792                             .type = TestOperandType::TENSOR_FLOAT32,
1793                             .zeroPoint = 0
1794                         }},
1795                 .operations = {{
1796                             .inputs = {0},
1797                             .outputs = {1},
1798                             .type = TestOperationType::CAST
1799                         }},
1800                 .outputIndexes = {1}
1801             },
1802         .minSupportedVersion = TestHalVersion::UNKNOWN,
1803         .referenced = {}
1804     };
1805     return model;
1806 }
1807 
1808 const auto dummy_test_model_int32_to_float32_relaxed = TestModelManager::get().add("cast_int32_to_float32_relaxed", get_test_model_int32_to_float32_relaxed());
1809 
1810 }  // namespace generated_tests::cast
1811 
1812 namespace generated_tests::cast {
1813 
get_test_model_int32_to_int32()1814 const TestModel& get_test_model_int32_to_int32() {
1815     static TestModel model = {
1816         .expectFailure = false,
1817         .expectedMultinomialDistributionTolerance = 0,
1818         .isRelaxed = false,
1819         .main = {
1820                 .inputIndexes = {0},
1821                 .operands = {{ // input02
1822                             .channelQuant = {},
1823                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6}),
1824                             .dimensions = {2, 3},
1825                             .isIgnored = false,
1826                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1827                             .numberOfConsumers = 1,
1828                             .scale = 0.0f,
1829                             .type = TestOperandType::TENSOR_INT32,
1830                             .zeroPoint = 0
1831                         }, { // output02
1832                             .channelQuant = {},
1833                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6}),
1834                             .dimensions = {2, 3},
1835                             .isIgnored = false,
1836                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1837                             .numberOfConsumers = 0,
1838                             .scale = 0.0f,
1839                             .type = TestOperandType::TENSOR_INT32,
1840                             .zeroPoint = 0
1841                         }},
1842                 .operations = {{
1843                             .inputs = {0},
1844                             .outputs = {1},
1845                             .type = TestOperationType::CAST
1846                         }},
1847                 .outputIndexes = {1}
1848             },
1849         .minSupportedVersion = TestHalVersion::V1_2,
1850         .referenced = {}
1851     };
1852     return model;
1853 }
1854 
1855 const auto dummy_test_model_int32_to_int32 = TestModelManager::get().add("cast_int32_to_int32", get_test_model_int32_to_int32());
1856 
1857 }  // namespace generated_tests::cast
1858 
1859 namespace generated_tests::cast {
1860 
get_test_model_int32_to_quant8()1861 const TestModel& get_test_model_int32_to_quant8() {
1862     static TestModel model = {
1863         .expectFailure = false,
1864         .expectedMultinomialDistributionTolerance = 0,
1865         .isRelaxed = false,
1866         .main = {
1867                 .inputIndexes = {0},
1868                 .operands = {{ // input02
1869                             .channelQuant = {},
1870                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6}),
1871                             .dimensions = {2, 3},
1872                             .isIgnored = false,
1873                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1874                             .numberOfConsumers = 1,
1875                             .scale = 0.0f,
1876                             .type = TestOperandType::TENSOR_INT32,
1877                             .zeroPoint = 0
1878                         }, { // output03
1879                             .channelQuant = {},
1880                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}),
1881                             .dimensions = {2, 3},
1882                             .isIgnored = false,
1883                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1884                             .numberOfConsumers = 0,
1885                             .scale = 4.0f,
1886                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
1887                             .zeroPoint = 100
1888                         }},
1889                 .operations = {{
1890                             .inputs = {0},
1891                             .outputs = {1},
1892                             .type = TestOperationType::CAST
1893                         }},
1894                 .outputIndexes = {1}
1895             },
1896         .minSupportedVersion = TestHalVersion::V1_2,
1897         .referenced = {}
1898     };
1899     return model;
1900 }
1901 
1902 const auto dummy_test_model_int32_to_quant8 = TestModelManager::get().add("cast_int32_to_quant8", get_test_model_int32_to_quant8());
1903 
1904 }  // namespace generated_tests::cast
1905 
1906 namespace generated_tests::cast {
1907 
get_test_model_quant8_to_float16()1908 const TestModel& get_test_model_quant8_to_float16() {
1909     static TestModel model = {
1910         .expectFailure = false,
1911         .expectedMultinomialDistributionTolerance = 0,
1912         .isRelaxed = false,
1913         .main = {
1914                 .inputIndexes = {0},
1915                 .operands = {{ // input03
1916                             .channelQuant = {},
1917                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}),
1918                             .dimensions = {2, 3},
1919                             .isIgnored = false,
1920                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1921                             .numberOfConsumers = 1,
1922                             .scale = 4.0f,
1923                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
1924                             .zeroPoint = 100
1925                         }, { // output0
1926                             .channelQuant = {},
1927                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
1928                             .dimensions = {2, 3},
1929                             .isIgnored = false,
1930                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1931                             .numberOfConsumers = 0,
1932                             .scale = 0.0f,
1933                             .type = TestOperandType::TENSOR_FLOAT16,
1934                             .zeroPoint = 0
1935                         }},
1936                 .operations = {{
1937                             .inputs = {0},
1938                             .outputs = {1},
1939                             .type = TestOperationType::CAST
1940                         }},
1941                 .outputIndexes = {1}
1942             },
1943         .minSupportedVersion = TestHalVersion::V1_2,
1944         .referenced = {}
1945     };
1946     return model;
1947 }
1948 
1949 const auto dummy_test_model_quant8_to_float16 = TestModelManager::get().add("cast_quant8_to_float16", get_test_model_quant8_to_float16());
1950 
1951 }  // namespace generated_tests::cast
1952 
1953 namespace generated_tests::cast {
1954 
get_test_model_quant8_to_float16_all_inputs_as_internal()1955 const TestModel& get_test_model_quant8_to_float16_all_inputs_as_internal() {
1956     static TestModel model = {
1957         .expectFailure = false,
1958         .expectedMultinomialDistributionTolerance = 0,
1959         .isRelaxed = false,
1960         .main = {
1961                 .inputIndexes = {2},
1962                 .operands = {{ // input03
1963                             .channelQuant = {},
1964                             .data = TestBuffer::createFromVector<uint8_t>({}),
1965                             .dimensions = {2, 3},
1966                             .isIgnored = false,
1967                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
1968                             .numberOfConsumers = 1,
1969                             .scale = 4.0f,
1970                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
1971                             .zeroPoint = 100
1972                         }, { // output0
1973                             .channelQuant = {},
1974                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
1975                             .dimensions = {2, 3},
1976                             .isIgnored = false,
1977                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1978                             .numberOfConsumers = 0,
1979                             .scale = 0.0f,
1980                             .type = TestOperandType::TENSOR_FLOAT16,
1981                             .zeroPoint = 0
1982                         }, { // input03_new
1983                             .channelQuant = {},
1984                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}),
1985                             .dimensions = {2, 3},
1986                             .isIgnored = false,
1987                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1988                             .numberOfConsumers = 1,
1989                             .scale = 4.0f,
1990                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
1991                             .zeroPoint = 100
1992                         }, { // placeholder13
1993                             .channelQuant = {},
1994                             .data = TestBuffer::createFromVector<uint8_t>({100}),
1995                             .dimensions = {1},
1996                             .isIgnored = false,
1997                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1998                             .numberOfConsumers = 1,
1999                             .scale = 4.0f,
2000                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2001                             .zeroPoint = 100
2002                         }, { // param13
2003                             .channelQuant = {},
2004                             .data = TestBuffer::createFromVector<int32_t>({0}),
2005                             .dimensions = {},
2006                             .isIgnored = false,
2007                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2008                             .numberOfConsumers = 1,
2009                             .scale = 0.0f,
2010                             .type = TestOperandType::INT32,
2011                             .zeroPoint = 0
2012                         }},
2013                 .operations = {{
2014                             .inputs = {2, 3, 4},
2015                             .outputs = {0},
2016                             .type = TestOperationType::ADD
2017                         }, {
2018                             .inputs = {0},
2019                             .outputs = {1},
2020                             .type = TestOperationType::CAST
2021                         }},
2022                 .outputIndexes = {1}
2023             },
2024         .minSupportedVersion = TestHalVersion::V1_2,
2025         .referenced = {}
2026     };
2027     return model;
2028 }
2029 
2030 const auto dummy_test_model_quant8_to_float16_all_inputs_as_internal = TestModelManager::get().add("cast_quant8_to_float16_all_inputs_as_internal", get_test_model_quant8_to_float16_all_inputs_as_internal());
2031 
2032 }  // namespace generated_tests::cast
2033 
2034 namespace generated_tests::cast {
2035 
get_test_model_quant8_to_float32()2036 const TestModel& get_test_model_quant8_to_float32() {
2037     static TestModel model = {
2038         .expectFailure = false,
2039         .expectedMultinomialDistributionTolerance = 0,
2040         .isRelaxed = false,
2041         .main = {
2042                 .inputIndexes = {0},
2043                 .operands = {{ // input03
2044                             .channelQuant = {},
2045                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}),
2046                             .dimensions = {2, 3},
2047                             .isIgnored = false,
2048                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2049                             .numberOfConsumers = 1,
2050                             .scale = 4.0f,
2051                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2052                             .zeroPoint = 100
2053                         }, { // output01
2054                             .channelQuant = {},
2055                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
2056                             .dimensions = {2, 3},
2057                             .isIgnored = false,
2058                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2059                             .numberOfConsumers = 0,
2060                             .scale = 0.0f,
2061                             .type = TestOperandType::TENSOR_FLOAT32,
2062                             .zeroPoint = 0
2063                         }},
2064                 .operations = {{
2065                             .inputs = {0},
2066                             .outputs = {1},
2067                             .type = TestOperationType::CAST
2068                         }},
2069                 .outputIndexes = {1}
2070             },
2071         .minSupportedVersion = TestHalVersion::V1_2,
2072         .referenced = {}
2073     };
2074     return model;
2075 }
2076 
2077 const auto dummy_test_model_quant8_to_float32 = TestModelManager::get().add("cast_quant8_to_float32", get_test_model_quant8_to_float32());
2078 
2079 }  // namespace generated_tests::cast
2080 
2081 namespace generated_tests::cast {
2082 
get_test_model_quant8_to_float32_all_inputs_as_internal()2083 const TestModel& get_test_model_quant8_to_float32_all_inputs_as_internal() {
2084     static TestModel model = {
2085         .expectFailure = false,
2086         .expectedMultinomialDistributionTolerance = 0,
2087         .isRelaxed = false,
2088         .main = {
2089                 .inputIndexes = {2},
2090                 .operands = {{ // input03
2091                             .channelQuant = {},
2092                             .data = TestBuffer::createFromVector<uint8_t>({}),
2093                             .dimensions = {2, 3},
2094                             .isIgnored = false,
2095                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
2096                             .numberOfConsumers = 1,
2097                             .scale = 4.0f,
2098                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2099                             .zeroPoint = 100
2100                         }, { // output01
2101                             .channelQuant = {},
2102                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
2103                             .dimensions = {2, 3},
2104                             .isIgnored = false,
2105                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2106                             .numberOfConsumers = 0,
2107                             .scale = 0.0f,
2108                             .type = TestOperandType::TENSOR_FLOAT32,
2109                             .zeroPoint = 0
2110                         }, { // input03_new
2111                             .channelQuant = {},
2112                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}),
2113                             .dimensions = {2, 3},
2114                             .isIgnored = false,
2115                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2116                             .numberOfConsumers = 1,
2117                             .scale = 4.0f,
2118                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2119                             .zeroPoint = 100
2120                         }, { // placeholder14
2121                             .channelQuant = {},
2122                             .data = TestBuffer::createFromVector<uint8_t>({100}),
2123                             .dimensions = {1},
2124                             .isIgnored = false,
2125                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2126                             .numberOfConsumers = 1,
2127                             .scale = 4.0f,
2128                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2129                             .zeroPoint = 100
2130                         }, { // param14
2131                             .channelQuant = {},
2132                             .data = TestBuffer::createFromVector<int32_t>({0}),
2133                             .dimensions = {},
2134                             .isIgnored = false,
2135                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2136                             .numberOfConsumers = 1,
2137                             .scale = 0.0f,
2138                             .type = TestOperandType::INT32,
2139                             .zeroPoint = 0
2140                         }},
2141                 .operations = {{
2142                             .inputs = {2, 3, 4},
2143                             .outputs = {0},
2144                             .type = TestOperationType::ADD
2145                         }, {
2146                             .inputs = {0},
2147                             .outputs = {1},
2148                             .type = TestOperationType::CAST
2149                         }},
2150                 .outputIndexes = {1}
2151             },
2152         .minSupportedVersion = TestHalVersion::V1_2,
2153         .referenced = {}
2154     };
2155     return model;
2156 }
2157 
2158 const auto dummy_test_model_quant8_to_float32_all_inputs_as_internal = TestModelManager::get().add("cast_quant8_to_float32_all_inputs_as_internal", get_test_model_quant8_to_float32_all_inputs_as_internal());
2159 
2160 }  // namespace generated_tests::cast
2161 
2162 namespace generated_tests::cast {
2163 
get_test_model_quant8_to_float32_relaxed()2164 const TestModel& get_test_model_quant8_to_float32_relaxed() {
2165     static TestModel model = {
2166         .expectFailure = false,
2167         .expectedMultinomialDistributionTolerance = 0,
2168         .isRelaxed = true,
2169         .main = {
2170                 .inputIndexes = {0},
2171                 .operands = {{ // input03
2172                             .channelQuant = {},
2173                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}),
2174                             .dimensions = {2, 3},
2175                             .isIgnored = false,
2176                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2177                             .numberOfConsumers = 1,
2178                             .scale = 4.0f,
2179                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2180                             .zeroPoint = 100
2181                         }, { // output01
2182                             .channelQuant = {},
2183                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
2184                             .dimensions = {2, 3},
2185                             .isIgnored = false,
2186                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2187                             .numberOfConsumers = 0,
2188                             .scale = 0.0f,
2189                             .type = TestOperandType::TENSOR_FLOAT32,
2190                             .zeroPoint = 0
2191                         }},
2192                 .operations = {{
2193                             .inputs = {0},
2194                             .outputs = {1},
2195                             .type = TestOperationType::CAST
2196                         }},
2197                 .outputIndexes = {1}
2198             },
2199         .minSupportedVersion = TestHalVersion::UNKNOWN,
2200         .referenced = {}
2201     };
2202     return model;
2203 }
2204 
2205 const auto dummy_test_model_quant8_to_float32_relaxed = TestModelManager::get().add("cast_quant8_to_float32_relaxed", get_test_model_quant8_to_float32_relaxed());
2206 
2207 }  // namespace generated_tests::cast
2208 
2209 namespace generated_tests::cast {
2210 
get_test_model_quant8_to_float32_relaxed_all_inputs_as_internal()2211 const TestModel& get_test_model_quant8_to_float32_relaxed_all_inputs_as_internal() {
2212     static TestModel model = {
2213         .expectFailure = false,
2214         .expectedMultinomialDistributionTolerance = 0,
2215         .isRelaxed = true,
2216         .main = {
2217                 .inputIndexes = {2},
2218                 .operands = {{ // input03
2219                             .channelQuant = {},
2220                             .data = TestBuffer::createFromVector<uint8_t>({}),
2221                             .dimensions = {2, 3},
2222                             .isIgnored = false,
2223                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
2224                             .numberOfConsumers = 1,
2225                             .scale = 4.0f,
2226                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2227                             .zeroPoint = 100
2228                         }, { // output01
2229                             .channelQuant = {},
2230                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}),
2231                             .dimensions = {2, 3},
2232                             .isIgnored = false,
2233                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2234                             .numberOfConsumers = 0,
2235                             .scale = 0.0f,
2236                             .type = TestOperandType::TENSOR_FLOAT32,
2237                             .zeroPoint = 0
2238                         }, { // input03_new
2239                             .channelQuant = {},
2240                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}),
2241                             .dimensions = {2, 3},
2242                             .isIgnored = false,
2243                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2244                             .numberOfConsumers = 1,
2245                             .scale = 4.0f,
2246                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2247                             .zeroPoint = 100
2248                         }, { // placeholder15
2249                             .channelQuant = {},
2250                             .data = TestBuffer::createFromVector<uint8_t>({100}),
2251                             .dimensions = {1},
2252                             .isIgnored = false,
2253                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2254                             .numberOfConsumers = 1,
2255                             .scale = 4.0f,
2256                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2257                             .zeroPoint = 100
2258                         }, { // param15
2259                             .channelQuant = {},
2260                             .data = TestBuffer::createFromVector<int32_t>({0}),
2261                             .dimensions = {},
2262                             .isIgnored = false,
2263                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2264                             .numberOfConsumers = 1,
2265                             .scale = 0.0f,
2266                             .type = TestOperandType::INT32,
2267                             .zeroPoint = 0
2268                         }},
2269                 .operations = {{
2270                             .inputs = {2, 3, 4},
2271                             .outputs = {0},
2272                             .type = TestOperationType::ADD
2273                         }, {
2274                             .inputs = {0},
2275                             .outputs = {1},
2276                             .type = TestOperationType::CAST
2277                         }},
2278                 .outputIndexes = {1}
2279             },
2280         .minSupportedVersion = TestHalVersion::UNKNOWN,
2281         .referenced = {}
2282     };
2283     return model;
2284 }
2285 
2286 const auto dummy_test_model_quant8_to_float32_relaxed_all_inputs_as_internal = TestModelManager::get().add("cast_quant8_to_float32_relaxed_all_inputs_as_internal", get_test_model_quant8_to_float32_relaxed_all_inputs_as_internal());
2287 
2288 }  // namespace generated_tests::cast
2289 
2290 namespace generated_tests::cast {
2291 
get_test_model_quant8_to_int32()2292 const TestModel& get_test_model_quant8_to_int32() {
2293     static TestModel model = {
2294         .expectFailure = false,
2295         .expectedMultinomialDistributionTolerance = 0,
2296         .isRelaxed = false,
2297         .main = {
2298                 .inputIndexes = {0},
2299                 .operands = {{ // input03
2300                             .channelQuant = {},
2301                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}),
2302                             .dimensions = {2, 3},
2303                             .isIgnored = false,
2304                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2305                             .numberOfConsumers = 1,
2306                             .scale = 4.0f,
2307                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2308                             .zeroPoint = 100
2309                         }, { // output02
2310                             .channelQuant = {},
2311                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6}),
2312                             .dimensions = {2, 3},
2313                             .isIgnored = false,
2314                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2315                             .numberOfConsumers = 0,
2316                             .scale = 0.0f,
2317                             .type = TestOperandType::TENSOR_INT32,
2318                             .zeroPoint = 0
2319                         }},
2320                 .operations = {{
2321                             .inputs = {0},
2322                             .outputs = {1},
2323                             .type = TestOperationType::CAST
2324                         }},
2325                 .outputIndexes = {1}
2326             },
2327         .minSupportedVersion = TestHalVersion::V1_2,
2328         .referenced = {}
2329     };
2330     return model;
2331 }
2332 
2333 const auto dummy_test_model_quant8_to_int32 = TestModelManager::get().add("cast_quant8_to_int32", get_test_model_quant8_to_int32());
2334 
2335 }  // namespace generated_tests::cast
2336 
2337 namespace generated_tests::cast {
2338 
get_test_model_quant8_to_int32_all_inputs_as_internal()2339 const TestModel& get_test_model_quant8_to_int32_all_inputs_as_internal() {
2340     static TestModel model = {
2341         .expectFailure = false,
2342         .expectedMultinomialDistributionTolerance = 0,
2343         .isRelaxed = false,
2344         .main = {
2345                 .inputIndexes = {2},
2346                 .operands = {{ // input03
2347                             .channelQuant = {},
2348                             .data = TestBuffer::createFromVector<uint8_t>({}),
2349                             .dimensions = {2, 3},
2350                             .isIgnored = false,
2351                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
2352                             .numberOfConsumers = 1,
2353                             .scale = 4.0f,
2354                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2355                             .zeroPoint = 100
2356                         }, { // output02
2357                             .channelQuant = {},
2358                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6}),
2359                             .dimensions = {2, 3},
2360                             .isIgnored = false,
2361                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2362                             .numberOfConsumers = 0,
2363                             .scale = 0.0f,
2364                             .type = TestOperandType::TENSOR_INT32,
2365                             .zeroPoint = 0
2366                         }, { // input03_new
2367                             .channelQuant = {},
2368                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}),
2369                             .dimensions = {2, 3},
2370                             .isIgnored = false,
2371                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2372                             .numberOfConsumers = 1,
2373                             .scale = 4.0f,
2374                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2375                             .zeroPoint = 100
2376                         }, { // placeholder16
2377                             .channelQuant = {},
2378                             .data = TestBuffer::createFromVector<uint8_t>({100}),
2379                             .dimensions = {1},
2380                             .isIgnored = false,
2381                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2382                             .numberOfConsumers = 1,
2383                             .scale = 4.0f,
2384                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2385                             .zeroPoint = 100
2386                         }, { // param16
2387                             .channelQuant = {},
2388                             .data = TestBuffer::createFromVector<int32_t>({0}),
2389                             .dimensions = {},
2390                             .isIgnored = false,
2391                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2392                             .numberOfConsumers = 1,
2393                             .scale = 0.0f,
2394                             .type = TestOperandType::INT32,
2395                             .zeroPoint = 0
2396                         }},
2397                 .operations = {{
2398                             .inputs = {2, 3, 4},
2399                             .outputs = {0},
2400                             .type = TestOperationType::ADD
2401                         }, {
2402                             .inputs = {0},
2403                             .outputs = {1},
2404                             .type = TestOperationType::CAST
2405                         }},
2406                 .outputIndexes = {1}
2407             },
2408         .minSupportedVersion = TestHalVersion::V1_2,
2409         .referenced = {}
2410     };
2411     return model;
2412 }
2413 
2414 const auto dummy_test_model_quant8_to_int32_all_inputs_as_internal = TestModelManager::get().add("cast_quant8_to_int32_all_inputs_as_internal", get_test_model_quant8_to_int32_all_inputs_as_internal());
2415 
2416 }  // namespace generated_tests::cast
2417 
2418 namespace generated_tests::cast {
2419 
get_test_model_quant8_to_quant8()2420 const TestModel& get_test_model_quant8_to_quant8() {
2421     static TestModel model = {
2422         .expectFailure = false,
2423         .expectedMultinomialDistributionTolerance = 0,
2424         .isRelaxed = false,
2425         .main = {
2426                 .inputIndexes = {0},
2427                 .operands = {{ // input03
2428                             .channelQuant = {},
2429                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}),
2430                             .dimensions = {2, 3},
2431                             .isIgnored = false,
2432                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2433                             .numberOfConsumers = 1,
2434                             .scale = 4.0f,
2435                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2436                             .zeroPoint = 100
2437                         }, { // output03
2438                             .channelQuant = {},
2439                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}),
2440                             .dimensions = {2, 3},
2441                             .isIgnored = false,
2442                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2443                             .numberOfConsumers = 0,
2444                             .scale = 4.0f,
2445                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2446                             .zeroPoint = 100
2447                         }},
2448                 .operations = {{
2449                             .inputs = {0},
2450                             .outputs = {1},
2451                             .type = TestOperationType::CAST
2452                         }},
2453                 .outputIndexes = {1}
2454             },
2455         .minSupportedVersion = TestHalVersion::V1_2,
2456         .referenced = {}
2457     };
2458     return model;
2459 }
2460 
2461 const auto dummy_test_model_quant8_to_quant8 = TestModelManager::get().add("cast_quant8_to_quant8", get_test_model_quant8_to_quant8());
2462 
2463 }  // namespace generated_tests::cast
2464 
2465 namespace generated_tests::cast {
2466 
get_test_model_quant8_to_quant8_all_inputs_as_internal()2467 const TestModel& get_test_model_quant8_to_quant8_all_inputs_as_internal() {
2468     static TestModel model = {
2469         .expectFailure = false,
2470         .expectedMultinomialDistributionTolerance = 0,
2471         .isRelaxed = false,
2472         .main = {
2473                 .inputIndexes = {2},
2474                 .operands = {{ // input03
2475                             .channelQuant = {},
2476                             .data = TestBuffer::createFromVector<uint8_t>({}),
2477                             .dimensions = {2, 3},
2478                             .isIgnored = false,
2479                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
2480                             .numberOfConsumers = 1,
2481                             .scale = 4.0f,
2482                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2483                             .zeroPoint = 100
2484                         }, { // output03
2485                             .channelQuant = {},
2486                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}),
2487                             .dimensions = {2, 3},
2488                             .isIgnored = false,
2489                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2490                             .numberOfConsumers = 0,
2491                             .scale = 4.0f,
2492                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2493                             .zeroPoint = 100
2494                         }, { // input03_new
2495                             .channelQuant = {},
2496                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}),
2497                             .dimensions = {2, 3},
2498                             .isIgnored = false,
2499                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2500                             .numberOfConsumers = 1,
2501                             .scale = 4.0f,
2502                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2503                             .zeroPoint = 100
2504                         }, { // placeholder17
2505                             .channelQuant = {},
2506                             .data = TestBuffer::createFromVector<uint8_t>({100}),
2507                             .dimensions = {1},
2508                             .isIgnored = false,
2509                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2510                             .numberOfConsumers = 1,
2511                             .scale = 4.0f,
2512                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2513                             .zeroPoint = 100
2514                         }, { // param17
2515                             .channelQuant = {},
2516                             .data = TestBuffer::createFromVector<int32_t>({0}),
2517                             .dimensions = {},
2518                             .isIgnored = false,
2519                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2520                             .numberOfConsumers = 1,
2521                             .scale = 0.0f,
2522                             .type = TestOperandType::INT32,
2523                             .zeroPoint = 0
2524                         }},
2525                 .operations = {{
2526                             .inputs = {2, 3, 4},
2527                             .outputs = {0},
2528                             .type = TestOperationType::ADD
2529                         }, {
2530                             .inputs = {0},
2531                             .outputs = {1},
2532                             .type = TestOperationType::CAST
2533                         }},
2534                 .outputIndexes = {1}
2535             },
2536         .minSupportedVersion = TestHalVersion::V1_2,
2537         .referenced = {}
2538     };
2539     return model;
2540 }
2541 
2542 const auto dummy_test_model_quant8_to_quant8_all_inputs_as_internal = TestModelManager::get().add("cast_quant8_to_quant8_all_inputs_as_internal", get_test_model_quant8_to_quant8_all_inputs_as_internal());
2543 
2544 }  // namespace generated_tests::cast
2545 
2546 namespace generated_tests::cast {
2547 
get_test_model_float16_to_quant8_overflow()2548 const TestModel& get_test_model_float16_to_quant8_overflow() {
2549     static TestModel model = {
2550         .expectFailure = false,
2551         .expectedMultinomialDistributionTolerance = 0,
2552         .isRelaxed = false,
2553         .main = {
2554                 .inputIndexes = {0},
2555                 .operands = {{ // input04
2556                             .channelQuant = {},
2557                             .data = TestBuffer::createFromVector<_Float16>({-1.0f, 256.0f}),
2558                             .dimensions = {2},
2559                             .isIgnored = false,
2560                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2561                             .numberOfConsumers = 1,
2562                             .scale = 0.0f,
2563                             .type = TestOperandType::TENSOR_FLOAT16,
2564                             .zeroPoint = 0
2565                         }, { // output04
2566                             .channelQuant = {},
2567                             .data = TestBuffer::createFromVector<uint8_t>({0, 255}),
2568                             .dimensions = {2},
2569                             .isIgnored = false,
2570                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2571                             .numberOfConsumers = 0,
2572                             .scale = 4.0f,
2573                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2574                             .zeroPoint = 100
2575                         }},
2576                 .operations = {{
2577                             .inputs = {0},
2578                             .outputs = {1},
2579                             .type = TestOperationType::CAST
2580                         }},
2581                 .outputIndexes = {1}
2582             },
2583         .minSupportedVersion = TestHalVersion::V1_2,
2584         .referenced = {}
2585     };
2586     return model;
2587 }
2588 
2589 const auto dummy_test_model_float16_to_quant8_overflow = TestModelManager::get().add("cast_float16_to_quant8_overflow", get_test_model_float16_to_quant8_overflow());
2590 
2591 }  // namespace generated_tests::cast
2592 
2593 namespace generated_tests::cast {
2594 
get_test_model_float16_to_quant8_overflow_all_inputs_as_internal()2595 const TestModel& get_test_model_float16_to_quant8_overflow_all_inputs_as_internal() {
2596     static TestModel model = {
2597         .expectFailure = false,
2598         .expectedMultinomialDistributionTolerance = 0,
2599         .isRelaxed = false,
2600         .main = {
2601                 .inputIndexes = {2},
2602                 .operands = {{ // input04
2603                             .channelQuant = {},
2604                             .data = TestBuffer::createFromVector<_Float16>({}),
2605                             .dimensions = {2},
2606                             .isIgnored = false,
2607                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
2608                             .numberOfConsumers = 1,
2609                             .scale = 0.0f,
2610                             .type = TestOperandType::TENSOR_FLOAT16,
2611                             .zeroPoint = 0
2612                         }, { // output04
2613                             .channelQuant = {},
2614                             .data = TestBuffer::createFromVector<uint8_t>({0, 255}),
2615                             .dimensions = {2},
2616                             .isIgnored = false,
2617                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2618                             .numberOfConsumers = 0,
2619                             .scale = 4.0f,
2620                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2621                             .zeroPoint = 100
2622                         }, { // input04_new
2623                             .channelQuant = {},
2624                             .data = TestBuffer::createFromVector<_Float16>({-1.0f, 256.0f}),
2625                             .dimensions = {2},
2626                             .isIgnored = false,
2627                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2628                             .numberOfConsumers = 1,
2629                             .scale = 0.0f,
2630                             .type = TestOperandType::TENSOR_FLOAT16,
2631                             .zeroPoint = 0
2632                         }, { // placeholder18
2633                             .channelQuant = {},
2634                             .data = TestBuffer::createFromVector<_Float16>({0.0f}),
2635                             .dimensions = {1},
2636                             .isIgnored = false,
2637                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2638                             .numberOfConsumers = 1,
2639                             .scale = 0.0f,
2640                             .type = TestOperandType::TENSOR_FLOAT16,
2641                             .zeroPoint = 0
2642                         }, { // param18
2643                             .channelQuant = {},
2644                             .data = TestBuffer::createFromVector<int32_t>({0}),
2645                             .dimensions = {},
2646                             .isIgnored = false,
2647                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2648                             .numberOfConsumers = 1,
2649                             .scale = 0.0f,
2650                             .type = TestOperandType::INT32,
2651                             .zeroPoint = 0
2652                         }},
2653                 .operations = {{
2654                             .inputs = {2, 3, 4},
2655                             .outputs = {0},
2656                             .type = TestOperationType::ADD
2657                         }, {
2658                             .inputs = {0},
2659                             .outputs = {1},
2660                             .type = TestOperationType::CAST
2661                         }},
2662                 .outputIndexes = {1}
2663             },
2664         .minSupportedVersion = TestHalVersion::V1_2,
2665         .referenced = {}
2666     };
2667     return model;
2668 }
2669 
2670 const auto dummy_test_model_float16_to_quant8_overflow_all_inputs_as_internal = TestModelManager::get().add("cast_float16_to_quant8_overflow_all_inputs_as_internal", get_test_model_float16_to_quant8_overflow_all_inputs_as_internal());
2671 
2672 }  // namespace generated_tests::cast
2673 
2674 namespace generated_tests::cast {
2675 
get_test_model_float32_to_quant8_overflow()2676 const TestModel& get_test_model_float32_to_quant8_overflow() {
2677     static TestModel model = {
2678         .expectFailure = false,
2679         .expectedMultinomialDistributionTolerance = 0,
2680         .isRelaxed = false,
2681         .main = {
2682                 .inputIndexes = {0},
2683                 .operands = {{ // input05
2684                             .channelQuant = {},
2685                             .data = TestBuffer::createFromVector<float>({-1.0f, 256.0f}),
2686                             .dimensions = {2},
2687                             .isIgnored = false,
2688                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2689                             .numberOfConsumers = 1,
2690                             .scale = 0.0f,
2691                             .type = TestOperandType::TENSOR_FLOAT32,
2692                             .zeroPoint = 0
2693                         }, { // output05
2694                             .channelQuant = {},
2695                             .data = TestBuffer::createFromVector<uint8_t>({0, 255}),
2696                             .dimensions = {2},
2697                             .isIgnored = false,
2698                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2699                             .numberOfConsumers = 0,
2700                             .scale = 4.0f,
2701                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2702                             .zeroPoint = 100
2703                         }},
2704                 .operations = {{
2705                             .inputs = {0},
2706                             .outputs = {1},
2707                             .type = TestOperationType::CAST
2708                         }},
2709                 .outputIndexes = {1}
2710             },
2711         .minSupportedVersion = TestHalVersion::V1_2,
2712         .referenced = {}
2713     };
2714     return model;
2715 }
2716 
2717 const auto dummy_test_model_float32_to_quant8_overflow = TestModelManager::get().add("cast_float32_to_quant8_overflow", get_test_model_float32_to_quant8_overflow());
2718 
2719 }  // namespace generated_tests::cast
2720 
2721 namespace generated_tests::cast {
2722 
get_test_model_float32_to_quant8_overflow_all_inputs_as_internal()2723 const TestModel& get_test_model_float32_to_quant8_overflow_all_inputs_as_internal() {
2724     static TestModel model = {
2725         .expectFailure = false,
2726         .expectedMultinomialDistributionTolerance = 0,
2727         .isRelaxed = false,
2728         .main = {
2729                 .inputIndexes = {2},
2730                 .operands = {{ // input05
2731                             .channelQuant = {},
2732                             .data = TestBuffer::createFromVector<float>({}),
2733                             .dimensions = {2},
2734                             .isIgnored = false,
2735                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
2736                             .numberOfConsumers = 1,
2737                             .scale = 0.0f,
2738                             .type = TestOperandType::TENSOR_FLOAT32,
2739                             .zeroPoint = 0
2740                         }, { // output05
2741                             .channelQuant = {},
2742                             .data = TestBuffer::createFromVector<uint8_t>({0, 255}),
2743                             .dimensions = {2},
2744                             .isIgnored = false,
2745                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2746                             .numberOfConsumers = 0,
2747                             .scale = 4.0f,
2748                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2749                             .zeroPoint = 100
2750                         }, { // input05_new
2751                             .channelQuant = {},
2752                             .data = TestBuffer::createFromVector<float>({-1.0f, 256.0f}),
2753                             .dimensions = {2},
2754                             .isIgnored = false,
2755                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2756                             .numberOfConsumers = 1,
2757                             .scale = 0.0f,
2758                             .type = TestOperandType::TENSOR_FLOAT32,
2759                             .zeroPoint = 0
2760                         }, { // placeholder19
2761                             .channelQuant = {},
2762                             .data = TestBuffer::createFromVector<float>({0.0f}),
2763                             .dimensions = {1},
2764                             .isIgnored = false,
2765                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2766                             .numberOfConsumers = 1,
2767                             .scale = 0.0f,
2768                             .type = TestOperandType::TENSOR_FLOAT32,
2769                             .zeroPoint = 0
2770                         }, { // param19
2771                             .channelQuant = {},
2772                             .data = TestBuffer::createFromVector<int32_t>({0}),
2773                             .dimensions = {},
2774                             .isIgnored = false,
2775                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2776                             .numberOfConsumers = 1,
2777                             .scale = 0.0f,
2778                             .type = TestOperandType::INT32,
2779                             .zeroPoint = 0
2780                         }},
2781                 .operations = {{
2782                             .inputs = {2, 3, 4},
2783                             .outputs = {0},
2784                             .type = TestOperationType::ADD
2785                         }, {
2786                             .inputs = {0},
2787                             .outputs = {1},
2788                             .type = TestOperationType::CAST
2789                         }},
2790                 .outputIndexes = {1}
2791             },
2792         .minSupportedVersion = TestHalVersion::V1_2,
2793         .referenced = {}
2794     };
2795     return model;
2796 }
2797 
2798 const auto dummy_test_model_float32_to_quant8_overflow_all_inputs_as_internal = TestModelManager::get().add("cast_float32_to_quant8_overflow_all_inputs_as_internal", get_test_model_float32_to_quant8_overflow_all_inputs_as_internal());
2799 
2800 }  // namespace generated_tests::cast
2801 
2802 namespace generated_tests::cast {
2803 
get_test_model_float32_to_quant8_overflow_relaxed()2804 const TestModel& get_test_model_float32_to_quant8_overflow_relaxed() {
2805     static TestModel model = {
2806         .expectFailure = false,
2807         .expectedMultinomialDistributionTolerance = 0,
2808         .isRelaxed = true,
2809         .main = {
2810                 .inputIndexes = {0},
2811                 .operands = {{ // input05
2812                             .channelQuant = {},
2813                             .data = TestBuffer::createFromVector<float>({-1.0f, 256.0f}),
2814                             .dimensions = {2},
2815                             .isIgnored = false,
2816                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2817                             .numberOfConsumers = 1,
2818                             .scale = 0.0f,
2819                             .type = TestOperandType::TENSOR_FLOAT32,
2820                             .zeroPoint = 0
2821                         }, { // output05
2822                             .channelQuant = {},
2823                             .data = TestBuffer::createFromVector<uint8_t>({0, 255}),
2824                             .dimensions = {2},
2825                             .isIgnored = false,
2826                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2827                             .numberOfConsumers = 0,
2828                             .scale = 4.0f,
2829                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2830                             .zeroPoint = 100
2831                         }},
2832                 .operations = {{
2833                             .inputs = {0},
2834                             .outputs = {1},
2835                             .type = TestOperationType::CAST
2836                         }},
2837                 .outputIndexes = {1}
2838             },
2839         .minSupportedVersion = TestHalVersion::UNKNOWN,
2840         .referenced = {}
2841     };
2842     return model;
2843 }
2844 
2845 const auto dummy_test_model_float32_to_quant8_overflow_relaxed = TestModelManager::get().add("cast_float32_to_quant8_overflow_relaxed", get_test_model_float32_to_quant8_overflow_relaxed());
2846 
2847 }  // namespace generated_tests::cast
2848 
2849 namespace generated_tests::cast {
2850 
get_test_model_float32_to_quant8_overflow_relaxed_all_inputs_as_internal()2851 const TestModel& get_test_model_float32_to_quant8_overflow_relaxed_all_inputs_as_internal() {
2852     static TestModel model = {
2853         .expectFailure = false,
2854         .expectedMultinomialDistributionTolerance = 0,
2855         .isRelaxed = true,
2856         .main = {
2857                 .inputIndexes = {2},
2858                 .operands = {{ // input05
2859                             .channelQuant = {},
2860                             .data = TestBuffer::createFromVector<float>({}),
2861                             .dimensions = {2},
2862                             .isIgnored = false,
2863                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
2864                             .numberOfConsumers = 1,
2865                             .scale = 0.0f,
2866                             .type = TestOperandType::TENSOR_FLOAT32,
2867                             .zeroPoint = 0
2868                         }, { // output05
2869                             .channelQuant = {},
2870                             .data = TestBuffer::createFromVector<uint8_t>({0, 255}),
2871                             .dimensions = {2},
2872                             .isIgnored = false,
2873                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2874                             .numberOfConsumers = 0,
2875                             .scale = 4.0f,
2876                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2877                             .zeroPoint = 100
2878                         }, { // input05_new
2879                             .channelQuant = {},
2880                             .data = TestBuffer::createFromVector<float>({-1.0f, 256.0f}),
2881                             .dimensions = {2},
2882                             .isIgnored = false,
2883                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2884                             .numberOfConsumers = 1,
2885                             .scale = 0.0f,
2886                             .type = TestOperandType::TENSOR_FLOAT32,
2887                             .zeroPoint = 0
2888                         }, { // placeholder20
2889                             .channelQuant = {},
2890                             .data = TestBuffer::createFromVector<float>({0.0f}),
2891                             .dimensions = {1},
2892                             .isIgnored = false,
2893                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2894                             .numberOfConsumers = 1,
2895                             .scale = 0.0f,
2896                             .type = TestOperandType::TENSOR_FLOAT32,
2897                             .zeroPoint = 0
2898                         }, { // param20
2899                             .channelQuant = {},
2900                             .data = TestBuffer::createFromVector<int32_t>({0}),
2901                             .dimensions = {},
2902                             .isIgnored = false,
2903                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2904                             .numberOfConsumers = 1,
2905                             .scale = 0.0f,
2906                             .type = TestOperandType::INT32,
2907                             .zeroPoint = 0
2908                         }},
2909                 .operations = {{
2910                             .inputs = {2, 3, 4},
2911                             .outputs = {0},
2912                             .type = TestOperationType::ADD
2913                         }, {
2914                             .inputs = {0},
2915                             .outputs = {1},
2916                             .type = TestOperationType::CAST
2917                         }},
2918                 .outputIndexes = {1}
2919             },
2920         .minSupportedVersion = TestHalVersion::UNKNOWN,
2921         .referenced = {}
2922     };
2923     return model;
2924 }
2925 
2926 const auto dummy_test_model_float32_to_quant8_overflow_relaxed_all_inputs_as_internal = TestModelManager::get().add("cast_float32_to_quant8_overflow_relaxed_all_inputs_as_internal", get_test_model_float32_to_quant8_overflow_relaxed_all_inputs_as_internal());
2927 
2928 }  // namespace generated_tests::cast
2929 
2930 namespace generated_tests::cast {
2931 
get_test_model_int32_to_quant8_overflow()2932 const TestModel& get_test_model_int32_to_quant8_overflow() {
2933     static TestModel model = {
2934         .expectFailure = false,
2935         .expectedMultinomialDistributionTolerance = 0,
2936         .isRelaxed = false,
2937         .main = {
2938                 .inputIndexes = {0},
2939                 .operands = {{ // input06
2940                             .channelQuant = {},
2941                             .data = TestBuffer::createFromVector<int32_t>({-1, 256}),
2942                             .dimensions = {2},
2943                             .isIgnored = false,
2944                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2945                             .numberOfConsumers = 1,
2946                             .scale = 0.0f,
2947                             .type = TestOperandType::TENSOR_INT32,
2948                             .zeroPoint = 0
2949                         }, { // output06
2950                             .channelQuant = {},
2951                             .data = TestBuffer::createFromVector<uint8_t>({0, 255}),
2952                             .dimensions = {2},
2953                             .isIgnored = false,
2954                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2955                             .numberOfConsumers = 0,
2956                             .scale = 4.0f,
2957                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2958                             .zeroPoint = 100
2959                         }},
2960                 .operations = {{
2961                             .inputs = {0},
2962                             .outputs = {1},
2963                             .type = TestOperationType::CAST
2964                         }},
2965                 .outputIndexes = {1}
2966             },
2967         .minSupportedVersion = TestHalVersion::V1_2,
2968         .referenced = {}
2969     };
2970     return model;
2971 }
2972 
2973 const auto dummy_test_model_int32_to_quant8_overflow = TestModelManager::get().add("cast_int32_to_quant8_overflow", get_test_model_int32_to_quant8_overflow());
2974 
2975 }  // namespace generated_tests::cast
2976 
2977