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