1 // Generated from cast.mod.py
2 // DO NOT EDIT
3 // clang-format off
4 #include "TestHarness.h"
5 using namespace test_helper;  // NOLINT(google-build-using-namespace)
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         .main = {
12                 .operands = {{ // input0
13                             .type = TestOperandType::TENSOR_FLOAT16,
14                             .dimensions = {2, 3},
15                             .numberOfConsumers = 1,
16                             .scale = 0.0f,
17                             .zeroPoint = 0,
18                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
19                             .channelQuant = {},
20                             .isIgnored = false,
21                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
22                         }, { // output0
23                             .type = TestOperandType::TENSOR_FLOAT16,
24                             .dimensions = {2, 3},
25                             .numberOfConsumers = 0,
26                             .scale = 0.0f,
27                             .zeroPoint = 0,
28                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
29                             .channelQuant = {},
30                             .isIgnored = false,
31                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
32                         }},
33                 .operations = {{
34                             .type = TestOperationType::CAST,
35                             .inputs = {0},
36                             .outputs = {1}
37                         }},
38                 .inputIndexes = {0},
39                 .outputIndexes = {1}
40             },
41         .referenced = {},
42         .isRelaxed = false,
43         .expectedMultinomialDistributionTolerance = 0,
44         .expectFailure = false,
45         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
59                 .operands = {{ // input0
60                             .type = TestOperandType::TENSOR_FLOAT16,
61                             .dimensions = {2, 3},
62                             .numberOfConsumers = 1,
63                             .scale = 0.0f,
64                             .zeroPoint = 0,
65                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
66                             .channelQuant = {},
67                             .isIgnored = false,
68                             .data = TestBuffer::createFromVector<_Float16>({})
69                         }, { // output0
70                             .type = TestOperandType::TENSOR_FLOAT16,
71                             .dimensions = {2, 3},
72                             .numberOfConsumers = 0,
73                             .scale = 0.0f,
74                             .zeroPoint = 0,
75                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
76                             .channelQuant = {},
77                             .isIgnored = false,
78                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
79                         }, { // input0_new
80                             .type = TestOperandType::TENSOR_FLOAT16,
81                             .dimensions = {2, 3},
82                             .numberOfConsumers = 1,
83                             .scale = 0.0f,
84                             .zeroPoint = 0,
85                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
86                             .channelQuant = {},
87                             .isIgnored = false,
88                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
89                         }, { // placeholder
90                             .type = TestOperandType::TENSOR_FLOAT16,
91                             .dimensions = {1},
92                             .numberOfConsumers = 1,
93                             .scale = 0.0f,
94                             .zeroPoint = 0,
95                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
96                             .channelQuant = {},
97                             .isIgnored = false,
98                             .data = TestBuffer::createFromVector<_Float16>({0.0f})
99                         }, { // param
100                             .type = TestOperandType::INT32,
101                             .dimensions = {},
102                             .numberOfConsumers = 1,
103                             .scale = 0.0f,
104                             .zeroPoint = 0,
105                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
106                             .channelQuant = {},
107                             .isIgnored = false,
108                             .data = TestBuffer::createFromVector<int32_t>({0})
109                         }},
110                 .operations = {{
111                             .type = TestOperationType::ADD,
112                             .inputs = {2, 3, 4},
113                             .outputs = {0}
114                         }, {
115                             .type = TestOperationType::CAST,
116                             .inputs = {0},
117                             .outputs = {1}
118                         }},
119                 .inputIndexes = {2},
120                 .outputIndexes = {1}
121             },
122         .referenced = {},
123         .isRelaxed = false,
124         .expectedMultinomialDistributionTolerance = 0,
125         .expectFailure = false,
126         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
140                 .operands = {{ // input0
141                             .type = TestOperandType::TENSOR_FLOAT16,
142                             .dimensions = {2, 3},
143                             .numberOfConsumers = 1,
144                             .scale = 0.0f,
145                             .zeroPoint = 0,
146                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
147                             .channelQuant = {},
148                             .isIgnored = false,
149                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
150                         }, { // output01
151                             .type = TestOperandType::TENSOR_FLOAT32,
152                             .dimensions = {2, 3},
153                             .numberOfConsumers = 0,
154                             .scale = 0.0f,
155                             .zeroPoint = 0,
156                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
157                             .channelQuant = {},
158                             .isIgnored = false,
159                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
160                         }},
161                 .operations = {{
162                             .type = TestOperationType::CAST,
163                             .inputs = {0},
164                             .outputs = {1}
165                         }},
166                 .inputIndexes = {0},
167                 .outputIndexes = {1}
168             },
169         .referenced = {},
170         .isRelaxed = false,
171         .expectedMultinomialDistributionTolerance = 0,
172         .expectFailure = false,
173         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
187                 .operands = {{ // input0
188                             .type = TestOperandType::TENSOR_FLOAT16,
189                             .dimensions = {2, 3},
190                             .numberOfConsumers = 1,
191                             .scale = 0.0f,
192                             .zeroPoint = 0,
193                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
194                             .channelQuant = {},
195                             .isIgnored = false,
196                             .data = TestBuffer::createFromVector<_Float16>({})
197                         }, { // output01
198                             .type = TestOperandType::TENSOR_FLOAT32,
199                             .dimensions = {2, 3},
200                             .numberOfConsumers = 0,
201                             .scale = 0.0f,
202                             .zeroPoint = 0,
203                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
204                             .channelQuant = {},
205                             .isIgnored = false,
206                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
207                         }, { // input0_new
208                             .type = TestOperandType::TENSOR_FLOAT16,
209                             .dimensions = {2, 3},
210                             .numberOfConsumers = 1,
211                             .scale = 0.0f,
212                             .zeroPoint = 0,
213                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
214                             .channelQuant = {},
215                             .isIgnored = false,
216                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
217                         }, { // placeholder1
218                             .type = TestOperandType::TENSOR_FLOAT16,
219                             .dimensions = {1},
220                             .numberOfConsumers = 1,
221                             .scale = 0.0f,
222                             .zeroPoint = 0,
223                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
224                             .channelQuant = {},
225                             .isIgnored = false,
226                             .data = TestBuffer::createFromVector<_Float16>({0.0f})
227                         }, { // param1
228                             .type = TestOperandType::INT32,
229                             .dimensions = {},
230                             .numberOfConsumers = 1,
231                             .scale = 0.0f,
232                             .zeroPoint = 0,
233                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
234                             .channelQuant = {},
235                             .isIgnored = false,
236                             .data = TestBuffer::createFromVector<int32_t>({0})
237                         }},
238                 .operations = {{
239                             .type = TestOperationType::ADD,
240                             .inputs = {2, 3, 4},
241                             .outputs = {0}
242                         }, {
243                             .type = TestOperationType::CAST,
244                             .inputs = {0},
245                             .outputs = {1}
246                         }},
247                 .inputIndexes = {2},
248                 .outputIndexes = {1}
249             },
250         .referenced = {},
251         .isRelaxed = false,
252         .expectedMultinomialDistributionTolerance = 0,
253         .expectFailure = false,
254         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
268                 .operands = {{ // input0
269                             .type = TestOperandType::TENSOR_FLOAT16,
270                             .dimensions = {2, 3},
271                             .numberOfConsumers = 1,
272                             .scale = 0.0f,
273                             .zeroPoint = 0,
274                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
275                             .channelQuant = {},
276                             .isIgnored = false,
277                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
278                         }, { // output01
279                             .type = TestOperandType::TENSOR_FLOAT32,
280                             .dimensions = {2, 3},
281                             .numberOfConsumers = 0,
282                             .scale = 0.0f,
283                             .zeroPoint = 0,
284                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
285                             .channelQuant = {},
286                             .isIgnored = false,
287                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
288                         }},
289                 .operations = {{
290                             .type = TestOperationType::CAST,
291                             .inputs = {0},
292                             .outputs = {1}
293                         }},
294                 .inputIndexes = {0},
295                 .outputIndexes = {1}
296             },
297         .referenced = {},
298         .isRelaxed = true,
299         .expectedMultinomialDistributionTolerance = 0,
300         .expectFailure = false,
301         .minSupportedVersion = TestHalVersion::UNKNOWN
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         .main = {
315                 .operands = {{ // input0
316                             .type = TestOperandType::TENSOR_FLOAT16,
317                             .dimensions = {2, 3},
318                             .numberOfConsumers = 1,
319                             .scale = 0.0f,
320                             .zeroPoint = 0,
321                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
322                             .channelQuant = {},
323                             .isIgnored = false,
324                             .data = TestBuffer::createFromVector<_Float16>({})
325                         }, { // output01
326                             .type = TestOperandType::TENSOR_FLOAT32,
327                             .dimensions = {2, 3},
328                             .numberOfConsumers = 0,
329                             .scale = 0.0f,
330                             .zeroPoint = 0,
331                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
332                             .channelQuant = {},
333                             .isIgnored = false,
334                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
335                         }, { // input0_new
336                             .type = TestOperandType::TENSOR_FLOAT16,
337                             .dimensions = {2, 3},
338                             .numberOfConsumers = 1,
339                             .scale = 0.0f,
340                             .zeroPoint = 0,
341                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
342                             .channelQuant = {},
343                             .isIgnored = false,
344                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
345                         }, { // placeholder2
346                             .type = TestOperandType::TENSOR_FLOAT16,
347                             .dimensions = {1},
348                             .numberOfConsumers = 1,
349                             .scale = 0.0f,
350                             .zeroPoint = 0,
351                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
352                             .channelQuant = {},
353                             .isIgnored = false,
354                             .data = TestBuffer::createFromVector<_Float16>({0.0f})
355                         }, { // param2
356                             .type = TestOperandType::INT32,
357                             .dimensions = {},
358                             .numberOfConsumers = 1,
359                             .scale = 0.0f,
360                             .zeroPoint = 0,
361                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
362                             .channelQuant = {},
363                             .isIgnored = false,
364                             .data = TestBuffer::createFromVector<int32_t>({0})
365                         }},
366                 .operations = {{
367                             .type = TestOperationType::ADD,
368                             .inputs = {2, 3, 4},
369                             .outputs = {0}
370                         }, {
371                             .type = TestOperationType::CAST,
372                             .inputs = {0},
373                             .outputs = {1}
374                         }},
375                 .inputIndexes = {2},
376                 .outputIndexes = {1}
377             },
378         .referenced = {},
379         .isRelaxed = true,
380         .expectedMultinomialDistributionTolerance = 0,
381         .expectFailure = false,
382         .minSupportedVersion = TestHalVersion::UNKNOWN
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         .main = {
396                 .operands = {{ // input0
397                             .type = TestOperandType::TENSOR_FLOAT16,
398                             .dimensions = {2, 3},
399                             .numberOfConsumers = 1,
400                             .scale = 0.0f,
401                             .zeroPoint = 0,
402                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
403                             .channelQuant = {},
404                             .isIgnored = false,
405                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
406                         }, { // output02
407                             .type = TestOperandType::TENSOR_INT32,
408                             .dimensions = {2, 3},
409                             .numberOfConsumers = 0,
410                             .scale = 0.0f,
411                             .zeroPoint = 0,
412                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
413                             .channelQuant = {},
414                             .isIgnored = false,
415                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6})
416                         }},
417                 .operations = {{
418                             .type = TestOperationType::CAST,
419                             .inputs = {0},
420                             .outputs = {1}
421                         }},
422                 .inputIndexes = {0},
423                 .outputIndexes = {1}
424             },
425         .referenced = {},
426         .isRelaxed = false,
427         .expectedMultinomialDistributionTolerance = 0,
428         .expectFailure = false,
429         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
443                 .operands = {{ // input0
444                             .type = TestOperandType::TENSOR_FLOAT16,
445                             .dimensions = {2, 3},
446                             .numberOfConsumers = 1,
447                             .scale = 0.0f,
448                             .zeroPoint = 0,
449                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
450                             .channelQuant = {},
451                             .isIgnored = false,
452                             .data = TestBuffer::createFromVector<_Float16>({})
453                         }, { // output02
454                             .type = TestOperandType::TENSOR_INT32,
455                             .dimensions = {2, 3},
456                             .numberOfConsumers = 0,
457                             .scale = 0.0f,
458                             .zeroPoint = 0,
459                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
460                             .channelQuant = {},
461                             .isIgnored = false,
462                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6})
463                         }, { // input0_new
464                             .type = TestOperandType::TENSOR_FLOAT16,
465                             .dimensions = {2, 3},
466                             .numberOfConsumers = 1,
467                             .scale = 0.0f,
468                             .zeroPoint = 0,
469                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
470                             .channelQuant = {},
471                             .isIgnored = false,
472                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
473                         }, { // placeholder3
474                             .type = TestOperandType::TENSOR_FLOAT16,
475                             .dimensions = {1},
476                             .numberOfConsumers = 1,
477                             .scale = 0.0f,
478                             .zeroPoint = 0,
479                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
480                             .channelQuant = {},
481                             .isIgnored = false,
482                             .data = TestBuffer::createFromVector<_Float16>({0.0f})
483                         }, { // param3
484                             .type = TestOperandType::INT32,
485                             .dimensions = {},
486                             .numberOfConsumers = 1,
487                             .scale = 0.0f,
488                             .zeroPoint = 0,
489                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
490                             .channelQuant = {},
491                             .isIgnored = false,
492                             .data = TestBuffer::createFromVector<int32_t>({0})
493                         }},
494                 .operations = {{
495                             .type = TestOperationType::ADD,
496                             .inputs = {2, 3, 4},
497                             .outputs = {0}
498                         }, {
499                             .type = TestOperationType::CAST,
500                             .inputs = {0},
501                             .outputs = {1}
502                         }},
503                 .inputIndexes = {2},
504                 .outputIndexes = {1}
505             },
506         .referenced = {},
507         .isRelaxed = false,
508         .expectedMultinomialDistributionTolerance = 0,
509         .expectFailure = false,
510         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
524                 .operands = {{ // input0
525                             .type = TestOperandType::TENSOR_FLOAT16,
526                             .dimensions = {2, 3},
527                             .numberOfConsumers = 1,
528                             .scale = 0.0f,
529                             .zeroPoint = 0,
530                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
531                             .channelQuant = {},
532                             .isIgnored = false,
533                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
534                         }, { // output03
535                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
536                             .dimensions = {2, 3},
537                             .numberOfConsumers = 0,
538                             .scale = 4.0f,
539                             .zeroPoint = 100,
540                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
541                             .channelQuant = {},
542                             .isIgnored = false,
543                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6})
544                         }},
545                 .operations = {{
546                             .type = TestOperationType::CAST,
547                             .inputs = {0},
548                             .outputs = {1}
549                         }},
550                 .inputIndexes = {0},
551                 .outputIndexes = {1}
552             },
553         .referenced = {},
554         .isRelaxed = false,
555         .expectedMultinomialDistributionTolerance = 0,
556         .expectFailure = false,
557         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
571                 .operands = {{ // input0
572                             .type = TestOperandType::TENSOR_FLOAT16,
573                             .dimensions = {2, 3},
574                             .numberOfConsumers = 1,
575                             .scale = 0.0f,
576                             .zeroPoint = 0,
577                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
578                             .channelQuant = {},
579                             .isIgnored = false,
580                             .data = TestBuffer::createFromVector<_Float16>({})
581                         }, { // output03
582                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
583                             .dimensions = {2, 3},
584                             .numberOfConsumers = 0,
585                             .scale = 4.0f,
586                             .zeroPoint = 100,
587                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
588                             .channelQuant = {},
589                             .isIgnored = false,
590                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6})
591                         }, { // input0_new
592                             .type = TestOperandType::TENSOR_FLOAT16,
593                             .dimensions = {2, 3},
594                             .numberOfConsumers = 1,
595                             .scale = 0.0f,
596                             .zeroPoint = 0,
597                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
598                             .channelQuant = {},
599                             .isIgnored = false,
600                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
601                         }, { // placeholder4
602                             .type = TestOperandType::TENSOR_FLOAT16,
603                             .dimensions = {1},
604                             .numberOfConsumers = 1,
605                             .scale = 0.0f,
606                             .zeroPoint = 0,
607                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
608                             .channelQuant = {},
609                             .isIgnored = false,
610                             .data = TestBuffer::createFromVector<_Float16>({0.0f})
611                         }, { // param4
612                             .type = TestOperandType::INT32,
613                             .dimensions = {},
614                             .numberOfConsumers = 1,
615                             .scale = 0.0f,
616                             .zeroPoint = 0,
617                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
618                             .channelQuant = {},
619                             .isIgnored = false,
620                             .data = TestBuffer::createFromVector<int32_t>({0})
621                         }},
622                 .operations = {{
623                             .type = TestOperationType::ADD,
624                             .inputs = {2, 3, 4},
625                             .outputs = {0}
626                         }, {
627                             .type = TestOperationType::CAST,
628                             .inputs = {0},
629                             .outputs = {1}
630                         }},
631                 .inputIndexes = {2},
632                 .outputIndexes = {1}
633             },
634         .referenced = {},
635         .isRelaxed = false,
636         .expectedMultinomialDistributionTolerance = 0,
637         .expectFailure = false,
638         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
652                 .operands = {{ // input01
653                             .type = TestOperandType::TENSOR_FLOAT32,
654                             .dimensions = {2, 3},
655                             .numberOfConsumers = 1,
656                             .scale = 0.0f,
657                             .zeroPoint = 0,
658                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
659                             .channelQuant = {},
660                             .isIgnored = false,
661                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
662                         }, { // output0
663                             .type = TestOperandType::TENSOR_FLOAT16,
664                             .dimensions = {2, 3},
665                             .numberOfConsumers = 0,
666                             .scale = 0.0f,
667                             .zeroPoint = 0,
668                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
669                             .channelQuant = {},
670                             .isIgnored = false,
671                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
672                         }},
673                 .operations = {{
674                             .type = TestOperationType::CAST,
675                             .inputs = {0},
676                             .outputs = {1}
677                         }},
678                 .inputIndexes = {0},
679                 .outputIndexes = {1}
680             },
681         .referenced = {},
682         .isRelaxed = false,
683         .expectedMultinomialDistributionTolerance = 0,
684         .expectFailure = false,
685         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
699                 .operands = {{ // input01
700                             .type = TestOperandType::TENSOR_FLOAT32,
701                             .dimensions = {2, 3},
702                             .numberOfConsumers = 1,
703                             .scale = 0.0f,
704                             .zeroPoint = 0,
705                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
706                             .channelQuant = {},
707                             .isIgnored = false,
708                             .data = TestBuffer::createFromVector<float>({})
709                         }, { // output0
710                             .type = TestOperandType::TENSOR_FLOAT16,
711                             .dimensions = {2, 3},
712                             .numberOfConsumers = 0,
713                             .scale = 0.0f,
714                             .zeroPoint = 0,
715                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
716                             .channelQuant = {},
717                             .isIgnored = false,
718                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
719                         }, { // input01_new
720                             .type = TestOperandType::TENSOR_FLOAT32,
721                             .dimensions = {2, 3},
722                             .numberOfConsumers = 1,
723                             .scale = 0.0f,
724                             .zeroPoint = 0,
725                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
726                             .channelQuant = {},
727                             .isIgnored = false,
728                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
729                         }, { // placeholder5
730                             .type = TestOperandType::TENSOR_FLOAT32,
731                             .dimensions = {1},
732                             .numberOfConsumers = 1,
733                             .scale = 0.0f,
734                             .zeroPoint = 0,
735                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
736                             .channelQuant = {},
737                             .isIgnored = false,
738                             .data = TestBuffer::createFromVector<float>({0.0f})
739                         }, { // param5
740                             .type = TestOperandType::INT32,
741                             .dimensions = {},
742                             .numberOfConsumers = 1,
743                             .scale = 0.0f,
744                             .zeroPoint = 0,
745                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
746                             .channelQuant = {},
747                             .isIgnored = false,
748                             .data = TestBuffer::createFromVector<int32_t>({0})
749                         }},
750                 .operations = {{
751                             .type = TestOperationType::ADD,
752                             .inputs = {2, 3, 4},
753                             .outputs = {0}
754                         }, {
755                             .type = TestOperationType::CAST,
756                             .inputs = {0},
757                             .outputs = {1}
758                         }},
759                 .inputIndexes = {2},
760                 .outputIndexes = {1}
761             },
762         .referenced = {},
763         .isRelaxed = false,
764         .expectedMultinomialDistributionTolerance = 0,
765         .expectFailure = false,
766         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
780                 .operands = {{ // input01
781                             .type = TestOperandType::TENSOR_FLOAT32,
782                             .dimensions = {2, 3},
783                             .numberOfConsumers = 1,
784                             .scale = 0.0f,
785                             .zeroPoint = 0,
786                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
787                             .channelQuant = {},
788                             .isIgnored = false,
789                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
790                         }, { // output0
791                             .type = TestOperandType::TENSOR_FLOAT16,
792                             .dimensions = {2, 3},
793                             .numberOfConsumers = 0,
794                             .scale = 0.0f,
795                             .zeroPoint = 0,
796                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
797                             .channelQuant = {},
798                             .isIgnored = false,
799                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
800                         }},
801                 .operations = {{
802                             .type = TestOperationType::CAST,
803                             .inputs = {0},
804                             .outputs = {1}
805                         }},
806                 .inputIndexes = {0},
807                 .outputIndexes = {1}
808             },
809         .referenced = {},
810         .isRelaxed = true,
811         .expectedMultinomialDistributionTolerance = 0,
812         .expectFailure = false,
813         .minSupportedVersion = TestHalVersion::UNKNOWN
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         .main = {
827                 .operands = {{ // input01
828                             .type = TestOperandType::TENSOR_FLOAT32,
829                             .dimensions = {2, 3},
830                             .numberOfConsumers = 1,
831                             .scale = 0.0f,
832                             .zeroPoint = 0,
833                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
834                             .channelQuant = {},
835                             .isIgnored = false,
836                             .data = TestBuffer::createFromVector<float>({})
837                         }, { // output0
838                             .type = TestOperandType::TENSOR_FLOAT16,
839                             .dimensions = {2, 3},
840                             .numberOfConsumers = 0,
841                             .scale = 0.0f,
842                             .zeroPoint = 0,
843                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
844                             .channelQuant = {},
845                             .isIgnored = false,
846                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
847                         }, { // input01_new
848                             .type = TestOperandType::TENSOR_FLOAT32,
849                             .dimensions = {2, 3},
850                             .numberOfConsumers = 1,
851                             .scale = 0.0f,
852                             .zeroPoint = 0,
853                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
854                             .channelQuant = {},
855                             .isIgnored = false,
856                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
857                         }, { // placeholder6
858                             .type = TestOperandType::TENSOR_FLOAT32,
859                             .dimensions = {1},
860                             .numberOfConsumers = 1,
861                             .scale = 0.0f,
862                             .zeroPoint = 0,
863                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
864                             .channelQuant = {},
865                             .isIgnored = false,
866                             .data = TestBuffer::createFromVector<float>({0.0f})
867                         }, { // param6
868                             .type = TestOperandType::INT32,
869                             .dimensions = {},
870                             .numberOfConsumers = 1,
871                             .scale = 0.0f,
872                             .zeroPoint = 0,
873                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
874                             .channelQuant = {},
875                             .isIgnored = false,
876                             .data = TestBuffer::createFromVector<int32_t>({0})
877                         }},
878                 .operations = {{
879                             .type = TestOperationType::ADD,
880                             .inputs = {2, 3, 4},
881                             .outputs = {0}
882                         }, {
883                             .type = TestOperationType::CAST,
884                             .inputs = {0},
885                             .outputs = {1}
886                         }},
887                 .inputIndexes = {2},
888                 .outputIndexes = {1}
889             },
890         .referenced = {},
891         .isRelaxed = true,
892         .expectedMultinomialDistributionTolerance = 0,
893         .expectFailure = false,
894         .minSupportedVersion = TestHalVersion::UNKNOWN
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         .main = {
908                 .operands = {{ // input01
909                             .type = TestOperandType::TENSOR_FLOAT32,
910                             .dimensions = {2, 3},
911                             .numberOfConsumers = 1,
912                             .scale = 0.0f,
913                             .zeroPoint = 0,
914                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
915                             .channelQuant = {},
916                             .isIgnored = false,
917                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
918                         }, { // output01
919                             .type = TestOperandType::TENSOR_FLOAT32,
920                             .dimensions = {2, 3},
921                             .numberOfConsumers = 0,
922                             .scale = 0.0f,
923                             .zeroPoint = 0,
924                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
925                             .channelQuant = {},
926                             .isIgnored = false,
927                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
928                         }},
929                 .operations = {{
930                             .type = TestOperationType::CAST,
931                             .inputs = {0},
932                             .outputs = {1}
933                         }},
934                 .inputIndexes = {0},
935                 .outputIndexes = {1}
936             },
937         .referenced = {},
938         .isRelaxed = false,
939         .expectedMultinomialDistributionTolerance = 0,
940         .expectFailure = false,
941         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
955                 .operands = {{ // input01
956                             .type = TestOperandType::TENSOR_FLOAT32,
957                             .dimensions = {2, 3},
958                             .numberOfConsumers = 1,
959                             .scale = 0.0f,
960                             .zeroPoint = 0,
961                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
962                             .channelQuant = {},
963                             .isIgnored = false,
964                             .data = TestBuffer::createFromVector<float>({})
965                         }, { // output01
966                             .type = TestOperandType::TENSOR_FLOAT32,
967                             .dimensions = {2, 3},
968                             .numberOfConsumers = 0,
969                             .scale = 0.0f,
970                             .zeroPoint = 0,
971                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
972                             .channelQuant = {},
973                             .isIgnored = false,
974                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
975                         }, { // input01_new
976                             .type = TestOperandType::TENSOR_FLOAT32,
977                             .dimensions = {2, 3},
978                             .numberOfConsumers = 1,
979                             .scale = 0.0f,
980                             .zeroPoint = 0,
981                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
982                             .channelQuant = {},
983                             .isIgnored = false,
984                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
985                         }, { // placeholder7
986                             .type = TestOperandType::TENSOR_FLOAT32,
987                             .dimensions = {1},
988                             .numberOfConsumers = 1,
989                             .scale = 0.0f,
990                             .zeroPoint = 0,
991                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
992                             .channelQuant = {},
993                             .isIgnored = false,
994                             .data = TestBuffer::createFromVector<float>({0.0f})
995                         }, { // param7
996                             .type = TestOperandType::INT32,
997                             .dimensions = {},
998                             .numberOfConsumers = 1,
999                             .scale = 0.0f,
1000                             .zeroPoint = 0,
1001                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1002                             .channelQuant = {},
1003                             .isIgnored = false,
1004                             .data = TestBuffer::createFromVector<int32_t>({0})
1005                         }},
1006                 .operations = {{
1007                             .type = TestOperationType::ADD,
1008                             .inputs = {2, 3, 4},
1009                             .outputs = {0}
1010                         }, {
1011                             .type = TestOperationType::CAST,
1012                             .inputs = {0},
1013                             .outputs = {1}
1014                         }},
1015                 .inputIndexes = {2},
1016                 .outputIndexes = {1}
1017             },
1018         .referenced = {},
1019         .isRelaxed = false,
1020         .expectedMultinomialDistributionTolerance = 0,
1021         .expectFailure = false,
1022         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
1036                 .operands = {{ // input01
1037                             .type = TestOperandType::TENSOR_FLOAT32,
1038                             .dimensions = {2, 3},
1039                             .numberOfConsumers = 1,
1040                             .scale = 0.0f,
1041                             .zeroPoint = 0,
1042                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1043                             .channelQuant = {},
1044                             .isIgnored = false,
1045                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
1046                         }, { // output01
1047                             .type = TestOperandType::TENSOR_FLOAT32,
1048                             .dimensions = {2, 3},
1049                             .numberOfConsumers = 0,
1050                             .scale = 0.0f,
1051                             .zeroPoint = 0,
1052                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1053                             .channelQuant = {},
1054                             .isIgnored = false,
1055                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
1056                         }},
1057                 .operations = {{
1058                             .type = TestOperationType::CAST,
1059                             .inputs = {0},
1060                             .outputs = {1}
1061                         }},
1062                 .inputIndexes = {0},
1063                 .outputIndexes = {1}
1064             },
1065         .referenced = {},
1066         .isRelaxed = true,
1067         .expectedMultinomialDistributionTolerance = 0,
1068         .expectFailure = false,
1069         .minSupportedVersion = TestHalVersion::UNKNOWN
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         .main = {
1083                 .operands = {{ // input01
1084                             .type = TestOperandType::TENSOR_FLOAT32,
1085                             .dimensions = {2, 3},
1086                             .numberOfConsumers = 1,
1087                             .scale = 0.0f,
1088                             .zeroPoint = 0,
1089                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
1090                             .channelQuant = {},
1091                             .isIgnored = false,
1092                             .data = TestBuffer::createFromVector<float>({})
1093                         }, { // output01
1094                             .type = TestOperandType::TENSOR_FLOAT32,
1095                             .dimensions = {2, 3},
1096                             .numberOfConsumers = 0,
1097                             .scale = 0.0f,
1098                             .zeroPoint = 0,
1099                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1100                             .channelQuant = {},
1101                             .isIgnored = false,
1102                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
1103                         }, { // input01_new
1104                             .type = TestOperandType::TENSOR_FLOAT32,
1105                             .dimensions = {2, 3},
1106                             .numberOfConsumers = 1,
1107                             .scale = 0.0f,
1108                             .zeroPoint = 0,
1109                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1110                             .channelQuant = {},
1111                             .isIgnored = false,
1112                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
1113                         }, { // placeholder8
1114                             .type = TestOperandType::TENSOR_FLOAT32,
1115                             .dimensions = {1},
1116                             .numberOfConsumers = 1,
1117                             .scale = 0.0f,
1118                             .zeroPoint = 0,
1119                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1120                             .channelQuant = {},
1121                             .isIgnored = false,
1122                             .data = TestBuffer::createFromVector<float>({0.0f})
1123                         }, { // param8
1124                             .type = TestOperandType::INT32,
1125                             .dimensions = {},
1126                             .numberOfConsumers = 1,
1127                             .scale = 0.0f,
1128                             .zeroPoint = 0,
1129                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1130                             .channelQuant = {},
1131                             .isIgnored = false,
1132                             .data = TestBuffer::createFromVector<int32_t>({0})
1133                         }},
1134                 .operations = {{
1135                             .type = TestOperationType::ADD,
1136                             .inputs = {2, 3, 4},
1137                             .outputs = {0}
1138                         }, {
1139                             .type = TestOperationType::CAST,
1140                             .inputs = {0},
1141                             .outputs = {1}
1142                         }},
1143                 .inputIndexes = {2},
1144                 .outputIndexes = {1}
1145             },
1146         .referenced = {},
1147         .isRelaxed = true,
1148         .expectedMultinomialDistributionTolerance = 0,
1149         .expectFailure = false,
1150         .minSupportedVersion = TestHalVersion::UNKNOWN
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         .main = {
1164                 .operands = {{ // input01
1165                             .type = TestOperandType::TENSOR_FLOAT32,
1166                             .dimensions = {2, 3},
1167                             .numberOfConsumers = 1,
1168                             .scale = 0.0f,
1169                             .zeroPoint = 0,
1170                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1171                             .channelQuant = {},
1172                             .isIgnored = false,
1173                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
1174                         }, { // output02
1175                             .type = TestOperandType::TENSOR_INT32,
1176                             .dimensions = {2, 3},
1177                             .numberOfConsumers = 0,
1178                             .scale = 0.0f,
1179                             .zeroPoint = 0,
1180                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1181                             .channelQuant = {},
1182                             .isIgnored = false,
1183                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6})
1184                         }},
1185                 .operations = {{
1186                             .type = TestOperationType::CAST,
1187                             .inputs = {0},
1188                             .outputs = {1}
1189                         }},
1190                 .inputIndexes = {0},
1191                 .outputIndexes = {1}
1192             },
1193         .referenced = {},
1194         .isRelaxed = false,
1195         .expectedMultinomialDistributionTolerance = 0,
1196         .expectFailure = false,
1197         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
1211                 .operands = {{ // input01
1212                             .type = TestOperandType::TENSOR_FLOAT32,
1213                             .dimensions = {2, 3},
1214                             .numberOfConsumers = 1,
1215                             .scale = 0.0f,
1216                             .zeroPoint = 0,
1217                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
1218                             .channelQuant = {},
1219                             .isIgnored = false,
1220                             .data = TestBuffer::createFromVector<float>({})
1221                         }, { // output02
1222                             .type = TestOperandType::TENSOR_INT32,
1223                             .dimensions = {2, 3},
1224                             .numberOfConsumers = 0,
1225                             .scale = 0.0f,
1226                             .zeroPoint = 0,
1227                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1228                             .channelQuant = {},
1229                             .isIgnored = false,
1230                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6})
1231                         }, { // input01_new
1232                             .type = TestOperandType::TENSOR_FLOAT32,
1233                             .dimensions = {2, 3},
1234                             .numberOfConsumers = 1,
1235                             .scale = 0.0f,
1236                             .zeroPoint = 0,
1237                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1238                             .channelQuant = {},
1239                             .isIgnored = false,
1240                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
1241                         }, { // placeholder9
1242                             .type = TestOperandType::TENSOR_FLOAT32,
1243                             .dimensions = {1},
1244                             .numberOfConsumers = 1,
1245                             .scale = 0.0f,
1246                             .zeroPoint = 0,
1247                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1248                             .channelQuant = {},
1249                             .isIgnored = false,
1250                             .data = TestBuffer::createFromVector<float>({0.0f})
1251                         }, { // param9
1252                             .type = TestOperandType::INT32,
1253                             .dimensions = {},
1254                             .numberOfConsumers = 1,
1255                             .scale = 0.0f,
1256                             .zeroPoint = 0,
1257                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1258                             .channelQuant = {},
1259                             .isIgnored = false,
1260                             .data = TestBuffer::createFromVector<int32_t>({0})
1261                         }},
1262                 .operations = {{
1263                             .type = TestOperationType::ADD,
1264                             .inputs = {2, 3, 4},
1265                             .outputs = {0}
1266                         }, {
1267                             .type = TestOperationType::CAST,
1268                             .inputs = {0},
1269                             .outputs = {1}
1270                         }},
1271                 .inputIndexes = {2},
1272                 .outputIndexes = {1}
1273             },
1274         .referenced = {},
1275         .isRelaxed = false,
1276         .expectedMultinomialDistributionTolerance = 0,
1277         .expectFailure = false,
1278         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
1292                 .operands = {{ // input01
1293                             .type = TestOperandType::TENSOR_FLOAT32,
1294                             .dimensions = {2, 3},
1295                             .numberOfConsumers = 1,
1296                             .scale = 0.0f,
1297                             .zeroPoint = 0,
1298                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1299                             .channelQuant = {},
1300                             .isIgnored = false,
1301                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
1302                         }, { // output02
1303                             .type = TestOperandType::TENSOR_INT32,
1304                             .dimensions = {2, 3},
1305                             .numberOfConsumers = 0,
1306                             .scale = 0.0f,
1307                             .zeroPoint = 0,
1308                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1309                             .channelQuant = {},
1310                             .isIgnored = false,
1311                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6})
1312                         }},
1313                 .operations = {{
1314                             .type = TestOperationType::CAST,
1315                             .inputs = {0},
1316                             .outputs = {1}
1317                         }},
1318                 .inputIndexes = {0},
1319                 .outputIndexes = {1}
1320             },
1321         .referenced = {},
1322         .isRelaxed = true,
1323         .expectedMultinomialDistributionTolerance = 0,
1324         .expectFailure = false,
1325         .minSupportedVersion = TestHalVersion::UNKNOWN
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         .main = {
1339                 .operands = {{ // input01
1340                             .type = TestOperandType::TENSOR_FLOAT32,
1341                             .dimensions = {2, 3},
1342                             .numberOfConsumers = 1,
1343                             .scale = 0.0f,
1344                             .zeroPoint = 0,
1345                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
1346                             .channelQuant = {},
1347                             .isIgnored = false,
1348                             .data = TestBuffer::createFromVector<float>({})
1349                         }, { // output02
1350                             .type = TestOperandType::TENSOR_INT32,
1351                             .dimensions = {2, 3},
1352                             .numberOfConsumers = 0,
1353                             .scale = 0.0f,
1354                             .zeroPoint = 0,
1355                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1356                             .channelQuant = {},
1357                             .isIgnored = false,
1358                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6})
1359                         }, { // input01_new
1360                             .type = TestOperandType::TENSOR_FLOAT32,
1361                             .dimensions = {2, 3},
1362                             .numberOfConsumers = 1,
1363                             .scale = 0.0f,
1364                             .zeroPoint = 0,
1365                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1366                             .channelQuant = {},
1367                             .isIgnored = false,
1368                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
1369                         }, { // placeholder10
1370                             .type = TestOperandType::TENSOR_FLOAT32,
1371                             .dimensions = {1},
1372                             .numberOfConsumers = 1,
1373                             .scale = 0.0f,
1374                             .zeroPoint = 0,
1375                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1376                             .channelQuant = {},
1377                             .isIgnored = false,
1378                             .data = TestBuffer::createFromVector<float>({0.0f})
1379                         }, { // param10
1380                             .type = TestOperandType::INT32,
1381                             .dimensions = {},
1382                             .numberOfConsumers = 1,
1383                             .scale = 0.0f,
1384                             .zeroPoint = 0,
1385                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1386                             .channelQuant = {},
1387                             .isIgnored = false,
1388                             .data = TestBuffer::createFromVector<int32_t>({0})
1389                         }},
1390                 .operations = {{
1391                             .type = TestOperationType::ADD,
1392                             .inputs = {2, 3, 4},
1393                             .outputs = {0}
1394                         }, {
1395                             .type = TestOperationType::CAST,
1396                             .inputs = {0},
1397                             .outputs = {1}
1398                         }},
1399                 .inputIndexes = {2},
1400                 .outputIndexes = {1}
1401             },
1402         .referenced = {},
1403         .isRelaxed = true,
1404         .expectedMultinomialDistributionTolerance = 0,
1405         .expectFailure = false,
1406         .minSupportedVersion = TestHalVersion::UNKNOWN
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         .main = {
1420                 .operands = {{ // input01
1421                             .type = TestOperandType::TENSOR_FLOAT32,
1422                             .dimensions = {2, 3},
1423                             .numberOfConsumers = 1,
1424                             .scale = 0.0f,
1425                             .zeroPoint = 0,
1426                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1427                             .channelQuant = {},
1428                             .isIgnored = false,
1429                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
1430                         }, { // output03
1431                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
1432                             .dimensions = {2, 3},
1433                             .numberOfConsumers = 0,
1434                             .scale = 4.0f,
1435                             .zeroPoint = 100,
1436                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1437                             .channelQuant = {},
1438                             .isIgnored = false,
1439                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6})
1440                         }},
1441                 .operations = {{
1442                             .type = TestOperationType::CAST,
1443                             .inputs = {0},
1444                             .outputs = {1}
1445                         }},
1446                 .inputIndexes = {0},
1447                 .outputIndexes = {1}
1448             },
1449         .referenced = {},
1450         .isRelaxed = false,
1451         .expectedMultinomialDistributionTolerance = 0,
1452         .expectFailure = false,
1453         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
1467                 .operands = {{ // input01
1468                             .type = TestOperandType::TENSOR_FLOAT32,
1469                             .dimensions = {2, 3},
1470                             .numberOfConsumers = 1,
1471                             .scale = 0.0f,
1472                             .zeroPoint = 0,
1473                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
1474                             .channelQuant = {},
1475                             .isIgnored = false,
1476                             .data = TestBuffer::createFromVector<float>({})
1477                         }, { // output03
1478                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
1479                             .dimensions = {2, 3},
1480                             .numberOfConsumers = 0,
1481                             .scale = 4.0f,
1482                             .zeroPoint = 100,
1483                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1484                             .channelQuant = {},
1485                             .isIgnored = false,
1486                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6})
1487                         }, { // input01_new
1488                             .type = TestOperandType::TENSOR_FLOAT32,
1489                             .dimensions = {2, 3},
1490                             .numberOfConsumers = 1,
1491                             .scale = 0.0f,
1492                             .zeroPoint = 0,
1493                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1494                             .channelQuant = {},
1495                             .isIgnored = false,
1496                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
1497                         }, { // placeholder11
1498                             .type = TestOperandType::TENSOR_FLOAT32,
1499                             .dimensions = {1},
1500                             .numberOfConsumers = 1,
1501                             .scale = 0.0f,
1502                             .zeroPoint = 0,
1503                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1504                             .channelQuant = {},
1505                             .isIgnored = false,
1506                             .data = TestBuffer::createFromVector<float>({0.0f})
1507                         }, { // param11
1508                             .type = TestOperandType::INT32,
1509                             .dimensions = {},
1510                             .numberOfConsumers = 1,
1511                             .scale = 0.0f,
1512                             .zeroPoint = 0,
1513                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1514                             .channelQuant = {},
1515                             .isIgnored = false,
1516                             .data = TestBuffer::createFromVector<int32_t>({0})
1517                         }},
1518                 .operations = {{
1519                             .type = TestOperationType::ADD,
1520                             .inputs = {2, 3, 4},
1521                             .outputs = {0}
1522                         }, {
1523                             .type = TestOperationType::CAST,
1524                             .inputs = {0},
1525                             .outputs = {1}
1526                         }},
1527                 .inputIndexes = {2},
1528                 .outputIndexes = {1}
1529             },
1530         .referenced = {},
1531         .isRelaxed = false,
1532         .expectedMultinomialDistributionTolerance = 0,
1533         .expectFailure = false,
1534         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
1548                 .operands = {{ // input01
1549                             .type = TestOperandType::TENSOR_FLOAT32,
1550                             .dimensions = {2, 3},
1551                             .numberOfConsumers = 1,
1552                             .scale = 0.0f,
1553                             .zeroPoint = 0,
1554                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1555                             .channelQuant = {},
1556                             .isIgnored = false,
1557                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
1558                         }, { // output03
1559                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
1560                             .dimensions = {2, 3},
1561                             .numberOfConsumers = 0,
1562                             .scale = 4.0f,
1563                             .zeroPoint = 100,
1564                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1565                             .channelQuant = {},
1566                             .isIgnored = false,
1567                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6})
1568                         }},
1569                 .operations = {{
1570                             .type = TestOperationType::CAST,
1571                             .inputs = {0},
1572                             .outputs = {1}
1573                         }},
1574                 .inputIndexes = {0},
1575                 .outputIndexes = {1}
1576             },
1577         .referenced = {},
1578         .isRelaxed = true,
1579         .expectedMultinomialDistributionTolerance = 0,
1580         .expectFailure = false,
1581         .minSupportedVersion = TestHalVersion::UNKNOWN
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         .main = {
1595                 .operands = {{ // input01
1596                             .type = TestOperandType::TENSOR_FLOAT32,
1597                             .dimensions = {2, 3},
1598                             .numberOfConsumers = 1,
1599                             .scale = 0.0f,
1600                             .zeroPoint = 0,
1601                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
1602                             .channelQuant = {},
1603                             .isIgnored = false,
1604                             .data = TestBuffer::createFromVector<float>({})
1605                         }, { // output03
1606                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
1607                             .dimensions = {2, 3},
1608                             .numberOfConsumers = 0,
1609                             .scale = 4.0f,
1610                             .zeroPoint = 100,
1611                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1612                             .channelQuant = {},
1613                             .isIgnored = false,
1614                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6})
1615                         }, { // input01_new
1616                             .type = TestOperandType::TENSOR_FLOAT32,
1617                             .dimensions = {2, 3},
1618                             .numberOfConsumers = 1,
1619                             .scale = 0.0f,
1620                             .zeroPoint = 0,
1621                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1622                             .channelQuant = {},
1623                             .isIgnored = false,
1624                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
1625                         }, { // placeholder12
1626                             .type = TestOperandType::TENSOR_FLOAT32,
1627                             .dimensions = {1},
1628                             .numberOfConsumers = 1,
1629                             .scale = 0.0f,
1630                             .zeroPoint = 0,
1631                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1632                             .channelQuant = {},
1633                             .isIgnored = false,
1634                             .data = TestBuffer::createFromVector<float>({0.0f})
1635                         }, { // param12
1636                             .type = TestOperandType::INT32,
1637                             .dimensions = {},
1638                             .numberOfConsumers = 1,
1639                             .scale = 0.0f,
1640                             .zeroPoint = 0,
1641                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1642                             .channelQuant = {},
1643                             .isIgnored = false,
1644                             .data = TestBuffer::createFromVector<int32_t>({0})
1645                         }},
1646                 .operations = {{
1647                             .type = TestOperationType::ADD,
1648                             .inputs = {2, 3, 4},
1649                             .outputs = {0}
1650                         }, {
1651                             .type = TestOperationType::CAST,
1652                             .inputs = {0},
1653                             .outputs = {1}
1654                         }},
1655                 .inputIndexes = {2},
1656                 .outputIndexes = {1}
1657             },
1658         .referenced = {},
1659         .isRelaxed = true,
1660         .expectedMultinomialDistributionTolerance = 0,
1661         .expectFailure = false,
1662         .minSupportedVersion = TestHalVersion::UNKNOWN
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         .main = {
1676                 .operands = {{ // input02
1677                             .type = TestOperandType::TENSOR_INT32,
1678                             .dimensions = {2, 3},
1679                             .numberOfConsumers = 1,
1680                             .scale = 0.0f,
1681                             .zeroPoint = 0,
1682                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1683                             .channelQuant = {},
1684                             .isIgnored = false,
1685                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6})
1686                         }, { // output0
1687                             .type = TestOperandType::TENSOR_FLOAT16,
1688                             .dimensions = {2, 3},
1689                             .numberOfConsumers = 0,
1690                             .scale = 0.0f,
1691                             .zeroPoint = 0,
1692                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1693                             .channelQuant = {},
1694                             .isIgnored = false,
1695                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
1696                         }},
1697                 .operations = {{
1698                             .type = TestOperationType::CAST,
1699                             .inputs = {0},
1700                             .outputs = {1}
1701                         }},
1702                 .inputIndexes = {0},
1703                 .outputIndexes = {1}
1704             },
1705         .referenced = {},
1706         .isRelaxed = false,
1707         .expectedMultinomialDistributionTolerance = 0,
1708         .expectFailure = false,
1709         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
1723                 .operands = {{ // input02
1724                             .type = TestOperandType::TENSOR_INT32,
1725                             .dimensions = {2, 3},
1726                             .numberOfConsumers = 1,
1727                             .scale = 0.0f,
1728                             .zeroPoint = 0,
1729                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1730                             .channelQuant = {},
1731                             .isIgnored = false,
1732                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6})
1733                         }, { // output01
1734                             .type = TestOperandType::TENSOR_FLOAT32,
1735                             .dimensions = {2, 3},
1736                             .numberOfConsumers = 0,
1737                             .scale = 0.0f,
1738                             .zeroPoint = 0,
1739                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1740                             .channelQuant = {},
1741                             .isIgnored = false,
1742                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
1743                         }},
1744                 .operations = {{
1745                             .type = TestOperationType::CAST,
1746                             .inputs = {0},
1747                             .outputs = {1}
1748                         }},
1749                 .inputIndexes = {0},
1750                 .outputIndexes = {1}
1751             },
1752         .referenced = {},
1753         .isRelaxed = false,
1754         .expectedMultinomialDistributionTolerance = 0,
1755         .expectFailure = false,
1756         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
1770                 .operands = {{ // input02
1771                             .type = TestOperandType::TENSOR_INT32,
1772                             .dimensions = {2, 3},
1773                             .numberOfConsumers = 1,
1774                             .scale = 0.0f,
1775                             .zeroPoint = 0,
1776                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1777                             .channelQuant = {},
1778                             .isIgnored = false,
1779                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6})
1780                         }, { // output01
1781                             .type = TestOperandType::TENSOR_FLOAT32,
1782                             .dimensions = {2, 3},
1783                             .numberOfConsumers = 0,
1784                             .scale = 0.0f,
1785                             .zeroPoint = 0,
1786                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1787                             .channelQuant = {},
1788                             .isIgnored = false,
1789                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
1790                         }},
1791                 .operations = {{
1792                             .type = TestOperationType::CAST,
1793                             .inputs = {0},
1794                             .outputs = {1}
1795                         }},
1796                 .inputIndexes = {0},
1797                 .outputIndexes = {1}
1798             },
1799         .referenced = {},
1800         .isRelaxed = true,
1801         .expectedMultinomialDistributionTolerance = 0,
1802         .expectFailure = false,
1803         .minSupportedVersion = TestHalVersion::UNKNOWN
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         .main = {
1817                 .operands = {{ // input02
1818                             .type = TestOperandType::TENSOR_INT32,
1819                             .dimensions = {2, 3},
1820                             .numberOfConsumers = 1,
1821                             .scale = 0.0f,
1822                             .zeroPoint = 0,
1823                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1824                             .channelQuant = {},
1825                             .isIgnored = false,
1826                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6})
1827                         }, { // output02
1828                             .type = TestOperandType::TENSOR_INT32,
1829                             .dimensions = {2, 3},
1830                             .numberOfConsumers = 0,
1831                             .scale = 0.0f,
1832                             .zeroPoint = 0,
1833                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1834                             .channelQuant = {},
1835                             .isIgnored = false,
1836                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6})
1837                         }},
1838                 .operations = {{
1839                             .type = TestOperationType::CAST,
1840                             .inputs = {0},
1841                             .outputs = {1}
1842                         }},
1843                 .inputIndexes = {0},
1844                 .outputIndexes = {1}
1845             },
1846         .referenced = {},
1847         .isRelaxed = false,
1848         .expectedMultinomialDistributionTolerance = 0,
1849         .expectFailure = false,
1850         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
1864                 .operands = {{ // input02
1865                             .type = TestOperandType::TENSOR_INT32,
1866                             .dimensions = {2, 3},
1867                             .numberOfConsumers = 1,
1868                             .scale = 0.0f,
1869                             .zeroPoint = 0,
1870                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1871                             .channelQuant = {},
1872                             .isIgnored = false,
1873                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6})
1874                         }, { // output03
1875                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
1876                             .dimensions = {2, 3},
1877                             .numberOfConsumers = 0,
1878                             .scale = 4.0f,
1879                             .zeroPoint = 100,
1880                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1881                             .channelQuant = {},
1882                             .isIgnored = false,
1883                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6})
1884                         }},
1885                 .operations = {{
1886                             .type = TestOperationType::CAST,
1887                             .inputs = {0},
1888                             .outputs = {1}
1889                         }},
1890                 .inputIndexes = {0},
1891                 .outputIndexes = {1}
1892             },
1893         .referenced = {},
1894         .isRelaxed = false,
1895         .expectedMultinomialDistributionTolerance = 0,
1896         .expectFailure = false,
1897         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
1911                 .operands = {{ // input03
1912                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
1913                             .dimensions = {2, 3},
1914                             .numberOfConsumers = 1,
1915                             .scale = 4.0f,
1916                             .zeroPoint = 100,
1917                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1918                             .channelQuant = {},
1919                             .isIgnored = false,
1920                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6})
1921                         }, { // output0
1922                             .type = TestOperandType::TENSOR_FLOAT16,
1923                             .dimensions = {2, 3},
1924                             .numberOfConsumers = 0,
1925                             .scale = 0.0f,
1926                             .zeroPoint = 0,
1927                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1928                             .channelQuant = {},
1929                             .isIgnored = false,
1930                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
1931                         }},
1932                 .operations = {{
1933                             .type = TestOperationType::CAST,
1934                             .inputs = {0},
1935                             .outputs = {1}
1936                         }},
1937                 .inputIndexes = {0},
1938                 .outputIndexes = {1}
1939             },
1940         .referenced = {},
1941         .isRelaxed = false,
1942         .expectedMultinomialDistributionTolerance = 0,
1943         .expectFailure = false,
1944         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
1958                 .operands = {{ // input03
1959                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
1960                             .dimensions = {2, 3},
1961                             .numberOfConsumers = 1,
1962                             .scale = 4.0f,
1963                             .zeroPoint = 100,
1964                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
1965                             .channelQuant = {},
1966                             .isIgnored = false,
1967                             .data = TestBuffer::createFromVector<uint8_t>({})
1968                         }, { // output0
1969                             .type = TestOperandType::TENSOR_FLOAT16,
1970                             .dimensions = {2, 3},
1971                             .numberOfConsumers = 0,
1972                             .scale = 0.0f,
1973                             .zeroPoint = 0,
1974                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
1975                             .channelQuant = {},
1976                             .isIgnored = false,
1977                             .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
1978                         }, { // input03_new
1979                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
1980                             .dimensions = {2, 3},
1981                             .numberOfConsumers = 1,
1982                             .scale = 4.0f,
1983                             .zeroPoint = 100,
1984                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
1985                             .channelQuant = {},
1986                             .isIgnored = false,
1987                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6})
1988                         }, { // placeholder13
1989                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
1990                             .dimensions = {1},
1991                             .numberOfConsumers = 1,
1992                             .scale = 4.0f,
1993                             .zeroPoint = 100,
1994                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
1995                             .channelQuant = {},
1996                             .isIgnored = false,
1997                             .data = TestBuffer::createFromVector<uint8_t>({100})
1998                         }, { // param13
1999                             .type = TestOperandType::INT32,
2000                             .dimensions = {},
2001                             .numberOfConsumers = 1,
2002                             .scale = 0.0f,
2003                             .zeroPoint = 0,
2004                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2005                             .channelQuant = {},
2006                             .isIgnored = false,
2007                             .data = TestBuffer::createFromVector<int32_t>({0})
2008                         }},
2009                 .operations = {{
2010                             .type = TestOperationType::ADD,
2011                             .inputs = {2, 3, 4},
2012                             .outputs = {0}
2013                         }, {
2014                             .type = TestOperationType::CAST,
2015                             .inputs = {0},
2016                             .outputs = {1}
2017                         }},
2018                 .inputIndexes = {2},
2019                 .outputIndexes = {1}
2020             },
2021         .referenced = {},
2022         .isRelaxed = false,
2023         .expectedMultinomialDistributionTolerance = 0,
2024         .expectFailure = false,
2025         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
2039                 .operands = {{ // input03
2040                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2041                             .dimensions = {2, 3},
2042                             .numberOfConsumers = 1,
2043                             .scale = 4.0f,
2044                             .zeroPoint = 100,
2045                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2046                             .channelQuant = {},
2047                             .isIgnored = false,
2048                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6})
2049                         }, { // output01
2050                             .type = TestOperandType::TENSOR_FLOAT32,
2051                             .dimensions = {2, 3},
2052                             .numberOfConsumers = 0,
2053                             .scale = 0.0f,
2054                             .zeroPoint = 0,
2055                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2056                             .channelQuant = {},
2057                             .isIgnored = false,
2058                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
2059                         }},
2060                 .operations = {{
2061                             .type = TestOperationType::CAST,
2062                             .inputs = {0},
2063                             .outputs = {1}
2064                         }},
2065                 .inputIndexes = {0},
2066                 .outputIndexes = {1}
2067             },
2068         .referenced = {},
2069         .isRelaxed = false,
2070         .expectedMultinomialDistributionTolerance = 0,
2071         .expectFailure = false,
2072         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
2086                 .operands = {{ // input03
2087                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2088                             .dimensions = {2, 3},
2089                             .numberOfConsumers = 1,
2090                             .scale = 4.0f,
2091                             .zeroPoint = 100,
2092                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
2093                             .channelQuant = {},
2094                             .isIgnored = false,
2095                             .data = TestBuffer::createFromVector<uint8_t>({})
2096                         }, { // output01
2097                             .type = TestOperandType::TENSOR_FLOAT32,
2098                             .dimensions = {2, 3},
2099                             .numberOfConsumers = 0,
2100                             .scale = 0.0f,
2101                             .zeroPoint = 0,
2102                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2103                             .channelQuant = {},
2104                             .isIgnored = false,
2105                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
2106                         }, { // input03_new
2107                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2108                             .dimensions = {2, 3},
2109                             .numberOfConsumers = 1,
2110                             .scale = 4.0f,
2111                             .zeroPoint = 100,
2112                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2113                             .channelQuant = {},
2114                             .isIgnored = false,
2115                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6})
2116                         }, { // placeholder14
2117                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2118                             .dimensions = {1},
2119                             .numberOfConsumers = 1,
2120                             .scale = 4.0f,
2121                             .zeroPoint = 100,
2122                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2123                             .channelQuant = {},
2124                             .isIgnored = false,
2125                             .data = TestBuffer::createFromVector<uint8_t>({100})
2126                         }, { // param14
2127                             .type = TestOperandType::INT32,
2128                             .dimensions = {},
2129                             .numberOfConsumers = 1,
2130                             .scale = 0.0f,
2131                             .zeroPoint = 0,
2132                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2133                             .channelQuant = {},
2134                             .isIgnored = false,
2135                             .data = TestBuffer::createFromVector<int32_t>({0})
2136                         }},
2137                 .operations = {{
2138                             .type = TestOperationType::ADD,
2139                             .inputs = {2, 3, 4},
2140                             .outputs = {0}
2141                         }, {
2142                             .type = TestOperationType::CAST,
2143                             .inputs = {0},
2144                             .outputs = {1}
2145                         }},
2146                 .inputIndexes = {2},
2147                 .outputIndexes = {1}
2148             },
2149         .referenced = {},
2150         .isRelaxed = false,
2151         .expectedMultinomialDistributionTolerance = 0,
2152         .expectFailure = false,
2153         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
2167                 .operands = {{ // input03
2168                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2169                             .dimensions = {2, 3},
2170                             .numberOfConsumers = 1,
2171                             .scale = 4.0f,
2172                             .zeroPoint = 100,
2173                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2174                             .channelQuant = {},
2175                             .isIgnored = false,
2176                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6})
2177                         }, { // output01
2178                             .type = TestOperandType::TENSOR_FLOAT32,
2179                             .dimensions = {2, 3},
2180                             .numberOfConsumers = 0,
2181                             .scale = 0.0f,
2182                             .zeroPoint = 0,
2183                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2184                             .channelQuant = {},
2185                             .isIgnored = false,
2186                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
2187                         }},
2188                 .operations = {{
2189                             .type = TestOperationType::CAST,
2190                             .inputs = {0},
2191                             .outputs = {1}
2192                         }},
2193                 .inputIndexes = {0},
2194                 .outputIndexes = {1}
2195             },
2196         .referenced = {},
2197         .isRelaxed = true,
2198         .expectedMultinomialDistributionTolerance = 0,
2199         .expectFailure = false,
2200         .minSupportedVersion = TestHalVersion::UNKNOWN
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         .main = {
2214                 .operands = {{ // input03
2215                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2216                             .dimensions = {2, 3},
2217                             .numberOfConsumers = 1,
2218                             .scale = 4.0f,
2219                             .zeroPoint = 100,
2220                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
2221                             .channelQuant = {},
2222                             .isIgnored = false,
2223                             .data = TestBuffer::createFromVector<uint8_t>({})
2224                         }, { // output01
2225                             .type = TestOperandType::TENSOR_FLOAT32,
2226                             .dimensions = {2, 3},
2227                             .numberOfConsumers = 0,
2228                             .scale = 0.0f,
2229                             .zeroPoint = 0,
2230                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2231                             .channelQuant = {},
2232                             .isIgnored = false,
2233                             .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})
2234                         }, { // input03_new
2235                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2236                             .dimensions = {2, 3},
2237                             .numberOfConsumers = 1,
2238                             .scale = 4.0f,
2239                             .zeroPoint = 100,
2240                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2241                             .channelQuant = {},
2242                             .isIgnored = false,
2243                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6})
2244                         }, { // placeholder15
2245                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2246                             .dimensions = {1},
2247                             .numberOfConsumers = 1,
2248                             .scale = 4.0f,
2249                             .zeroPoint = 100,
2250                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2251                             .channelQuant = {},
2252                             .isIgnored = false,
2253                             .data = TestBuffer::createFromVector<uint8_t>({100})
2254                         }, { // param15
2255                             .type = TestOperandType::INT32,
2256                             .dimensions = {},
2257                             .numberOfConsumers = 1,
2258                             .scale = 0.0f,
2259                             .zeroPoint = 0,
2260                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2261                             .channelQuant = {},
2262                             .isIgnored = false,
2263                             .data = TestBuffer::createFromVector<int32_t>({0})
2264                         }},
2265                 .operations = {{
2266                             .type = TestOperationType::ADD,
2267                             .inputs = {2, 3, 4},
2268                             .outputs = {0}
2269                         }, {
2270                             .type = TestOperationType::CAST,
2271                             .inputs = {0},
2272                             .outputs = {1}
2273                         }},
2274                 .inputIndexes = {2},
2275                 .outputIndexes = {1}
2276             },
2277         .referenced = {},
2278         .isRelaxed = true,
2279         .expectedMultinomialDistributionTolerance = 0,
2280         .expectFailure = false,
2281         .minSupportedVersion = TestHalVersion::UNKNOWN
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         .main = {
2295                 .operands = {{ // input03
2296                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2297                             .dimensions = {2, 3},
2298                             .numberOfConsumers = 1,
2299                             .scale = 4.0f,
2300                             .zeroPoint = 100,
2301                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2302                             .channelQuant = {},
2303                             .isIgnored = false,
2304                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6})
2305                         }, { // output02
2306                             .type = TestOperandType::TENSOR_INT32,
2307                             .dimensions = {2, 3},
2308                             .numberOfConsumers = 0,
2309                             .scale = 0.0f,
2310                             .zeroPoint = 0,
2311                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2312                             .channelQuant = {},
2313                             .isIgnored = false,
2314                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6})
2315                         }},
2316                 .operations = {{
2317                             .type = TestOperationType::CAST,
2318                             .inputs = {0},
2319                             .outputs = {1}
2320                         }},
2321                 .inputIndexes = {0},
2322                 .outputIndexes = {1}
2323             },
2324         .referenced = {},
2325         .isRelaxed = false,
2326         .expectedMultinomialDistributionTolerance = 0,
2327         .expectFailure = false,
2328         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
2342                 .operands = {{ // input03
2343                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2344                             .dimensions = {2, 3},
2345                             .numberOfConsumers = 1,
2346                             .scale = 4.0f,
2347                             .zeroPoint = 100,
2348                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
2349                             .channelQuant = {},
2350                             .isIgnored = false,
2351                             .data = TestBuffer::createFromVector<uint8_t>({})
2352                         }, { // output02
2353                             .type = TestOperandType::TENSOR_INT32,
2354                             .dimensions = {2, 3},
2355                             .numberOfConsumers = 0,
2356                             .scale = 0.0f,
2357                             .zeroPoint = 0,
2358                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2359                             .channelQuant = {},
2360                             .isIgnored = false,
2361                             .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6})
2362                         }, { // input03_new
2363                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2364                             .dimensions = {2, 3},
2365                             .numberOfConsumers = 1,
2366                             .scale = 4.0f,
2367                             .zeroPoint = 100,
2368                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2369                             .channelQuant = {},
2370                             .isIgnored = false,
2371                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6})
2372                         }, { // placeholder16
2373                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2374                             .dimensions = {1},
2375                             .numberOfConsumers = 1,
2376                             .scale = 4.0f,
2377                             .zeroPoint = 100,
2378                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2379                             .channelQuant = {},
2380                             .isIgnored = false,
2381                             .data = TestBuffer::createFromVector<uint8_t>({100})
2382                         }, { // param16
2383                             .type = TestOperandType::INT32,
2384                             .dimensions = {},
2385                             .numberOfConsumers = 1,
2386                             .scale = 0.0f,
2387                             .zeroPoint = 0,
2388                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2389                             .channelQuant = {},
2390                             .isIgnored = false,
2391                             .data = TestBuffer::createFromVector<int32_t>({0})
2392                         }},
2393                 .operations = {{
2394                             .type = TestOperationType::ADD,
2395                             .inputs = {2, 3, 4},
2396                             .outputs = {0}
2397                         }, {
2398                             .type = TestOperationType::CAST,
2399                             .inputs = {0},
2400                             .outputs = {1}
2401                         }},
2402                 .inputIndexes = {2},
2403                 .outputIndexes = {1}
2404             },
2405         .referenced = {},
2406         .isRelaxed = false,
2407         .expectedMultinomialDistributionTolerance = 0,
2408         .expectFailure = false,
2409         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
2423                 .operands = {{ // input03
2424                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2425                             .dimensions = {2, 3},
2426                             .numberOfConsumers = 1,
2427                             .scale = 4.0f,
2428                             .zeroPoint = 100,
2429                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2430                             .channelQuant = {},
2431                             .isIgnored = false,
2432                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6})
2433                         }, { // output03
2434                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2435                             .dimensions = {2, 3},
2436                             .numberOfConsumers = 0,
2437                             .scale = 4.0f,
2438                             .zeroPoint = 100,
2439                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2440                             .channelQuant = {},
2441                             .isIgnored = false,
2442                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6})
2443                         }},
2444                 .operations = {{
2445                             .type = TestOperationType::CAST,
2446                             .inputs = {0},
2447                             .outputs = {1}
2448                         }},
2449                 .inputIndexes = {0},
2450                 .outputIndexes = {1}
2451             },
2452         .referenced = {},
2453         .isRelaxed = false,
2454         .expectedMultinomialDistributionTolerance = 0,
2455         .expectFailure = false,
2456         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
2470                 .operands = {{ // input03
2471                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2472                             .dimensions = {2, 3},
2473                             .numberOfConsumers = 1,
2474                             .scale = 4.0f,
2475                             .zeroPoint = 100,
2476                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
2477                             .channelQuant = {},
2478                             .isIgnored = false,
2479                             .data = TestBuffer::createFromVector<uint8_t>({})
2480                         }, { // output03
2481                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2482                             .dimensions = {2, 3},
2483                             .numberOfConsumers = 0,
2484                             .scale = 4.0f,
2485                             .zeroPoint = 100,
2486                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2487                             .channelQuant = {},
2488                             .isIgnored = false,
2489                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6})
2490                         }, { // input03_new
2491                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2492                             .dimensions = {2, 3},
2493                             .numberOfConsumers = 1,
2494                             .scale = 4.0f,
2495                             .zeroPoint = 100,
2496                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2497                             .channelQuant = {},
2498                             .isIgnored = false,
2499                             .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6})
2500                         }, { // placeholder17
2501                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2502                             .dimensions = {1},
2503                             .numberOfConsumers = 1,
2504                             .scale = 4.0f,
2505                             .zeroPoint = 100,
2506                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2507                             .channelQuant = {},
2508                             .isIgnored = false,
2509                             .data = TestBuffer::createFromVector<uint8_t>({100})
2510                         }, { // param17
2511                             .type = TestOperandType::INT32,
2512                             .dimensions = {},
2513                             .numberOfConsumers = 1,
2514                             .scale = 0.0f,
2515                             .zeroPoint = 0,
2516                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2517                             .channelQuant = {},
2518                             .isIgnored = false,
2519                             .data = TestBuffer::createFromVector<int32_t>({0})
2520                         }},
2521                 .operations = {{
2522                             .type = TestOperationType::ADD,
2523                             .inputs = {2, 3, 4},
2524                             .outputs = {0}
2525                         }, {
2526                             .type = TestOperationType::CAST,
2527                             .inputs = {0},
2528                             .outputs = {1}
2529                         }},
2530                 .inputIndexes = {2},
2531                 .outputIndexes = {1}
2532             },
2533         .referenced = {},
2534         .isRelaxed = false,
2535         .expectedMultinomialDistributionTolerance = 0,
2536         .expectFailure = false,
2537         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
2551                 .operands = {{ // input04
2552                             .type = TestOperandType::TENSOR_FLOAT16,
2553                             .dimensions = {2},
2554                             .numberOfConsumers = 1,
2555                             .scale = 0.0f,
2556                             .zeroPoint = 0,
2557                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2558                             .channelQuant = {},
2559                             .isIgnored = false,
2560                             .data = TestBuffer::createFromVector<_Float16>({-1.0f, 256.0f})
2561                         }, { // output04
2562                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2563                             .dimensions = {2},
2564                             .numberOfConsumers = 0,
2565                             .scale = 4.0f,
2566                             .zeroPoint = 100,
2567                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2568                             .channelQuant = {},
2569                             .isIgnored = false,
2570                             .data = TestBuffer::createFromVector<uint8_t>({0, 255})
2571                         }},
2572                 .operations = {{
2573                             .type = TestOperationType::CAST,
2574                             .inputs = {0},
2575                             .outputs = {1}
2576                         }},
2577                 .inputIndexes = {0},
2578                 .outputIndexes = {1}
2579             },
2580         .referenced = {},
2581         .isRelaxed = false,
2582         .expectedMultinomialDistributionTolerance = 0,
2583         .expectFailure = false,
2584         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
2598                 .operands = {{ // input04
2599                             .type = TestOperandType::TENSOR_FLOAT16,
2600                             .dimensions = {2},
2601                             .numberOfConsumers = 1,
2602                             .scale = 0.0f,
2603                             .zeroPoint = 0,
2604                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
2605                             .channelQuant = {},
2606                             .isIgnored = false,
2607                             .data = TestBuffer::createFromVector<_Float16>({})
2608                         }, { // output04
2609                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2610                             .dimensions = {2},
2611                             .numberOfConsumers = 0,
2612                             .scale = 4.0f,
2613                             .zeroPoint = 100,
2614                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2615                             .channelQuant = {},
2616                             .isIgnored = false,
2617                             .data = TestBuffer::createFromVector<uint8_t>({0, 255})
2618                         }, { // input04_new
2619                             .type = TestOperandType::TENSOR_FLOAT16,
2620                             .dimensions = {2},
2621                             .numberOfConsumers = 1,
2622                             .scale = 0.0f,
2623                             .zeroPoint = 0,
2624                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2625                             .channelQuant = {},
2626                             .isIgnored = false,
2627                             .data = TestBuffer::createFromVector<_Float16>({-1.0f, 256.0f})
2628                         }, { // placeholder18
2629                             .type = TestOperandType::TENSOR_FLOAT16,
2630                             .dimensions = {1},
2631                             .numberOfConsumers = 1,
2632                             .scale = 0.0f,
2633                             .zeroPoint = 0,
2634                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2635                             .channelQuant = {},
2636                             .isIgnored = false,
2637                             .data = TestBuffer::createFromVector<_Float16>({0.0f})
2638                         }, { // param18
2639                             .type = TestOperandType::INT32,
2640                             .dimensions = {},
2641                             .numberOfConsumers = 1,
2642                             .scale = 0.0f,
2643                             .zeroPoint = 0,
2644                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2645                             .channelQuant = {},
2646                             .isIgnored = false,
2647                             .data = TestBuffer::createFromVector<int32_t>({0})
2648                         }},
2649                 .operations = {{
2650                             .type = TestOperationType::ADD,
2651                             .inputs = {2, 3, 4},
2652                             .outputs = {0}
2653                         }, {
2654                             .type = TestOperationType::CAST,
2655                             .inputs = {0},
2656                             .outputs = {1}
2657                         }},
2658                 .inputIndexes = {2},
2659                 .outputIndexes = {1}
2660             },
2661         .referenced = {},
2662         .isRelaxed = false,
2663         .expectedMultinomialDistributionTolerance = 0,
2664         .expectFailure = false,
2665         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
2679                 .operands = {{ // input05
2680                             .type = TestOperandType::TENSOR_FLOAT32,
2681                             .dimensions = {2},
2682                             .numberOfConsumers = 1,
2683                             .scale = 0.0f,
2684                             .zeroPoint = 0,
2685                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2686                             .channelQuant = {},
2687                             .isIgnored = false,
2688                             .data = TestBuffer::createFromVector<float>({-1.0f, 256.0f})
2689                         }, { // output05
2690                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2691                             .dimensions = {2},
2692                             .numberOfConsumers = 0,
2693                             .scale = 4.0f,
2694                             .zeroPoint = 100,
2695                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2696                             .channelQuant = {},
2697                             .isIgnored = false,
2698                             .data = TestBuffer::createFromVector<uint8_t>({0, 255})
2699                         }},
2700                 .operations = {{
2701                             .type = TestOperationType::CAST,
2702                             .inputs = {0},
2703                             .outputs = {1}
2704                         }},
2705                 .inputIndexes = {0},
2706                 .outputIndexes = {1}
2707             },
2708         .referenced = {},
2709         .isRelaxed = false,
2710         .expectedMultinomialDistributionTolerance = 0,
2711         .expectFailure = false,
2712         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
2726                 .operands = {{ // input05
2727                             .type = TestOperandType::TENSOR_FLOAT32,
2728                             .dimensions = {2},
2729                             .numberOfConsumers = 1,
2730                             .scale = 0.0f,
2731                             .zeroPoint = 0,
2732                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
2733                             .channelQuant = {},
2734                             .isIgnored = false,
2735                             .data = TestBuffer::createFromVector<float>({})
2736                         }, { // output05
2737                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2738                             .dimensions = {2},
2739                             .numberOfConsumers = 0,
2740                             .scale = 4.0f,
2741                             .zeroPoint = 100,
2742                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2743                             .channelQuant = {},
2744                             .isIgnored = false,
2745                             .data = TestBuffer::createFromVector<uint8_t>({0, 255})
2746                         }, { // input05_new
2747                             .type = TestOperandType::TENSOR_FLOAT32,
2748                             .dimensions = {2},
2749                             .numberOfConsumers = 1,
2750                             .scale = 0.0f,
2751                             .zeroPoint = 0,
2752                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2753                             .channelQuant = {},
2754                             .isIgnored = false,
2755                             .data = TestBuffer::createFromVector<float>({-1.0f, 256.0f})
2756                         }, { // placeholder19
2757                             .type = TestOperandType::TENSOR_FLOAT32,
2758                             .dimensions = {1},
2759                             .numberOfConsumers = 1,
2760                             .scale = 0.0f,
2761                             .zeroPoint = 0,
2762                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2763                             .channelQuant = {},
2764                             .isIgnored = false,
2765                             .data = TestBuffer::createFromVector<float>({0.0f})
2766                         }, { // param19
2767                             .type = TestOperandType::INT32,
2768                             .dimensions = {},
2769                             .numberOfConsumers = 1,
2770                             .scale = 0.0f,
2771                             .zeroPoint = 0,
2772                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2773                             .channelQuant = {},
2774                             .isIgnored = false,
2775                             .data = TestBuffer::createFromVector<int32_t>({0})
2776                         }},
2777                 .operations = {{
2778                             .type = TestOperationType::ADD,
2779                             .inputs = {2, 3, 4},
2780                             .outputs = {0}
2781                         }, {
2782                             .type = TestOperationType::CAST,
2783                             .inputs = {0},
2784                             .outputs = {1}
2785                         }},
2786                 .inputIndexes = {2},
2787                 .outputIndexes = {1}
2788             },
2789         .referenced = {},
2790         .isRelaxed = false,
2791         .expectedMultinomialDistributionTolerance = 0,
2792         .expectFailure = false,
2793         .minSupportedVersion = TestHalVersion::V1_2
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         .main = {
2807                 .operands = {{ // input05
2808                             .type = TestOperandType::TENSOR_FLOAT32,
2809                             .dimensions = {2},
2810                             .numberOfConsumers = 1,
2811                             .scale = 0.0f,
2812                             .zeroPoint = 0,
2813                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2814                             .channelQuant = {},
2815                             .isIgnored = false,
2816                             .data = TestBuffer::createFromVector<float>({-1.0f, 256.0f})
2817                         }, { // output05
2818                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2819                             .dimensions = {2},
2820                             .numberOfConsumers = 0,
2821                             .scale = 4.0f,
2822                             .zeroPoint = 100,
2823                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2824                             .channelQuant = {},
2825                             .isIgnored = false,
2826                             .data = TestBuffer::createFromVector<uint8_t>({0, 255})
2827                         }},
2828                 .operations = {{
2829                             .type = TestOperationType::CAST,
2830                             .inputs = {0},
2831                             .outputs = {1}
2832                         }},
2833                 .inputIndexes = {0},
2834                 .outputIndexes = {1}
2835             },
2836         .referenced = {},
2837         .isRelaxed = true,
2838         .expectedMultinomialDistributionTolerance = 0,
2839         .expectFailure = false,
2840         .minSupportedVersion = TestHalVersion::UNKNOWN
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         .main = {
2854                 .operands = {{ // input05
2855                             .type = TestOperandType::TENSOR_FLOAT32,
2856                             .dimensions = {2},
2857                             .numberOfConsumers = 1,
2858                             .scale = 0.0f,
2859                             .zeroPoint = 0,
2860                             .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
2861                             .channelQuant = {},
2862                             .isIgnored = false,
2863                             .data = TestBuffer::createFromVector<float>({})
2864                         }, { // output05
2865                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2866                             .dimensions = {2},
2867                             .numberOfConsumers = 0,
2868                             .scale = 4.0f,
2869                             .zeroPoint = 100,
2870                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2871                             .channelQuant = {},
2872                             .isIgnored = false,
2873                             .data = TestBuffer::createFromVector<uint8_t>({0, 255})
2874                         }, { // input05_new
2875                             .type = TestOperandType::TENSOR_FLOAT32,
2876                             .dimensions = {2},
2877                             .numberOfConsumers = 1,
2878                             .scale = 0.0f,
2879                             .zeroPoint = 0,
2880                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2881                             .channelQuant = {},
2882                             .isIgnored = false,
2883                             .data = TestBuffer::createFromVector<float>({-1.0f, 256.0f})
2884                         }, { // placeholder20
2885                             .type = TestOperandType::TENSOR_FLOAT32,
2886                             .dimensions = {1},
2887                             .numberOfConsumers = 1,
2888                             .scale = 0.0f,
2889                             .zeroPoint = 0,
2890                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2891                             .channelQuant = {},
2892                             .isIgnored = false,
2893                             .data = TestBuffer::createFromVector<float>({0.0f})
2894                         }, { // param20
2895                             .type = TestOperandType::INT32,
2896                             .dimensions = {},
2897                             .numberOfConsumers = 1,
2898                             .scale = 0.0f,
2899                             .zeroPoint = 0,
2900                             .lifetime = TestOperandLifeTime::CONSTANT_COPY,
2901                             .channelQuant = {},
2902                             .isIgnored = false,
2903                             .data = TestBuffer::createFromVector<int32_t>({0})
2904                         }},
2905                 .operations = {{
2906                             .type = TestOperationType::ADD,
2907                             .inputs = {2, 3, 4},
2908                             .outputs = {0}
2909                         }, {
2910                             .type = TestOperationType::CAST,
2911                             .inputs = {0},
2912                             .outputs = {1}
2913                         }},
2914                 .inputIndexes = {2},
2915                 .outputIndexes = {1}
2916             },
2917         .referenced = {},
2918         .isRelaxed = true,
2919         .expectedMultinomialDistributionTolerance = 0,
2920         .expectFailure = false,
2921         .minSupportedVersion = TestHalVersion::UNKNOWN
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         .main = {
2935                 .operands = {{ // input06
2936                             .type = TestOperandType::TENSOR_INT32,
2937                             .dimensions = {2},
2938                             .numberOfConsumers = 1,
2939                             .scale = 0.0f,
2940                             .zeroPoint = 0,
2941                             .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
2942                             .channelQuant = {},
2943                             .isIgnored = false,
2944                             .data = TestBuffer::createFromVector<int32_t>({-1, 256})
2945                         }, { // output06
2946                             .type = TestOperandType::TENSOR_QUANT8_ASYMM,
2947                             .dimensions = {2},
2948                             .numberOfConsumers = 0,
2949                             .scale = 4.0f,
2950                             .zeroPoint = 100,
2951                             .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT,
2952                             .channelQuant = {},
2953                             .isIgnored = false,
2954                             .data = TestBuffer::createFromVector<uint8_t>({0, 255})
2955                         }},
2956                 .operations = {{
2957                             .type = TestOperationType::CAST,
2958                             .inputs = {0},
2959                             .outputs = {1}
2960                         }},
2961                 .inputIndexes = {0},
2962                 .outputIndexes = {1}
2963             },
2964         .referenced = {},
2965         .isRelaxed = false,
2966         .expectedMultinomialDistributionTolerance = 0,
2967         .expectFailure = false,
2968         .minSupportedVersion = TestHalVersion::V1_2
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