1 // clang-format off 2 // Generated file (from: detection_postprocess.mod.py). Do not edit 3 // Create the model 4 Model createTestModel_regular() { 5 const std::vector<Operand> operands = { 6 { 7 .type = OperandType::TENSOR_FLOAT32, 8 .dimensions = {1, 6, 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_FLOAT32, 17 .dimensions = {1, 6, 4}, 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 = {6, 4}, 27 .numberOfConsumers = 1, 28 .scale = 0.0f, 29 .zeroPoint = 0, 30 .lifetime = OperandLifeTime::MODEL_INPUT, 31 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 32 }, 33 { 34 .type = OperandType::FLOAT32, 35 .dimensions = {}, 36 .numberOfConsumers = 1, 37 .scale = 0.0f, 38 .zeroPoint = 0, 39 .lifetime = OperandLifeTime::CONSTANT_COPY, 40 .location = {.poolIndex = 0, .offset = 0, .length = 4}, 41 }, 42 { 43 .type = OperandType::FLOAT32, 44 .dimensions = {}, 45 .numberOfConsumers = 1, 46 .scale = 0.0f, 47 .zeroPoint = 0, 48 .lifetime = OperandLifeTime::CONSTANT_COPY, 49 .location = {.poolIndex = 0, .offset = 4, .length = 4}, 50 }, 51 { 52 .type = OperandType::FLOAT32, 53 .dimensions = {}, 54 .numberOfConsumers = 1, 55 .scale = 0.0f, 56 .zeroPoint = 0, 57 .lifetime = OperandLifeTime::CONSTANT_COPY, 58 .location = {.poolIndex = 0, .offset = 8, .length = 4}, 59 }, 60 { 61 .type = OperandType::FLOAT32, 62 .dimensions = {}, 63 .numberOfConsumers = 1, 64 .scale = 0.0f, 65 .zeroPoint = 0, 66 .lifetime = OperandLifeTime::CONSTANT_COPY, 67 .location = {.poolIndex = 0, .offset = 12, .length = 4}, 68 }, 69 { 70 .type = OperandType::BOOL, 71 .dimensions = {}, 72 .numberOfConsumers = 1, 73 .scale = 0.0f, 74 .zeroPoint = 0, 75 .lifetime = OperandLifeTime::CONSTANT_COPY, 76 .location = {.poolIndex = 0, .offset = 16, .length = 1}, 77 }, 78 { 79 .type = OperandType::INT32, 80 .dimensions = {}, 81 .numberOfConsumers = 1, 82 .scale = 0.0f, 83 .zeroPoint = 0, 84 .lifetime = OperandLifeTime::CONSTANT_COPY, 85 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 86 }, 87 { 88 .type = OperandType::INT32, 89 .dimensions = {}, 90 .numberOfConsumers = 1, 91 .scale = 0.0f, 92 .zeroPoint = 0, 93 .lifetime = OperandLifeTime::CONSTANT_COPY, 94 .location = {.poolIndex = 0, .offset = 21, .length = 4}, 95 }, 96 { 97 .type = OperandType::INT32, 98 .dimensions = {}, 99 .numberOfConsumers = 1, 100 .scale = 0.0f, 101 .zeroPoint = 0, 102 .lifetime = OperandLifeTime::CONSTANT_COPY, 103 .location = {.poolIndex = 0, .offset = 25, .length = 4}, 104 }, 105 { 106 .type = OperandType::FLOAT32, 107 .dimensions = {}, 108 .numberOfConsumers = 1, 109 .scale = 0.0f, 110 .zeroPoint = 0, 111 .lifetime = OperandLifeTime::CONSTANT_COPY, 112 .location = {.poolIndex = 0, .offset = 29, .length = 4}, 113 }, 114 { 115 .type = OperandType::FLOAT32, 116 .dimensions = {}, 117 .numberOfConsumers = 1, 118 .scale = 0.0f, 119 .zeroPoint = 0, 120 .lifetime = OperandLifeTime::CONSTANT_COPY, 121 .location = {.poolIndex = 0, .offset = 33, .length = 4}, 122 }, 123 { 124 .type = OperandType::BOOL, 125 .dimensions = {}, 126 .numberOfConsumers = 1, 127 .scale = 0.0f, 128 .zeroPoint = 0, 129 .lifetime = OperandLifeTime::CONSTANT_COPY, 130 .location = {.poolIndex = 0, .offset = 37, .length = 1}, 131 }, 132 { 133 .type = OperandType::TENSOR_FLOAT32, 134 .dimensions = {1, 3}, 135 .numberOfConsumers = 0, 136 .scale = 0.0f, 137 .zeroPoint = 0, 138 .lifetime = OperandLifeTime::MODEL_OUTPUT, 139 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 140 }, 141 { 142 .type = OperandType::TENSOR_FLOAT32, 143 .dimensions = {1, 3, 4}, 144 .numberOfConsumers = 0, 145 .scale = 0.0f, 146 .zeroPoint = 0, 147 .lifetime = OperandLifeTime::MODEL_OUTPUT, 148 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 149 }, 150 { 151 .type = OperandType::TENSOR_INT32, 152 .dimensions = {1, 3}, 153 .numberOfConsumers = 0, 154 .scale = 0.0f, 155 .zeroPoint = 0, 156 .lifetime = OperandLifeTime::MODEL_OUTPUT, 157 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 158 }, 159 { 160 .type = OperandType::TENSOR_INT32, 161 .dimensions = {1}, 162 .numberOfConsumers = 0, 163 .scale = 0.0f, 164 .zeroPoint = 0, 165 .lifetime = OperandLifeTime::MODEL_OUTPUT, 166 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 167 } 168 }; 169 170 const std::vector<Operation> operations = { 171 { 172 .type = OperationType::DETECTION_POSTPROCESSING, 173 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 174 .outputs = {14, 15, 16, 17}, 175 } 176 }; 177 178 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 179 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 180 std::vector<uint8_t> operandValues = { 181 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 160, 64, 0, 0, 160, 64, 1, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0 182 }; 183 const std::vector<hidl_memory> pools = {}; 184 185 return { 186 .operands = operands, 187 .operations = operations, 188 .inputIndexes = inputIndexes, 189 .outputIndexes = outputIndexes, 190 .operandValues = operandValues, 191 .pools = pools, 192 }; 193 } 194 195 inline bool is_ignored_regular(int i) { 196 static std::set<int> ignore = {}; 197 return ignore.find(i) != ignore.end(); 198 } 199 200 // Create the model 201 Model createTestModel_regular_relaxed() { 202 const std::vector<Operand> operands = { 203 { 204 .type = OperandType::TENSOR_FLOAT32, 205 .dimensions = {1, 6, 3}, 206 .numberOfConsumers = 1, 207 .scale = 0.0f, 208 .zeroPoint = 0, 209 .lifetime = OperandLifeTime::MODEL_INPUT, 210 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 211 }, 212 { 213 .type = OperandType::TENSOR_FLOAT32, 214 .dimensions = {1, 6, 4}, 215 .numberOfConsumers = 1, 216 .scale = 0.0f, 217 .zeroPoint = 0, 218 .lifetime = OperandLifeTime::MODEL_INPUT, 219 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 220 }, 221 { 222 .type = OperandType::TENSOR_FLOAT32, 223 .dimensions = {6, 4}, 224 .numberOfConsumers = 1, 225 .scale = 0.0f, 226 .zeroPoint = 0, 227 .lifetime = OperandLifeTime::MODEL_INPUT, 228 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 229 }, 230 { 231 .type = OperandType::FLOAT32, 232 .dimensions = {}, 233 .numberOfConsumers = 1, 234 .scale = 0.0f, 235 .zeroPoint = 0, 236 .lifetime = OperandLifeTime::CONSTANT_COPY, 237 .location = {.poolIndex = 0, .offset = 0, .length = 4}, 238 }, 239 { 240 .type = OperandType::FLOAT32, 241 .dimensions = {}, 242 .numberOfConsumers = 1, 243 .scale = 0.0f, 244 .zeroPoint = 0, 245 .lifetime = OperandLifeTime::CONSTANT_COPY, 246 .location = {.poolIndex = 0, .offset = 4, .length = 4}, 247 }, 248 { 249 .type = OperandType::FLOAT32, 250 .dimensions = {}, 251 .numberOfConsumers = 1, 252 .scale = 0.0f, 253 .zeroPoint = 0, 254 .lifetime = OperandLifeTime::CONSTANT_COPY, 255 .location = {.poolIndex = 0, .offset = 8, .length = 4}, 256 }, 257 { 258 .type = OperandType::FLOAT32, 259 .dimensions = {}, 260 .numberOfConsumers = 1, 261 .scale = 0.0f, 262 .zeroPoint = 0, 263 .lifetime = OperandLifeTime::CONSTANT_COPY, 264 .location = {.poolIndex = 0, .offset = 12, .length = 4}, 265 }, 266 { 267 .type = OperandType::BOOL, 268 .dimensions = {}, 269 .numberOfConsumers = 1, 270 .scale = 0.0f, 271 .zeroPoint = 0, 272 .lifetime = OperandLifeTime::CONSTANT_COPY, 273 .location = {.poolIndex = 0, .offset = 16, .length = 1}, 274 }, 275 { 276 .type = OperandType::INT32, 277 .dimensions = {}, 278 .numberOfConsumers = 1, 279 .scale = 0.0f, 280 .zeroPoint = 0, 281 .lifetime = OperandLifeTime::CONSTANT_COPY, 282 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 283 }, 284 { 285 .type = OperandType::INT32, 286 .dimensions = {}, 287 .numberOfConsumers = 1, 288 .scale = 0.0f, 289 .zeroPoint = 0, 290 .lifetime = OperandLifeTime::CONSTANT_COPY, 291 .location = {.poolIndex = 0, .offset = 21, .length = 4}, 292 }, 293 { 294 .type = OperandType::INT32, 295 .dimensions = {}, 296 .numberOfConsumers = 1, 297 .scale = 0.0f, 298 .zeroPoint = 0, 299 .lifetime = OperandLifeTime::CONSTANT_COPY, 300 .location = {.poolIndex = 0, .offset = 25, .length = 4}, 301 }, 302 { 303 .type = OperandType::FLOAT32, 304 .dimensions = {}, 305 .numberOfConsumers = 1, 306 .scale = 0.0f, 307 .zeroPoint = 0, 308 .lifetime = OperandLifeTime::CONSTANT_COPY, 309 .location = {.poolIndex = 0, .offset = 29, .length = 4}, 310 }, 311 { 312 .type = OperandType::FLOAT32, 313 .dimensions = {}, 314 .numberOfConsumers = 1, 315 .scale = 0.0f, 316 .zeroPoint = 0, 317 .lifetime = OperandLifeTime::CONSTANT_COPY, 318 .location = {.poolIndex = 0, .offset = 33, .length = 4}, 319 }, 320 { 321 .type = OperandType::BOOL, 322 .dimensions = {}, 323 .numberOfConsumers = 1, 324 .scale = 0.0f, 325 .zeroPoint = 0, 326 .lifetime = OperandLifeTime::CONSTANT_COPY, 327 .location = {.poolIndex = 0, .offset = 37, .length = 1}, 328 }, 329 { 330 .type = OperandType::TENSOR_FLOAT32, 331 .dimensions = {1, 3}, 332 .numberOfConsumers = 0, 333 .scale = 0.0f, 334 .zeroPoint = 0, 335 .lifetime = OperandLifeTime::MODEL_OUTPUT, 336 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 337 }, 338 { 339 .type = OperandType::TENSOR_FLOAT32, 340 .dimensions = {1, 3, 4}, 341 .numberOfConsumers = 0, 342 .scale = 0.0f, 343 .zeroPoint = 0, 344 .lifetime = OperandLifeTime::MODEL_OUTPUT, 345 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 346 }, 347 { 348 .type = OperandType::TENSOR_INT32, 349 .dimensions = {1, 3}, 350 .numberOfConsumers = 0, 351 .scale = 0.0f, 352 .zeroPoint = 0, 353 .lifetime = OperandLifeTime::MODEL_OUTPUT, 354 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 355 }, 356 { 357 .type = OperandType::TENSOR_INT32, 358 .dimensions = {1}, 359 .numberOfConsumers = 0, 360 .scale = 0.0f, 361 .zeroPoint = 0, 362 .lifetime = OperandLifeTime::MODEL_OUTPUT, 363 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 364 } 365 }; 366 367 const std::vector<Operation> operations = { 368 { 369 .type = OperationType::DETECTION_POSTPROCESSING, 370 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 371 .outputs = {14, 15, 16, 17}, 372 } 373 }; 374 375 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 376 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 377 std::vector<uint8_t> operandValues = { 378 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 160, 64, 0, 0, 160, 64, 1, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0 379 }; 380 const std::vector<hidl_memory> pools = {}; 381 382 return { 383 .operands = operands, 384 .operations = operations, 385 .inputIndexes = inputIndexes, 386 .outputIndexes = outputIndexes, 387 .operandValues = operandValues, 388 .pools = pools, 389 .relaxComputationFloat32toFloat16 = true, 390 }; 391 } 392 393 inline bool is_ignored_regular_relaxed(int i) { 394 static std::set<int> ignore = {}; 395 return ignore.find(i) != ignore.end(); 396 } 397 398 // Create the model 399 Model createTestModel_regular_float16() { 400 const std::vector<Operand> operands = { 401 { 402 .type = OperandType::TENSOR_FLOAT16, 403 .dimensions = {1, 6, 3}, 404 .numberOfConsumers = 1, 405 .scale = 0.0f, 406 .zeroPoint = 0, 407 .lifetime = OperandLifeTime::MODEL_INPUT, 408 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 409 }, 410 { 411 .type = OperandType::TENSOR_FLOAT16, 412 .dimensions = {1, 6, 4}, 413 .numberOfConsumers = 1, 414 .scale = 0.0f, 415 .zeroPoint = 0, 416 .lifetime = OperandLifeTime::MODEL_INPUT, 417 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 418 }, 419 { 420 .type = OperandType::TENSOR_FLOAT16, 421 .dimensions = {6, 4}, 422 .numberOfConsumers = 1, 423 .scale = 0.0f, 424 .zeroPoint = 0, 425 .lifetime = OperandLifeTime::MODEL_INPUT, 426 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 427 }, 428 { 429 .type = OperandType::FLOAT16, 430 .dimensions = {}, 431 .numberOfConsumers = 1, 432 .scale = 0.0f, 433 .zeroPoint = 0, 434 .lifetime = OperandLifeTime::CONSTANT_COPY, 435 .location = {.poolIndex = 0, .offset = 0, .length = 2}, 436 }, 437 { 438 .type = OperandType::FLOAT16, 439 .dimensions = {}, 440 .numberOfConsumers = 1, 441 .scale = 0.0f, 442 .zeroPoint = 0, 443 .lifetime = OperandLifeTime::CONSTANT_COPY, 444 .location = {.poolIndex = 0, .offset = 2, .length = 2}, 445 }, 446 { 447 .type = OperandType::FLOAT16, 448 .dimensions = {}, 449 .numberOfConsumers = 1, 450 .scale = 0.0f, 451 .zeroPoint = 0, 452 .lifetime = OperandLifeTime::CONSTANT_COPY, 453 .location = {.poolIndex = 0, .offset = 4, .length = 2}, 454 }, 455 { 456 .type = OperandType::FLOAT16, 457 .dimensions = {}, 458 .numberOfConsumers = 1, 459 .scale = 0.0f, 460 .zeroPoint = 0, 461 .lifetime = OperandLifeTime::CONSTANT_COPY, 462 .location = {.poolIndex = 0, .offset = 6, .length = 2}, 463 }, 464 { 465 .type = OperandType::BOOL, 466 .dimensions = {}, 467 .numberOfConsumers = 1, 468 .scale = 0.0f, 469 .zeroPoint = 0, 470 .lifetime = OperandLifeTime::CONSTANT_COPY, 471 .location = {.poolIndex = 0, .offset = 8, .length = 1}, 472 }, 473 { 474 .type = OperandType::INT32, 475 .dimensions = {}, 476 .numberOfConsumers = 1, 477 .scale = 0.0f, 478 .zeroPoint = 0, 479 .lifetime = OperandLifeTime::CONSTANT_COPY, 480 .location = {.poolIndex = 0, .offset = 9, .length = 4}, 481 }, 482 { 483 .type = OperandType::INT32, 484 .dimensions = {}, 485 .numberOfConsumers = 1, 486 .scale = 0.0f, 487 .zeroPoint = 0, 488 .lifetime = OperandLifeTime::CONSTANT_COPY, 489 .location = {.poolIndex = 0, .offset = 13, .length = 4}, 490 }, 491 { 492 .type = OperandType::INT32, 493 .dimensions = {}, 494 .numberOfConsumers = 1, 495 .scale = 0.0f, 496 .zeroPoint = 0, 497 .lifetime = OperandLifeTime::CONSTANT_COPY, 498 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 499 }, 500 { 501 .type = OperandType::FLOAT16, 502 .dimensions = {}, 503 .numberOfConsumers = 1, 504 .scale = 0.0f, 505 .zeroPoint = 0, 506 .lifetime = OperandLifeTime::CONSTANT_COPY, 507 .location = {.poolIndex = 0, .offset = 21, .length = 2}, 508 }, 509 { 510 .type = OperandType::FLOAT16, 511 .dimensions = {}, 512 .numberOfConsumers = 1, 513 .scale = 0.0f, 514 .zeroPoint = 0, 515 .lifetime = OperandLifeTime::CONSTANT_COPY, 516 .location = {.poolIndex = 0, .offset = 23, .length = 2}, 517 }, 518 { 519 .type = OperandType::BOOL, 520 .dimensions = {}, 521 .numberOfConsumers = 1, 522 .scale = 0.0f, 523 .zeroPoint = 0, 524 .lifetime = OperandLifeTime::CONSTANT_COPY, 525 .location = {.poolIndex = 0, .offset = 25, .length = 1}, 526 }, 527 { 528 .type = OperandType::TENSOR_FLOAT16, 529 .dimensions = {1, 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 .type = OperandType::TENSOR_FLOAT16, 538 .dimensions = {1, 3, 4}, 539 .numberOfConsumers = 0, 540 .scale = 0.0f, 541 .zeroPoint = 0, 542 .lifetime = OperandLifeTime::MODEL_OUTPUT, 543 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 544 }, 545 { 546 .type = OperandType::TENSOR_INT32, 547 .dimensions = {1, 3}, 548 .numberOfConsumers = 0, 549 .scale = 0.0f, 550 .zeroPoint = 0, 551 .lifetime = OperandLifeTime::MODEL_OUTPUT, 552 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 553 }, 554 { 555 .type = OperandType::TENSOR_INT32, 556 .dimensions = {1}, 557 .numberOfConsumers = 0, 558 .scale = 0.0f, 559 .zeroPoint = 0, 560 .lifetime = OperandLifeTime::MODEL_OUTPUT, 561 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 562 } 563 }; 564 565 const std::vector<Operation> operations = { 566 { 567 .type = OperationType::DETECTION_POSTPROCESSING, 568 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 569 .outputs = {14, 15, 16, 17}, 570 } 571 }; 572 573 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 574 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 575 std::vector<uint8_t> operandValues = { 576 0, 73, 0, 73, 0, 69, 0, 69, 1, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 56, 0 577 }; 578 const std::vector<hidl_memory> pools = {}; 579 580 return { 581 .operands = operands, 582 .operations = operations, 583 .inputIndexes = inputIndexes, 584 .outputIndexes = outputIndexes, 585 .operandValues = operandValues, 586 .pools = pools, 587 }; 588 } 589 590 inline bool is_ignored_regular_float16(int i) { 591 static std::set<int> ignore = {}; 592 return ignore.find(i) != ignore.end(); 593 } 594 595 // Create the model 596 Model createTestModel_regular_dynamic_output_shape() { 597 const std::vector<Operand> operands = { 598 { 599 .type = OperandType::TENSOR_FLOAT32, 600 .dimensions = {1, 6, 3}, 601 .numberOfConsumers = 1, 602 .scale = 0.0f, 603 .zeroPoint = 0, 604 .lifetime = OperandLifeTime::MODEL_INPUT, 605 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 606 }, 607 { 608 .type = OperandType::TENSOR_FLOAT32, 609 .dimensions = {1, 6, 4}, 610 .numberOfConsumers = 1, 611 .scale = 0.0f, 612 .zeroPoint = 0, 613 .lifetime = OperandLifeTime::MODEL_INPUT, 614 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 615 }, 616 { 617 .type = OperandType::TENSOR_FLOAT32, 618 .dimensions = {6, 4}, 619 .numberOfConsumers = 1, 620 .scale = 0.0f, 621 .zeroPoint = 0, 622 .lifetime = OperandLifeTime::MODEL_INPUT, 623 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 624 }, 625 { 626 .type = OperandType::FLOAT32, 627 .dimensions = {}, 628 .numberOfConsumers = 1, 629 .scale = 0.0f, 630 .zeroPoint = 0, 631 .lifetime = OperandLifeTime::CONSTANT_COPY, 632 .location = {.poolIndex = 0, .offset = 0, .length = 4}, 633 }, 634 { 635 .type = OperandType::FLOAT32, 636 .dimensions = {}, 637 .numberOfConsumers = 1, 638 .scale = 0.0f, 639 .zeroPoint = 0, 640 .lifetime = OperandLifeTime::CONSTANT_COPY, 641 .location = {.poolIndex = 0, .offset = 4, .length = 4}, 642 }, 643 { 644 .type = OperandType::FLOAT32, 645 .dimensions = {}, 646 .numberOfConsumers = 1, 647 .scale = 0.0f, 648 .zeroPoint = 0, 649 .lifetime = OperandLifeTime::CONSTANT_COPY, 650 .location = {.poolIndex = 0, .offset = 8, .length = 4}, 651 }, 652 { 653 .type = OperandType::FLOAT32, 654 .dimensions = {}, 655 .numberOfConsumers = 1, 656 .scale = 0.0f, 657 .zeroPoint = 0, 658 .lifetime = OperandLifeTime::CONSTANT_COPY, 659 .location = {.poolIndex = 0, .offset = 12, .length = 4}, 660 }, 661 { 662 .type = OperandType::BOOL, 663 .dimensions = {}, 664 .numberOfConsumers = 1, 665 .scale = 0.0f, 666 .zeroPoint = 0, 667 .lifetime = OperandLifeTime::CONSTANT_COPY, 668 .location = {.poolIndex = 0, .offset = 16, .length = 1}, 669 }, 670 { 671 .type = OperandType::INT32, 672 .dimensions = {}, 673 .numberOfConsumers = 1, 674 .scale = 0.0f, 675 .zeroPoint = 0, 676 .lifetime = OperandLifeTime::CONSTANT_COPY, 677 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 678 }, 679 { 680 .type = OperandType::INT32, 681 .dimensions = {}, 682 .numberOfConsumers = 1, 683 .scale = 0.0f, 684 .zeroPoint = 0, 685 .lifetime = OperandLifeTime::CONSTANT_COPY, 686 .location = {.poolIndex = 0, .offset = 21, .length = 4}, 687 }, 688 { 689 .type = OperandType::INT32, 690 .dimensions = {}, 691 .numberOfConsumers = 1, 692 .scale = 0.0f, 693 .zeroPoint = 0, 694 .lifetime = OperandLifeTime::CONSTANT_COPY, 695 .location = {.poolIndex = 0, .offset = 25, .length = 4}, 696 }, 697 { 698 .type = OperandType::FLOAT32, 699 .dimensions = {}, 700 .numberOfConsumers = 1, 701 .scale = 0.0f, 702 .zeroPoint = 0, 703 .lifetime = OperandLifeTime::CONSTANT_COPY, 704 .location = {.poolIndex = 0, .offset = 29, .length = 4}, 705 }, 706 { 707 .type = OperandType::FLOAT32, 708 .dimensions = {}, 709 .numberOfConsumers = 1, 710 .scale = 0.0f, 711 .zeroPoint = 0, 712 .lifetime = OperandLifeTime::CONSTANT_COPY, 713 .location = {.poolIndex = 0, .offset = 33, .length = 4}, 714 }, 715 { 716 .type = OperandType::BOOL, 717 .dimensions = {}, 718 .numberOfConsumers = 1, 719 .scale = 0.0f, 720 .zeroPoint = 0, 721 .lifetime = OperandLifeTime::CONSTANT_COPY, 722 .location = {.poolIndex = 0, .offset = 37, .length = 1}, 723 }, 724 { 725 .type = OperandType::TENSOR_FLOAT32, 726 .dimensions = {0, 0}, 727 .numberOfConsumers = 0, 728 .scale = 0.0f, 729 .zeroPoint = 0, 730 .lifetime = OperandLifeTime::MODEL_OUTPUT, 731 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 732 }, 733 { 734 .type = OperandType::TENSOR_FLOAT32, 735 .dimensions = {0, 0, 0}, 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 .type = OperandType::TENSOR_INT32, 744 .dimensions = {0, 0}, 745 .numberOfConsumers = 0, 746 .scale = 0.0f, 747 .zeroPoint = 0, 748 .lifetime = OperandLifeTime::MODEL_OUTPUT, 749 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 750 }, 751 { 752 .type = OperandType::TENSOR_INT32, 753 .dimensions = {0}, 754 .numberOfConsumers = 0, 755 .scale = 0.0f, 756 .zeroPoint = 0, 757 .lifetime = OperandLifeTime::MODEL_OUTPUT, 758 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 759 } 760 }; 761 762 const std::vector<Operation> operations = { 763 { 764 .type = OperationType::DETECTION_POSTPROCESSING, 765 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 766 .outputs = {14, 15, 16, 17}, 767 } 768 }; 769 770 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 771 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 772 std::vector<uint8_t> operandValues = { 773 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 160, 64, 0, 0, 160, 64, 1, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0 774 }; 775 const std::vector<hidl_memory> pools = {}; 776 777 return { 778 .operands = operands, 779 .operations = operations, 780 .inputIndexes = inputIndexes, 781 .outputIndexes = outputIndexes, 782 .operandValues = operandValues, 783 .pools = pools, 784 }; 785 } 786 787 inline bool is_ignored_regular_dynamic_output_shape(int i) { 788 static std::set<int> ignore = {}; 789 return ignore.find(i) != ignore.end(); 790 } 791 792 // Create the model 793 Model createTestModel_regular_dynamic_output_shape_relaxed() { 794 const std::vector<Operand> operands = { 795 { 796 .type = OperandType::TENSOR_FLOAT32, 797 .dimensions = {1, 6, 3}, 798 .numberOfConsumers = 1, 799 .scale = 0.0f, 800 .zeroPoint = 0, 801 .lifetime = OperandLifeTime::MODEL_INPUT, 802 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 803 }, 804 { 805 .type = OperandType::TENSOR_FLOAT32, 806 .dimensions = {1, 6, 4}, 807 .numberOfConsumers = 1, 808 .scale = 0.0f, 809 .zeroPoint = 0, 810 .lifetime = OperandLifeTime::MODEL_INPUT, 811 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 812 }, 813 { 814 .type = OperandType::TENSOR_FLOAT32, 815 .dimensions = {6, 4}, 816 .numberOfConsumers = 1, 817 .scale = 0.0f, 818 .zeroPoint = 0, 819 .lifetime = OperandLifeTime::MODEL_INPUT, 820 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 821 }, 822 { 823 .type = OperandType::FLOAT32, 824 .dimensions = {}, 825 .numberOfConsumers = 1, 826 .scale = 0.0f, 827 .zeroPoint = 0, 828 .lifetime = OperandLifeTime::CONSTANT_COPY, 829 .location = {.poolIndex = 0, .offset = 0, .length = 4}, 830 }, 831 { 832 .type = OperandType::FLOAT32, 833 .dimensions = {}, 834 .numberOfConsumers = 1, 835 .scale = 0.0f, 836 .zeroPoint = 0, 837 .lifetime = OperandLifeTime::CONSTANT_COPY, 838 .location = {.poolIndex = 0, .offset = 4, .length = 4}, 839 }, 840 { 841 .type = OperandType::FLOAT32, 842 .dimensions = {}, 843 .numberOfConsumers = 1, 844 .scale = 0.0f, 845 .zeroPoint = 0, 846 .lifetime = OperandLifeTime::CONSTANT_COPY, 847 .location = {.poolIndex = 0, .offset = 8, .length = 4}, 848 }, 849 { 850 .type = OperandType::FLOAT32, 851 .dimensions = {}, 852 .numberOfConsumers = 1, 853 .scale = 0.0f, 854 .zeroPoint = 0, 855 .lifetime = OperandLifeTime::CONSTANT_COPY, 856 .location = {.poolIndex = 0, .offset = 12, .length = 4}, 857 }, 858 { 859 .type = OperandType::BOOL, 860 .dimensions = {}, 861 .numberOfConsumers = 1, 862 .scale = 0.0f, 863 .zeroPoint = 0, 864 .lifetime = OperandLifeTime::CONSTANT_COPY, 865 .location = {.poolIndex = 0, .offset = 16, .length = 1}, 866 }, 867 { 868 .type = OperandType::INT32, 869 .dimensions = {}, 870 .numberOfConsumers = 1, 871 .scale = 0.0f, 872 .zeroPoint = 0, 873 .lifetime = OperandLifeTime::CONSTANT_COPY, 874 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 875 }, 876 { 877 .type = OperandType::INT32, 878 .dimensions = {}, 879 .numberOfConsumers = 1, 880 .scale = 0.0f, 881 .zeroPoint = 0, 882 .lifetime = OperandLifeTime::CONSTANT_COPY, 883 .location = {.poolIndex = 0, .offset = 21, .length = 4}, 884 }, 885 { 886 .type = OperandType::INT32, 887 .dimensions = {}, 888 .numberOfConsumers = 1, 889 .scale = 0.0f, 890 .zeroPoint = 0, 891 .lifetime = OperandLifeTime::CONSTANT_COPY, 892 .location = {.poolIndex = 0, .offset = 25, .length = 4}, 893 }, 894 { 895 .type = OperandType::FLOAT32, 896 .dimensions = {}, 897 .numberOfConsumers = 1, 898 .scale = 0.0f, 899 .zeroPoint = 0, 900 .lifetime = OperandLifeTime::CONSTANT_COPY, 901 .location = {.poolIndex = 0, .offset = 29, .length = 4}, 902 }, 903 { 904 .type = OperandType::FLOAT32, 905 .dimensions = {}, 906 .numberOfConsumers = 1, 907 .scale = 0.0f, 908 .zeroPoint = 0, 909 .lifetime = OperandLifeTime::CONSTANT_COPY, 910 .location = {.poolIndex = 0, .offset = 33, .length = 4}, 911 }, 912 { 913 .type = OperandType::BOOL, 914 .dimensions = {}, 915 .numberOfConsumers = 1, 916 .scale = 0.0f, 917 .zeroPoint = 0, 918 .lifetime = OperandLifeTime::CONSTANT_COPY, 919 .location = {.poolIndex = 0, .offset = 37, .length = 1}, 920 }, 921 { 922 .type = OperandType::TENSOR_FLOAT32, 923 .dimensions = {0, 0}, 924 .numberOfConsumers = 0, 925 .scale = 0.0f, 926 .zeroPoint = 0, 927 .lifetime = OperandLifeTime::MODEL_OUTPUT, 928 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 929 }, 930 { 931 .type = OperandType::TENSOR_FLOAT32, 932 .dimensions = {0, 0, 0}, 933 .numberOfConsumers = 0, 934 .scale = 0.0f, 935 .zeroPoint = 0, 936 .lifetime = OperandLifeTime::MODEL_OUTPUT, 937 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 938 }, 939 { 940 .type = OperandType::TENSOR_INT32, 941 .dimensions = {0, 0}, 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 .type = OperandType::TENSOR_INT32, 950 .dimensions = {0}, 951 .numberOfConsumers = 0, 952 .scale = 0.0f, 953 .zeroPoint = 0, 954 .lifetime = OperandLifeTime::MODEL_OUTPUT, 955 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 956 } 957 }; 958 959 const std::vector<Operation> operations = { 960 { 961 .type = OperationType::DETECTION_POSTPROCESSING, 962 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 963 .outputs = {14, 15, 16, 17}, 964 } 965 }; 966 967 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 968 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 969 std::vector<uint8_t> operandValues = { 970 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 160, 64, 0, 0, 160, 64, 1, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0 971 }; 972 const std::vector<hidl_memory> pools = {}; 973 974 return { 975 .operands = operands, 976 .operations = operations, 977 .inputIndexes = inputIndexes, 978 .outputIndexes = outputIndexes, 979 .operandValues = operandValues, 980 .pools = pools, 981 .relaxComputationFloat32toFloat16 = true, 982 }; 983 } 984 985 inline bool is_ignored_regular_dynamic_output_shape_relaxed(int i) { 986 static std::set<int> ignore = {}; 987 return ignore.find(i) != ignore.end(); 988 } 989 990 // Create the model 991 Model createTestModel_regular_dynamic_output_shape_float16() { 992 const std::vector<Operand> operands = { 993 { 994 .type = OperandType::TENSOR_FLOAT16, 995 .dimensions = {1, 6, 3}, 996 .numberOfConsumers = 1, 997 .scale = 0.0f, 998 .zeroPoint = 0, 999 .lifetime = OperandLifeTime::MODEL_INPUT, 1000 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1001 }, 1002 { 1003 .type = OperandType::TENSOR_FLOAT16, 1004 .dimensions = {1, 6, 4}, 1005 .numberOfConsumers = 1, 1006 .scale = 0.0f, 1007 .zeroPoint = 0, 1008 .lifetime = OperandLifeTime::MODEL_INPUT, 1009 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1010 }, 1011 { 1012 .type = OperandType::TENSOR_FLOAT16, 1013 .dimensions = {6, 4}, 1014 .numberOfConsumers = 1, 1015 .scale = 0.0f, 1016 .zeroPoint = 0, 1017 .lifetime = OperandLifeTime::MODEL_INPUT, 1018 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1019 }, 1020 { 1021 .type = OperandType::FLOAT16, 1022 .dimensions = {}, 1023 .numberOfConsumers = 1, 1024 .scale = 0.0f, 1025 .zeroPoint = 0, 1026 .lifetime = OperandLifeTime::CONSTANT_COPY, 1027 .location = {.poolIndex = 0, .offset = 0, .length = 2}, 1028 }, 1029 { 1030 .type = OperandType::FLOAT16, 1031 .dimensions = {}, 1032 .numberOfConsumers = 1, 1033 .scale = 0.0f, 1034 .zeroPoint = 0, 1035 .lifetime = OperandLifeTime::CONSTANT_COPY, 1036 .location = {.poolIndex = 0, .offset = 2, .length = 2}, 1037 }, 1038 { 1039 .type = OperandType::FLOAT16, 1040 .dimensions = {}, 1041 .numberOfConsumers = 1, 1042 .scale = 0.0f, 1043 .zeroPoint = 0, 1044 .lifetime = OperandLifeTime::CONSTANT_COPY, 1045 .location = {.poolIndex = 0, .offset = 4, .length = 2}, 1046 }, 1047 { 1048 .type = OperandType::FLOAT16, 1049 .dimensions = {}, 1050 .numberOfConsumers = 1, 1051 .scale = 0.0f, 1052 .zeroPoint = 0, 1053 .lifetime = OperandLifeTime::CONSTANT_COPY, 1054 .location = {.poolIndex = 0, .offset = 6, .length = 2}, 1055 }, 1056 { 1057 .type = OperandType::BOOL, 1058 .dimensions = {}, 1059 .numberOfConsumers = 1, 1060 .scale = 0.0f, 1061 .zeroPoint = 0, 1062 .lifetime = OperandLifeTime::CONSTANT_COPY, 1063 .location = {.poolIndex = 0, .offset = 8, .length = 1}, 1064 }, 1065 { 1066 .type = OperandType::INT32, 1067 .dimensions = {}, 1068 .numberOfConsumers = 1, 1069 .scale = 0.0f, 1070 .zeroPoint = 0, 1071 .lifetime = OperandLifeTime::CONSTANT_COPY, 1072 .location = {.poolIndex = 0, .offset = 9, .length = 4}, 1073 }, 1074 { 1075 .type = OperandType::INT32, 1076 .dimensions = {}, 1077 .numberOfConsumers = 1, 1078 .scale = 0.0f, 1079 .zeroPoint = 0, 1080 .lifetime = OperandLifeTime::CONSTANT_COPY, 1081 .location = {.poolIndex = 0, .offset = 13, .length = 4}, 1082 }, 1083 { 1084 .type = OperandType::INT32, 1085 .dimensions = {}, 1086 .numberOfConsumers = 1, 1087 .scale = 0.0f, 1088 .zeroPoint = 0, 1089 .lifetime = OperandLifeTime::CONSTANT_COPY, 1090 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 1091 }, 1092 { 1093 .type = OperandType::FLOAT16, 1094 .dimensions = {}, 1095 .numberOfConsumers = 1, 1096 .scale = 0.0f, 1097 .zeroPoint = 0, 1098 .lifetime = OperandLifeTime::CONSTANT_COPY, 1099 .location = {.poolIndex = 0, .offset = 21, .length = 2}, 1100 }, 1101 { 1102 .type = OperandType::FLOAT16, 1103 .dimensions = {}, 1104 .numberOfConsumers = 1, 1105 .scale = 0.0f, 1106 .zeroPoint = 0, 1107 .lifetime = OperandLifeTime::CONSTANT_COPY, 1108 .location = {.poolIndex = 0, .offset = 23, .length = 2}, 1109 }, 1110 { 1111 .type = OperandType::BOOL, 1112 .dimensions = {}, 1113 .numberOfConsumers = 1, 1114 .scale = 0.0f, 1115 .zeroPoint = 0, 1116 .lifetime = OperandLifeTime::CONSTANT_COPY, 1117 .location = {.poolIndex = 0, .offset = 25, .length = 1}, 1118 }, 1119 { 1120 .type = OperandType::TENSOR_FLOAT16, 1121 .dimensions = {0, 0}, 1122 .numberOfConsumers = 0, 1123 .scale = 0.0f, 1124 .zeroPoint = 0, 1125 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1126 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1127 }, 1128 { 1129 .type = OperandType::TENSOR_FLOAT16, 1130 .dimensions = {0, 0, 0}, 1131 .numberOfConsumers = 0, 1132 .scale = 0.0f, 1133 .zeroPoint = 0, 1134 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1135 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1136 }, 1137 { 1138 .type = OperandType::TENSOR_INT32, 1139 .dimensions = {0, 0}, 1140 .numberOfConsumers = 0, 1141 .scale = 0.0f, 1142 .zeroPoint = 0, 1143 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1144 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1145 }, 1146 { 1147 .type = OperandType::TENSOR_INT32, 1148 .dimensions = {0}, 1149 .numberOfConsumers = 0, 1150 .scale = 0.0f, 1151 .zeroPoint = 0, 1152 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1153 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1154 } 1155 }; 1156 1157 const std::vector<Operation> operations = { 1158 { 1159 .type = OperationType::DETECTION_POSTPROCESSING, 1160 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 1161 .outputs = {14, 15, 16, 17}, 1162 } 1163 }; 1164 1165 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 1166 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 1167 std::vector<uint8_t> operandValues = { 1168 0, 73, 0, 73, 0, 69, 0, 69, 1, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 56, 0 1169 }; 1170 const std::vector<hidl_memory> pools = {}; 1171 1172 return { 1173 .operands = operands, 1174 .operations = operations, 1175 .inputIndexes = inputIndexes, 1176 .outputIndexes = outputIndexes, 1177 .operandValues = operandValues, 1178 .pools = pools, 1179 }; 1180 } 1181 1182 inline bool is_ignored_regular_dynamic_output_shape_float16(int i) { 1183 static std::set<int> ignore = {}; 1184 return ignore.find(i) != ignore.end(); 1185 } 1186 1187 // Create the model 1188 Model createTestModel() { 1189 const std::vector<Operand> operands = { 1190 { 1191 .type = OperandType::TENSOR_FLOAT32, 1192 .dimensions = {1, 6, 3}, 1193 .numberOfConsumers = 1, 1194 .scale = 0.0f, 1195 .zeroPoint = 0, 1196 .lifetime = OperandLifeTime::MODEL_INPUT, 1197 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1198 }, 1199 { 1200 .type = OperandType::TENSOR_FLOAT32, 1201 .dimensions = {1, 6, 4}, 1202 .numberOfConsumers = 1, 1203 .scale = 0.0f, 1204 .zeroPoint = 0, 1205 .lifetime = OperandLifeTime::MODEL_INPUT, 1206 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1207 }, 1208 { 1209 .type = OperandType::TENSOR_FLOAT32, 1210 .dimensions = {6, 4}, 1211 .numberOfConsumers = 1, 1212 .scale = 0.0f, 1213 .zeroPoint = 0, 1214 .lifetime = OperandLifeTime::MODEL_INPUT, 1215 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1216 }, 1217 { 1218 .type = OperandType::FLOAT32, 1219 .dimensions = {}, 1220 .numberOfConsumers = 1, 1221 .scale = 0.0f, 1222 .zeroPoint = 0, 1223 .lifetime = OperandLifeTime::CONSTANT_COPY, 1224 .location = {.poolIndex = 0, .offset = 0, .length = 4}, 1225 }, 1226 { 1227 .type = OperandType::FLOAT32, 1228 .dimensions = {}, 1229 .numberOfConsumers = 1, 1230 .scale = 0.0f, 1231 .zeroPoint = 0, 1232 .lifetime = OperandLifeTime::CONSTANT_COPY, 1233 .location = {.poolIndex = 0, .offset = 4, .length = 4}, 1234 }, 1235 { 1236 .type = OperandType::FLOAT32, 1237 .dimensions = {}, 1238 .numberOfConsumers = 1, 1239 .scale = 0.0f, 1240 .zeroPoint = 0, 1241 .lifetime = OperandLifeTime::CONSTANT_COPY, 1242 .location = {.poolIndex = 0, .offset = 8, .length = 4}, 1243 }, 1244 { 1245 .type = OperandType::FLOAT32, 1246 .dimensions = {}, 1247 .numberOfConsumers = 1, 1248 .scale = 0.0f, 1249 .zeroPoint = 0, 1250 .lifetime = OperandLifeTime::CONSTANT_COPY, 1251 .location = {.poolIndex = 0, .offset = 12, .length = 4}, 1252 }, 1253 { 1254 .type = OperandType::BOOL, 1255 .dimensions = {}, 1256 .numberOfConsumers = 1, 1257 .scale = 0.0f, 1258 .zeroPoint = 0, 1259 .lifetime = OperandLifeTime::CONSTANT_COPY, 1260 .location = {.poolIndex = 0, .offset = 16, .length = 1}, 1261 }, 1262 { 1263 .type = OperandType::INT32, 1264 .dimensions = {}, 1265 .numberOfConsumers = 1, 1266 .scale = 0.0f, 1267 .zeroPoint = 0, 1268 .lifetime = OperandLifeTime::CONSTANT_COPY, 1269 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 1270 }, 1271 { 1272 .type = OperandType::INT32, 1273 .dimensions = {}, 1274 .numberOfConsumers = 1, 1275 .scale = 0.0f, 1276 .zeroPoint = 0, 1277 .lifetime = OperandLifeTime::CONSTANT_COPY, 1278 .location = {.poolIndex = 0, .offset = 21, .length = 4}, 1279 }, 1280 { 1281 .type = OperandType::INT32, 1282 .dimensions = {}, 1283 .numberOfConsumers = 1, 1284 .scale = 0.0f, 1285 .zeroPoint = 0, 1286 .lifetime = OperandLifeTime::CONSTANT_COPY, 1287 .location = {.poolIndex = 0, .offset = 25, .length = 4}, 1288 }, 1289 { 1290 .type = OperandType::FLOAT32, 1291 .dimensions = {}, 1292 .numberOfConsumers = 1, 1293 .scale = 0.0f, 1294 .zeroPoint = 0, 1295 .lifetime = OperandLifeTime::CONSTANT_COPY, 1296 .location = {.poolIndex = 0, .offset = 29, .length = 4}, 1297 }, 1298 { 1299 .type = OperandType::FLOAT32, 1300 .dimensions = {}, 1301 .numberOfConsumers = 1, 1302 .scale = 0.0f, 1303 .zeroPoint = 0, 1304 .lifetime = OperandLifeTime::CONSTANT_COPY, 1305 .location = {.poolIndex = 0, .offset = 33, .length = 4}, 1306 }, 1307 { 1308 .type = OperandType::BOOL, 1309 .dimensions = {}, 1310 .numberOfConsumers = 1, 1311 .scale = 0.0f, 1312 .zeroPoint = 0, 1313 .lifetime = OperandLifeTime::CONSTANT_COPY, 1314 .location = {.poolIndex = 0, .offset = 37, .length = 1}, 1315 }, 1316 { 1317 .type = OperandType::TENSOR_FLOAT32, 1318 .dimensions = {1, 3}, 1319 .numberOfConsumers = 0, 1320 .scale = 0.0f, 1321 .zeroPoint = 0, 1322 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1323 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1324 }, 1325 { 1326 .type = OperandType::TENSOR_FLOAT32, 1327 .dimensions = {1, 3, 4}, 1328 .numberOfConsumers = 0, 1329 .scale = 0.0f, 1330 .zeroPoint = 0, 1331 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1332 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1333 }, 1334 { 1335 .type = OperandType::TENSOR_INT32, 1336 .dimensions = {1, 3}, 1337 .numberOfConsumers = 0, 1338 .scale = 0.0f, 1339 .zeroPoint = 0, 1340 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1341 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1342 }, 1343 { 1344 .type = OperandType::TENSOR_INT32, 1345 .dimensions = {1}, 1346 .numberOfConsumers = 0, 1347 .scale = 0.0f, 1348 .zeroPoint = 0, 1349 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1350 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1351 } 1352 }; 1353 1354 const std::vector<Operation> operations = { 1355 { 1356 .type = OperationType::DETECTION_POSTPROCESSING, 1357 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 1358 .outputs = {14, 15, 16, 17}, 1359 } 1360 }; 1361 1362 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 1363 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 1364 std::vector<uint8_t> operandValues = { 1365 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 160, 64, 0, 0, 160, 64, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0 1366 }; 1367 const std::vector<hidl_memory> pools = {}; 1368 1369 return { 1370 .operands = operands, 1371 .operations = operations, 1372 .inputIndexes = inputIndexes, 1373 .outputIndexes = outputIndexes, 1374 .operandValues = operandValues, 1375 .pools = pools, 1376 }; 1377 } 1378 1379 inline bool is_ignored(int i) { 1380 static std::set<int> ignore = {}; 1381 return ignore.find(i) != ignore.end(); 1382 } 1383 1384 // Create the model 1385 Model createTestModel_relaxed() { 1386 const std::vector<Operand> operands = { 1387 { 1388 .type = OperandType::TENSOR_FLOAT32, 1389 .dimensions = {1, 6, 3}, 1390 .numberOfConsumers = 1, 1391 .scale = 0.0f, 1392 .zeroPoint = 0, 1393 .lifetime = OperandLifeTime::MODEL_INPUT, 1394 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1395 }, 1396 { 1397 .type = OperandType::TENSOR_FLOAT32, 1398 .dimensions = {1, 6, 4}, 1399 .numberOfConsumers = 1, 1400 .scale = 0.0f, 1401 .zeroPoint = 0, 1402 .lifetime = OperandLifeTime::MODEL_INPUT, 1403 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1404 }, 1405 { 1406 .type = OperandType::TENSOR_FLOAT32, 1407 .dimensions = {6, 4}, 1408 .numberOfConsumers = 1, 1409 .scale = 0.0f, 1410 .zeroPoint = 0, 1411 .lifetime = OperandLifeTime::MODEL_INPUT, 1412 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1413 }, 1414 { 1415 .type = OperandType::FLOAT32, 1416 .dimensions = {}, 1417 .numberOfConsumers = 1, 1418 .scale = 0.0f, 1419 .zeroPoint = 0, 1420 .lifetime = OperandLifeTime::CONSTANT_COPY, 1421 .location = {.poolIndex = 0, .offset = 0, .length = 4}, 1422 }, 1423 { 1424 .type = OperandType::FLOAT32, 1425 .dimensions = {}, 1426 .numberOfConsumers = 1, 1427 .scale = 0.0f, 1428 .zeroPoint = 0, 1429 .lifetime = OperandLifeTime::CONSTANT_COPY, 1430 .location = {.poolIndex = 0, .offset = 4, .length = 4}, 1431 }, 1432 { 1433 .type = OperandType::FLOAT32, 1434 .dimensions = {}, 1435 .numberOfConsumers = 1, 1436 .scale = 0.0f, 1437 .zeroPoint = 0, 1438 .lifetime = OperandLifeTime::CONSTANT_COPY, 1439 .location = {.poolIndex = 0, .offset = 8, .length = 4}, 1440 }, 1441 { 1442 .type = OperandType::FLOAT32, 1443 .dimensions = {}, 1444 .numberOfConsumers = 1, 1445 .scale = 0.0f, 1446 .zeroPoint = 0, 1447 .lifetime = OperandLifeTime::CONSTANT_COPY, 1448 .location = {.poolIndex = 0, .offset = 12, .length = 4}, 1449 }, 1450 { 1451 .type = OperandType::BOOL, 1452 .dimensions = {}, 1453 .numberOfConsumers = 1, 1454 .scale = 0.0f, 1455 .zeroPoint = 0, 1456 .lifetime = OperandLifeTime::CONSTANT_COPY, 1457 .location = {.poolIndex = 0, .offset = 16, .length = 1}, 1458 }, 1459 { 1460 .type = OperandType::INT32, 1461 .dimensions = {}, 1462 .numberOfConsumers = 1, 1463 .scale = 0.0f, 1464 .zeroPoint = 0, 1465 .lifetime = OperandLifeTime::CONSTANT_COPY, 1466 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 1467 }, 1468 { 1469 .type = OperandType::INT32, 1470 .dimensions = {}, 1471 .numberOfConsumers = 1, 1472 .scale = 0.0f, 1473 .zeroPoint = 0, 1474 .lifetime = OperandLifeTime::CONSTANT_COPY, 1475 .location = {.poolIndex = 0, .offset = 21, .length = 4}, 1476 }, 1477 { 1478 .type = OperandType::INT32, 1479 .dimensions = {}, 1480 .numberOfConsumers = 1, 1481 .scale = 0.0f, 1482 .zeroPoint = 0, 1483 .lifetime = OperandLifeTime::CONSTANT_COPY, 1484 .location = {.poolIndex = 0, .offset = 25, .length = 4}, 1485 }, 1486 { 1487 .type = OperandType::FLOAT32, 1488 .dimensions = {}, 1489 .numberOfConsumers = 1, 1490 .scale = 0.0f, 1491 .zeroPoint = 0, 1492 .lifetime = OperandLifeTime::CONSTANT_COPY, 1493 .location = {.poolIndex = 0, .offset = 29, .length = 4}, 1494 }, 1495 { 1496 .type = OperandType::FLOAT32, 1497 .dimensions = {}, 1498 .numberOfConsumers = 1, 1499 .scale = 0.0f, 1500 .zeroPoint = 0, 1501 .lifetime = OperandLifeTime::CONSTANT_COPY, 1502 .location = {.poolIndex = 0, .offset = 33, .length = 4}, 1503 }, 1504 { 1505 .type = OperandType::BOOL, 1506 .dimensions = {}, 1507 .numberOfConsumers = 1, 1508 .scale = 0.0f, 1509 .zeroPoint = 0, 1510 .lifetime = OperandLifeTime::CONSTANT_COPY, 1511 .location = {.poolIndex = 0, .offset = 37, .length = 1}, 1512 }, 1513 { 1514 .type = OperandType::TENSOR_FLOAT32, 1515 .dimensions = {1, 3}, 1516 .numberOfConsumers = 0, 1517 .scale = 0.0f, 1518 .zeroPoint = 0, 1519 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1520 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1521 }, 1522 { 1523 .type = OperandType::TENSOR_FLOAT32, 1524 .dimensions = {1, 3, 4}, 1525 .numberOfConsumers = 0, 1526 .scale = 0.0f, 1527 .zeroPoint = 0, 1528 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1529 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1530 }, 1531 { 1532 .type = OperandType::TENSOR_INT32, 1533 .dimensions = {1, 3}, 1534 .numberOfConsumers = 0, 1535 .scale = 0.0f, 1536 .zeroPoint = 0, 1537 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1538 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1539 }, 1540 { 1541 .type = OperandType::TENSOR_INT32, 1542 .dimensions = {1}, 1543 .numberOfConsumers = 0, 1544 .scale = 0.0f, 1545 .zeroPoint = 0, 1546 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1547 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1548 } 1549 }; 1550 1551 const std::vector<Operation> operations = { 1552 { 1553 .type = OperationType::DETECTION_POSTPROCESSING, 1554 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 1555 .outputs = {14, 15, 16, 17}, 1556 } 1557 }; 1558 1559 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 1560 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 1561 std::vector<uint8_t> operandValues = { 1562 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 160, 64, 0, 0, 160, 64, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0 1563 }; 1564 const std::vector<hidl_memory> pools = {}; 1565 1566 return { 1567 .operands = operands, 1568 .operations = operations, 1569 .inputIndexes = inputIndexes, 1570 .outputIndexes = outputIndexes, 1571 .operandValues = operandValues, 1572 .pools = pools, 1573 .relaxComputationFloat32toFloat16 = true, 1574 }; 1575 } 1576 1577 inline bool is_ignored_relaxed(int i) { 1578 static std::set<int> ignore = {}; 1579 return ignore.find(i) != ignore.end(); 1580 } 1581 1582 // Create the model 1583 Model createTestModel_float16() { 1584 const std::vector<Operand> operands = { 1585 { 1586 .type = OperandType::TENSOR_FLOAT16, 1587 .dimensions = {1, 6, 3}, 1588 .numberOfConsumers = 1, 1589 .scale = 0.0f, 1590 .zeroPoint = 0, 1591 .lifetime = OperandLifeTime::MODEL_INPUT, 1592 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1593 }, 1594 { 1595 .type = OperandType::TENSOR_FLOAT16, 1596 .dimensions = {1, 6, 4}, 1597 .numberOfConsumers = 1, 1598 .scale = 0.0f, 1599 .zeroPoint = 0, 1600 .lifetime = OperandLifeTime::MODEL_INPUT, 1601 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1602 }, 1603 { 1604 .type = OperandType::TENSOR_FLOAT16, 1605 .dimensions = {6, 4}, 1606 .numberOfConsumers = 1, 1607 .scale = 0.0f, 1608 .zeroPoint = 0, 1609 .lifetime = OperandLifeTime::MODEL_INPUT, 1610 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1611 }, 1612 { 1613 .type = OperandType::FLOAT16, 1614 .dimensions = {}, 1615 .numberOfConsumers = 1, 1616 .scale = 0.0f, 1617 .zeroPoint = 0, 1618 .lifetime = OperandLifeTime::CONSTANT_COPY, 1619 .location = {.poolIndex = 0, .offset = 0, .length = 2}, 1620 }, 1621 { 1622 .type = OperandType::FLOAT16, 1623 .dimensions = {}, 1624 .numberOfConsumers = 1, 1625 .scale = 0.0f, 1626 .zeroPoint = 0, 1627 .lifetime = OperandLifeTime::CONSTANT_COPY, 1628 .location = {.poolIndex = 0, .offset = 2, .length = 2}, 1629 }, 1630 { 1631 .type = OperandType::FLOAT16, 1632 .dimensions = {}, 1633 .numberOfConsumers = 1, 1634 .scale = 0.0f, 1635 .zeroPoint = 0, 1636 .lifetime = OperandLifeTime::CONSTANT_COPY, 1637 .location = {.poolIndex = 0, .offset = 4, .length = 2}, 1638 }, 1639 { 1640 .type = OperandType::FLOAT16, 1641 .dimensions = {}, 1642 .numberOfConsumers = 1, 1643 .scale = 0.0f, 1644 .zeroPoint = 0, 1645 .lifetime = OperandLifeTime::CONSTANT_COPY, 1646 .location = {.poolIndex = 0, .offset = 6, .length = 2}, 1647 }, 1648 { 1649 .type = OperandType::BOOL, 1650 .dimensions = {}, 1651 .numberOfConsumers = 1, 1652 .scale = 0.0f, 1653 .zeroPoint = 0, 1654 .lifetime = OperandLifeTime::CONSTANT_COPY, 1655 .location = {.poolIndex = 0, .offset = 8, .length = 1}, 1656 }, 1657 { 1658 .type = OperandType::INT32, 1659 .dimensions = {}, 1660 .numberOfConsumers = 1, 1661 .scale = 0.0f, 1662 .zeroPoint = 0, 1663 .lifetime = OperandLifeTime::CONSTANT_COPY, 1664 .location = {.poolIndex = 0, .offset = 9, .length = 4}, 1665 }, 1666 { 1667 .type = OperandType::INT32, 1668 .dimensions = {}, 1669 .numberOfConsumers = 1, 1670 .scale = 0.0f, 1671 .zeroPoint = 0, 1672 .lifetime = OperandLifeTime::CONSTANT_COPY, 1673 .location = {.poolIndex = 0, .offset = 13, .length = 4}, 1674 }, 1675 { 1676 .type = OperandType::INT32, 1677 .dimensions = {}, 1678 .numberOfConsumers = 1, 1679 .scale = 0.0f, 1680 .zeroPoint = 0, 1681 .lifetime = OperandLifeTime::CONSTANT_COPY, 1682 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 1683 }, 1684 { 1685 .type = OperandType::FLOAT16, 1686 .dimensions = {}, 1687 .numberOfConsumers = 1, 1688 .scale = 0.0f, 1689 .zeroPoint = 0, 1690 .lifetime = OperandLifeTime::CONSTANT_COPY, 1691 .location = {.poolIndex = 0, .offset = 21, .length = 2}, 1692 }, 1693 { 1694 .type = OperandType::FLOAT16, 1695 .dimensions = {}, 1696 .numberOfConsumers = 1, 1697 .scale = 0.0f, 1698 .zeroPoint = 0, 1699 .lifetime = OperandLifeTime::CONSTANT_COPY, 1700 .location = {.poolIndex = 0, .offset = 23, .length = 2}, 1701 }, 1702 { 1703 .type = OperandType::BOOL, 1704 .dimensions = {}, 1705 .numberOfConsumers = 1, 1706 .scale = 0.0f, 1707 .zeroPoint = 0, 1708 .lifetime = OperandLifeTime::CONSTANT_COPY, 1709 .location = {.poolIndex = 0, .offset = 25, .length = 1}, 1710 }, 1711 { 1712 .type = OperandType::TENSOR_FLOAT16, 1713 .dimensions = {1, 3}, 1714 .numberOfConsumers = 0, 1715 .scale = 0.0f, 1716 .zeroPoint = 0, 1717 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1718 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1719 }, 1720 { 1721 .type = OperandType::TENSOR_FLOAT16, 1722 .dimensions = {1, 3, 4}, 1723 .numberOfConsumers = 0, 1724 .scale = 0.0f, 1725 .zeroPoint = 0, 1726 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1727 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1728 }, 1729 { 1730 .type = OperandType::TENSOR_INT32, 1731 .dimensions = {1, 3}, 1732 .numberOfConsumers = 0, 1733 .scale = 0.0f, 1734 .zeroPoint = 0, 1735 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1736 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1737 }, 1738 { 1739 .type = OperandType::TENSOR_INT32, 1740 .dimensions = {1}, 1741 .numberOfConsumers = 0, 1742 .scale = 0.0f, 1743 .zeroPoint = 0, 1744 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1745 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1746 } 1747 }; 1748 1749 const std::vector<Operation> operations = { 1750 { 1751 .type = OperationType::DETECTION_POSTPROCESSING, 1752 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 1753 .outputs = {14, 15, 16, 17}, 1754 } 1755 }; 1756 1757 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 1758 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 1759 std::vector<uint8_t> operandValues = { 1760 0, 73, 0, 73, 0, 69, 0, 69, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 56, 0 1761 }; 1762 const std::vector<hidl_memory> pools = {}; 1763 1764 return { 1765 .operands = operands, 1766 .operations = operations, 1767 .inputIndexes = inputIndexes, 1768 .outputIndexes = outputIndexes, 1769 .operandValues = operandValues, 1770 .pools = pools, 1771 }; 1772 } 1773 1774 inline bool is_ignored_float16(int i) { 1775 static std::set<int> ignore = {}; 1776 return ignore.find(i) != ignore.end(); 1777 } 1778 1779 // Create the model 1780 Model createTestModel_dynamic_output_shape() { 1781 const std::vector<Operand> operands = { 1782 { 1783 .type = OperandType::TENSOR_FLOAT32, 1784 .dimensions = {1, 6, 3}, 1785 .numberOfConsumers = 1, 1786 .scale = 0.0f, 1787 .zeroPoint = 0, 1788 .lifetime = OperandLifeTime::MODEL_INPUT, 1789 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1790 }, 1791 { 1792 .type = OperandType::TENSOR_FLOAT32, 1793 .dimensions = {1, 6, 4}, 1794 .numberOfConsumers = 1, 1795 .scale = 0.0f, 1796 .zeroPoint = 0, 1797 .lifetime = OperandLifeTime::MODEL_INPUT, 1798 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1799 }, 1800 { 1801 .type = OperandType::TENSOR_FLOAT32, 1802 .dimensions = {6, 4}, 1803 .numberOfConsumers = 1, 1804 .scale = 0.0f, 1805 .zeroPoint = 0, 1806 .lifetime = OperandLifeTime::MODEL_INPUT, 1807 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1808 }, 1809 { 1810 .type = OperandType::FLOAT32, 1811 .dimensions = {}, 1812 .numberOfConsumers = 1, 1813 .scale = 0.0f, 1814 .zeroPoint = 0, 1815 .lifetime = OperandLifeTime::CONSTANT_COPY, 1816 .location = {.poolIndex = 0, .offset = 0, .length = 4}, 1817 }, 1818 { 1819 .type = OperandType::FLOAT32, 1820 .dimensions = {}, 1821 .numberOfConsumers = 1, 1822 .scale = 0.0f, 1823 .zeroPoint = 0, 1824 .lifetime = OperandLifeTime::CONSTANT_COPY, 1825 .location = {.poolIndex = 0, .offset = 4, .length = 4}, 1826 }, 1827 { 1828 .type = OperandType::FLOAT32, 1829 .dimensions = {}, 1830 .numberOfConsumers = 1, 1831 .scale = 0.0f, 1832 .zeroPoint = 0, 1833 .lifetime = OperandLifeTime::CONSTANT_COPY, 1834 .location = {.poolIndex = 0, .offset = 8, .length = 4}, 1835 }, 1836 { 1837 .type = OperandType::FLOAT32, 1838 .dimensions = {}, 1839 .numberOfConsumers = 1, 1840 .scale = 0.0f, 1841 .zeroPoint = 0, 1842 .lifetime = OperandLifeTime::CONSTANT_COPY, 1843 .location = {.poolIndex = 0, .offset = 12, .length = 4}, 1844 }, 1845 { 1846 .type = OperandType::BOOL, 1847 .dimensions = {}, 1848 .numberOfConsumers = 1, 1849 .scale = 0.0f, 1850 .zeroPoint = 0, 1851 .lifetime = OperandLifeTime::CONSTANT_COPY, 1852 .location = {.poolIndex = 0, .offset = 16, .length = 1}, 1853 }, 1854 { 1855 .type = OperandType::INT32, 1856 .dimensions = {}, 1857 .numberOfConsumers = 1, 1858 .scale = 0.0f, 1859 .zeroPoint = 0, 1860 .lifetime = OperandLifeTime::CONSTANT_COPY, 1861 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 1862 }, 1863 { 1864 .type = OperandType::INT32, 1865 .dimensions = {}, 1866 .numberOfConsumers = 1, 1867 .scale = 0.0f, 1868 .zeroPoint = 0, 1869 .lifetime = OperandLifeTime::CONSTANT_COPY, 1870 .location = {.poolIndex = 0, .offset = 21, .length = 4}, 1871 }, 1872 { 1873 .type = OperandType::INT32, 1874 .dimensions = {}, 1875 .numberOfConsumers = 1, 1876 .scale = 0.0f, 1877 .zeroPoint = 0, 1878 .lifetime = OperandLifeTime::CONSTANT_COPY, 1879 .location = {.poolIndex = 0, .offset = 25, .length = 4}, 1880 }, 1881 { 1882 .type = OperandType::FLOAT32, 1883 .dimensions = {}, 1884 .numberOfConsumers = 1, 1885 .scale = 0.0f, 1886 .zeroPoint = 0, 1887 .lifetime = OperandLifeTime::CONSTANT_COPY, 1888 .location = {.poolIndex = 0, .offset = 29, .length = 4}, 1889 }, 1890 { 1891 .type = OperandType::FLOAT32, 1892 .dimensions = {}, 1893 .numberOfConsumers = 1, 1894 .scale = 0.0f, 1895 .zeroPoint = 0, 1896 .lifetime = OperandLifeTime::CONSTANT_COPY, 1897 .location = {.poolIndex = 0, .offset = 33, .length = 4}, 1898 }, 1899 { 1900 .type = OperandType::BOOL, 1901 .dimensions = {}, 1902 .numberOfConsumers = 1, 1903 .scale = 0.0f, 1904 .zeroPoint = 0, 1905 .lifetime = OperandLifeTime::CONSTANT_COPY, 1906 .location = {.poolIndex = 0, .offset = 37, .length = 1}, 1907 }, 1908 { 1909 .type = OperandType::TENSOR_FLOAT32, 1910 .dimensions = {0, 0}, 1911 .numberOfConsumers = 0, 1912 .scale = 0.0f, 1913 .zeroPoint = 0, 1914 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1915 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1916 }, 1917 { 1918 .type = OperandType::TENSOR_FLOAT32, 1919 .dimensions = {0, 0, 0}, 1920 .numberOfConsumers = 0, 1921 .scale = 0.0f, 1922 .zeroPoint = 0, 1923 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1924 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1925 }, 1926 { 1927 .type = OperandType::TENSOR_INT32, 1928 .dimensions = {0, 0}, 1929 .numberOfConsumers = 0, 1930 .scale = 0.0f, 1931 .zeroPoint = 0, 1932 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1933 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1934 }, 1935 { 1936 .type = OperandType::TENSOR_INT32, 1937 .dimensions = {0}, 1938 .numberOfConsumers = 0, 1939 .scale = 0.0f, 1940 .zeroPoint = 0, 1941 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1942 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1943 } 1944 }; 1945 1946 const std::vector<Operation> operations = { 1947 { 1948 .type = OperationType::DETECTION_POSTPROCESSING, 1949 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 1950 .outputs = {14, 15, 16, 17}, 1951 } 1952 }; 1953 1954 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 1955 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 1956 std::vector<uint8_t> operandValues = { 1957 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 160, 64, 0, 0, 160, 64, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0 1958 }; 1959 const std::vector<hidl_memory> pools = {}; 1960 1961 return { 1962 .operands = operands, 1963 .operations = operations, 1964 .inputIndexes = inputIndexes, 1965 .outputIndexes = outputIndexes, 1966 .operandValues = operandValues, 1967 .pools = pools, 1968 }; 1969 } 1970 1971 inline bool is_ignored_dynamic_output_shape(int i) { 1972 static std::set<int> ignore = {}; 1973 return ignore.find(i) != ignore.end(); 1974 } 1975 1976 // Create the model 1977 Model createTestModel_dynamic_output_shape_relaxed() { 1978 const std::vector<Operand> operands = { 1979 { 1980 .type = OperandType::TENSOR_FLOAT32, 1981 .dimensions = {1, 6, 3}, 1982 .numberOfConsumers = 1, 1983 .scale = 0.0f, 1984 .zeroPoint = 0, 1985 .lifetime = OperandLifeTime::MODEL_INPUT, 1986 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1987 }, 1988 { 1989 .type = OperandType::TENSOR_FLOAT32, 1990 .dimensions = {1, 6, 4}, 1991 .numberOfConsumers = 1, 1992 .scale = 0.0f, 1993 .zeroPoint = 0, 1994 .lifetime = OperandLifeTime::MODEL_INPUT, 1995 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1996 }, 1997 { 1998 .type = OperandType::TENSOR_FLOAT32, 1999 .dimensions = {6, 4}, 2000 .numberOfConsumers = 1, 2001 .scale = 0.0f, 2002 .zeroPoint = 0, 2003 .lifetime = OperandLifeTime::MODEL_INPUT, 2004 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2005 }, 2006 { 2007 .type = OperandType::FLOAT32, 2008 .dimensions = {}, 2009 .numberOfConsumers = 1, 2010 .scale = 0.0f, 2011 .zeroPoint = 0, 2012 .lifetime = OperandLifeTime::CONSTANT_COPY, 2013 .location = {.poolIndex = 0, .offset = 0, .length = 4}, 2014 }, 2015 { 2016 .type = OperandType::FLOAT32, 2017 .dimensions = {}, 2018 .numberOfConsumers = 1, 2019 .scale = 0.0f, 2020 .zeroPoint = 0, 2021 .lifetime = OperandLifeTime::CONSTANT_COPY, 2022 .location = {.poolIndex = 0, .offset = 4, .length = 4}, 2023 }, 2024 { 2025 .type = OperandType::FLOAT32, 2026 .dimensions = {}, 2027 .numberOfConsumers = 1, 2028 .scale = 0.0f, 2029 .zeroPoint = 0, 2030 .lifetime = OperandLifeTime::CONSTANT_COPY, 2031 .location = {.poolIndex = 0, .offset = 8, .length = 4}, 2032 }, 2033 { 2034 .type = OperandType::FLOAT32, 2035 .dimensions = {}, 2036 .numberOfConsumers = 1, 2037 .scale = 0.0f, 2038 .zeroPoint = 0, 2039 .lifetime = OperandLifeTime::CONSTANT_COPY, 2040 .location = {.poolIndex = 0, .offset = 12, .length = 4}, 2041 }, 2042 { 2043 .type = OperandType::BOOL, 2044 .dimensions = {}, 2045 .numberOfConsumers = 1, 2046 .scale = 0.0f, 2047 .zeroPoint = 0, 2048 .lifetime = OperandLifeTime::CONSTANT_COPY, 2049 .location = {.poolIndex = 0, .offset = 16, .length = 1}, 2050 }, 2051 { 2052 .type = OperandType::INT32, 2053 .dimensions = {}, 2054 .numberOfConsumers = 1, 2055 .scale = 0.0f, 2056 .zeroPoint = 0, 2057 .lifetime = OperandLifeTime::CONSTANT_COPY, 2058 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 2059 }, 2060 { 2061 .type = OperandType::INT32, 2062 .dimensions = {}, 2063 .numberOfConsumers = 1, 2064 .scale = 0.0f, 2065 .zeroPoint = 0, 2066 .lifetime = OperandLifeTime::CONSTANT_COPY, 2067 .location = {.poolIndex = 0, .offset = 21, .length = 4}, 2068 }, 2069 { 2070 .type = OperandType::INT32, 2071 .dimensions = {}, 2072 .numberOfConsumers = 1, 2073 .scale = 0.0f, 2074 .zeroPoint = 0, 2075 .lifetime = OperandLifeTime::CONSTANT_COPY, 2076 .location = {.poolIndex = 0, .offset = 25, .length = 4}, 2077 }, 2078 { 2079 .type = OperandType::FLOAT32, 2080 .dimensions = {}, 2081 .numberOfConsumers = 1, 2082 .scale = 0.0f, 2083 .zeroPoint = 0, 2084 .lifetime = OperandLifeTime::CONSTANT_COPY, 2085 .location = {.poolIndex = 0, .offset = 29, .length = 4}, 2086 }, 2087 { 2088 .type = OperandType::FLOAT32, 2089 .dimensions = {}, 2090 .numberOfConsumers = 1, 2091 .scale = 0.0f, 2092 .zeroPoint = 0, 2093 .lifetime = OperandLifeTime::CONSTANT_COPY, 2094 .location = {.poolIndex = 0, .offset = 33, .length = 4}, 2095 }, 2096 { 2097 .type = OperandType::BOOL, 2098 .dimensions = {}, 2099 .numberOfConsumers = 1, 2100 .scale = 0.0f, 2101 .zeroPoint = 0, 2102 .lifetime = OperandLifeTime::CONSTANT_COPY, 2103 .location = {.poolIndex = 0, .offset = 37, .length = 1}, 2104 }, 2105 { 2106 .type = OperandType::TENSOR_FLOAT32, 2107 .dimensions = {0, 0}, 2108 .numberOfConsumers = 0, 2109 .scale = 0.0f, 2110 .zeroPoint = 0, 2111 .lifetime = OperandLifeTime::MODEL_OUTPUT, 2112 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2113 }, 2114 { 2115 .type = OperandType::TENSOR_FLOAT32, 2116 .dimensions = {0, 0, 0}, 2117 .numberOfConsumers = 0, 2118 .scale = 0.0f, 2119 .zeroPoint = 0, 2120 .lifetime = OperandLifeTime::MODEL_OUTPUT, 2121 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2122 }, 2123 { 2124 .type = OperandType::TENSOR_INT32, 2125 .dimensions = {0, 0}, 2126 .numberOfConsumers = 0, 2127 .scale = 0.0f, 2128 .zeroPoint = 0, 2129 .lifetime = OperandLifeTime::MODEL_OUTPUT, 2130 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2131 }, 2132 { 2133 .type = OperandType::TENSOR_INT32, 2134 .dimensions = {0}, 2135 .numberOfConsumers = 0, 2136 .scale = 0.0f, 2137 .zeroPoint = 0, 2138 .lifetime = OperandLifeTime::MODEL_OUTPUT, 2139 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2140 } 2141 }; 2142 2143 const std::vector<Operation> operations = { 2144 { 2145 .type = OperationType::DETECTION_POSTPROCESSING, 2146 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 2147 .outputs = {14, 15, 16, 17}, 2148 } 2149 }; 2150 2151 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 2152 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 2153 std::vector<uint8_t> operandValues = { 2154 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 160, 64, 0, 0, 160, 64, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0 2155 }; 2156 const std::vector<hidl_memory> pools = {}; 2157 2158 return { 2159 .operands = operands, 2160 .operations = operations, 2161 .inputIndexes = inputIndexes, 2162 .outputIndexes = outputIndexes, 2163 .operandValues = operandValues, 2164 .pools = pools, 2165 .relaxComputationFloat32toFloat16 = true, 2166 }; 2167 } 2168 2169 inline bool is_ignored_dynamic_output_shape_relaxed(int i) { 2170 static std::set<int> ignore = {}; 2171 return ignore.find(i) != ignore.end(); 2172 } 2173 2174 // Create the model 2175 Model createTestModel_dynamic_output_shape_float16() { 2176 const std::vector<Operand> operands = { 2177 { 2178 .type = OperandType::TENSOR_FLOAT16, 2179 .dimensions = {1, 6, 3}, 2180 .numberOfConsumers = 1, 2181 .scale = 0.0f, 2182 .zeroPoint = 0, 2183 .lifetime = OperandLifeTime::MODEL_INPUT, 2184 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2185 }, 2186 { 2187 .type = OperandType::TENSOR_FLOAT16, 2188 .dimensions = {1, 6, 4}, 2189 .numberOfConsumers = 1, 2190 .scale = 0.0f, 2191 .zeroPoint = 0, 2192 .lifetime = OperandLifeTime::MODEL_INPUT, 2193 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2194 }, 2195 { 2196 .type = OperandType::TENSOR_FLOAT16, 2197 .dimensions = {6, 4}, 2198 .numberOfConsumers = 1, 2199 .scale = 0.0f, 2200 .zeroPoint = 0, 2201 .lifetime = OperandLifeTime::MODEL_INPUT, 2202 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2203 }, 2204 { 2205 .type = OperandType::FLOAT16, 2206 .dimensions = {}, 2207 .numberOfConsumers = 1, 2208 .scale = 0.0f, 2209 .zeroPoint = 0, 2210 .lifetime = OperandLifeTime::CONSTANT_COPY, 2211 .location = {.poolIndex = 0, .offset = 0, .length = 2}, 2212 }, 2213 { 2214 .type = OperandType::FLOAT16, 2215 .dimensions = {}, 2216 .numberOfConsumers = 1, 2217 .scale = 0.0f, 2218 .zeroPoint = 0, 2219 .lifetime = OperandLifeTime::CONSTANT_COPY, 2220 .location = {.poolIndex = 0, .offset = 2, .length = 2}, 2221 }, 2222 { 2223 .type = OperandType::FLOAT16, 2224 .dimensions = {}, 2225 .numberOfConsumers = 1, 2226 .scale = 0.0f, 2227 .zeroPoint = 0, 2228 .lifetime = OperandLifeTime::CONSTANT_COPY, 2229 .location = {.poolIndex = 0, .offset = 4, .length = 2}, 2230 }, 2231 { 2232 .type = OperandType::FLOAT16, 2233 .dimensions = {}, 2234 .numberOfConsumers = 1, 2235 .scale = 0.0f, 2236 .zeroPoint = 0, 2237 .lifetime = OperandLifeTime::CONSTANT_COPY, 2238 .location = {.poolIndex = 0, .offset = 6, .length = 2}, 2239 }, 2240 { 2241 .type = OperandType::BOOL, 2242 .dimensions = {}, 2243 .numberOfConsumers = 1, 2244 .scale = 0.0f, 2245 .zeroPoint = 0, 2246 .lifetime = OperandLifeTime::CONSTANT_COPY, 2247 .location = {.poolIndex = 0, .offset = 8, .length = 1}, 2248 }, 2249 { 2250 .type = OperandType::INT32, 2251 .dimensions = {}, 2252 .numberOfConsumers = 1, 2253 .scale = 0.0f, 2254 .zeroPoint = 0, 2255 .lifetime = OperandLifeTime::CONSTANT_COPY, 2256 .location = {.poolIndex = 0, .offset = 9, .length = 4}, 2257 }, 2258 { 2259 .type = OperandType::INT32, 2260 .dimensions = {}, 2261 .numberOfConsumers = 1, 2262 .scale = 0.0f, 2263 .zeroPoint = 0, 2264 .lifetime = OperandLifeTime::CONSTANT_COPY, 2265 .location = {.poolIndex = 0, .offset = 13, .length = 4}, 2266 }, 2267 { 2268 .type = OperandType::INT32, 2269 .dimensions = {}, 2270 .numberOfConsumers = 1, 2271 .scale = 0.0f, 2272 .zeroPoint = 0, 2273 .lifetime = OperandLifeTime::CONSTANT_COPY, 2274 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 2275 }, 2276 { 2277 .type = OperandType::FLOAT16, 2278 .dimensions = {}, 2279 .numberOfConsumers = 1, 2280 .scale = 0.0f, 2281 .zeroPoint = 0, 2282 .lifetime = OperandLifeTime::CONSTANT_COPY, 2283 .location = {.poolIndex = 0, .offset = 21, .length = 2}, 2284 }, 2285 { 2286 .type = OperandType::FLOAT16, 2287 .dimensions = {}, 2288 .numberOfConsumers = 1, 2289 .scale = 0.0f, 2290 .zeroPoint = 0, 2291 .lifetime = OperandLifeTime::CONSTANT_COPY, 2292 .location = {.poolIndex = 0, .offset = 23, .length = 2}, 2293 }, 2294 { 2295 .type = OperandType::BOOL, 2296 .dimensions = {}, 2297 .numberOfConsumers = 1, 2298 .scale = 0.0f, 2299 .zeroPoint = 0, 2300 .lifetime = OperandLifeTime::CONSTANT_COPY, 2301 .location = {.poolIndex = 0, .offset = 25, .length = 1}, 2302 }, 2303 { 2304 .type = OperandType::TENSOR_FLOAT16, 2305 .dimensions = {0, 0}, 2306 .numberOfConsumers = 0, 2307 .scale = 0.0f, 2308 .zeroPoint = 0, 2309 .lifetime = OperandLifeTime::MODEL_OUTPUT, 2310 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2311 }, 2312 { 2313 .type = OperandType::TENSOR_FLOAT16, 2314 .dimensions = {0, 0, 0}, 2315 .numberOfConsumers = 0, 2316 .scale = 0.0f, 2317 .zeroPoint = 0, 2318 .lifetime = OperandLifeTime::MODEL_OUTPUT, 2319 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2320 }, 2321 { 2322 .type = OperandType::TENSOR_INT32, 2323 .dimensions = {0, 0}, 2324 .numberOfConsumers = 0, 2325 .scale = 0.0f, 2326 .zeroPoint = 0, 2327 .lifetime = OperandLifeTime::MODEL_OUTPUT, 2328 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2329 }, 2330 { 2331 .type = OperandType::TENSOR_INT32, 2332 .dimensions = {0}, 2333 .numberOfConsumers = 0, 2334 .scale = 0.0f, 2335 .zeroPoint = 0, 2336 .lifetime = OperandLifeTime::MODEL_OUTPUT, 2337 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2338 } 2339 }; 2340 2341 const std::vector<Operation> operations = { 2342 { 2343 .type = OperationType::DETECTION_POSTPROCESSING, 2344 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 2345 .outputs = {14, 15, 16, 17}, 2346 } 2347 }; 2348 2349 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 2350 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 2351 std::vector<uint8_t> operandValues = { 2352 0, 73, 0, 73, 0, 69, 0, 69, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 56, 0 2353 }; 2354 const std::vector<hidl_memory> pools = {}; 2355 2356 return { 2357 .operands = operands, 2358 .operations = operations, 2359 .inputIndexes = inputIndexes, 2360 .outputIndexes = outputIndexes, 2361 .operandValues = operandValues, 2362 .pools = pools, 2363 }; 2364 } 2365 2366 inline bool is_ignored_dynamic_output_shape_float16(int i) { 2367 static std::set<int> ignore = {}; 2368 return ignore.find(i) != ignore.end(); 2369 } 2370 2371 // Create the model 2372 Model createTestModel_2() { 2373 const std::vector<Operand> operands = { 2374 { 2375 .type = OperandType::TENSOR_FLOAT32, 2376 .dimensions = {1, 6, 3}, 2377 .numberOfConsumers = 1, 2378 .scale = 0.0f, 2379 .zeroPoint = 0, 2380 .lifetime = OperandLifeTime::MODEL_INPUT, 2381 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2382 }, 2383 { 2384 .type = OperandType::TENSOR_FLOAT32, 2385 .dimensions = {1, 6, 7}, 2386 .numberOfConsumers = 1, 2387 .scale = 0.0f, 2388 .zeroPoint = 0, 2389 .lifetime = OperandLifeTime::MODEL_INPUT, 2390 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2391 }, 2392 { 2393 .type = OperandType::TENSOR_FLOAT32, 2394 .dimensions = {6, 4}, 2395 .numberOfConsumers = 1, 2396 .scale = 0.0f, 2397 .zeroPoint = 0, 2398 .lifetime = OperandLifeTime::MODEL_INPUT, 2399 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2400 }, 2401 { 2402 .type = OperandType::FLOAT32, 2403 .dimensions = {}, 2404 .numberOfConsumers = 1, 2405 .scale = 0.0f, 2406 .zeroPoint = 0, 2407 .lifetime = OperandLifeTime::CONSTANT_COPY, 2408 .location = {.poolIndex = 0, .offset = 0, .length = 4}, 2409 }, 2410 { 2411 .type = OperandType::FLOAT32, 2412 .dimensions = {}, 2413 .numberOfConsumers = 1, 2414 .scale = 0.0f, 2415 .zeroPoint = 0, 2416 .lifetime = OperandLifeTime::CONSTANT_COPY, 2417 .location = {.poolIndex = 0, .offset = 4, .length = 4}, 2418 }, 2419 { 2420 .type = OperandType::FLOAT32, 2421 .dimensions = {}, 2422 .numberOfConsumers = 1, 2423 .scale = 0.0f, 2424 .zeroPoint = 0, 2425 .lifetime = OperandLifeTime::CONSTANT_COPY, 2426 .location = {.poolIndex = 0, .offset = 8, .length = 4}, 2427 }, 2428 { 2429 .type = OperandType::FLOAT32, 2430 .dimensions = {}, 2431 .numberOfConsumers = 1, 2432 .scale = 0.0f, 2433 .zeroPoint = 0, 2434 .lifetime = OperandLifeTime::CONSTANT_COPY, 2435 .location = {.poolIndex = 0, .offset = 12, .length = 4}, 2436 }, 2437 { 2438 .type = OperandType::BOOL, 2439 .dimensions = {}, 2440 .numberOfConsumers = 1, 2441 .scale = 0.0f, 2442 .zeroPoint = 0, 2443 .lifetime = OperandLifeTime::CONSTANT_COPY, 2444 .location = {.poolIndex = 0, .offset = 16, .length = 1}, 2445 }, 2446 { 2447 .type = OperandType::INT32, 2448 .dimensions = {}, 2449 .numberOfConsumers = 1, 2450 .scale = 0.0f, 2451 .zeroPoint = 0, 2452 .lifetime = OperandLifeTime::CONSTANT_COPY, 2453 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 2454 }, 2455 { 2456 .type = OperandType::INT32, 2457 .dimensions = {}, 2458 .numberOfConsumers = 1, 2459 .scale = 0.0f, 2460 .zeroPoint = 0, 2461 .lifetime = OperandLifeTime::CONSTANT_COPY, 2462 .location = {.poolIndex = 0, .offset = 21, .length = 4}, 2463 }, 2464 { 2465 .type = OperandType::INT32, 2466 .dimensions = {}, 2467 .numberOfConsumers = 1, 2468 .scale = 0.0f, 2469 .zeroPoint = 0, 2470 .lifetime = OperandLifeTime::CONSTANT_COPY, 2471 .location = {.poolIndex = 0, .offset = 25, .length = 4}, 2472 }, 2473 { 2474 .type = OperandType::FLOAT32, 2475 .dimensions = {}, 2476 .numberOfConsumers = 1, 2477 .scale = 0.0f, 2478 .zeroPoint = 0, 2479 .lifetime = OperandLifeTime::CONSTANT_COPY, 2480 .location = {.poolIndex = 0, .offset = 29, .length = 4}, 2481 }, 2482 { 2483 .type = OperandType::FLOAT32, 2484 .dimensions = {}, 2485 .numberOfConsumers = 1, 2486 .scale = 0.0f, 2487 .zeroPoint = 0, 2488 .lifetime = OperandLifeTime::CONSTANT_COPY, 2489 .location = {.poolIndex = 0, .offset = 33, .length = 4}, 2490 }, 2491 { 2492 .type = OperandType::BOOL, 2493 .dimensions = {}, 2494 .numberOfConsumers = 1, 2495 .scale = 0.0f, 2496 .zeroPoint = 0, 2497 .lifetime = OperandLifeTime::CONSTANT_COPY, 2498 .location = {.poolIndex = 0, .offset = 37, .length = 1}, 2499 }, 2500 { 2501 .type = OperandType::TENSOR_FLOAT32, 2502 .dimensions = {1, 3}, 2503 .numberOfConsumers = 0, 2504 .scale = 0.0f, 2505 .zeroPoint = 0, 2506 .lifetime = OperandLifeTime::MODEL_OUTPUT, 2507 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2508 }, 2509 { 2510 .type = OperandType::TENSOR_FLOAT32, 2511 .dimensions = {1, 3, 4}, 2512 .numberOfConsumers = 0, 2513 .scale = 0.0f, 2514 .zeroPoint = 0, 2515 .lifetime = OperandLifeTime::MODEL_OUTPUT, 2516 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2517 }, 2518 { 2519 .type = OperandType::TENSOR_INT32, 2520 .dimensions = {1, 3}, 2521 .numberOfConsumers = 0, 2522 .scale = 0.0f, 2523 .zeroPoint = 0, 2524 .lifetime = OperandLifeTime::MODEL_OUTPUT, 2525 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2526 }, 2527 { 2528 .type = OperandType::TENSOR_INT32, 2529 .dimensions = {1}, 2530 .numberOfConsumers = 0, 2531 .scale = 0.0f, 2532 .zeroPoint = 0, 2533 .lifetime = OperandLifeTime::MODEL_OUTPUT, 2534 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2535 } 2536 }; 2537 2538 const std::vector<Operation> operations = { 2539 { 2540 .type = OperationType::DETECTION_POSTPROCESSING, 2541 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 2542 .outputs = {14, 15, 16, 17}, 2543 } 2544 }; 2545 2546 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 2547 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 2548 std::vector<uint8_t> operandValues = { 2549 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 160, 64, 0, 0, 160, 64, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0 2550 }; 2551 const std::vector<hidl_memory> pools = {}; 2552 2553 return { 2554 .operands = operands, 2555 .operations = operations, 2556 .inputIndexes = inputIndexes, 2557 .outputIndexes = outputIndexes, 2558 .operandValues = operandValues, 2559 .pools = pools, 2560 }; 2561 } 2562 2563 inline bool is_ignored_2(int i) { 2564 static std::set<int> ignore = {}; 2565 return ignore.find(i) != ignore.end(); 2566 } 2567 2568 // Create the model 2569 Model createTestModel_relaxed_2() { 2570 const std::vector<Operand> operands = { 2571 { 2572 .type = OperandType::TENSOR_FLOAT32, 2573 .dimensions = {1, 6, 3}, 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_FLOAT32, 2582 .dimensions = {1, 6, 7}, 2583 .numberOfConsumers = 1, 2584 .scale = 0.0f, 2585 .zeroPoint = 0, 2586 .lifetime = OperandLifeTime::MODEL_INPUT, 2587 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2588 }, 2589 { 2590 .type = OperandType::TENSOR_FLOAT32, 2591 .dimensions = {6, 4}, 2592 .numberOfConsumers = 1, 2593 .scale = 0.0f, 2594 .zeroPoint = 0, 2595 .lifetime = OperandLifeTime::MODEL_INPUT, 2596 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2597 }, 2598 { 2599 .type = OperandType::FLOAT32, 2600 .dimensions = {}, 2601 .numberOfConsumers = 1, 2602 .scale = 0.0f, 2603 .zeroPoint = 0, 2604 .lifetime = OperandLifeTime::CONSTANT_COPY, 2605 .location = {.poolIndex = 0, .offset = 0, .length = 4}, 2606 }, 2607 { 2608 .type = OperandType::FLOAT32, 2609 .dimensions = {}, 2610 .numberOfConsumers = 1, 2611 .scale = 0.0f, 2612 .zeroPoint = 0, 2613 .lifetime = OperandLifeTime::CONSTANT_COPY, 2614 .location = {.poolIndex = 0, .offset = 4, .length = 4}, 2615 }, 2616 { 2617 .type = OperandType::FLOAT32, 2618 .dimensions = {}, 2619 .numberOfConsumers = 1, 2620 .scale = 0.0f, 2621 .zeroPoint = 0, 2622 .lifetime = OperandLifeTime::CONSTANT_COPY, 2623 .location = {.poolIndex = 0, .offset = 8, .length = 4}, 2624 }, 2625 { 2626 .type = OperandType::FLOAT32, 2627 .dimensions = {}, 2628 .numberOfConsumers = 1, 2629 .scale = 0.0f, 2630 .zeroPoint = 0, 2631 .lifetime = OperandLifeTime::CONSTANT_COPY, 2632 .location = {.poolIndex = 0, .offset = 12, .length = 4}, 2633 }, 2634 { 2635 .type = OperandType::BOOL, 2636 .dimensions = {}, 2637 .numberOfConsumers = 1, 2638 .scale = 0.0f, 2639 .zeroPoint = 0, 2640 .lifetime = OperandLifeTime::CONSTANT_COPY, 2641 .location = {.poolIndex = 0, .offset = 16, .length = 1}, 2642 }, 2643 { 2644 .type = OperandType::INT32, 2645 .dimensions = {}, 2646 .numberOfConsumers = 1, 2647 .scale = 0.0f, 2648 .zeroPoint = 0, 2649 .lifetime = OperandLifeTime::CONSTANT_COPY, 2650 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 2651 }, 2652 { 2653 .type = OperandType::INT32, 2654 .dimensions = {}, 2655 .numberOfConsumers = 1, 2656 .scale = 0.0f, 2657 .zeroPoint = 0, 2658 .lifetime = OperandLifeTime::CONSTANT_COPY, 2659 .location = {.poolIndex = 0, .offset = 21, .length = 4}, 2660 }, 2661 { 2662 .type = OperandType::INT32, 2663 .dimensions = {}, 2664 .numberOfConsumers = 1, 2665 .scale = 0.0f, 2666 .zeroPoint = 0, 2667 .lifetime = OperandLifeTime::CONSTANT_COPY, 2668 .location = {.poolIndex = 0, .offset = 25, .length = 4}, 2669 }, 2670 { 2671 .type = OperandType::FLOAT32, 2672 .dimensions = {}, 2673 .numberOfConsumers = 1, 2674 .scale = 0.0f, 2675 .zeroPoint = 0, 2676 .lifetime = OperandLifeTime::CONSTANT_COPY, 2677 .location = {.poolIndex = 0, .offset = 29, .length = 4}, 2678 }, 2679 { 2680 .type = OperandType::FLOAT32, 2681 .dimensions = {}, 2682 .numberOfConsumers = 1, 2683 .scale = 0.0f, 2684 .zeroPoint = 0, 2685 .lifetime = OperandLifeTime::CONSTANT_COPY, 2686 .location = {.poolIndex = 0, .offset = 33, .length = 4}, 2687 }, 2688 { 2689 .type = OperandType::BOOL, 2690 .dimensions = {}, 2691 .numberOfConsumers = 1, 2692 .scale = 0.0f, 2693 .zeroPoint = 0, 2694 .lifetime = OperandLifeTime::CONSTANT_COPY, 2695 .location = {.poolIndex = 0, .offset = 37, .length = 1}, 2696 }, 2697 { 2698 .type = OperandType::TENSOR_FLOAT32, 2699 .dimensions = {1, 3}, 2700 .numberOfConsumers = 0, 2701 .scale = 0.0f, 2702 .zeroPoint = 0, 2703 .lifetime = OperandLifeTime::MODEL_OUTPUT, 2704 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2705 }, 2706 { 2707 .type = OperandType::TENSOR_FLOAT32, 2708 .dimensions = {1, 3, 4}, 2709 .numberOfConsumers = 0, 2710 .scale = 0.0f, 2711 .zeroPoint = 0, 2712 .lifetime = OperandLifeTime::MODEL_OUTPUT, 2713 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2714 }, 2715 { 2716 .type = OperandType::TENSOR_INT32, 2717 .dimensions = {1, 3}, 2718 .numberOfConsumers = 0, 2719 .scale = 0.0f, 2720 .zeroPoint = 0, 2721 .lifetime = OperandLifeTime::MODEL_OUTPUT, 2722 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2723 }, 2724 { 2725 .type = OperandType::TENSOR_INT32, 2726 .dimensions = {1}, 2727 .numberOfConsumers = 0, 2728 .scale = 0.0f, 2729 .zeroPoint = 0, 2730 .lifetime = OperandLifeTime::MODEL_OUTPUT, 2731 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2732 } 2733 }; 2734 2735 const std::vector<Operation> operations = { 2736 { 2737 .type = OperationType::DETECTION_POSTPROCESSING, 2738 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 2739 .outputs = {14, 15, 16, 17}, 2740 } 2741 }; 2742 2743 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 2744 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 2745 std::vector<uint8_t> operandValues = { 2746 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 160, 64, 0, 0, 160, 64, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0 2747 }; 2748 const std::vector<hidl_memory> pools = {}; 2749 2750 return { 2751 .operands = operands, 2752 .operations = operations, 2753 .inputIndexes = inputIndexes, 2754 .outputIndexes = outputIndexes, 2755 .operandValues = operandValues, 2756 .pools = pools, 2757 .relaxComputationFloat32toFloat16 = true, 2758 }; 2759 } 2760 2761 inline bool is_ignored_relaxed_2(int i) { 2762 static std::set<int> ignore = {}; 2763 return ignore.find(i) != ignore.end(); 2764 } 2765 2766 // Create the model 2767 Model createTestModel_float16_2() { 2768 const std::vector<Operand> operands = { 2769 { 2770 .type = OperandType::TENSOR_FLOAT16, 2771 .dimensions = {1, 6, 3}, 2772 .numberOfConsumers = 1, 2773 .scale = 0.0f, 2774 .zeroPoint = 0, 2775 .lifetime = OperandLifeTime::MODEL_INPUT, 2776 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2777 }, 2778 { 2779 .type = OperandType::TENSOR_FLOAT16, 2780 .dimensions = {1, 6, 7}, 2781 .numberOfConsumers = 1, 2782 .scale = 0.0f, 2783 .zeroPoint = 0, 2784 .lifetime = OperandLifeTime::MODEL_INPUT, 2785 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2786 }, 2787 { 2788 .type = OperandType::TENSOR_FLOAT16, 2789 .dimensions = {6, 4}, 2790 .numberOfConsumers = 1, 2791 .scale = 0.0f, 2792 .zeroPoint = 0, 2793 .lifetime = OperandLifeTime::MODEL_INPUT, 2794 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2795 }, 2796 { 2797 .type = OperandType::FLOAT16, 2798 .dimensions = {}, 2799 .numberOfConsumers = 1, 2800 .scale = 0.0f, 2801 .zeroPoint = 0, 2802 .lifetime = OperandLifeTime::CONSTANT_COPY, 2803 .location = {.poolIndex = 0, .offset = 0, .length = 2}, 2804 }, 2805 { 2806 .type = OperandType::FLOAT16, 2807 .dimensions = {}, 2808 .numberOfConsumers = 1, 2809 .scale = 0.0f, 2810 .zeroPoint = 0, 2811 .lifetime = OperandLifeTime::CONSTANT_COPY, 2812 .location = {.poolIndex = 0, .offset = 2, .length = 2}, 2813 }, 2814 { 2815 .type = OperandType::FLOAT16, 2816 .dimensions = {}, 2817 .numberOfConsumers = 1, 2818 .scale = 0.0f, 2819 .zeroPoint = 0, 2820 .lifetime = OperandLifeTime::CONSTANT_COPY, 2821 .location = {.poolIndex = 0, .offset = 4, .length = 2}, 2822 }, 2823 { 2824 .type = OperandType::FLOAT16, 2825 .dimensions = {}, 2826 .numberOfConsumers = 1, 2827 .scale = 0.0f, 2828 .zeroPoint = 0, 2829 .lifetime = OperandLifeTime::CONSTANT_COPY, 2830 .location = {.poolIndex = 0, .offset = 6, .length = 2}, 2831 }, 2832 { 2833 .type = OperandType::BOOL, 2834 .dimensions = {}, 2835 .numberOfConsumers = 1, 2836 .scale = 0.0f, 2837 .zeroPoint = 0, 2838 .lifetime = OperandLifeTime::CONSTANT_COPY, 2839 .location = {.poolIndex = 0, .offset = 8, .length = 1}, 2840 }, 2841 { 2842 .type = OperandType::INT32, 2843 .dimensions = {}, 2844 .numberOfConsumers = 1, 2845 .scale = 0.0f, 2846 .zeroPoint = 0, 2847 .lifetime = OperandLifeTime::CONSTANT_COPY, 2848 .location = {.poolIndex = 0, .offset = 9, .length = 4}, 2849 }, 2850 { 2851 .type = OperandType::INT32, 2852 .dimensions = {}, 2853 .numberOfConsumers = 1, 2854 .scale = 0.0f, 2855 .zeroPoint = 0, 2856 .lifetime = OperandLifeTime::CONSTANT_COPY, 2857 .location = {.poolIndex = 0, .offset = 13, .length = 4}, 2858 }, 2859 { 2860 .type = OperandType::INT32, 2861 .dimensions = {}, 2862 .numberOfConsumers = 1, 2863 .scale = 0.0f, 2864 .zeroPoint = 0, 2865 .lifetime = OperandLifeTime::CONSTANT_COPY, 2866 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 2867 }, 2868 { 2869 .type = OperandType::FLOAT16, 2870 .dimensions = {}, 2871 .numberOfConsumers = 1, 2872 .scale = 0.0f, 2873 .zeroPoint = 0, 2874 .lifetime = OperandLifeTime::CONSTANT_COPY, 2875 .location = {.poolIndex = 0, .offset = 21, .length = 2}, 2876 }, 2877 { 2878 .type = OperandType::FLOAT16, 2879 .dimensions = {}, 2880 .numberOfConsumers = 1, 2881 .scale = 0.0f, 2882 .zeroPoint = 0, 2883 .lifetime = OperandLifeTime::CONSTANT_COPY, 2884 .location = {.poolIndex = 0, .offset = 23, .length = 2}, 2885 }, 2886 { 2887 .type = OperandType::BOOL, 2888 .dimensions = {}, 2889 .numberOfConsumers = 1, 2890 .scale = 0.0f, 2891 .zeroPoint = 0, 2892 .lifetime = OperandLifeTime::CONSTANT_COPY, 2893 .location = {.poolIndex = 0, .offset = 25, .length = 1}, 2894 }, 2895 { 2896 .type = OperandType::TENSOR_FLOAT16, 2897 .dimensions = {1, 3}, 2898 .numberOfConsumers = 0, 2899 .scale = 0.0f, 2900 .zeroPoint = 0, 2901 .lifetime = OperandLifeTime::MODEL_OUTPUT, 2902 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2903 }, 2904 { 2905 .type = OperandType::TENSOR_FLOAT16, 2906 .dimensions = {1, 3, 4}, 2907 .numberOfConsumers = 0, 2908 .scale = 0.0f, 2909 .zeroPoint = 0, 2910 .lifetime = OperandLifeTime::MODEL_OUTPUT, 2911 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2912 }, 2913 { 2914 .type = OperandType::TENSOR_INT32, 2915 .dimensions = {1, 3}, 2916 .numberOfConsumers = 0, 2917 .scale = 0.0f, 2918 .zeroPoint = 0, 2919 .lifetime = OperandLifeTime::MODEL_OUTPUT, 2920 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2921 }, 2922 { 2923 .type = OperandType::TENSOR_INT32, 2924 .dimensions = {1}, 2925 .numberOfConsumers = 0, 2926 .scale = 0.0f, 2927 .zeroPoint = 0, 2928 .lifetime = OperandLifeTime::MODEL_OUTPUT, 2929 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2930 } 2931 }; 2932 2933 const std::vector<Operation> operations = { 2934 { 2935 .type = OperationType::DETECTION_POSTPROCESSING, 2936 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 2937 .outputs = {14, 15, 16, 17}, 2938 } 2939 }; 2940 2941 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 2942 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 2943 std::vector<uint8_t> operandValues = { 2944 0, 73, 0, 73, 0, 69, 0, 69, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 56, 0 2945 }; 2946 const std::vector<hidl_memory> pools = {}; 2947 2948 return { 2949 .operands = operands, 2950 .operations = operations, 2951 .inputIndexes = inputIndexes, 2952 .outputIndexes = outputIndexes, 2953 .operandValues = operandValues, 2954 .pools = pools, 2955 }; 2956 } 2957 2958 inline bool is_ignored_float16_2(int i) { 2959 static std::set<int> ignore = {}; 2960 return ignore.find(i) != ignore.end(); 2961 } 2962 2963 // Create the model 2964 Model createTestModel_dynamic_output_shape_2() { 2965 const std::vector<Operand> operands = { 2966 { 2967 .type = OperandType::TENSOR_FLOAT32, 2968 .dimensions = {1, 6, 3}, 2969 .numberOfConsumers = 1, 2970 .scale = 0.0f, 2971 .zeroPoint = 0, 2972 .lifetime = OperandLifeTime::MODEL_INPUT, 2973 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2974 }, 2975 { 2976 .type = OperandType::TENSOR_FLOAT32, 2977 .dimensions = {1, 6, 7}, 2978 .numberOfConsumers = 1, 2979 .scale = 0.0f, 2980 .zeroPoint = 0, 2981 .lifetime = OperandLifeTime::MODEL_INPUT, 2982 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2983 }, 2984 { 2985 .type = OperandType::TENSOR_FLOAT32, 2986 .dimensions = {6, 4}, 2987 .numberOfConsumers = 1, 2988 .scale = 0.0f, 2989 .zeroPoint = 0, 2990 .lifetime = OperandLifeTime::MODEL_INPUT, 2991 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 2992 }, 2993 { 2994 .type = OperandType::FLOAT32, 2995 .dimensions = {}, 2996 .numberOfConsumers = 1, 2997 .scale = 0.0f, 2998 .zeroPoint = 0, 2999 .lifetime = OperandLifeTime::CONSTANT_COPY, 3000 .location = {.poolIndex = 0, .offset = 0, .length = 4}, 3001 }, 3002 { 3003 .type = OperandType::FLOAT32, 3004 .dimensions = {}, 3005 .numberOfConsumers = 1, 3006 .scale = 0.0f, 3007 .zeroPoint = 0, 3008 .lifetime = OperandLifeTime::CONSTANT_COPY, 3009 .location = {.poolIndex = 0, .offset = 4, .length = 4}, 3010 }, 3011 { 3012 .type = OperandType::FLOAT32, 3013 .dimensions = {}, 3014 .numberOfConsumers = 1, 3015 .scale = 0.0f, 3016 .zeroPoint = 0, 3017 .lifetime = OperandLifeTime::CONSTANT_COPY, 3018 .location = {.poolIndex = 0, .offset = 8, .length = 4}, 3019 }, 3020 { 3021 .type = OperandType::FLOAT32, 3022 .dimensions = {}, 3023 .numberOfConsumers = 1, 3024 .scale = 0.0f, 3025 .zeroPoint = 0, 3026 .lifetime = OperandLifeTime::CONSTANT_COPY, 3027 .location = {.poolIndex = 0, .offset = 12, .length = 4}, 3028 }, 3029 { 3030 .type = OperandType::BOOL, 3031 .dimensions = {}, 3032 .numberOfConsumers = 1, 3033 .scale = 0.0f, 3034 .zeroPoint = 0, 3035 .lifetime = OperandLifeTime::CONSTANT_COPY, 3036 .location = {.poolIndex = 0, .offset = 16, .length = 1}, 3037 }, 3038 { 3039 .type = OperandType::INT32, 3040 .dimensions = {}, 3041 .numberOfConsumers = 1, 3042 .scale = 0.0f, 3043 .zeroPoint = 0, 3044 .lifetime = OperandLifeTime::CONSTANT_COPY, 3045 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 3046 }, 3047 { 3048 .type = OperandType::INT32, 3049 .dimensions = {}, 3050 .numberOfConsumers = 1, 3051 .scale = 0.0f, 3052 .zeroPoint = 0, 3053 .lifetime = OperandLifeTime::CONSTANT_COPY, 3054 .location = {.poolIndex = 0, .offset = 21, .length = 4}, 3055 }, 3056 { 3057 .type = OperandType::INT32, 3058 .dimensions = {}, 3059 .numberOfConsumers = 1, 3060 .scale = 0.0f, 3061 .zeroPoint = 0, 3062 .lifetime = OperandLifeTime::CONSTANT_COPY, 3063 .location = {.poolIndex = 0, .offset = 25, .length = 4}, 3064 }, 3065 { 3066 .type = OperandType::FLOAT32, 3067 .dimensions = {}, 3068 .numberOfConsumers = 1, 3069 .scale = 0.0f, 3070 .zeroPoint = 0, 3071 .lifetime = OperandLifeTime::CONSTANT_COPY, 3072 .location = {.poolIndex = 0, .offset = 29, .length = 4}, 3073 }, 3074 { 3075 .type = OperandType::FLOAT32, 3076 .dimensions = {}, 3077 .numberOfConsumers = 1, 3078 .scale = 0.0f, 3079 .zeroPoint = 0, 3080 .lifetime = OperandLifeTime::CONSTANT_COPY, 3081 .location = {.poolIndex = 0, .offset = 33, .length = 4}, 3082 }, 3083 { 3084 .type = OperandType::BOOL, 3085 .dimensions = {}, 3086 .numberOfConsumers = 1, 3087 .scale = 0.0f, 3088 .zeroPoint = 0, 3089 .lifetime = OperandLifeTime::CONSTANT_COPY, 3090 .location = {.poolIndex = 0, .offset = 37, .length = 1}, 3091 }, 3092 { 3093 .type = OperandType::TENSOR_FLOAT32, 3094 .dimensions = {0, 0}, 3095 .numberOfConsumers = 0, 3096 .scale = 0.0f, 3097 .zeroPoint = 0, 3098 .lifetime = OperandLifeTime::MODEL_OUTPUT, 3099 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3100 }, 3101 { 3102 .type = OperandType::TENSOR_FLOAT32, 3103 .dimensions = {0, 0, 0}, 3104 .numberOfConsumers = 0, 3105 .scale = 0.0f, 3106 .zeroPoint = 0, 3107 .lifetime = OperandLifeTime::MODEL_OUTPUT, 3108 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3109 }, 3110 { 3111 .type = OperandType::TENSOR_INT32, 3112 .dimensions = {0, 0}, 3113 .numberOfConsumers = 0, 3114 .scale = 0.0f, 3115 .zeroPoint = 0, 3116 .lifetime = OperandLifeTime::MODEL_OUTPUT, 3117 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3118 }, 3119 { 3120 .type = OperandType::TENSOR_INT32, 3121 .dimensions = {0}, 3122 .numberOfConsumers = 0, 3123 .scale = 0.0f, 3124 .zeroPoint = 0, 3125 .lifetime = OperandLifeTime::MODEL_OUTPUT, 3126 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3127 } 3128 }; 3129 3130 const std::vector<Operation> operations = { 3131 { 3132 .type = OperationType::DETECTION_POSTPROCESSING, 3133 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 3134 .outputs = {14, 15, 16, 17}, 3135 } 3136 }; 3137 3138 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 3139 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 3140 std::vector<uint8_t> operandValues = { 3141 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 160, 64, 0, 0, 160, 64, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0 3142 }; 3143 const std::vector<hidl_memory> pools = {}; 3144 3145 return { 3146 .operands = operands, 3147 .operations = operations, 3148 .inputIndexes = inputIndexes, 3149 .outputIndexes = outputIndexes, 3150 .operandValues = operandValues, 3151 .pools = pools, 3152 }; 3153 } 3154 3155 inline bool is_ignored_dynamic_output_shape_2(int i) { 3156 static std::set<int> ignore = {}; 3157 return ignore.find(i) != ignore.end(); 3158 } 3159 3160 // Create the model 3161 Model createTestModel_dynamic_output_shape_relaxed_2() { 3162 const std::vector<Operand> operands = { 3163 { 3164 .type = OperandType::TENSOR_FLOAT32, 3165 .dimensions = {1, 6, 3}, 3166 .numberOfConsumers = 1, 3167 .scale = 0.0f, 3168 .zeroPoint = 0, 3169 .lifetime = OperandLifeTime::MODEL_INPUT, 3170 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3171 }, 3172 { 3173 .type = OperandType::TENSOR_FLOAT32, 3174 .dimensions = {1, 6, 7}, 3175 .numberOfConsumers = 1, 3176 .scale = 0.0f, 3177 .zeroPoint = 0, 3178 .lifetime = OperandLifeTime::MODEL_INPUT, 3179 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3180 }, 3181 { 3182 .type = OperandType::TENSOR_FLOAT32, 3183 .dimensions = {6, 4}, 3184 .numberOfConsumers = 1, 3185 .scale = 0.0f, 3186 .zeroPoint = 0, 3187 .lifetime = OperandLifeTime::MODEL_INPUT, 3188 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3189 }, 3190 { 3191 .type = OperandType::FLOAT32, 3192 .dimensions = {}, 3193 .numberOfConsumers = 1, 3194 .scale = 0.0f, 3195 .zeroPoint = 0, 3196 .lifetime = OperandLifeTime::CONSTANT_COPY, 3197 .location = {.poolIndex = 0, .offset = 0, .length = 4}, 3198 }, 3199 { 3200 .type = OperandType::FLOAT32, 3201 .dimensions = {}, 3202 .numberOfConsumers = 1, 3203 .scale = 0.0f, 3204 .zeroPoint = 0, 3205 .lifetime = OperandLifeTime::CONSTANT_COPY, 3206 .location = {.poolIndex = 0, .offset = 4, .length = 4}, 3207 }, 3208 { 3209 .type = OperandType::FLOAT32, 3210 .dimensions = {}, 3211 .numberOfConsumers = 1, 3212 .scale = 0.0f, 3213 .zeroPoint = 0, 3214 .lifetime = OperandLifeTime::CONSTANT_COPY, 3215 .location = {.poolIndex = 0, .offset = 8, .length = 4}, 3216 }, 3217 { 3218 .type = OperandType::FLOAT32, 3219 .dimensions = {}, 3220 .numberOfConsumers = 1, 3221 .scale = 0.0f, 3222 .zeroPoint = 0, 3223 .lifetime = OperandLifeTime::CONSTANT_COPY, 3224 .location = {.poolIndex = 0, .offset = 12, .length = 4}, 3225 }, 3226 { 3227 .type = OperandType::BOOL, 3228 .dimensions = {}, 3229 .numberOfConsumers = 1, 3230 .scale = 0.0f, 3231 .zeroPoint = 0, 3232 .lifetime = OperandLifeTime::CONSTANT_COPY, 3233 .location = {.poolIndex = 0, .offset = 16, .length = 1}, 3234 }, 3235 { 3236 .type = OperandType::INT32, 3237 .dimensions = {}, 3238 .numberOfConsumers = 1, 3239 .scale = 0.0f, 3240 .zeroPoint = 0, 3241 .lifetime = OperandLifeTime::CONSTANT_COPY, 3242 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 3243 }, 3244 { 3245 .type = OperandType::INT32, 3246 .dimensions = {}, 3247 .numberOfConsumers = 1, 3248 .scale = 0.0f, 3249 .zeroPoint = 0, 3250 .lifetime = OperandLifeTime::CONSTANT_COPY, 3251 .location = {.poolIndex = 0, .offset = 21, .length = 4}, 3252 }, 3253 { 3254 .type = OperandType::INT32, 3255 .dimensions = {}, 3256 .numberOfConsumers = 1, 3257 .scale = 0.0f, 3258 .zeroPoint = 0, 3259 .lifetime = OperandLifeTime::CONSTANT_COPY, 3260 .location = {.poolIndex = 0, .offset = 25, .length = 4}, 3261 }, 3262 { 3263 .type = OperandType::FLOAT32, 3264 .dimensions = {}, 3265 .numberOfConsumers = 1, 3266 .scale = 0.0f, 3267 .zeroPoint = 0, 3268 .lifetime = OperandLifeTime::CONSTANT_COPY, 3269 .location = {.poolIndex = 0, .offset = 29, .length = 4}, 3270 }, 3271 { 3272 .type = OperandType::FLOAT32, 3273 .dimensions = {}, 3274 .numberOfConsumers = 1, 3275 .scale = 0.0f, 3276 .zeroPoint = 0, 3277 .lifetime = OperandLifeTime::CONSTANT_COPY, 3278 .location = {.poolIndex = 0, .offset = 33, .length = 4}, 3279 }, 3280 { 3281 .type = OperandType::BOOL, 3282 .dimensions = {}, 3283 .numberOfConsumers = 1, 3284 .scale = 0.0f, 3285 .zeroPoint = 0, 3286 .lifetime = OperandLifeTime::CONSTANT_COPY, 3287 .location = {.poolIndex = 0, .offset = 37, .length = 1}, 3288 }, 3289 { 3290 .type = OperandType::TENSOR_FLOAT32, 3291 .dimensions = {0, 0}, 3292 .numberOfConsumers = 0, 3293 .scale = 0.0f, 3294 .zeroPoint = 0, 3295 .lifetime = OperandLifeTime::MODEL_OUTPUT, 3296 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3297 }, 3298 { 3299 .type = OperandType::TENSOR_FLOAT32, 3300 .dimensions = {0, 0, 0}, 3301 .numberOfConsumers = 0, 3302 .scale = 0.0f, 3303 .zeroPoint = 0, 3304 .lifetime = OperandLifeTime::MODEL_OUTPUT, 3305 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3306 }, 3307 { 3308 .type = OperandType::TENSOR_INT32, 3309 .dimensions = {0, 0}, 3310 .numberOfConsumers = 0, 3311 .scale = 0.0f, 3312 .zeroPoint = 0, 3313 .lifetime = OperandLifeTime::MODEL_OUTPUT, 3314 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3315 }, 3316 { 3317 .type = OperandType::TENSOR_INT32, 3318 .dimensions = {0}, 3319 .numberOfConsumers = 0, 3320 .scale = 0.0f, 3321 .zeroPoint = 0, 3322 .lifetime = OperandLifeTime::MODEL_OUTPUT, 3323 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3324 } 3325 }; 3326 3327 const std::vector<Operation> operations = { 3328 { 3329 .type = OperationType::DETECTION_POSTPROCESSING, 3330 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 3331 .outputs = {14, 15, 16, 17}, 3332 } 3333 }; 3334 3335 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 3336 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 3337 std::vector<uint8_t> operandValues = { 3338 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 160, 64, 0, 0, 160, 64, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0 3339 }; 3340 const std::vector<hidl_memory> pools = {}; 3341 3342 return { 3343 .operands = operands, 3344 .operations = operations, 3345 .inputIndexes = inputIndexes, 3346 .outputIndexes = outputIndexes, 3347 .operandValues = operandValues, 3348 .pools = pools, 3349 .relaxComputationFloat32toFloat16 = true, 3350 }; 3351 } 3352 3353 inline bool is_ignored_dynamic_output_shape_relaxed_2(int i) { 3354 static std::set<int> ignore = {}; 3355 return ignore.find(i) != ignore.end(); 3356 } 3357 3358 // Create the model 3359 Model createTestModel_dynamic_output_shape_float16_2() { 3360 const std::vector<Operand> operands = { 3361 { 3362 .type = OperandType::TENSOR_FLOAT16, 3363 .dimensions = {1, 6, 3}, 3364 .numberOfConsumers = 1, 3365 .scale = 0.0f, 3366 .zeroPoint = 0, 3367 .lifetime = OperandLifeTime::MODEL_INPUT, 3368 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3369 }, 3370 { 3371 .type = OperandType::TENSOR_FLOAT16, 3372 .dimensions = {1, 6, 7}, 3373 .numberOfConsumers = 1, 3374 .scale = 0.0f, 3375 .zeroPoint = 0, 3376 .lifetime = OperandLifeTime::MODEL_INPUT, 3377 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3378 }, 3379 { 3380 .type = OperandType::TENSOR_FLOAT16, 3381 .dimensions = {6, 4}, 3382 .numberOfConsumers = 1, 3383 .scale = 0.0f, 3384 .zeroPoint = 0, 3385 .lifetime = OperandLifeTime::MODEL_INPUT, 3386 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3387 }, 3388 { 3389 .type = OperandType::FLOAT16, 3390 .dimensions = {}, 3391 .numberOfConsumers = 1, 3392 .scale = 0.0f, 3393 .zeroPoint = 0, 3394 .lifetime = OperandLifeTime::CONSTANT_COPY, 3395 .location = {.poolIndex = 0, .offset = 0, .length = 2}, 3396 }, 3397 { 3398 .type = OperandType::FLOAT16, 3399 .dimensions = {}, 3400 .numberOfConsumers = 1, 3401 .scale = 0.0f, 3402 .zeroPoint = 0, 3403 .lifetime = OperandLifeTime::CONSTANT_COPY, 3404 .location = {.poolIndex = 0, .offset = 2, .length = 2}, 3405 }, 3406 { 3407 .type = OperandType::FLOAT16, 3408 .dimensions = {}, 3409 .numberOfConsumers = 1, 3410 .scale = 0.0f, 3411 .zeroPoint = 0, 3412 .lifetime = OperandLifeTime::CONSTANT_COPY, 3413 .location = {.poolIndex = 0, .offset = 4, .length = 2}, 3414 }, 3415 { 3416 .type = OperandType::FLOAT16, 3417 .dimensions = {}, 3418 .numberOfConsumers = 1, 3419 .scale = 0.0f, 3420 .zeroPoint = 0, 3421 .lifetime = OperandLifeTime::CONSTANT_COPY, 3422 .location = {.poolIndex = 0, .offset = 6, .length = 2}, 3423 }, 3424 { 3425 .type = OperandType::BOOL, 3426 .dimensions = {}, 3427 .numberOfConsumers = 1, 3428 .scale = 0.0f, 3429 .zeroPoint = 0, 3430 .lifetime = OperandLifeTime::CONSTANT_COPY, 3431 .location = {.poolIndex = 0, .offset = 8, .length = 1}, 3432 }, 3433 { 3434 .type = OperandType::INT32, 3435 .dimensions = {}, 3436 .numberOfConsumers = 1, 3437 .scale = 0.0f, 3438 .zeroPoint = 0, 3439 .lifetime = OperandLifeTime::CONSTANT_COPY, 3440 .location = {.poolIndex = 0, .offset = 9, .length = 4}, 3441 }, 3442 { 3443 .type = OperandType::INT32, 3444 .dimensions = {}, 3445 .numberOfConsumers = 1, 3446 .scale = 0.0f, 3447 .zeroPoint = 0, 3448 .lifetime = OperandLifeTime::CONSTANT_COPY, 3449 .location = {.poolIndex = 0, .offset = 13, .length = 4}, 3450 }, 3451 { 3452 .type = OperandType::INT32, 3453 .dimensions = {}, 3454 .numberOfConsumers = 1, 3455 .scale = 0.0f, 3456 .zeroPoint = 0, 3457 .lifetime = OperandLifeTime::CONSTANT_COPY, 3458 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 3459 }, 3460 { 3461 .type = OperandType::FLOAT16, 3462 .dimensions = {}, 3463 .numberOfConsumers = 1, 3464 .scale = 0.0f, 3465 .zeroPoint = 0, 3466 .lifetime = OperandLifeTime::CONSTANT_COPY, 3467 .location = {.poolIndex = 0, .offset = 21, .length = 2}, 3468 }, 3469 { 3470 .type = OperandType::FLOAT16, 3471 .dimensions = {}, 3472 .numberOfConsumers = 1, 3473 .scale = 0.0f, 3474 .zeroPoint = 0, 3475 .lifetime = OperandLifeTime::CONSTANT_COPY, 3476 .location = {.poolIndex = 0, .offset = 23, .length = 2}, 3477 }, 3478 { 3479 .type = OperandType::BOOL, 3480 .dimensions = {}, 3481 .numberOfConsumers = 1, 3482 .scale = 0.0f, 3483 .zeroPoint = 0, 3484 .lifetime = OperandLifeTime::CONSTANT_COPY, 3485 .location = {.poolIndex = 0, .offset = 25, .length = 1}, 3486 }, 3487 { 3488 .type = OperandType::TENSOR_FLOAT16, 3489 .dimensions = {0, 0}, 3490 .numberOfConsumers = 0, 3491 .scale = 0.0f, 3492 .zeroPoint = 0, 3493 .lifetime = OperandLifeTime::MODEL_OUTPUT, 3494 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3495 }, 3496 { 3497 .type = OperandType::TENSOR_FLOAT16, 3498 .dimensions = {0, 0, 0}, 3499 .numberOfConsumers = 0, 3500 .scale = 0.0f, 3501 .zeroPoint = 0, 3502 .lifetime = OperandLifeTime::MODEL_OUTPUT, 3503 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3504 }, 3505 { 3506 .type = OperandType::TENSOR_INT32, 3507 .dimensions = {0, 0}, 3508 .numberOfConsumers = 0, 3509 .scale = 0.0f, 3510 .zeroPoint = 0, 3511 .lifetime = OperandLifeTime::MODEL_OUTPUT, 3512 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3513 }, 3514 { 3515 .type = OperandType::TENSOR_INT32, 3516 .dimensions = {0}, 3517 .numberOfConsumers = 0, 3518 .scale = 0.0f, 3519 .zeroPoint = 0, 3520 .lifetime = OperandLifeTime::MODEL_OUTPUT, 3521 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3522 } 3523 }; 3524 3525 const std::vector<Operation> operations = { 3526 { 3527 .type = OperationType::DETECTION_POSTPROCESSING, 3528 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 3529 .outputs = {14, 15, 16, 17}, 3530 } 3531 }; 3532 3533 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 3534 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 3535 std::vector<uint8_t> operandValues = { 3536 0, 73, 0, 73, 0, 69, 0, 69, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 56, 0 3537 }; 3538 const std::vector<hidl_memory> pools = {}; 3539 3540 return { 3541 .operands = operands, 3542 .operations = operations, 3543 .inputIndexes = inputIndexes, 3544 .outputIndexes = outputIndexes, 3545 .operandValues = operandValues, 3546 .pools = pools, 3547 }; 3548 } 3549 3550 inline bool is_ignored_dynamic_output_shape_float16_2(int i) { 3551 static std::set<int> ignore = {}; 3552 return ignore.find(i) != ignore.end(); 3553 } 3554 3555 // Create the model 3556 Model createTestModel_3() { 3557 const std::vector<Operand> operands = { 3558 { 3559 .type = OperandType::TENSOR_FLOAT32, 3560 .dimensions = {1, 6, 3}, 3561 .numberOfConsumers = 1, 3562 .scale = 0.0f, 3563 .zeroPoint = 0, 3564 .lifetime = OperandLifeTime::MODEL_INPUT, 3565 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3566 }, 3567 { 3568 .type = OperandType::TENSOR_FLOAT32, 3569 .dimensions = {1, 6, 7}, 3570 .numberOfConsumers = 1, 3571 .scale = 0.0f, 3572 .zeroPoint = 0, 3573 .lifetime = OperandLifeTime::MODEL_INPUT, 3574 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3575 }, 3576 { 3577 .type = OperandType::TENSOR_FLOAT32, 3578 .dimensions = {6, 4}, 3579 .numberOfConsumers = 1, 3580 .scale = 0.0f, 3581 .zeroPoint = 0, 3582 .lifetime = OperandLifeTime::MODEL_INPUT, 3583 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3584 }, 3585 { 3586 .type = OperandType::FLOAT32, 3587 .dimensions = {}, 3588 .numberOfConsumers = 1, 3589 .scale = 0.0f, 3590 .zeroPoint = 0, 3591 .lifetime = OperandLifeTime::CONSTANT_COPY, 3592 .location = {.poolIndex = 0, .offset = 0, .length = 4}, 3593 }, 3594 { 3595 .type = OperandType::FLOAT32, 3596 .dimensions = {}, 3597 .numberOfConsumers = 1, 3598 .scale = 0.0f, 3599 .zeroPoint = 0, 3600 .lifetime = OperandLifeTime::CONSTANT_COPY, 3601 .location = {.poolIndex = 0, .offset = 4, .length = 4}, 3602 }, 3603 { 3604 .type = OperandType::FLOAT32, 3605 .dimensions = {}, 3606 .numberOfConsumers = 1, 3607 .scale = 0.0f, 3608 .zeroPoint = 0, 3609 .lifetime = OperandLifeTime::CONSTANT_COPY, 3610 .location = {.poolIndex = 0, .offset = 8, .length = 4}, 3611 }, 3612 { 3613 .type = OperandType::FLOAT32, 3614 .dimensions = {}, 3615 .numberOfConsumers = 1, 3616 .scale = 0.0f, 3617 .zeroPoint = 0, 3618 .lifetime = OperandLifeTime::CONSTANT_COPY, 3619 .location = {.poolIndex = 0, .offset = 12, .length = 4}, 3620 }, 3621 { 3622 .type = OperandType::BOOL, 3623 .dimensions = {}, 3624 .numberOfConsumers = 1, 3625 .scale = 0.0f, 3626 .zeroPoint = 0, 3627 .lifetime = OperandLifeTime::CONSTANT_COPY, 3628 .location = {.poolIndex = 0, .offset = 16, .length = 1}, 3629 }, 3630 { 3631 .type = OperandType::INT32, 3632 .dimensions = {}, 3633 .numberOfConsumers = 1, 3634 .scale = 0.0f, 3635 .zeroPoint = 0, 3636 .lifetime = OperandLifeTime::CONSTANT_COPY, 3637 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 3638 }, 3639 { 3640 .type = OperandType::INT32, 3641 .dimensions = {}, 3642 .numberOfConsumers = 1, 3643 .scale = 0.0f, 3644 .zeroPoint = 0, 3645 .lifetime = OperandLifeTime::CONSTANT_COPY, 3646 .location = {.poolIndex = 0, .offset = 21, .length = 4}, 3647 }, 3648 { 3649 .type = OperandType::INT32, 3650 .dimensions = {}, 3651 .numberOfConsumers = 1, 3652 .scale = 0.0f, 3653 .zeroPoint = 0, 3654 .lifetime = OperandLifeTime::CONSTANT_COPY, 3655 .location = {.poolIndex = 0, .offset = 25, .length = 4}, 3656 }, 3657 { 3658 .type = OperandType::FLOAT32, 3659 .dimensions = {}, 3660 .numberOfConsumers = 1, 3661 .scale = 0.0f, 3662 .zeroPoint = 0, 3663 .lifetime = OperandLifeTime::CONSTANT_COPY, 3664 .location = {.poolIndex = 0, .offset = 29, .length = 4}, 3665 }, 3666 { 3667 .type = OperandType::FLOAT32, 3668 .dimensions = {}, 3669 .numberOfConsumers = 1, 3670 .scale = 0.0f, 3671 .zeroPoint = 0, 3672 .lifetime = OperandLifeTime::CONSTANT_COPY, 3673 .location = {.poolIndex = 0, .offset = 33, .length = 4}, 3674 }, 3675 { 3676 .type = OperandType::BOOL, 3677 .dimensions = {}, 3678 .numberOfConsumers = 1, 3679 .scale = 0.0f, 3680 .zeroPoint = 0, 3681 .lifetime = OperandLifeTime::CONSTANT_COPY, 3682 .location = {.poolIndex = 0, .offset = 37, .length = 1}, 3683 }, 3684 { 3685 .type = OperandType::TENSOR_FLOAT32, 3686 .dimensions = {1, 3}, 3687 .numberOfConsumers = 0, 3688 .scale = 0.0f, 3689 .zeroPoint = 0, 3690 .lifetime = OperandLifeTime::MODEL_OUTPUT, 3691 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3692 }, 3693 { 3694 .type = OperandType::TENSOR_FLOAT32, 3695 .dimensions = {1, 3, 4}, 3696 .numberOfConsumers = 0, 3697 .scale = 0.0f, 3698 .zeroPoint = 0, 3699 .lifetime = OperandLifeTime::MODEL_OUTPUT, 3700 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3701 }, 3702 { 3703 .type = OperandType::TENSOR_INT32, 3704 .dimensions = {1, 3}, 3705 .numberOfConsumers = 0, 3706 .scale = 0.0f, 3707 .zeroPoint = 0, 3708 .lifetime = OperandLifeTime::MODEL_OUTPUT, 3709 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3710 }, 3711 { 3712 .type = OperandType::TENSOR_INT32, 3713 .dimensions = {1}, 3714 .numberOfConsumers = 0, 3715 .scale = 0.0f, 3716 .zeroPoint = 0, 3717 .lifetime = OperandLifeTime::MODEL_OUTPUT, 3718 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3719 } 3720 }; 3721 3722 const std::vector<Operation> operations = { 3723 { 3724 .type = OperationType::DETECTION_POSTPROCESSING, 3725 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 3726 .outputs = {14, 15, 16, 17}, 3727 } 3728 }; 3729 3730 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 3731 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 3732 std::vector<uint8_t> operandValues = { 3733 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 160, 64, 0, 0, 160, 64, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 1 3734 }; 3735 const std::vector<hidl_memory> pools = {}; 3736 3737 return { 3738 .operands = operands, 3739 .operations = operations, 3740 .inputIndexes = inputIndexes, 3741 .outputIndexes = outputIndexes, 3742 .operandValues = operandValues, 3743 .pools = pools, 3744 }; 3745 } 3746 3747 inline bool is_ignored_3(int i) { 3748 static std::set<int> ignore = {}; 3749 return ignore.find(i) != ignore.end(); 3750 } 3751 3752 // Create the model 3753 Model createTestModel_relaxed_3() { 3754 const std::vector<Operand> operands = { 3755 { 3756 .type = OperandType::TENSOR_FLOAT32, 3757 .dimensions = {1, 6, 3}, 3758 .numberOfConsumers = 1, 3759 .scale = 0.0f, 3760 .zeroPoint = 0, 3761 .lifetime = OperandLifeTime::MODEL_INPUT, 3762 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3763 }, 3764 { 3765 .type = OperandType::TENSOR_FLOAT32, 3766 .dimensions = {1, 6, 7}, 3767 .numberOfConsumers = 1, 3768 .scale = 0.0f, 3769 .zeroPoint = 0, 3770 .lifetime = OperandLifeTime::MODEL_INPUT, 3771 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3772 }, 3773 { 3774 .type = OperandType::TENSOR_FLOAT32, 3775 .dimensions = {6, 4}, 3776 .numberOfConsumers = 1, 3777 .scale = 0.0f, 3778 .zeroPoint = 0, 3779 .lifetime = OperandLifeTime::MODEL_INPUT, 3780 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3781 }, 3782 { 3783 .type = OperandType::FLOAT32, 3784 .dimensions = {}, 3785 .numberOfConsumers = 1, 3786 .scale = 0.0f, 3787 .zeroPoint = 0, 3788 .lifetime = OperandLifeTime::CONSTANT_COPY, 3789 .location = {.poolIndex = 0, .offset = 0, .length = 4}, 3790 }, 3791 { 3792 .type = OperandType::FLOAT32, 3793 .dimensions = {}, 3794 .numberOfConsumers = 1, 3795 .scale = 0.0f, 3796 .zeroPoint = 0, 3797 .lifetime = OperandLifeTime::CONSTANT_COPY, 3798 .location = {.poolIndex = 0, .offset = 4, .length = 4}, 3799 }, 3800 { 3801 .type = OperandType::FLOAT32, 3802 .dimensions = {}, 3803 .numberOfConsumers = 1, 3804 .scale = 0.0f, 3805 .zeroPoint = 0, 3806 .lifetime = OperandLifeTime::CONSTANT_COPY, 3807 .location = {.poolIndex = 0, .offset = 8, .length = 4}, 3808 }, 3809 { 3810 .type = OperandType::FLOAT32, 3811 .dimensions = {}, 3812 .numberOfConsumers = 1, 3813 .scale = 0.0f, 3814 .zeroPoint = 0, 3815 .lifetime = OperandLifeTime::CONSTANT_COPY, 3816 .location = {.poolIndex = 0, .offset = 12, .length = 4}, 3817 }, 3818 { 3819 .type = OperandType::BOOL, 3820 .dimensions = {}, 3821 .numberOfConsumers = 1, 3822 .scale = 0.0f, 3823 .zeroPoint = 0, 3824 .lifetime = OperandLifeTime::CONSTANT_COPY, 3825 .location = {.poolIndex = 0, .offset = 16, .length = 1}, 3826 }, 3827 { 3828 .type = OperandType::INT32, 3829 .dimensions = {}, 3830 .numberOfConsumers = 1, 3831 .scale = 0.0f, 3832 .zeroPoint = 0, 3833 .lifetime = OperandLifeTime::CONSTANT_COPY, 3834 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 3835 }, 3836 { 3837 .type = OperandType::INT32, 3838 .dimensions = {}, 3839 .numberOfConsumers = 1, 3840 .scale = 0.0f, 3841 .zeroPoint = 0, 3842 .lifetime = OperandLifeTime::CONSTANT_COPY, 3843 .location = {.poolIndex = 0, .offset = 21, .length = 4}, 3844 }, 3845 { 3846 .type = OperandType::INT32, 3847 .dimensions = {}, 3848 .numberOfConsumers = 1, 3849 .scale = 0.0f, 3850 .zeroPoint = 0, 3851 .lifetime = OperandLifeTime::CONSTANT_COPY, 3852 .location = {.poolIndex = 0, .offset = 25, .length = 4}, 3853 }, 3854 { 3855 .type = OperandType::FLOAT32, 3856 .dimensions = {}, 3857 .numberOfConsumers = 1, 3858 .scale = 0.0f, 3859 .zeroPoint = 0, 3860 .lifetime = OperandLifeTime::CONSTANT_COPY, 3861 .location = {.poolIndex = 0, .offset = 29, .length = 4}, 3862 }, 3863 { 3864 .type = OperandType::FLOAT32, 3865 .dimensions = {}, 3866 .numberOfConsumers = 1, 3867 .scale = 0.0f, 3868 .zeroPoint = 0, 3869 .lifetime = OperandLifeTime::CONSTANT_COPY, 3870 .location = {.poolIndex = 0, .offset = 33, .length = 4}, 3871 }, 3872 { 3873 .type = OperandType::BOOL, 3874 .dimensions = {}, 3875 .numberOfConsumers = 1, 3876 .scale = 0.0f, 3877 .zeroPoint = 0, 3878 .lifetime = OperandLifeTime::CONSTANT_COPY, 3879 .location = {.poolIndex = 0, .offset = 37, .length = 1}, 3880 }, 3881 { 3882 .type = OperandType::TENSOR_FLOAT32, 3883 .dimensions = {1, 3}, 3884 .numberOfConsumers = 0, 3885 .scale = 0.0f, 3886 .zeroPoint = 0, 3887 .lifetime = OperandLifeTime::MODEL_OUTPUT, 3888 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3889 }, 3890 { 3891 .type = OperandType::TENSOR_FLOAT32, 3892 .dimensions = {1, 3, 4}, 3893 .numberOfConsumers = 0, 3894 .scale = 0.0f, 3895 .zeroPoint = 0, 3896 .lifetime = OperandLifeTime::MODEL_OUTPUT, 3897 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3898 }, 3899 { 3900 .type = OperandType::TENSOR_INT32, 3901 .dimensions = {1, 3}, 3902 .numberOfConsumers = 0, 3903 .scale = 0.0f, 3904 .zeroPoint = 0, 3905 .lifetime = OperandLifeTime::MODEL_OUTPUT, 3906 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3907 }, 3908 { 3909 .type = OperandType::TENSOR_INT32, 3910 .dimensions = {1}, 3911 .numberOfConsumers = 0, 3912 .scale = 0.0f, 3913 .zeroPoint = 0, 3914 .lifetime = OperandLifeTime::MODEL_OUTPUT, 3915 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3916 } 3917 }; 3918 3919 const std::vector<Operation> operations = { 3920 { 3921 .type = OperationType::DETECTION_POSTPROCESSING, 3922 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 3923 .outputs = {14, 15, 16, 17}, 3924 } 3925 }; 3926 3927 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 3928 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 3929 std::vector<uint8_t> operandValues = { 3930 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 160, 64, 0, 0, 160, 64, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 1 3931 }; 3932 const std::vector<hidl_memory> pools = {}; 3933 3934 return { 3935 .operands = operands, 3936 .operations = operations, 3937 .inputIndexes = inputIndexes, 3938 .outputIndexes = outputIndexes, 3939 .operandValues = operandValues, 3940 .pools = pools, 3941 .relaxComputationFloat32toFloat16 = true, 3942 }; 3943 } 3944 3945 inline bool is_ignored_relaxed_3(int i) { 3946 static std::set<int> ignore = {}; 3947 return ignore.find(i) != ignore.end(); 3948 } 3949 3950 // Create the model 3951 Model createTestModel_float16_3() { 3952 const std::vector<Operand> operands = { 3953 { 3954 .type = OperandType::TENSOR_FLOAT16, 3955 .dimensions = {1, 6, 3}, 3956 .numberOfConsumers = 1, 3957 .scale = 0.0f, 3958 .zeroPoint = 0, 3959 .lifetime = OperandLifeTime::MODEL_INPUT, 3960 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3961 }, 3962 { 3963 .type = OperandType::TENSOR_FLOAT16, 3964 .dimensions = {1, 6, 7}, 3965 .numberOfConsumers = 1, 3966 .scale = 0.0f, 3967 .zeroPoint = 0, 3968 .lifetime = OperandLifeTime::MODEL_INPUT, 3969 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3970 }, 3971 { 3972 .type = OperandType::TENSOR_FLOAT16, 3973 .dimensions = {6, 4}, 3974 .numberOfConsumers = 1, 3975 .scale = 0.0f, 3976 .zeroPoint = 0, 3977 .lifetime = OperandLifeTime::MODEL_INPUT, 3978 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 3979 }, 3980 { 3981 .type = OperandType::FLOAT16, 3982 .dimensions = {}, 3983 .numberOfConsumers = 1, 3984 .scale = 0.0f, 3985 .zeroPoint = 0, 3986 .lifetime = OperandLifeTime::CONSTANT_COPY, 3987 .location = {.poolIndex = 0, .offset = 0, .length = 2}, 3988 }, 3989 { 3990 .type = OperandType::FLOAT16, 3991 .dimensions = {}, 3992 .numberOfConsumers = 1, 3993 .scale = 0.0f, 3994 .zeroPoint = 0, 3995 .lifetime = OperandLifeTime::CONSTANT_COPY, 3996 .location = {.poolIndex = 0, .offset = 2, .length = 2}, 3997 }, 3998 { 3999 .type = OperandType::FLOAT16, 4000 .dimensions = {}, 4001 .numberOfConsumers = 1, 4002 .scale = 0.0f, 4003 .zeroPoint = 0, 4004 .lifetime = OperandLifeTime::CONSTANT_COPY, 4005 .location = {.poolIndex = 0, .offset = 4, .length = 2}, 4006 }, 4007 { 4008 .type = OperandType::FLOAT16, 4009 .dimensions = {}, 4010 .numberOfConsumers = 1, 4011 .scale = 0.0f, 4012 .zeroPoint = 0, 4013 .lifetime = OperandLifeTime::CONSTANT_COPY, 4014 .location = {.poolIndex = 0, .offset = 6, .length = 2}, 4015 }, 4016 { 4017 .type = OperandType::BOOL, 4018 .dimensions = {}, 4019 .numberOfConsumers = 1, 4020 .scale = 0.0f, 4021 .zeroPoint = 0, 4022 .lifetime = OperandLifeTime::CONSTANT_COPY, 4023 .location = {.poolIndex = 0, .offset = 8, .length = 1}, 4024 }, 4025 { 4026 .type = OperandType::INT32, 4027 .dimensions = {}, 4028 .numberOfConsumers = 1, 4029 .scale = 0.0f, 4030 .zeroPoint = 0, 4031 .lifetime = OperandLifeTime::CONSTANT_COPY, 4032 .location = {.poolIndex = 0, .offset = 9, .length = 4}, 4033 }, 4034 { 4035 .type = OperandType::INT32, 4036 .dimensions = {}, 4037 .numberOfConsumers = 1, 4038 .scale = 0.0f, 4039 .zeroPoint = 0, 4040 .lifetime = OperandLifeTime::CONSTANT_COPY, 4041 .location = {.poolIndex = 0, .offset = 13, .length = 4}, 4042 }, 4043 { 4044 .type = OperandType::INT32, 4045 .dimensions = {}, 4046 .numberOfConsumers = 1, 4047 .scale = 0.0f, 4048 .zeroPoint = 0, 4049 .lifetime = OperandLifeTime::CONSTANT_COPY, 4050 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 4051 }, 4052 { 4053 .type = OperandType::FLOAT16, 4054 .dimensions = {}, 4055 .numberOfConsumers = 1, 4056 .scale = 0.0f, 4057 .zeroPoint = 0, 4058 .lifetime = OperandLifeTime::CONSTANT_COPY, 4059 .location = {.poolIndex = 0, .offset = 21, .length = 2}, 4060 }, 4061 { 4062 .type = OperandType::FLOAT16, 4063 .dimensions = {}, 4064 .numberOfConsumers = 1, 4065 .scale = 0.0f, 4066 .zeroPoint = 0, 4067 .lifetime = OperandLifeTime::CONSTANT_COPY, 4068 .location = {.poolIndex = 0, .offset = 23, .length = 2}, 4069 }, 4070 { 4071 .type = OperandType::BOOL, 4072 .dimensions = {}, 4073 .numberOfConsumers = 1, 4074 .scale = 0.0f, 4075 .zeroPoint = 0, 4076 .lifetime = OperandLifeTime::CONSTANT_COPY, 4077 .location = {.poolIndex = 0, .offset = 25, .length = 1}, 4078 }, 4079 { 4080 .type = OperandType::TENSOR_FLOAT16, 4081 .dimensions = {1, 3}, 4082 .numberOfConsumers = 0, 4083 .scale = 0.0f, 4084 .zeroPoint = 0, 4085 .lifetime = OperandLifeTime::MODEL_OUTPUT, 4086 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4087 }, 4088 { 4089 .type = OperandType::TENSOR_FLOAT16, 4090 .dimensions = {1, 3, 4}, 4091 .numberOfConsumers = 0, 4092 .scale = 0.0f, 4093 .zeroPoint = 0, 4094 .lifetime = OperandLifeTime::MODEL_OUTPUT, 4095 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4096 }, 4097 { 4098 .type = OperandType::TENSOR_INT32, 4099 .dimensions = {1, 3}, 4100 .numberOfConsumers = 0, 4101 .scale = 0.0f, 4102 .zeroPoint = 0, 4103 .lifetime = OperandLifeTime::MODEL_OUTPUT, 4104 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4105 }, 4106 { 4107 .type = OperandType::TENSOR_INT32, 4108 .dimensions = {1}, 4109 .numberOfConsumers = 0, 4110 .scale = 0.0f, 4111 .zeroPoint = 0, 4112 .lifetime = OperandLifeTime::MODEL_OUTPUT, 4113 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4114 } 4115 }; 4116 4117 const std::vector<Operation> operations = { 4118 { 4119 .type = OperationType::DETECTION_POSTPROCESSING, 4120 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 4121 .outputs = {14, 15, 16, 17}, 4122 } 4123 }; 4124 4125 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 4126 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 4127 std::vector<uint8_t> operandValues = { 4128 0, 73, 0, 73, 0, 69, 0, 69, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 56, 1 4129 }; 4130 const std::vector<hidl_memory> pools = {}; 4131 4132 return { 4133 .operands = operands, 4134 .operations = operations, 4135 .inputIndexes = inputIndexes, 4136 .outputIndexes = outputIndexes, 4137 .operandValues = operandValues, 4138 .pools = pools, 4139 }; 4140 } 4141 4142 inline bool is_ignored_float16_3(int i) { 4143 static std::set<int> ignore = {}; 4144 return ignore.find(i) != ignore.end(); 4145 } 4146 4147 // Create the model 4148 Model createTestModel_dynamic_output_shape_3() { 4149 const std::vector<Operand> operands = { 4150 { 4151 .type = OperandType::TENSOR_FLOAT32, 4152 .dimensions = {1, 6, 3}, 4153 .numberOfConsumers = 1, 4154 .scale = 0.0f, 4155 .zeroPoint = 0, 4156 .lifetime = OperandLifeTime::MODEL_INPUT, 4157 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4158 }, 4159 { 4160 .type = OperandType::TENSOR_FLOAT32, 4161 .dimensions = {1, 6, 7}, 4162 .numberOfConsumers = 1, 4163 .scale = 0.0f, 4164 .zeroPoint = 0, 4165 .lifetime = OperandLifeTime::MODEL_INPUT, 4166 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4167 }, 4168 { 4169 .type = OperandType::TENSOR_FLOAT32, 4170 .dimensions = {6, 4}, 4171 .numberOfConsumers = 1, 4172 .scale = 0.0f, 4173 .zeroPoint = 0, 4174 .lifetime = OperandLifeTime::MODEL_INPUT, 4175 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4176 }, 4177 { 4178 .type = OperandType::FLOAT32, 4179 .dimensions = {}, 4180 .numberOfConsumers = 1, 4181 .scale = 0.0f, 4182 .zeroPoint = 0, 4183 .lifetime = OperandLifeTime::CONSTANT_COPY, 4184 .location = {.poolIndex = 0, .offset = 0, .length = 4}, 4185 }, 4186 { 4187 .type = OperandType::FLOAT32, 4188 .dimensions = {}, 4189 .numberOfConsumers = 1, 4190 .scale = 0.0f, 4191 .zeroPoint = 0, 4192 .lifetime = OperandLifeTime::CONSTANT_COPY, 4193 .location = {.poolIndex = 0, .offset = 4, .length = 4}, 4194 }, 4195 { 4196 .type = OperandType::FLOAT32, 4197 .dimensions = {}, 4198 .numberOfConsumers = 1, 4199 .scale = 0.0f, 4200 .zeroPoint = 0, 4201 .lifetime = OperandLifeTime::CONSTANT_COPY, 4202 .location = {.poolIndex = 0, .offset = 8, .length = 4}, 4203 }, 4204 { 4205 .type = OperandType::FLOAT32, 4206 .dimensions = {}, 4207 .numberOfConsumers = 1, 4208 .scale = 0.0f, 4209 .zeroPoint = 0, 4210 .lifetime = OperandLifeTime::CONSTANT_COPY, 4211 .location = {.poolIndex = 0, .offset = 12, .length = 4}, 4212 }, 4213 { 4214 .type = OperandType::BOOL, 4215 .dimensions = {}, 4216 .numberOfConsumers = 1, 4217 .scale = 0.0f, 4218 .zeroPoint = 0, 4219 .lifetime = OperandLifeTime::CONSTANT_COPY, 4220 .location = {.poolIndex = 0, .offset = 16, .length = 1}, 4221 }, 4222 { 4223 .type = OperandType::INT32, 4224 .dimensions = {}, 4225 .numberOfConsumers = 1, 4226 .scale = 0.0f, 4227 .zeroPoint = 0, 4228 .lifetime = OperandLifeTime::CONSTANT_COPY, 4229 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 4230 }, 4231 { 4232 .type = OperandType::INT32, 4233 .dimensions = {}, 4234 .numberOfConsumers = 1, 4235 .scale = 0.0f, 4236 .zeroPoint = 0, 4237 .lifetime = OperandLifeTime::CONSTANT_COPY, 4238 .location = {.poolIndex = 0, .offset = 21, .length = 4}, 4239 }, 4240 { 4241 .type = OperandType::INT32, 4242 .dimensions = {}, 4243 .numberOfConsumers = 1, 4244 .scale = 0.0f, 4245 .zeroPoint = 0, 4246 .lifetime = OperandLifeTime::CONSTANT_COPY, 4247 .location = {.poolIndex = 0, .offset = 25, .length = 4}, 4248 }, 4249 { 4250 .type = OperandType::FLOAT32, 4251 .dimensions = {}, 4252 .numberOfConsumers = 1, 4253 .scale = 0.0f, 4254 .zeroPoint = 0, 4255 .lifetime = OperandLifeTime::CONSTANT_COPY, 4256 .location = {.poolIndex = 0, .offset = 29, .length = 4}, 4257 }, 4258 { 4259 .type = OperandType::FLOAT32, 4260 .dimensions = {}, 4261 .numberOfConsumers = 1, 4262 .scale = 0.0f, 4263 .zeroPoint = 0, 4264 .lifetime = OperandLifeTime::CONSTANT_COPY, 4265 .location = {.poolIndex = 0, .offset = 33, .length = 4}, 4266 }, 4267 { 4268 .type = OperandType::BOOL, 4269 .dimensions = {}, 4270 .numberOfConsumers = 1, 4271 .scale = 0.0f, 4272 .zeroPoint = 0, 4273 .lifetime = OperandLifeTime::CONSTANT_COPY, 4274 .location = {.poolIndex = 0, .offset = 37, .length = 1}, 4275 }, 4276 { 4277 .type = OperandType::TENSOR_FLOAT32, 4278 .dimensions = {0, 0}, 4279 .numberOfConsumers = 0, 4280 .scale = 0.0f, 4281 .zeroPoint = 0, 4282 .lifetime = OperandLifeTime::MODEL_OUTPUT, 4283 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4284 }, 4285 { 4286 .type = OperandType::TENSOR_FLOAT32, 4287 .dimensions = {0, 0, 0}, 4288 .numberOfConsumers = 0, 4289 .scale = 0.0f, 4290 .zeroPoint = 0, 4291 .lifetime = OperandLifeTime::MODEL_OUTPUT, 4292 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4293 }, 4294 { 4295 .type = OperandType::TENSOR_INT32, 4296 .dimensions = {0, 0}, 4297 .numberOfConsumers = 0, 4298 .scale = 0.0f, 4299 .zeroPoint = 0, 4300 .lifetime = OperandLifeTime::MODEL_OUTPUT, 4301 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4302 }, 4303 { 4304 .type = OperandType::TENSOR_INT32, 4305 .dimensions = {0}, 4306 .numberOfConsumers = 0, 4307 .scale = 0.0f, 4308 .zeroPoint = 0, 4309 .lifetime = OperandLifeTime::MODEL_OUTPUT, 4310 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4311 } 4312 }; 4313 4314 const std::vector<Operation> operations = { 4315 { 4316 .type = OperationType::DETECTION_POSTPROCESSING, 4317 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 4318 .outputs = {14, 15, 16, 17}, 4319 } 4320 }; 4321 4322 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 4323 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 4324 std::vector<uint8_t> operandValues = { 4325 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 160, 64, 0, 0, 160, 64, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 1 4326 }; 4327 const std::vector<hidl_memory> pools = {}; 4328 4329 return { 4330 .operands = operands, 4331 .operations = operations, 4332 .inputIndexes = inputIndexes, 4333 .outputIndexes = outputIndexes, 4334 .operandValues = operandValues, 4335 .pools = pools, 4336 }; 4337 } 4338 4339 inline bool is_ignored_dynamic_output_shape_3(int i) { 4340 static std::set<int> ignore = {}; 4341 return ignore.find(i) != ignore.end(); 4342 } 4343 4344 // Create the model 4345 Model createTestModel_dynamic_output_shape_relaxed_3() { 4346 const std::vector<Operand> operands = { 4347 { 4348 .type = OperandType::TENSOR_FLOAT32, 4349 .dimensions = {1, 6, 3}, 4350 .numberOfConsumers = 1, 4351 .scale = 0.0f, 4352 .zeroPoint = 0, 4353 .lifetime = OperandLifeTime::MODEL_INPUT, 4354 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4355 }, 4356 { 4357 .type = OperandType::TENSOR_FLOAT32, 4358 .dimensions = {1, 6, 7}, 4359 .numberOfConsumers = 1, 4360 .scale = 0.0f, 4361 .zeroPoint = 0, 4362 .lifetime = OperandLifeTime::MODEL_INPUT, 4363 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4364 }, 4365 { 4366 .type = OperandType::TENSOR_FLOAT32, 4367 .dimensions = {6, 4}, 4368 .numberOfConsumers = 1, 4369 .scale = 0.0f, 4370 .zeroPoint = 0, 4371 .lifetime = OperandLifeTime::MODEL_INPUT, 4372 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4373 }, 4374 { 4375 .type = OperandType::FLOAT32, 4376 .dimensions = {}, 4377 .numberOfConsumers = 1, 4378 .scale = 0.0f, 4379 .zeroPoint = 0, 4380 .lifetime = OperandLifeTime::CONSTANT_COPY, 4381 .location = {.poolIndex = 0, .offset = 0, .length = 4}, 4382 }, 4383 { 4384 .type = OperandType::FLOAT32, 4385 .dimensions = {}, 4386 .numberOfConsumers = 1, 4387 .scale = 0.0f, 4388 .zeroPoint = 0, 4389 .lifetime = OperandLifeTime::CONSTANT_COPY, 4390 .location = {.poolIndex = 0, .offset = 4, .length = 4}, 4391 }, 4392 { 4393 .type = OperandType::FLOAT32, 4394 .dimensions = {}, 4395 .numberOfConsumers = 1, 4396 .scale = 0.0f, 4397 .zeroPoint = 0, 4398 .lifetime = OperandLifeTime::CONSTANT_COPY, 4399 .location = {.poolIndex = 0, .offset = 8, .length = 4}, 4400 }, 4401 { 4402 .type = OperandType::FLOAT32, 4403 .dimensions = {}, 4404 .numberOfConsumers = 1, 4405 .scale = 0.0f, 4406 .zeroPoint = 0, 4407 .lifetime = OperandLifeTime::CONSTANT_COPY, 4408 .location = {.poolIndex = 0, .offset = 12, .length = 4}, 4409 }, 4410 { 4411 .type = OperandType::BOOL, 4412 .dimensions = {}, 4413 .numberOfConsumers = 1, 4414 .scale = 0.0f, 4415 .zeroPoint = 0, 4416 .lifetime = OperandLifeTime::CONSTANT_COPY, 4417 .location = {.poolIndex = 0, .offset = 16, .length = 1}, 4418 }, 4419 { 4420 .type = OperandType::INT32, 4421 .dimensions = {}, 4422 .numberOfConsumers = 1, 4423 .scale = 0.0f, 4424 .zeroPoint = 0, 4425 .lifetime = OperandLifeTime::CONSTANT_COPY, 4426 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 4427 }, 4428 { 4429 .type = OperandType::INT32, 4430 .dimensions = {}, 4431 .numberOfConsumers = 1, 4432 .scale = 0.0f, 4433 .zeroPoint = 0, 4434 .lifetime = OperandLifeTime::CONSTANT_COPY, 4435 .location = {.poolIndex = 0, .offset = 21, .length = 4}, 4436 }, 4437 { 4438 .type = OperandType::INT32, 4439 .dimensions = {}, 4440 .numberOfConsumers = 1, 4441 .scale = 0.0f, 4442 .zeroPoint = 0, 4443 .lifetime = OperandLifeTime::CONSTANT_COPY, 4444 .location = {.poolIndex = 0, .offset = 25, .length = 4}, 4445 }, 4446 { 4447 .type = OperandType::FLOAT32, 4448 .dimensions = {}, 4449 .numberOfConsumers = 1, 4450 .scale = 0.0f, 4451 .zeroPoint = 0, 4452 .lifetime = OperandLifeTime::CONSTANT_COPY, 4453 .location = {.poolIndex = 0, .offset = 29, .length = 4}, 4454 }, 4455 { 4456 .type = OperandType::FLOAT32, 4457 .dimensions = {}, 4458 .numberOfConsumers = 1, 4459 .scale = 0.0f, 4460 .zeroPoint = 0, 4461 .lifetime = OperandLifeTime::CONSTANT_COPY, 4462 .location = {.poolIndex = 0, .offset = 33, .length = 4}, 4463 }, 4464 { 4465 .type = OperandType::BOOL, 4466 .dimensions = {}, 4467 .numberOfConsumers = 1, 4468 .scale = 0.0f, 4469 .zeroPoint = 0, 4470 .lifetime = OperandLifeTime::CONSTANT_COPY, 4471 .location = {.poolIndex = 0, .offset = 37, .length = 1}, 4472 }, 4473 { 4474 .type = OperandType::TENSOR_FLOAT32, 4475 .dimensions = {0, 0}, 4476 .numberOfConsumers = 0, 4477 .scale = 0.0f, 4478 .zeroPoint = 0, 4479 .lifetime = OperandLifeTime::MODEL_OUTPUT, 4480 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4481 }, 4482 { 4483 .type = OperandType::TENSOR_FLOAT32, 4484 .dimensions = {0, 0, 0}, 4485 .numberOfConsumers = 0, 4486 .scale = 0.0f, 4487 .zeroPoint = 0, 4488 .lifetime = OperandLifeTime::MODEL_OUTPUT, 4489 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4490 }, 4491 { 4492 .type = OperandType::TENSOR_INT32, 4493 .dimensions = {0, 0}, 4494 .numberOfConsumers = 0, 4495 .scale = 0.0f, 4496 .zeroPoint = 0, 4497 .lifetime = OperandLifeTime::MODEL_OUTPUT, 4498 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4499 }, 4500 { 4501 .type = OperandType::TENSOR_INT32, 4502 .dimensions = {0}, 4503 .numberOfConsumers = 0, 4504 .scale = 0.0f, 4505 .zeroPoint = 0, 4506 .lifetime = OperandLifeTime::MODEL_OUTPUT, 4507 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4508 } 4509 }; 4510 4511 const std::vector<Operation> operations = { 4512 { 4513 .type = OperationType::DETECTION_POSTPROCESSING, 4514 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 4515 .outputs = {14, 15, 16, 17}, 4516 } 4517 }; 4518 4519 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 4520 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 4521 std::vector<uint8_t> operandValues = { 4522 0, 0, 32, 65, 0, 0, 32, 65, 0, 0, 160, 64, 0, 0, 160, 64, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 1 4523 }; 4524 const std::vector<hidl_memory> pools = {}; 4525 4526 return { 4527 .operands = operands, 4528 .operations = operations, 4529 .inputIndexes = inputIndexes, 4530 .outputIndexes = outputIndexes, 4531 .operandValues = operandValues, 4532 .pools = pools, 4533 .relaxComputationFloat32toFloat16 = true, 4534 }; 4535 } 4536 4537 inline bool is_ignored_dynamic_output_shape_relaxed_3(int i) { 4538 static std::set<int> ignore = {}; 4539 return ignore.find(i) != ignore.end(); 4540 } 4541 4542 // Create the model 4543 Model createTestModel_dynamic_output_shape_float16_3() { 4544 const std::vector<Operand> operands = { 4545 { 4546 .type = OperandType::TENSOR_FLOAT16, 4547 .dimensions = {1, 6, 3}, 4548 .numberOfConsumers = 1, 4549 .scale = 0.0f, 4550 .zeroPoint = 0, 4551 .lifetime = OperandLifeTime::MODEL_INPUT, 4552 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4553 }, 4554 { 4555 .type = OperandType::TENSOR_FLOAT16, 4556 .dimensions = {1, 6, 7}, 4557 .numberOfConsumers = 1, 4558 .scale = 0.0f, 4559 .zeroPoint = 0, 4560 .lifetime = OperandLifeTime::MODEL_INPUT, 4561 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4562 }, 4563 { 4564 .type = OperandType::TENSOR_FLOAT16, 4565 .dimensions = {6, 4}, 4566 .numberOfConsumers = 1, 4567 .scale = 0.0f, 4568 .zeroPoint = 0, 4569 .lifetime = OperandLifeTime::MODEL_INPUT, 4570 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4571 }, 4572 { 4573 .type = OperandType::FLOAT16, 4574 .dimensions = {}, 4575 .numberOfConsumers = 1, 4576 .scale = 0.0f, 4577 .zeroPoint = 0, 4578 .lifetime = OperandLifeTime::CONSTANT_COPY, 4579 .location = {.poolIndex = 0, .offset = 0, .length = 2}, 4580 }, 4581 { 4582 .type = OperandType::FLOAT16, 4583 .dimensions = {}, 4584 .numberOfConsumers = 1, 4585 .scale = 0.0f, 4586 .zeroPoint = 0, 4587 .lifetime = OperandLifeTime::CONSTANT_COPY, 4588 .location = {.poolIndex = 0, .offset = 2, .length = 2}, 4589 }, 4590 { 4591 .type = OperandType::FLOAT16, 4592 .dimensions = {}, 4593 .numberOfConsumers = 1, 4594 .scale = 0.0f, 4595 .zeroPoint = 0, 4596 .lifetime = OperandLifeTime::CONSTANT_COPY, 4597 .location = {.poolIndex = 0, .offset = 4, .length = 2}, 4598 }, 4599 { 4600 .type = OperandType::FLOAT16, 4601 .dimensions = {}, 4602 .numberOfConsumers = 1, 4603 .scale = 0.0f, 4604 .zeroPoint = 0, 4605 .lifetime = OperandLifeTime::CONSTANT_COPY, 4606 .location = {.poolIndex = 0, .offset = 6, .length = 2}, 4607 }, 4608 { 4609 .type = OperandType::BOOL, 4610 .dimensions = {}, 4611 .numberOfConsumers = 1, 4612 .scale = 0.0f, 4613 .zeroPoint = 0, 4614 .lifetime = OperandLifeTime::CONSTANT_COPY, 4615 .location = {.poolIndex = 0, .offset = 8, .length = 1}, 4616 }, 4617 { 4618 .type = OperandType::INT32, 4619 .dimensions = {}, 4620 .numberOfConsumers = 1, 4621 .scale = 0.0f, 4622 .zeroPoint = 0, 4623 .lifetime = OperandLifeTime::CONSTANT_COPY, 4624 .location = {.poolIndex = 0, .offset = 9, .length = 4}, 4625 }, 4626 { 4627 .type = OperandType::INT32, 4628 .dimensions = {}, 4629 .numberOfConsumers = 1, 4630 .scale = 0.0f, 4631 .zeroPoint = 0, 4632 .lifetime = OperandLifeTime::CONSTANT_COPY, 4633 .location = {.poolIndex = 0, .offset = 13, .length = 4}, 4634 }, 4635 { 4636 .type = OperandType::INT32, 4637 .dimensions = {}, 4638 .numberOfConsumers = 1, 4639 .scale = 0.0f, 4640 .zeroPoint = 0, 4641 .lifetime = OperandLifeTime::CONSTANT_COPY, 4642 .location = {.poolIndex = 0, .offset = 17, .length = 4}, 4643 }, 4644 { 4645 .type = OperandType::FLOAT16, 4646 .dimensions = {}, 4647 .numberOfConsumers = 1, 4648 .scale = 0.0f, 4649 .zeroPoint = 0, 4650 .lifetime = OperandLifeTime::CONSTANT_COPY, 4651 .location = {.poolIndex = 0, .offset = 21, .length = 2}, 4652 }, 4653 { 4654 .type = OperandType::FLOAT16, 4655 .dimensions = {}, 4656 .numberOfConsumers = 1, 4657 .scale = 0.0f, 4658 .zeroPoint = 0, 4659 .lifetime = OperandLifeTime::CONSTANT_COPY, 4660 .location = {.poolIndex = 0, .offset = 23, .length = 2}, 4661 }, 4662 { 4663 .type = OperandType::BOOL, 4664 .dimensions = {}, 4665 .numberOfConsumers = 1, 4666 .scale = 0.0f, 4667 .zeroPoint = 0, 4668 .lifetime = OperandLifeTime::CONSTANT_COPY, 4669 .location = {.poolIndex = 0, .offset = 25, .length = 1}, 4670 }, 4671 { 4672 .type = OperandType::TENSOR_FLOAT16, 4673 .dimensions = {0, 0}, 4674 .numberOfConsumers = 0, 4675 .scale = 0.0f, 4676 .zeroPoint = 0, 4677 .lifetime = OperandLifeTime::MODEL_OUTPUT, 4678 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4679 }, 4680 { 4681 .type = OperandType::TENSOR_FLOAT16, 4682 .dimensions = {0, 0, 0}, 4683 .numberOfConsumers = 0, 4684 .scale = 0.0f, 4685 .zeroPoint = 0, 4686 .lifetime = OperandLifeTime::MODEL_OUTPUT, 4687 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4688 }, 4689 { 4690 .type = OperandType::TENSOR_INT32, 4691 .dimensions = {0, 0}, 4692 .numberOfConsumers = 0, 4693 .scale = 0.0f, 4694 .zeroPoint = 0, 4695 .lifetime = OperandLifeTime::MODEL_OUTPUT, 4696 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4697 }, 4698 { 4699 .type = OperandType::TENSOR_INT32, 4700 .dimensions = {0}, 4701 .numberOfConsumers = 0, 4702 .scale = 0.0f, 4703 .zeroPoint = 0, 4704 .lifetime = OperandLifeTime::MODEL_OUTPUT, 4705 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 4706 } 4707 }; 4708 4709 const std::vector<Operation> operations = { 4710 { 4711 .type = OperationType::DETECTION_POSTPROCESSING, 4712 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 4713 .outputs = {14, 15, 16, 17}, 4714 } 4715 }; 4716 4717 const std::vector<uint32_t> inputIndexes = {0, 1, 2}; 4718 const std::vector<uint32_t> outputIndexes = {14, 15, 16, 17}; 4719 std::vector<uint8_t> operandValues = { 4720 0, 73, 0, 73, 0, 69, 0, 69, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 56, 1 4721 }; 4722 const std::vector<hidl_memory> pools = {}; 4723 4724 return { 4725 .operands = operands, 4726 .operations = operations, 4727 .inputIndexes = inputIndexes, 4728 .outputIndexes = outputIndexes, 4729 .operandValues = operandValues, 4730 .pools = pools, 4731 }; 4732 } 4733 4734 inline bool is_ignored_dynamic_output_shape_float16_3(int i) { 4735 static std::set<int> ignore = {}; 4736 return ignore.find(i) != ignore.end(); 4737 } 4738 4739