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