1 // clang-format off 2 // Generated file (from: cast.mod.py). Do not edit 3 void CreateModel(Model *model) { 4 OperandType type0(Type::TENSOR_FLOAT16, {2, 3}); 5 // Phase 1, operands 6 auto input0 = model->addOperand(&type0); 7 auto output0 = model->addOperand(&type0); 8 // Phase 2, operations 9 model->addOperation(ANEURALNETWORKS_CAST, {input0}, {output0}); 10 // Phase 3, inputs and outputs 11 model->identifyInputsAndOutputs( 12 {input0}, 13 {output0}); 14 assert(model->isValid()); 15 } 16 17 inline bool is_ignored(int i) { 18 static std::set<int> ignore = {}; 19 return ignore.find(i) != ignore.end(); 20 } 21 22 void CreateModel_dynamic_output_shape(Model *model) { 23 OperandType type0(Type::TENSOR_FLOAT16, {2, 3}); 24 OperandType type8(Type::TENSOR_FLOAT16, {0, 0}); 25 // Phase 1, operands 26 auto input0 = model->addOperand(&type0); 27 auto output0 = model->addOperand(&type8); 28 // Phase 2, operations 29 model->addOperation(ANEURALNETWORKS_CAST, {input0}, {output0}); 30 // Phase 3, inputs and outputs 31 model->identifyInputsAndOutputs( 32 {input0}, 33 {output0}); 34 assert(model->isValid()); 35 } 36 37 inline bool is_ignored_dynamic_output_shape(int i) { 38 static std::set<int> ignore = {}; 39 return ignore.find(i) != ignore.end(); 40 } 41 42 void CreateModel_2(Model *model) { 43 OperandType type0(Type::TENSOR_FLOAT16, {2, 3}); 44 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 45 // Phase 1, operands 46 auto input0 = model->addOperand(&type0); 47 auto output01 = model->addOperand(&type1); 48 // Phase 2, operations 49 model->addOperation(ANEURALNETWORKS_CAST, {input0}, {output01}); 50 // Phase 3, inputs and outputs 51 model->identifyInputsAndOutputs( 52 {input0}, 53 {output01}); 54 assert(model->isValid()); 55 } 56 57 inline bool is_ignored_2(int i) { 58 static std::set<int> ignore = {}; 59 return ignore.find(i) != ignore.end(); 60 } 61 62 void CreateModel_relaxed(Model *model) { 63 OperandType type0(Type::TENSOR_FLOAT16, {2, 3}); 64 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 65 // Phase 1, operands 66 auto input0 = model->addOperand(&type0); 67 auto output01 = model->addOperand(&type1); 68 // Phase 2, operations 69 model->addOperation(ANEURALNETWORKS_CAST, {input0}, {output01}); 70 // Phase 3, inputs and outputs 71 model->identifyInputsAndOutputs( 72 {input0}, 73 {output01}); 74 // Phase 4: set relaxed execution 75 model->relaxComputationFloat32toFloat16(true); 76 assert(model->isValid()); 77 } 78 79 inline bool is_ignored_relaxed(int i) { 80 static std::set<int> ignore = {}; 81 return ignore.find(i) != ignore.end(); 82 } 83 84 void CreateModel_dynamic_output_shape_2(Model *model) { 85 OperandType type0(Type::TENSOR_FLOAT16, {2, 3}); 86 OperandType type9(Type::TENSOR_FLOAT32, {0, 0}); 87 // Phase 1, operands 88 auto input0 = model->addOperand(&type0); 89 auto output01 = model->addOperand(&type9); 90 // Phase 2, operations 91 model->addOperation(ANEURALNETWORKS_CAST, {input0}, {output01}); 92 // Phase 3, inputs and outputs 93 model->identifyInputsAndOutputs( 94 {input0}, 95 {output01}); 96 assert(model->isValid()); 97 } 98 99 inline bool is_ignored_dynamic_output_shape_2(int i) { 100 static std::set<int> ignore = {}; 101 return ignore.find(i) != ignore.end(); 102 } 103 104 void CreateModel_dynamic_output_shape_relaxed(Model *model) { 105 OperandType type0(Type::TENSOR_FLOAT16, {2, 3}); 106 OperandType type9(Type::TENSOR_FLOAT32, {0, 0}); 107 // Phase 1, operands 108 auto input0 = model->addOperand(&type0); 109 auto output01 = model->addOperand(&type9); 110 // Phase 2, operations 111 model->addOperation(ANEURALNETWORKS_CAST, {input0}, {output01}); 112 // Phase 3, inputs and outputs 113 model->identifyInputsAndOutputs( 114 {input0}, 115 {output01}); 116 // Phase 4: set relaxed execution 117 model->relaxComputationFloat32toFloat16(true); 118 assert(model->isValid()); 119 } 120 121 inline bool is_ignored_dynamic_output_shape_relaxed(int i) { 122 static std::set<int> ignore = {}; 123 return ignore.find(i) != ignore.end(); 124 } 125 126 void CreateModel_3(Model *model) { 127 OperandType type0(Type::TENSOR_FLOAT16, {2, 3}); 128 OperandType type2(Type::TENSOR_INT32, {2, 3}); 129 // Phase 1, operands 130 auto input0 = model->addOperand(&type0); 131 auto output02 = model->addOperand(&type2); 132 // Phase 2, operations 133 model->addOperation(ANEURALNETWORKS_CAST, {input0}, {output02}); 134 // Phase 3, inputs and outputs 135 model->identifyInputsAndOutputs( 136 {input0}, 137 {output02}); 138 assert(model->isValid()); 139 } 140 141 inline bool is_ignored_3(int i) { 142 static std::set<int> ignore = {}; 143 return ignore.find(i) != ignore.end(); 144 } 145 146 void CreateModel_dynamic_output_shape_3(Model *model) { 147 OperandType type0(Type::TENSOR_FLOAT16, {2, 3}); 148 OperandType type10(Type::TENSOR_INT32, {0, 0}); 149 // Phase 1, operands 150 auto input0 = model->addOperand(&type0); 151 auto output02 = model->addOperand(&type10); 152 // Phase 2, operations 153 model->addOperation(ANEURALNETWORKS_CAST, {input0}, {output02}); 154 // Phase 3, inputs and outputs 155 model->identifyInputsAndOutputs( 156 {input0}, 157 {output02}); 158 assert(model->isValid()); 159 } 160 161 inline bool is_ignored_dynamic_output_shape_3(int i) { 162 static std::set<int> ignore = {}; 163 return ignore.find(i) != ignore.end(); 164 } 165 166 void CreateModel_4(Model *model) { 167 OperandType type0(Type::TENSOR_FLOAT16, {2, 3}); 168 OperandType type3(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 4.0f, 100); 169 // Phase 1, operands 170 auto input0 = model->addOperand(&type0); 171 auto output03 = model->addOperand(&type3); 172 // Phase 2, operations 173 model->addOperation(ANEURALNETWORKS_CAST, {input0}, {output03}); 174 // Phase 3, inputs and outputs 175 model->identifyInputsAndOutputs( 176 {input0}, 177 {output03}); 178 assert(model->isValid()); 179 } 180 181 inline bool is_ignored_4(int i) { 182 static std::set<int> ignore = {}; 183 return ignore.find(i) != ignore.end(); 184 } 185 186 void CreateModel_dynamic_output_shape_4(Model *model) { 187 OperandType type0(Type::TENSOR_FLOAT16, {2, 3}); 188 OperandType type11(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 4.0f, 100); 189 // Phase 1, operands 190 auto input0 = model->addOperand(&type0); 191 auto output03 = model->addOperand(&type11); 192 // Phase 2, operations 193 model->addOperation(ANEURALNETWORKS_CAST, {input0}, {output03}); 194 // Phase 3, inputs and outputs 195 model->identifyInputsAndOutputs( 196 {input0}, 197 {output03}); 198 assert(model->isValid()); 199 } 200 201 inline bool is_ignored_dynamic_output_shape_4(int i) { 202 static std::set<int> ignore = {}; 203 return ignore.find(i) != ignore.end(); 204 } 205 206 void CreateModel_5(Model *model) { 207 OperandType type0(Type::TENSOR_FLOAT16, {2, 3}); 208 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 209 // Phase 1, operands 210 auto input01 = model->addOperand(&type1); 211 auto output0 = model->addOperand(&type0); 212 // Phase 2, operations 213 model->addOperation(ANEURALNETWORKS_CAST, {input01}, {output0}); 214 // Phase 3, inputs and outputs 215 model->identifyInputsAndOutputs( 216 {input01}, 217 {output0}); 218 assert(model->isValid()); 219 } 220 221 inline bool is_ignored_5(int i) { 222 static std::set<int> ignore = {}; 223 return ignore.find(i) != ignore.end(); 224 } 225 226 void CreateModel_relaxed_2(Model *model) { 227 OperandType type0(Type::TENSOR_FLOAT16, {2, 3}); 228 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 229 // Phase 1, operands 230 auto input01 = model->addOperand(&type1); 231 auto output0 = model->addOperand(&type0); 232 // Phase 2, operations 233 model->addOperation(ANEURALNETWORKS_CAST, {input01}, {output0}); 234 // Phase 3, inputs and outputs 235 model->identifyInputsAndOutputs( 236 {input01}, 237 {output0}); 238 // Phase 4: set relaxed execution 239 model->relaxComputationFloat32toFloat16(true); 240 assert(model->isValid()); 241 } 242 243 inline bool is_ignored_relaxed_2(int i) { 244 static std::set<int> ignore = {}; 245 return ignore.find(i) != ignore.end(); 246 } 247 248 void CreateModel_dynamic_output_shape_5(Model *model) { 249 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 250 OperandType type8(Type::TENSOR_FLOAT16, {0, 0}); 251 // Phase 1, operands 252 auto input01 = model->addOperand(&type1); 253 auto output0 = model->addOperand(&type8); 254 // Phase 2, operations 255 model->addOperation(ANEURALNETWORKS_CAST, {input01}, {output0}); 256 // Phase 3, inputs and outputs 257 model->identifyInputsAndOutputs( 258 {input01}, 259 {output0}); 260 assert(model->isValid()); 261 } 262 263 inline bool is_ignored_dynamic_output_shape_5(int i) { 264 static std::set<int> ignore = {}; 265 return ignore.find(i) != ignore.end(); 266 } 267 268 void CreateModel_dynamic_output_shape_relaxed_2(Model *model) { 269 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 270 OperandType type8(Type::TENSOR_FLOAT16, {0, 0}); 271 // Phase 1, operands 272 auto input01 = model->addOperand(&type1); 273 auto output0 = model->addOperand(&type8); 274 // Phase 2, operations 275 model->addOperation(ANEURALNETWORKS_CAST, {input01}, {output0}); 276 // Phase 3, inputs and outputs 277 model->identifyInputsAndOutputs( 278 {input01}, 279 {output0}); 280 // Phase 4: set relaxed execution 281 model->relaxComputationFloat32toFloat16(true); 282 assert(model->isValid()); 283 } 284 285 inline bool is_ignored_dynamic_output_shape_relaxed_2(int i) { 286 static std::set<int> ignore = {}; 287 return ignore.find(i) != ignore.end(); 288 } 289 290 void CreateModel_6(Model *model) { 291 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 292 // Phase 1, operands 293 auto input01 = model->addOperand(&type1); 294 auto output01 = model->addOperand(&type1); 295 // Phase 2, operations 296 model->addOperation(ANEURALNETWORKS_CAST, {input01}, {output01}); 297 // Phase 3, inputs and outputs 298 model->identifyInputsAndOutputs( 299 {input01}, 300 {output01}); 301 assert(model->isValid()); 302 } 303 304 inline bool is_ignored_6(int i) { 305 static std::set<int> ignore = {}; 306 return ignore.find(i) != ignore.end(); 307 } 308 309 void CreateModel_relaxed_3(Model *model) { 310 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 311 // Phase 1, operands 312 auto input01 = model->addOperand(&type1); 313 auto output01 = model->addOperand(&type1); 314 // Phase 2, operations 315 model->addOperation(ANEURALNETWORKS_CAST, {input01}, {output01}); 316 // Phase 3, inputs and outputs 317 model->identifyInputsAndOutputs( 318 {input01}, 319 {output01}); 320 // Phase 4: set relaxed execution 321 model->relaxComputationFloat32toFloat16(true); 322 assert(model->isValid()); 323 } 324 325 inline bool is_ignored_relaxed_3(int i) { 326 static std::set<int> ignore = {}; 327 return ignore.find(i) != ignore.end(); 328 } 329 330 void CreateModel_dynamic_output_shape_6(Model *model) { 331 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 332 OperandType type9(Type::TENSOR_FLOAT32, {0, 0}); 333 // Phase 1, operands 334 auto input01 = model->addOperand(&type1); 335 auto output01 = model->addOperand(&type9); 336 // Phase 2, operations 337 model->addOperation(ANEURALNETWORKS_CAST, {input01}, {output01}); 338 // Phase 3, inputs and outputs 339 model->identifyInputsAndOutputs( 340 {input01}, 341 {output01}); 342 assert(model->isValid()); 343 } 344 345 inline bool is_ignored_dynamic_output_shape_6(int i) { 346 static std::set<int> ignore = {}; 347 return ignore.find(i) != ignore.end(); 348 } 349 350 void CreateModel_dynamic_output_shape_relaxed_3(Model *model) { 351 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 352 OperandType type9(Type::TENSOR_FLOAT32, {0, 0}); 353 // Phase 1, operands 354 auto input01 = model->addOperand(&type1); 355 auto output01 = model->addOperand(&type9); 356 // Phase 2, operations 357 model->addOperation(ANEURALNETWORKS_CAST, {input01}, {output01}); 358 // Phase 3, inputs and outputs 359 model->identifyInputsAndOutputs( 360 {input01}, 361 {output01}); 362 // Phase 4: set relaxed execution 363 model->relaxComputationFloat32toFloat16(true); 364 assert(model->isValid()); 365 } 366 367 inline bool is_ignored_dynamic_output_shape_relaxed_3(int i) { 368 static std::set<int> ignore = {}; 369 return ignore.find(i) != ignore.end(); 370 } 371 372 void CreateModel_7(Model *model) { 373 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 374 OperandType type2(Type::TENSOR_INT32, {2, 3}); 375 // Phase 1, operands 376 auto input01 = model->addOperand(&type1); 377 auto output02 = model->addOperand(&type2); 378 // Phase 2, operations 379 model->addOperation(ANEURALNETWORKS_CAST, {input01}, {output02}); 380 // Phase 3, inputs and outputs 381 model->identifyInputsAndOutputs( 382 {input01}, 383 {output02}); 384 assert(model->isValid()); 385 } 386 387 inline bool is_ignored_7(int i) { 388 static std::set<int> ignore = {}; 389 return ignore.find(i) != ignore.end(); 390 } 391 392 void CreateModel_relaxed_4(Model *model) { 393 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 394 OperandType type2(Type::TENSOR_INT32, {2, 3}); 395 // Phase 1, operands 396 auto input01 = model->addOperand(&type1); 397 auto output02 = model->addOperand(&type2); 398 // Phase 2, operations 399 model->addOperation(ANEURALNETWORKS_CAST, {input01}, {output02}); 400 // Phase 3, inputs and outputs 401 model->identifyInputsAndOutputs( 402 {input01}, 403 {output02}); 404 // Phase 4: set relaxed execution 405 model->relaxComputationFloat32toFloat16(true); 406 assert(model->isValid()); 407 } 408 409 inline bool is_ignored_relaxed_4(int i) { 410 static std::set<int> ignore = {}; 411 return ignore.find(i) != ignore.end(); 412 } 413 414 void CreateModel_dynamic_output_shape_7(Model *model) { 415 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 416 OperandType type10(Type::TENSOR_INT32, {0, 0}); 417 // Phase 1, operands 418 auto input01 = model->addOperand(&type1); 419 auto output02 = model->addOperand(&type10); 420 // Phase 2, operations 421 model->addOperation(ANEURALNETWORKS_CAST, {input01}, {output02}); 422 // Phase 3, inputs and outputs 423 model->identifyInputsAndOutputs( 424 {input01}, 425 {output02}); 426 assert(model->isValid()); 427 } 428 429 inline bool is_ignored_dynamic_output_shape_7(int i) { 430 static std::set<int> ignore = {}; 431 return ignore.find(i) != ignore.end(); 432 } 433 434 void CreateModel_dynamic_output_shape_relaxed_4(Model *model) { 435 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 436 OperandType type10(Type::TENSOR_INT32, {0, 0}); 437 // Phase 1, operands 438 auto input01 = model->addOperand(&type1); 439 auto output02 = model->addOperand(&type10); 440 // Phase 2, operations 441 model->addOperation(ANEURALNETWORKS_CAST, {input01}, {output02}); 442 // Phase 3, inputs and outputs 443 model->identifyInputsAndOutputs( 444 {input01}, 445 {output02}); 446 // Phase 4: set relaxed execution 447 model->relaxComputationFloat32toFloat16(true); 448 assert(model->isValid()); 449 } 450 451 inline bool is_ignored_dynamic_output_shape_relaxed_4(int i) { 452 static std::set<int> ignore = {}; 453 return ignore.find(i) != ignore.end(); 454 } 455 456 void CreateModel_8(Model *model) { 457 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 458 OperandType type3(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 4.0f, 100); 459 // Phase 1, operands 460 auto input01 = model->addOperand(&type1); 461 auto output03 = model->addOperand(&type3); 462 // Phase 2, operations 463 model->addOperation(ANEURALNETWORKS_CAST, {input01}, {output03}); 464 // Phase 3, inputs and outputs 465 model->identifyInputsAndOutputs( 466 {input01}, 467 {output03}); 468 assert(model->isValid()); 469 } 470 471 inline bool is_ignored_8(int i) { 472 static std::set<int> ignore = {}; 473 return ignore.find(i) != ignore.end(); 474 } 475 476 void CreateModel_relaxed_5(Model *model) { 477 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 478 OperandType type3(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 4.0f, 100); 479 // Phase 1, operands 480 auto input01 = model->addOperand(&type1); 481 auto output03 = model->addOperand(&type3); 482 // Phase 2, operations 483 model->addOperation(ANEURALNETWORKS_CAST, {input01}, {output03}); 484 // Phase 3, inputs and outputs 485 model->identifyInputsAndOutputs( 486 {input01}, 487 {output03}); 488 // Phase 4: set relaxed execution 489 model->relaxComputationFloat32toFloat16(true); 490 assert(model->isValid()); 491 } 492 493 inline bool is_ignored_relaxed_5(int i) { 494 static std::set<int> ignore = {}; 495 return ignore.find(i) != ignore.end(); 496 } 497 498 void CreateModel_dynamic_output_shape_8(Model *model) { 499 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 500 OperandType type11(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 4.0f, 100); 501 // Phase 1, operands 502 auto input01 = model->addOperand(&type1); 503 auto output03 = model->addOperand(&type11); 504 // Phase 2, operations 505 model->addOperation(ANEURALNETWORKS_CAST, {input01}, {output03}); 506 // Phase 3, inputs and outputs 507 model->identifyInputsAndOutputs( 508 {input01}, 509 {output03}); 510 assert(model->isValid()); 511 } 512 513 inline bool is_ignored_dynamic_output_shape_8(int i) { 514 static std::set<int> ignore = {}; 515 return ignore.find(i) != ignore.end(); 516 } 517 518 void CreateModel_dynamic_output_shape_relaxed_5(Model *model) { 519 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 520 OperandType type11(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 4.0f, 100); 521 // Phase 1, operands 522 auto input01 = model->addOperand(&type1); 523 auto output03 = model->addOperand(&type11); 524 // Phase 2, operations 525 model->addOperation(ANEURALNETWORKS_CAST, {input01}, {output03}); 526 // Phase 3, inputs and outputs 527 model->identifyInputsAndOutputs( 528 {input01}, 529 {output03}); 530 // Phase 4: set relaxed execution 531 model->relaxComputationFloat32toFloat16(true); 532 assert(model->isValid()); 533 } 534 535 inline bool is_ignored_dynamic_output_shape_relaxed_5(int i) { 536 static std::set<int> ignore = {}; 537 return ignore.find(i) != ignore.end(); 538 } 539 540 void CreateModel_9(Model *model) { 541 OperandType type0(Type::TENSOR_FLOAT16, {2, 3}); 542 OperandType type2(Type::TENSOR_INT32, {2, 3}); 543 // Phase 1, operands 544 auto input02 = model->addOperand(&type2); 545 auto output0 = model->addOperand(&type0); 546 // Phase 2, operations 547 model->addOperation(ANEURALNETWORKS_CAST, {input02}, {output0}); 548 // Phase 3, inputs and outputs 549 model->identifyInputsAndOutputs( 550 {input02}, 551 {output0}); 552 assert(model->isValid()); 553 } 554 555 inline bool is_ignored_9(int i) { 556 static std::set<int> ignore = {}; 557 return ignore.find(i) != ignore.end(); 558 } 559 560 void CreateModel_dynamic_output_shape_9(Model *model) { 561 OperandType type2(Type::TENSOR_INT32, {2, 3}); 562 OperandType type8(Type::TENSOR_FLOAT16, {0, 0}); 563 // Phase 1, operands 564 auto input02 = model->addOperand(&type2); 565 auto output0 = model->addOperand(&type8); 566 // Phase 2, operations 567 model->addOperation(ANEURALNETWORKS_CAST, {input02}, {output0}); 568 // Phase 3, inputs and outputs 569 model->identifyInputsAndOutputs( 570 {input02}, 571 {output0}); 572 assert(model->isValid()); 573 } 574 575 inline bool is_ignored_dynamic_output_shape_9(int i) { 576 static std::set<int> ignore = {}; 577 return ignore.find(i) != ignore.end(); 578 } 579 580 void CreateModel_10(Model *model) { 581 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 582 OperandType type2(Type::TENSOR_INT32, {2, 3}); 583 // Phase 1, operands 584 auto input02 = model->addOperand(&type2); 585 auto output01 = model->addOperand(&type1); 586 // Phase 2, operations 587 model->addOperation(ANEURALNETWORKS_CAST, {input02}, {output01}); 588 // Phase 3, inputs and outputs 589 model->identifyInputsAndOutputs( 590 {input02}, 591 {output01}); 592 assert(model->isValid()); 593 } 594 595 inline bool is_ignored_10(int i) { 596 static std::set<int> ignore = {}; 597 return ignore.find(i) != ignore.end(); 598 } 599 600 void CreateModel_relaxed_6(Model *model) { 601 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 602 OperandType type2(Type::TENSOR_INT32, {2, 3}); 603 // Phase 1, operands 604 auto input02 = model->addOperand(&type2); 605 auto output01 = model->addOperand(&type1); 606 // Phase 2, operations 607 model->addOperation(ANEURALNETWORKS_CAST, {input02}, {output01}); 608 // Phase 3, inputs and outputs 609 model->identifyInputsAndOutputs( 610 {input02}, 611 {output01}); 612 // Phase 4: set relaxed execution 613 model->relaxComputationFloat32toFloat16(true); 614 assert(model->isValid()); 615 } 616 617 inline bool is_ignored_relaxed_6(int i) { 618 static std::set<int> ignore = {}; 619 return ignore.find(i) != ignore.end(); 620 } 621 622 void CreateModel_dynamic_output_shape_10(Model *model) { 623 OperandType type2(Type::TENSOR_INT32, {2, 3}); 624 OperandType type9(Type::TENSOR_FLOAT32, {0, 0}); 625 // Phase 1, operands 626 auto input02 = model->addOperand(&type2); 627 auto output01 = model->addOperand(&type9); 628 // Phase 2, operations 629 model->addOperation(ANEURALNETWORKS_CAST, {input02}, {output01}); 630 // Phase 3, inputs and outputs 631 model->identifyInputsAndOutputs( 632 {input02}, 633 {output01}); 634 assert(model->isValid()); 635 } 636 637 inline bool is_ignored_dynamic_output_shape_10(int i) { 638 static std::set<int> ignore = {}; 639 return ignore.find(i) != ignore.end(); 640 } 641 642 void CreateModel_dynamic_output_shape_relaxed_6(Model *model) { 643 OperandType type2(Type::TENSOR_INT32, {2, 3}); 644 OperandType type9(Type::TENSOR_FLOAT32, {0, 0}); 645 // Phase 1, operands 646 auto input02 = model->addOperand(&type2); 647 auto output01 = model->addOperand(&type9); 648 // Phase 2, operations 649 model->addOperation(ANEURALNETWORKS_CAST, {input02}, {output01}); 650 // Phase 3, inputs and outputs 651 model->identifyInputsAndOutputs( 652 {input02}, 653 {output01}); 654 // Phase 4: set relaxed execution 655 model->relaxComputationFloat32toFloat16(true); 656 assert(model->isValid()); 657 } 658 659 inline bool is_ignored_dynamic_output_shape_relaxed_6(int i) { 660 static std::set<int> ignore = {}; 661 return ignore.find(i) != ignore.end(); 662 } 663 664 void CreateModel_11(Model *model) { 665 OperandType type2(Type::TENSOR_INT32, {2, 3}); 666 // Phase 1, operands 667 auto input02 = model->addOperand(&type2); 668 auto output02 = model->addOperand(&type2); 669 // Phase 2, operations 670 model->addOperation(ANEURALNETWORKS_CAST, {input02}, {output02}); 671 // Phase 3, inputs and outputs 672 model->identifyInputsAndOutputs( 673 {input02}, 674 {output02}); 675 assert(model->isValid()); 676 } 677 678 inline bool is_ignored_11(int i) { 679 static std::set<int> ignore = {}; 680 return ignore.find(i) != ignore.end(); 681 } 682 683 void CreateModel_dynamic_output_shape_11(Model *model) { 684 OperandType type10(Type::TENSOR_INT32, {0, 0}); 685 OperandType type2(Type::TENSOR_INT32, {2, 3}); 686 // Phase 1, operands 687 auto input02 = model->addOperand(&type2); 688 auto output02 = model->addOperand(&type10); 689 // Phase 2, operations 690 model->addOperation(ANEURALNETWORKS_CAST, {input02}, {output02}); 691 // Phase 3, inputs and outputs 692 model->identifyInputsAndOutputs( 693 {input02}, 694 {output02}); 695 assert(model->isValid()); 696 } 697 698 inline bool is_ignored_dynamic_output_shape_11(int i) { 699 static std::set<int> ignore = {}; 700 return ignore.find(i) != ignore.end(); 701 } 702 703 void CreateModel_12(Model *model) { 704 OperandType type2(Type::TENSOR_INT32, {2, 3}); 705 OperandType type3(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 4.0f, 100); 706 // Phase 1, operands 707 auto input02 = model->addOperand(&type2); 708 auto output03 = model->addOperand(&type3); 709 // Phase 2, operations 710 model->addOperation(ANEURALNETWORKS_CAST, {input02}, {output03}); 711 // Phase 3, inputs and outputs 712 model->identifyInputsAndOutputs( 713 {input02}, 714 {output03}); 715 assert(model->isValid()); 716 } 717 718 inline bool is_ignored_12(int i) { 719 static std::set<int> ignore = {}; 720 return ignore.find(i) != ignore.end(); 721 } 722 723 void CreateModel_dynamic_output_shape_12(Model *model) { 724 OperandType type11(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 4.0f, 100); 725 OperandType type2(Type::TENSOR_INT32, {2, 3}); 726 // Phase 1, operands 727 auto input02 = model->addOperand(&type2); 728 auto output03 = model->addOperand(&type11); 729 // Phase 2, operations 730 model->addOperation(ANEURALNETWORKS_CAST, {input02}, {output03}); 731 // Phase 3, inputs and outputs 732 model->identifyInputsAndOutputs( 733 {input02}, 734 {output03}); 735 assert(model->isValid()); 736 } 737 738 inline bool is_ignored_dynamic_output_shape_12(int i) { 739 static std::set<int> ignore = {}; 740 return ignore.find(i) != ignore.end(); 741 } 742 743 void CreateModel_13(Model *model) { 744 OperandType type0(Type::TENSOR_FLOAT16, {2, 3}); 745 OperandType type3(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 4.0f, 100); 746 // Phase 1, operands 747 auto input03 = model->addOperand(&type3); 748 auto output0 = model->addOperand(&type0); 749 // Phase 2, operations 750 model->addOperation(ANEURALNETWORKS_CAST, {input03}, {output0}); 751 // Phase 3, inputs and outputs 752 model->identifyInputsAndOutputs( 753 {input03}, 754 {output0}); 755 assert(model->isValid()); 756 } 757 758 inline bool is_ignored_13(int i) { 759 static std::set<int> ignore = {}; 760 return ignore.find(i) != ignore.end(); 761 } 762 763 void CreateModel_dynamic_output_shape_13(Model *model) { 764 OperandType type3(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 4.0f, 100); 765 OperandType type8(Type::TENSOR_FLOAT16, {0, 0}); 766 // Phase 1, operands 767 auto input03 = model->addOperand(&type3); 768 auto output0 = model->addOperand(&type8); 769 // Phase 2, operations 770 model->addOperation(ANEURALNETWORKS_CAST, {input03}, {output0}); 771 // Phase 3, inputs and outputs 772 model->identifyInputsAndOutputs( 773 {input03}, 774 {output0}); 775 assert(model->isValid()); 776 } 777 778 inline bool is_ignored_dynamic_output_shape_13(int i) { 779 static std::set<int> ignore = {}; 780 return ignore.find(i) != ignore.end(); 781 } 782 783 void CreateModel_14(Model *model) { 784 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 785 OperandType type3(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 4.0f, 100); 786 // Phase 1, operands 787 auto input03 = model->addOperand(&type3); 788 auto output01 = model->addOperand(&type1); 789 // Phase 2, operations 790 model->addOperation(ANEURALNETWORKS_CAST, {input03}, {output01}); 791 // Phase 3, inputs and outputs 792 model->identifyInputsAndOutputs( 793 {input03}, 794 {output01}); 795 assert(model->isValid()); 796 } 797 798 inline bool is_ignored_14(int i) { 799 static std::set<int> ignore = {}; 800 return ignore.find(i) != ignore.end(); 801 } 802 803 void CreateModel_relaxed_7(Model *model) { 804 OperandType type1(Type::TENSOR_FLOAT32, {2, 3}); 805 OperandType type3(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 4.0f, 100); 806 // Phase 1, operands 807 auto input03 = model->addOperand(&type3); 808 auto output01 = model->addOperand(&type1); 809 // Phase 2, operations 810 model->addOperation(ANEURALNETWORKS_CAST, {input03}, {output01}); 811 // Phase 3, inputs and outputs 812 model->identifyInputsAndOutputs( 813 {input03}, 814 {output01}); 815 // Phase 4: set relaxed execution 816 model->relaxComputationFloat32toFloat16(true); 817 assert(model->isValid()); 818 } 819 820 inline bool is_ignored_relaxed_7(int i) { 821 static std::set<int> ignore = {}; 822 return ignore.find(i) != ignore.end(); 823 } 824 825 void CreateModel_dynamic_output_shape_14(Model *model) { 826 OperandType type3(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 4.0f, 100); 827 OperandType type9(Type::TENSOR_FLOAT32, {0, 0}); 828 // Phase 1, operands 829 auto input03 = model->addOperand(&type3); 830 auto output01 = model->addOperand(&type9); 831 // Phase 2, operations 832 model->addOperation(ANEURALNETWORKS_CAST, {input03}, {output01}); 833 // Phase 3, inputs and outputs 834 model->identifyInputsAndOutputs( 835 {input03}, 836 {output01}); 837 assert(model->isValid()); 838 } 839 840 inline bool is_ignored_dynamic_output_shape_14(int i) { 841 static std::set<int> ignore = {}; 842 return ignore.find(i) != ignore.end(); 843 } 844 845 void CreateModel_dynamic_output_shape_relaxed_7(Model *model) { 846 OperandType type3(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 4.0f, 100); 847 OperandType type9(Type::TENSOR_FLOAT32, {0, 0}); 848 // Phase 1, operands 849 auto input03 = model->addOperand(&type3); 850 auto output01 = model->addOperand(&type9); 851 // Phase 2, operations 852 model->addOperation(ANEURALNETWORKS_CAST, {input03}, {output01}); 853 // Phase 3, inputs and outputs 854 model->identifyInputsAndOutputs( 855 {input03}, 856 {output01}); 857 // Phase 4: set relaxed execution 858 model->relaxComputationFloat32toFloat16(true); 859 assert(model->isValid()); 860 } 861 862 inline bool is_ignored_dynamic_output_shape_relaxed_7(int i) { 863 static std::set<int> ignore = {}; 864 return ignore.find(i) != ignore.end(); 865 } 866 867 void CreateModel_15(Model *model) { 868 OperandType type2(Type::TENSOR_INT32, {2, 3}); 869 OperandType type3(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 4.0f, 100); 870 // Phase 1, operands 871 auto input03 = model->addOperand(&type3); 872 auto output02 = model->addOperand(&type2); 873 // Phase 2, operations 874 model->addOperation(ANEURALNETWORKS_CAST, {input03}, {output02}); 875 // Phase 3, inputs and outputs 876 model->identifyInputsAndOutputs( 877 {input03}, 878 {output02}); 879 assert(model->isValid()); 880 } 881 882 inline bool is_ignored_15(int i) { 883 static std::set<int> ignore = {}; 884 return ignore.find(i) != ignore.end(); 885 } 886 887 void CreateModel_dynamic_output_shape_15(Model *model) { 888 OperandType type10(Type::TENSOR_INT32, {0, 0}); 889 OperandType type3(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 4.0f, 100); 890 // Phase 1, operands 891 auto input03 = model->addOperand(&type3); 892 auto output02 = model->addOperand(&type10); 893 // Phase 2, operations 894 model->addOperation(ANEURALNETWORKS_CAST, {input03}, {output02}); 895 // Phase 3, inputs and outputs 896 model->identifyInputsAndOutputs( 897 {input03}, 898 {output02}); 899 assert(model->isValid()); 900 } 901 902 inline bool is_ignored_dynamic_output_shape_15(int i) { 903 static std::set<int> ignore = {}; 904 return ignore.find(i) != ignore.end(); 905 } 906 907 void CreateModel_16(Model *model) { 908 OperandType type3(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 4.0f, 100); 909 // Phase 1, operands 910 auto input03 = model->addOperand(&type3); 911 auto output03 = model->addOperand(&type3); 912 // Phase 2, operations 913 model->addOperation(ANEURALNETWORKS_CAST, {input03}, {output03}); 914 // Phase 3, inputs and outputs 915 model->identifyInputsAndOutputs( 916 {input03}, 917 {output03}); 918 assert(model->isValid()); 919 } 920 921 inline bool is_ignored_16(int i) { 922 static std::set<int> ignore = {}; 923 return ignore.find(i) != ignore.end(); 924 } 925 926 void CreateModel_dynamic_output_shape_16(Model *model) { 927 OperandType type11(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 4.0f, 100); 928 OperandType type3(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 4.0f, 100); 929 // Phase 1, operands 930 auto input03 = model->addOperand(&type3); 931 auto output03 = model->addOperand(&type11); 932 // Phase 2, operations 933 model->addOperation(ANEURALNETWORKS_CAST, {input03}, {output03}); 934 // Phase 3, inputs and outputs 935 model->identifyInputsAndOutputs( 936 {input03}, 937 {output03}); 938 assert(model->isValid()); 939 } 940 941 inline bool is_ignored_dynamic_output_shape_16(int i) { 942 static std::set<int> ignore = {}; 943 return ignore.find(i) != ignore.end(); 944 } 945 946 void CreateModel_17(Model *model) { 947 OperandType type4(Type::TENSOR_FLOAT16, {2}); 948 OperandType type7(Type::TENSOR_QUANT8_ASYMM, {2}, 4.0f, 100); 949 // Phase 1, operands 950 auto input04 = model->addOperand(&type4); 951 auto output04 = model->addOperand(&type7); 952 // Phase 2, operations 953 model->addOperation(ANEURALNETWORKS_CAST, {input04}, {output04}); 954 // Phase 3, inputs and outputs 955 model->identifyInputsAndOutputs( 956 {input04}, 957 {output04}); 958 assert(model->isValid()); 959 } 960 961 inline bool is_ignored_17(int i) { 962 static std::set<int> ignore = {}; 963 return ignore.find(i) != ignore.end(); 964 } 965 966 void CreateModel_dynamic_output_shape_17(Model *model) { 967 OperandType type12(Type::TENSOR_QUANT8_ASYMM, {0}, 4.0f, 100); 968 OperandType type4(Type::TENSOR_FLOAT16, {2}); 969 // Phase 1, operands 970 auto input04 = model->addOperand(&type4); 971 auto output04 = model->addOperand(&type12); 972 // Phase 2, operations 973 model->addOperation(ANEURALNETWORKS_CAST, {input04}, {output04}); 974 // Phase 3, inputs and outputs 975 model->identifyInputsAndOutputs( 976 {input04}, 977 {output04}); 978 assert(model->isValid()); 979 } 980 981 inline bool is_ignored_dynamic_output_shape_17(int i) { 982 static std::set<int> ignore = {}; 983 return ignore.find(i) != ignore.end(); 984 } 985 986 void CreateModel_18(Model *model) { 987 OperandType type5(Type::TENSOR_FLOAT32, {2}); 988 OperandType type7(Type::TENSOR_QUANT8_ASYMM, {2}, 4.0f, 100); 989 // Phase 1, operands 990 auto input05 = model->addOperand(&type5); 991 auto output05 = model->addOperand(&type7); 992 // Phase 2, operations 993 model->addOperation(ANEURALNETWORKS_CAST, {input05}, {output05}); 994 // Phase 3, inputs and outputs 995 model->identifyInputsAndOutputs( 996 {input05}, 997 {output05}); 998 assert(model->isValid()); 999 } 1000 1001 inline bool is_ignored_18(int i) { 1002 static std::set<int> ignore = {}; 1003 return ignore.find(i) != ignore.end(); 1004 } 1005 1006 void CreateModel_relaxed_8(Model *model) { 1007 OperandType type5(Type::TENSOR_FLOAT32, {2}); 1008 OperandType type7(Type::TENSOR_QUANT8_ASYMM, {2}, 4.0f, 100); 1009 // Phase 1, operands 1010 auto input05 = model->addOperand(&type5); 1011 auto output05 = model->addOperand(&type7); 1012 // Phase 2, operations 1013 model->addOperation(ANEURALNETWORKS_CAST, {input05}, {output05}); 1014 // Phase 3, inputs and outputs 1015 model->identifyInputsAndOutputs( 1016 {input05}, 1017 {output05}); 1018 // Phase 4: set relaxed execution 1019 model->relaxComputationFloat32toFloat16(true); 1020 assert(model->isValid()); 1021 } 1022 1023 inline bool is_ignored_relaxed_8(int i) { 1024 static std::set<int> ignore = {}; 1025 return ignore.find(i) != ignore.end(); 1026 } 1027 1028 void CreateModel_dynamic_output_shape_18(Model *model) { 1029 OperandType type12(Type::TENSOR_QUANT8_ASYMM, {0}, 4.0f, 100); 1030 OperandType type5(Type::TENSOR_FLOAT32, {2}); 1031 // Phase 1, operands 1032 auto input05 = model->addOperand(&type5); 1033 auto output05 = model->addOperand(&type12); 1034 // Phase 2, operations 1035 model->addOperation(ANEURALNETWORKS_CAST, {input05}, {output05}); 1036 // Phase 3, inputs and outputs 1037 model->identifyInputsAndOutputs( 1038 {input05}, 1039 {output05}); 1040 assert(model->isValid()); 1041 } 1042 1043 inline bool is_ignored_dynamic_output_shape_18(int i) { 1044 static std::set<int> ignore = {}; 1045 return ignore.find(i) != ignore.end(); 1046 } 1047 1048 void CreateModel_dynamic_output_shape_relaxed_8(Model *model) { 1049 OperandType type12(Type::TENSOR_QUANT8_ASYMM, {0}, 4.0f, 100); 1050 OperandType type5(Type::TENSOR_FLOAT32, {2}); 1051 // Phase 1, operands 1052 auto input05 = model->addOperand(&type5); 1053 auto output05 = model->addOperand(&type12); 1054 // Phase 2, operations 1055 model->addOperation(ANEURALNETWORKS_CAST, {input05}, {output05}); 1056 // Phase 3, inputs and outputs 1057 model->identifyInputsAndOutputs( 1058 {input05}, 1059 {output05}); 1060 // Phase 4: set relaxed execution 1061 model->relaxComputationFloat32toFloat16(true); 1062 assert(model->isValid()); 1063 } 1064 1065 inline bool is_ignored_dynamic_output_shape_relaxed_8(int i) { 1066 static std::set<int> ignore = {}; 1067 return ignore.find(i) != ignore.end(); 1068 } 1069 1070 void CreateModel_19(Model *model) { 1071 OperandType type6(Type::TENSOR_INT32, {2}); 1072 OperandType type7(Type::TENSOR_QUANT8_ASYMM, {2}, 4.0f, 100); 1073 // Phase 1, operands 1074 auto input06 = model->addOperand(&type6); 1075 auto output06 = model->addOperand(&type7); 1076 // Phase 2, operations 1077 model->addOperation(ANEURALNETWORKS_CAST, {input06}, {output06}); 1078 // Phase 3, inputs and outputs 1079 model->identifyInputsAndOutputs( 1080 {input06}, 1081 {output06}); 1082 assert(model->isValid()); 1083 } 1084 1085 inline bool is_ignored_19(int i) { 1086 static std::set<int> ignore = {}; 1087 return ignore.find(i) != ignore.end(); 1088 } 1089 1090 void CreateModel_dynamic_output_shape_19(Model *model) { 1091 OperandType type12(Type::TENSOR_QUANT8_ASYMM, {0}, 4.0f, 100); 1092 OperandType type6(Type::TENSOR_INT32, {2}); 1093 // Phase 1, operands 1094 auto input06 = model->addOperand(&type6); 1095 auto output06 = model->addOperand(&type12); 1096 // Phase 2, operations 1097 model->addOperation(ANEURALNETWORKS_CAST, {input06}, {output06}); 1098 // Phase 3, inputs and outputs 1099 model->identifyInputsAndOutputs( 1100 {input06}, 1101 {output06}); 1102 assert(model->isValid()); 1103 } 1104 1105 inline bool is_ignored_dynamic_output_shape_19(int i) { 1106 static std::set<int> ignore = {}; 1107 return ignore.find(i) != ignore.end(); 1108 } 1109 1110