1 // clang-format off 2 // Generated file (from: quantized_lstm.mod.py). Do not edit 3 // Create the model 4 Model createTestModel() { 5 const std::vector<Operand> operands = { 6 { 7 .type = OperandType::TENSOR_QUANT8_ASYMM, 8 .dimensions = {2, 2}, 9 .numberOfConsumers = 1, 10 .scale = 0.0078125f, 11 .zeroPoint = 128, 12 .lifetime = OperandLifeTime::MODEL_INPUT, 13 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 14 }, 15 { 16 .type = OperandType::TENSOR_QUANT8_ASYMM, 17 .dimensions = {4, 2}, 18 .numberOfConsumers = 1, 19 .scale = 0.00408021f, 20 .zeroPoint = 100, 21 .lifetime = OperandLifeTime::MODEL_INPUT, 22 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 23 }, 24 { 25 .type = OperandType::TENSOR_QUANT8_ASYMM, 26 .dimensions = {4, 2}, 27 .numberOfConsumers = 1, 28 .scale = 0.00408021f, 29 .zeroPoint = 100, 30 .lifetime = OperandLifeTime::MODEL_INPUT, 31 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 32 }, 33 { 34 .type = OperandType::TENSOR_QUANT8_ASYMM, 35 .dimensions = {4, 2}, 36 .numberOfConsumers = 1, 37 .scale = 0.00408021f, 38 .zeroPoint = 100, 39 .lifetime = OperandLifeTime::MODEL_INPUT, 40 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 41 }, 42 { 43 .type = OperandType::TENSOR_QUANT8_ASYMM, 44 .dimensions = {4, 2}, 45 .numberOfConsumers = 1, 46 .scale = 0.00408021f, 47 .zeroPoint = 100, 48 .lifetime = OperandLifeTime::MODEL_INPUT, 49 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 50 }, 51 { 52 .type = OperandType::TENSOR_QUANT8_ASYMM, 53 .dimensions = {4, 4}, 54 .numberOfConsumers = 1, 55 .scale = 0.00408021f, 56 .zeroPoint = 100, 57 .lifetime = OperandLifeTime::MODEL_INPUT, 58 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 59 }, 60 { 61 .type = OperandType::TENSOR_QUANT8_ASYMM, 62 .dimensions = {4, 4}, 63 .numberOfConsumers = 1, 64 .scale = 0.00408021f, 65 .zeroPoint = 100, 66 .lifetime = OperandLifeTime::MODEL_INPUT, 67 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 68 }, 69 { 70 .type = OperandType::TENSOR_QUANT8_ASYMM, 71 .dimensions = {4, 4}, 72 .numberOfConsumers = 1, 73 .scale = 0.00408021f, 74 .zeroPoint = 100, 75 .lifetime = OperandLifeTime::MODEL_INPUT, 76 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 77 }, 78 { 79 .type = OperandType::TENSOR_QUANT8_ASYMM, 80 .dimensions = {4, 4}, 81 .numberOfConsumers = 1, 82 .scale = 0.00408021f, 83 .zeroPoint = 100, 84 .lifetime = OperandLifeTime::MODEL_INPUT, 85 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 86 }, 87 { 88 .type = OperandType::TENSOR_INT32, 89 .dimensions = {4}, 90 .numberOfConsumers = 1, 91 .scale = 3.1876640625e-05f, 92 .zeroPoint = 0, 93 .lifetime = OperandLifeTime::MODEL_INPUT, 94 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 95 }, 96 { 97 .type = OperandType::TENSOR_INT32, 98 .dimensions = {4}, 99 .numberOfConsumers = 1, 100 .scale = 3.1876640625e-05f, 101 .zeroPoint = 0, 102 .lifetime = OperandLifeTime::MODEL_INPUT, 103 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 104 }, 105 { 106 .type = OperandType::TENSOR_INT32, 107 .dimensions = {4}, 108 .numberOfConsumers = 1, 109 .scale = 3.1876640625e-05f, 110 .zeroPoint = 0, 111 .lifetime = OperandLifeTime::MODEL_INPUT, 112 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 113 }, 114 { 115 .type = OperandType::TENSOR_INT32, 116 .dimensions = {4}, 117 .numberOfConsumers = 1, 118 .scale = 3.1876640625e-05f, 119 .zeroPoint = 0, 120 .lifetime = OperandLifeTime::MODEL_INPUT, 121 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 122 }, 123 { 124 .type = OperandType::TENSOR_QUANT16_SYMM, 125 .dimensions = {2, 4}, 126 .numberOfConsumers = 1, 127 .scale = 0.00048828125f, 128 .zeroPoint = 0, 129 .lifetime = OperandLifeTime::MODEL_INPUT, 130 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 131 }, 132 { 133 .type = OperandType::TENSOR_QUANT8_ASYMM, 134 .dimensions = {2, 4}, 135 .numberOfConsumers = 1, 136 .scale = 0.0078125f, 137 .zeroPoint = 128, 138 .lifetime = OperandLifeTime::MODEL_INPUT, 139 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 140 }, 141 { 142 .type = OperandType::TENSOR_QUANT16_SYMM, 143 .dimensions = {2, 4}, 144 .numberOfConsumers = 0, 145 .scale = 0.00048828125f, 146 .zeroPoint = 0, 147 .lifetime = OperandLifeTime::MODEL_OUTPUT, 148 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 149 }, 150 { 151 .type = OperandType::TENSOR_QUANT8_ASYMM, 152 .dimensions = {2, 4}, 153 .numberOfConsumers = 0, 154 .scale = 0.0078125f, 155 .zeroPoint = 128, 156 .lifetime = OperandLifeTime::MODEL_OUTPUT, 157 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 158 } 159 }; 160 161 const std::vector<Operation> operations = { 162 { 163 .type = OperationType::QUANTIZED_16BIT_LSTM, 164 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, 165 .outputs = {15, 16}, 166 } 167 }; 168 169 const std::vector<uint32_t> inputIndexes = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; 170 const std::vector<uint32_t> outputIndexes = {15, 16}; 171 std::vector<uint8_t> operandValues = {}; 172 const std::vector<hidl_memory> pools = {}; 173 174 return { 175 .operands = operands, 176 .operations = operations, 177 .inputIndexes = inputIndexes, 178 .outputIndexes = outputIndexes, 179 .operandValues = operandValues, 180 .pools = pools, 181 }; 182 } 183 184 inline bool is_ignored(int i) { 185 static std::set<int> ignore = {}; 186 return ignore.find(i) != ignore.end(); 187 } 188 189 // Create the model 190 Model createTestModel_relaxed() { 191 const std::vector<Operand> operands = { 192 { 193 .type = OperandType::TENSOR_QUANT8_ASYMM, 194 .dimensions = {2, 2}, 195 .numberOfConsumers = 1, 196 .scale = 0.0078125f, 197 .zeroPoint = 128, 198 .lifetime = OperandLifeTime::MODEL_INPUT, 199 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 200 }, 201 { 202 .type = OperandType::TENSOR_QUANT8_ASYMM, 203 .dimensions = {4, 2}, 204 .numberOfConsumers = 1, 205 .scale = 0.00408021f, 206 .zeroPoint = 100, 207 .lifetime = OperandLifeTime::MODEL_INPUT, 208 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 209 }, 210 { 211 .type = OperandType::TENSOR_QUANT8_ASYMM, 212 .dimensions = {4, 2}, 213 .numberOfConsumers = 1, 214 .scale = 0.00408021f, 215 .zeroPoint = 100, 216 .lifetime = OperandLifeTime::MODEL_INPUT, 217 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 218 }, 219 { 220 .type = OperandType::TENSOR_QUANT8_ASYMM, 221 .dimensions = {4, 2}, 222 .numberOfConsumers = 1, 223 .scale = 0.00408021f, 224 .zeroPoint = 100, 225 .lifetime = OperandLifeTime::MODEL_INPUT, 226 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 227 }, 228 { 229 .type = OperandType::TENSOR_QUANT8_ASYMM, 230 .dimensions = {4, 2}, 231 .numberOfConsumers = 1, 232 .scale = 0.00408021f, 233 .zeroPoint = 100, 234 .lifetime = OperandLifeTime::MODEL_INPUT, 235 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 236 }, 237 { 238 .type = OperandType::TENSOR_QUANT8_ASYMM, 239 .dimensions = {4, 4}, 240 .numberOfConsumers = 1, 241 .scale = 0.00408021f, 242 .zeroPoint = 100, 243 .lifetime = OperandLifeTime::MODEL_INPUT, 244 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 245 }, 246 { 247 .type = OperandType::TENSOR_QUANT8_ASYMM, 248 .dimensions = {4, 4}, 249 .numberOfConsumers = 1, 250 .scale = 0.00408021f, 251 .zeroPoint = 100, 252 .lifetime = OperandLifeTime::MODEL_INPUT, 253 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 254 }, 255 { 256 .type = OperandType::TENSOR_QUANT8_ASYMM, 257 .dimensions = {4, 4}, 258 .numberOfConsumers = 1, 259 .scale = 0.00408021f, 260 .zeroPoint = 100, 261 .lifetime = OperandLifeTime::MODEL_INPUT, 262 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 263 }, 264 { 265 .type = OperandType::TENSOR_QUANT8_ASYMM, 266 .dimensions = {4, 4}, 267 .numberOfConsumers = 1, 268 .scale = 0.00408021f, 269 .zeroPoint = 100, 270 .lifetime = OperandLifeTime::MODEL_INPUT, 271 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 272 }, 273 { 274 .type = OperandType::TENSOR_INT32, 275 .dimensions = {4}, 276 .numberOfConsumers = 1, 277 .scale = 3.1876640625e-05f, 278 .zeroPoint = 0, 279 .lifetime = OperandLifeTime::MODEL_INPUT, 280 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 281 }, 282 { 283 .type = OperandType::TENSOR_INT32, 284 .dimensions = {4}, 285 .numberOfConsumers = 1, 286 .scale = 3.1876640625e-05f, 287 .zeroPoint = 0, 288 .lifetime = OperandLifeTime::MODEL_INPUT, 289 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 290 }, 291 { 292 .type = OperandType::TENSOR_INT32, 293 .dimensions = {4}, 294 .numberOfConsumers = 1, 295 .scale = 3.1876640625e-05f, 296 .zeroPoint = 0, 297 .lifetime = OperandLifeTime::MODEL_INPUT, 298 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 299 }, 300 { 301 .type = OperandType::TENSOR_INT32, 302 .dimensions = {4}, 303 .numberOfConsumers = 1, 304 .scale = 3.1876640625e-05f, 305 .zeroPoint = 0, 306 .lifetime = OperandLifeTime::MODEL_INPUT, 307 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 308 }, 309 { 310 .type = OperandType::TENSOR_QUANT16_SYMM, 311 .dimensions = {2, 4}, 312 .numberOfConsumers = 1, 313 .scale = 0.00048828125f, 314 .zeroPoint = 0, 315 .lifetime = OperandLifeTime::MODEL_INPUT, 316 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 317 }, 318 { 319 .type = OperandType::TENSOR_QUANT8_ASYMM, 320 .dimensions = {2, 4}, 321 .numberOfConsumers = 1, 322 .scale = 0.0078125f, 323 .zeroPoint = 128, 324 .lifetime = OperandLifeTime::MODEL_INPUT, 325 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 326 }, 327 { 328 .type = OperandType::TENSOR_QUANT16_SYMM, 329 .dimensions = {2, 4}, 330 .numberOfConsumers = 0, 331 .scale = 0.00048828125f, 332 .zeroPoint = 0, 333 .lifetime = OperandLifeTime::MODEL_OUTPUT, 334 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 335 }, 336 { 337 .type = OperandType::TENSOR_QUANT8_ASYMM, 338 .dimensions = {2, 4}, 339 .numberOfConsumers = 0, 340 .scale = 0.0078125f, 341 .zeroPoint = 128, 342 .lifetime = OperandLifeTime::MODEL_OUTPUT, 343 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 344 } 345 }; 346 347 const std::vector<Operation> operations = { 348 { 349 .type = OperationType::QUANTIZED_16BIT_LSTM, 350 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, 351 .outputs = {15, 16}, 352 } 353 }; 354 355 const std::vector<uint32_t> inputIndexes = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; 356 const std::vector<uint32_t> outputIndexes = {15, 16}; 357 std::vector<uint8_t> operandValues = {}; 358 const std::vector<hidl_memory> pools = {}; 359 360 return { 361 .operands = operands, 362 .operations = operations, 363 .inputIndexes = inputIndexes, 364 .outputIndexes = outputIndexes, 365 .operandValues = operandValues, 366 .pools = pools, 367 .relaxComputationFloat32toFloat16 = true, 368 }; 369 } 370 371 inline bool is_ignored_relaxed(int i) { 372 static std::set<int> ignore = {}; 373 return ignore.find(i) != ignore.end(); 374 } 375 376 // Create the model 377 Model createTestModel_dynamic_output_shape() { 378 const std::vector<Operand> operands = { 379 { 380 .type = OperandType::TENSOR_QUANT8_ASYMM, 381 .dimensions = {2, 2}, 382 .numberOfConsumers = 1, 383 .scale = 0.0078125f, 384 .zeroPoint = 128, 385 .lifetime = OperandLifeTime::MODEL_INPUT, 386 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 387 }, 388 { 389 .type = OperandType::TENSOR_QUANT8_ASYMM, 390 .dimensions = {4, 2}, 391 .numberOfConsumers = 1, 392 .scale = 0.00408021f, 393 .zeroPoint = 100, 394 .lifetime = OperandLifeTime::MODEL_INPUT, 395 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 396 }, 397 { 398 .type = OperandType::TENSOR_QUANT8_ASYMM, 399 .dimensions = {4, 2}, 400 .numberOfConsumers = 1, 401 .scale = 0.00408021f, 402 .zeroPoint = 100, 403 .lifetime = OperandLifeTime::MODEL_INPUT, 404 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 405 }, 406 { 407 .type = OperandType::TENSOR_QUANT8_ASYMM, 408 .dimensions = {4, 2}, 409 .numberOfConsumers = 1, 410 .scale = 0.00408021f, 411 .zeroPoint = 100, 412 .lifetime = OperandLifeTime::MODEL_INPUT, 413 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 414 }, 415 { 416 .type = OperandType::TENSOR_QUANT8_ASYMM, 417 .dimensions = {4, 2}, 418 .numberOfConsumers = 1, 419 .scale = 0.00408021f, 420 .zeroPoint = 100, 421 .lifetime = OperandLifeTime::MODEL_INPUT, 422 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 423 }, 424 { 425 .type = OperandType::TENSOR_QUANT8_ASYMM, 426 .dimensions = {4, 4}, 427 .numberOfConsumers = 1, 428 .scale = 0.00408021f, 429 .zeroPoint = 100, 430 .lifetime = OperandLifeTime::MODEL_INPUT, 431 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 432 }, 433 { 434 .type = OperandType::TENSOR_QUANT8_ASYMM, 435 .dimensions = {4, 4}, 436 .numberOfConsumers = 1, 437 .scale = 0.00408021f, 438 .zeroPoint = 100, 439 .lifetime = OperandLifeTime::MODEL_INPUT, 440 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 441 }, 442 { 443 .type = OperandType::TENSOR_QUANT8_ASYMM, 444 .dimensions = {4, 4}, 445 .numberOfConsumers = 1, 446 .scale = 0.00408021f, 447 .zeroPoint = 100, 448 .lifetime = OperandLifeTime::MODEL_INPUT, 449 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 450 }, 451 { 452 .type = OperandType::TENSOR_QUANT8_ASYMM, 453 .dimensions = {4, 4}, 454 .numberOfConsumers = 1, 455 .scale = 0.00408021f, 456 .zeroPoint = 100, 457 .lifetime = OperandLifeTime::MODEL_INPUT, 458 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 459 }, 460 { 461 .type = OperandType::TENSOR_INT32, 462 .dimensions = {4}, 463 .numberOfConsumers = 1, 464 .scale = 3.1876640625e-05f, 465 .zeroPoint = 0, 466 .lifetime = OperandLifeTime::MODEL_INPUT, 467 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 468 }, 469 { 470 .type = OperandType::TENSOR_INT32, 471 .dimensions = {4}, 472 .numberOfConsumers = 1, 473 .scale = 3.1876640625e-05f, 474 .zeroPoint = 0, 475 .lifetime = OperandLifeTime::MODEL_INPUT, 476 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 477 }, 478 { 479 .type = OperandType::TENSOR_INT32, 480 .dimensions = {4}, 481 .numberOfConsumers = 1, 482 .scale = 3.1876640625e-05f, 483 .zeroPoint = 0, 484 .lifetime = OperandLifeTime::MODEL_INPUT, 485 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 486 }, 487 { 488 .type = OperandType::TENSOR_INT32, 489 .dimensions = {4}, 490 .numberOfConsumers = 1, 491 .scale = 3.1876640625e-05f, 492 .zeroPoint = 0, 493 .lifetime = OperandLifeTime::MODEL_INPUT, 494 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 495 }, 496 { 497 .type = OperandType::TENSOR_QUANT16_SYMM, 498 .dimensions = {2, 4}, 499 .numberOfConsumers = 1, 500 .scale = 0.00048828125f, 501 .zeroPoint = 0, 502 .lifetime = OperandLifeTime::MODEL_INPUT, 503 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 504 }, 505 { 506 .type = OperandType::TENSOR_QUANT8_ASYMM, 507 .dimensions = {2, 4}, 508 .numberOfConsumers = 1, 509 .scale = 0.0078125f, 510 .zeroPoint = 128, 511 .lifetime = OperandLifeTime::MODEL_INPUT, 512 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 513 }, 514 { 515 .type = OperandType::TENSOR_QUANT16_SYMM, 516 .dimensions = {0, 0}, 517 .numberOfConsumers = 0, 518 .scale = 0.00048828125f, 519 .zeroPoint = 0, 520 .lifetime = OperandLifeTime::MODEL_OUTPUT, 521 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 522 }, 523 { 524 .type = OperandType::TENSOR_QUANT8_ASYMM, 525 .dimensions = {0, 0}, 526 .numberOfConsumers = 0, 527 .scale = 0.0078125f, 528 .zeroPoint = 128, 529 .lifetime = OperandLifeTime::MODEL_OUTPUT, 530 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 531 } 532 }; 533 534 const std::vector<Operation> operations = { 535 { 536 .type = OperationType::QUANTIZED_16BIT_LSTM, 537 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, 538 .outputs = {15, 16}, 539 } 540 }; 541 542 const std::vector<uint32_t> inputIndexes = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; 543 const std::vector<uint32_t> outputIndexes = {15, 16}; 544 std::vector<uint8_t> operandValues = {}; 545 const std::vector<hidl_memory> pools = {}; 546 547 return { 548 .operands = operands, 549 .operations = operations, 550 .inputIndexes = inputIndexes, 551 .outputIndexes = outputIndexes, 552 .operandValues = operandValues, 553 .pools = pools, 554 }; 555 } 556 557 inline bool is_ignored_dynamic_output_shape(int i) { 558 static std::set<int> ignore = {}; 559 return ignore.find(i) != ignore.end(); 560 } 561 562 // Create the model 563 Model createTestModel_dynamic_output_shape_relaxed() { 564 const std::vector<Operand> operands = { 565 { 566 .type = OperandType::TENSOR_QUANT8_ASYMM, 567 .dimensions = {2, 2}, 568 .numberOfConsumers = 1, 569 .scale = 0.0078125f, 570 .zeroPoint = 128, 571 .lifetime = OperandLifeTime::MODEL_INPUT, 572 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 573 }, 574 { 575 .type = OperandType::TENSOR_QUANT8_ASYMM, 576 .dimensions = {4, 2}, 577 .numberOfConsumers = 1, 578 .scale = 0.00408021f, 579 .zeroPoint = 100, 580 .lifetime = OperandLifeTime::MODEL_INPUT, 581 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 582 }, 583 { 584 .type = OperandType::TENSOR_QUANT8_ASYMM, 585 .dimensions = {4, 2}, 586 .numberOfConsumers = 1, 587 .scale = 0.00408021f, 588 .zeroPoint = 100, 589 .lifetime = OperandLifeTime::MODEL_INPUT, 590 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 591 }, 592 { 593 .type = OperandType::TENSOR_QUANT8_ASYMM, 594 .dimensions = {4, 2}, 595 .numberOfConsumers = 1, 596 .scale = 0.00408021f, 597 .zeroPoint = 100, 598 .lifetime = OperandLifeTime::MODEL_INPUT, 599 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 600 }, 601 { 602 .type = OperandType::TENSOR_QUANT8_ASYMM, 603 .dimensions = {4, 2}, 604 .numberOfConsumers = 1, 605 .scale = 0.00408021f, 606 .zeroPoint = 100, 607 .lifetime = OperandLifeTime::MODEL_INPUT, 608 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 609 }, 610 { 611 .type = OperandType::TENSOR_QUANT8_ASYMM, 612 .dimensions = {4, 4}, 613 .numberOfConsumers = 1, 614 .scale = 0.00408021f, 615 .zeroPoint = 100, 616 .lifetime = OperandLifeTime::MODEL_INPUT, 617 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 618 }, 619 { 620 .type = OperandType::TENSOR_QUANT8_ASYMM, 621 .dimensions = {4, 4}, 622 .numberOfConsumers = 1, 623 .scale = 0.00408021f, 624 .zeroPoint = 100, 625 .lifetime = OperandLifeTime::MODEL_INPUT, 626 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 627 }, 628 { 629 .type = OperandType::TENSOR_QUANT8_ASYMM, 630 .dimensions = {4, 4}, 631 .numberOfConsumers = 1, 632 .scale = 0.00408021f, 633 .zeroPoint = 100, 634 .lifetime = OperandLifeTime::MODEL_INPUT, 635 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 636 }, 637 { 638 .type = OperandType::TENSOR_QUANT8_ASYMM, 639 .dimensions = {4, 4}, 640 .numberOfConsumers = 1, 641 .scale = 0.00408021f, 642 .zeroPoint = 100, 643 .lifetime = OperandLifeTime::MODEL_INPUT, 644 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 645 }, 646 { 647 .type = OperandType::TENSOR_INT32, 648 .dimensions = {4}, 649 .numberOfConsumers = 1, 650 .scale = 3.1876640625e-05f, 651 .zeroPoint = 0, 652 .lifetime = OperandLifeTime::MODEL_INPUT, 653 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 654 }, 655 { 656 .type = OperandType::TENSOR_INT32, 657 .dimensions = {4}, 658 .numberOfConsumers = 1, 659 .scale = 3.1876640625e-05f, 660 .zeroPoint = 0, 661 .lifetime = OperandLifeTime::MODEL_INPUT, 662 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 663 }, 664 { 665 .type = OperandType::TENSOR_INT32, 666 .dimensions = {4}, 667 .numberOfConsumers = 1, 668 .scale = 3.1876640625e-05f, 669 .zeroPoint = 0, 670 .lifetime = OperandLifeTime::MODEL_INPUT, 671 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 672 }, 673 { 674 .type = OperandType::TENSOR_INT32, 675 .dimensions = {4}, 676 .numberOfConsumers = 1, 677 .scale = 3.1876640625e-05f, 678 .zeroPoint = 0, 679 .lifetime = OperandLifeTime::MODEL_INPUT, 680 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 681 }, 682 { 683 .type = OperandType::TENSOR_QUANT16_SYMM, 684 .dimensions = {2, 4}, 685 .numberOfConsumers = 1, 686 .scale = 0.00048828125f, 687 .zeroPoint = 0, 688 .lifetime = OperandLifeTime::MODEL_INPUT, 689 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 690 }, 691 { 692 .type = OperandType::TENSOR_QUANT8_ASYMM, 693 .dimensions = {2, 4}, 694 .numberOfConsumers = 1, 695 .scale = 0.0078125f, 696 .zeroPoint = 128, 697 .lifetime = OperandLifeTime::MODEL_INPUT, 698 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 699 }, 700 { 701 .type = OperandType::TENSOR_QUANT16_SYMM, 702 .dimensions = {0, 0}, 703 .numberOfConsumers = 0, 704 .scale = 0.00048828125f, 705 .zeroPoint = 0, 706 .lifetime = OperandLifeTime::MODEL_OUTPUT, 707 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 708 }, 709 { 710 .type = OperandType::TENSOR_QUANT8_ASYMM, 711 .dimensions = {0, 0}, 712 .numberOfConsumers = 0, 713 .scale = 0.0078125f, 714 .zeroPoint = 128, 715 .lifetime = OperandLifeTime::MODEL_OUTPUT, 716 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 717 } 718 }; 719 720 const std::vector<Operation> operations = { 721 { 722 .type = OperationType::QUANTIZED_16BIT_LSTM, 723 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, 724 .outputs = {15, 16}, 725 } 726 }; 727 728 const std::vector<uint32_t> inputIndexes = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; 729 const std::vector<uint32_t> outputIndexes = {15, 16}; 730 std::vector<uint8_t> operandValues = {}; 731 const std::vector<hidl_memory> pools = {}; 732 733 return { 734 .operands = operands, 735 .operations = operations, 736 .inputIndexes = inputIndexes, 737 .outputIndexes = outputIndexes, 738 .operandValues = operandValues, 739 .pools = pools, 740 .relaxComputationFloat32toFloat16 = true, 741 }; 742 } 743 744 inline bool is_ignored_dynamic_output_shape_relaxed(int i) { 745 static std::set<int> ignore = {}; 746 return ignore.find(i) != ignore.end(); 747 } 748 749 // Create the model 750 Model createTestModel_2() { 751 const std::vector<Operand> operands = { 752 { 753 .type = OperandType::TENSOR_QUANT8_ASYMM, 754 .dimensions = {1, 2}, 755 .numberOfConsumers = 1, 756 .scale = 0.0078125f, 757 .zeroPoint = 128, 758 .lifetime = OperandLifeTime::MODEL_INPUT, 759 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 760 }, 761 { 762 .type = OperandType::TENSOR_QUANT8_ASYMM, 763 .dimensions = {4, 2}, 764 .numberOfConsumers = 1, 765 .scale = 0.00408021f, 766 .zeroPoint = 100, 767 .lifetime = OperandLifeTime::CONSTANT_COPY, 768 .location = {.poolIndex = 0, .offset = 0, .length = 8}, 769 }, 770 { 771 .type = OperandType::TENSOR_QUANT8_ASYMM, 772 .dimensions = {4, 2}, 773 .numberOfConsumers = 1, 774 .scale = 0.00408021f, 775 .zeroPoint = 100, 776 .lifetime = OperandLifeTime::CONSTANT_COPY, 777 .location = {.poolIndex = 0, .offset = 8, .length = 8}, 778 }, 779 { 780 .type = OperandType::TENSOR_QUANT8_ASYMM, 781 .dimensions = {4, 2}, 782 .numberOfConsumers = 1, 783 .scale = 0.00408021f, 784 .zeroPoint = 100, 785 .lifetime = OperandLifeTime::CONSTANT_COPY, 786 .location = {.poolIndex = 0, .offset = 16, .length = 8}, 787 }, 788 { 789 .type = OperandType::TENSOR_QUANT8_ASYMM, 790 .dimensions = {4, 2}, 791 .numberOfConsumers = 1, 792 .scale = 0.00408021f, 793 .zeroPoint = 100, 794 .lifetime = OperandLifeTime::CONSTANT_COPY, 795 .location = {.poolIndex = 0, .offset = 24, .length = 8}, 796 }, 797 { 798 .type = OperandType::TENSOR_QUANT8_ASYMM, 799 .dimensions = {4, 4}, 800 .numberOfConsumers = 1, 801 .scale = 0.00408021f, 802 .zeroPoint = 100, 803 .lifetime = OperandLifeTime::CONSTANT_COPY, 804 .location = {.poolIndex = 0, .offset = 32, .length = 16}, 805 }, 806 { 807 .type = OperandType::TENSOR_QUANT8_ASYMM, 808 .dimensions = {4, 4}, 809 .numberOfConsumers = 1, 810 .scale = 0.00408021f, 811 .zeroPoint = 100, 812 .lifetime = OperandLifeTime::CONSTANT_COPY, 813 .location = {.poolIndex = 0, .offset = 48, .length = 16}, 814 }, 815 { 816 .type = OperandType::TENSOR_QUANT8_ASYMM, 817 .dimensions = {4, 4}, 818 .numberOfConsumers = 1, 819 .scale = 0.00408021f, 820 .zeroPoint = 100, 821 .lifetime = OperandLifeTime::CONSTANT_COPY, 822 .location = {.poolIndex = 0, .offset = 64, .length = 16}, 823 }, 824 { 825 .type = OperandType::TENSOR_QUANT8_ASYMM, 826 .dimensions = {4, 4}, 827 .numberOfConsumers = 1, 828 .scale = 0.00408021f, 829 .zeroPoint = 100, 830 .lifetime = OperandLifeTime::CONSTANT_COPY, 831 .location = {.poolIndex = 0, .offset = 80, .length = 16}, 832 }, 833 { 834 .type = OperandType::TENSOR_INT32, 835 .dimensions = {4}, 836 .numberOfConsumers = 1, 837 .scale = 3.1876640625e-05f, 838 .zeroPoint = 0, 839 .lifetime = OperandLifeTime::CONSTANT_COPY, 840 .location = {.poolIndex = 0, .offset = 96, .length = 16}, 841 }, 842 { 843 .type = OperandType::TENSOR_INT32, 844 .dimensions = {4}, 845 .numberOfConsumers = 1, 846 .scale = 3.1876640625e-05f, 847 .zeroPoint = 0, 848 .lifetime = OperandLifeTime::CONSTANT_COPY, 849 .location = {.poolIndex = 0, .offset = 112, .length = 16}, 850 }, 851 { 852 .type = OperandType::TENSOR_INT32, 853 .dimensions = {4}, 854 .numberOfConsumers = 1, 855 .scale = 3.1876640625e-05f, 856 .zeroPoint = 0, 857 .lifetime = OperandLifeTime::CONSTANT_COPY, 858 .location = {.poolIndex = 0, .offset = 128, .length = 16}, 859 }, 860 { 861 .type = OperandType::TENSOR_INT32, 862 .dimensions = {4}, 863 .numberOfConsumers = 1, 864 .scale = 3.1876640625e-05f, 865 .zeroPoint = 0, 866 .lifetime = OperandLifeTime::CONSTANT_COPY, 867 .location = {.poolIndex = 0, .offset = 144, .length = 16}, 868 }, 869 { 870 .type = OperandType::TENSOR_QUANT16_SYMM, 871 .dimensions = {1, 4}, 872 .numberOfConsumers = 1, 873 .scale = 0.00048828125f, 874 .zeroPoint = 0, 875 .lifetime = OperandLifeTime::MODEL_INPUT, 876 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 877 }, 878 { 879 .type = OperandType::TENSOR_QUANT8_ASYMM, 880 .dimensions = {1, 4}, 881 .numberOfConsumers = 1, 882 .scale = 0.0078125f, 883 .zeroPoint = 128, 884 .lifetime = OperandLifeTime::MODEL_INPUT, 885 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 886 }, 887 { 888 .type = OperandType::TENSOR_QUANT16_SYMM, 889 .dimensions = {1, 4}, 890 .numberOfConsumers = 0, 891 .scale = 0.00048828125f, 892 .zeroPoint = 0, 893 .lifetime = OperandLifeTime::MODEL_OUTPUT, 894 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 895 }, 896 { 897 .type = OperandType::TENSOR_QUANT8_ASYMM, 898 .dimensions = {1, 4}, 899 .numberOfConsumers = 0, 900 .scale = 0.0078125f, 901 .zeroPoint = 128, 902 .lifetime = OperandLifeTime::MODEL_OUTPUT, 903 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 904 } 905 }; 906 907 const std::vector<Operation> operations = { 908 { 909 .type = OperationType::QUANTIZED_16BIT_LSTM, 910 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, 911 .outputs = {15, 16}, 912 } 913 }; 914 915 const std::vector<uint32_t> inputIndexes = {0, 13, 14}; 916 const std::vector<uint32_t> outputIndexes = {15, 16}; 917 std::vector<uint8_t> operandValues = { 918 146, 250, 235, 171, 10, 218, 171, 108, 24, 50, 132, 179, 158, 110, 3, 169, 133, 34, 29, 49, 206, 109, 54, 183, 195, 187, 11, 99, 109, 10, 218, 48, 254, 206, 77, 168, 71, 20, 215, 6, 223, 7, 118, 225, 59, 130, 174, 26, 137, 240, 103, 52, 68, 51, 237, 112, 0, 220, 89, 23, 69, 4, 207, 253, 172, 60, 205, 65, 14, 0, 140, 168, 240, 223, 133, 56, 142, 64, 246, 216, 106, 214, 67, 23, 59, 158, 45, 3, 119, 132, 49, 205, 129, 218, 11, 98, 60, 225, 255, 255, 176, 52, 0, 0, 42, 253, 255, 255, 71, 128, 0, 0, 246, 35, 0, 0, 220, 72, 255, 255, 83, 210, 255, 255, 188, 104, 255, 255, 57, 154, 0, 0, 240, 189, 0, 0, 80, 191, 0, 0, 85, 172, 255, 255, 137, 25, 255, 255, 102, 189, 255, 255, 132, 92, 255, 255, 166, 97, 255, 255 919 }; 920 const std::vector<hidl_memory> pools = {}; 921 922 return { 923 .operands = operands, 924 .operations = operations, 925 .inputIndexes = inputIndexes, 926 .outputIndexes = outputIndexes, 927 .operandValues = operandValues, 928 .pools = pools, 929 }; 930 } 931 932 inline bool is_ignored_2(int i) { 933 static std::set<int> ignore = {}; 934 return ignore.find(i) != ignore.end(); 935 } 936 937 // Create the model 938 Model createTestModel_relaxed_2() { 939 const std::vector<Operand> operands = { 940 { 941 .type = OperandType::TENSOR_QUANT8_ASYMM, 942 .dimensions = {1, 2}, 943 .numberOfConsumers = 1, 944 .scale = 0.0078125f, 945 .zeroPoint = 128, 946 .lifetime = OperandLifeTime::MODEL_INPUT, 947 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 948 }, 949 { 950 .type = OperandType::TENSOR_QUANT8_ASYMM, 951 .dimensions = {4, 2}, 952 .numberOfConsumers = 1, 953 .scale = 0.00408021f, 954 .zeroPoint = 100, 955 .lifetime = OperandLifeTime::CONSTANT_COPY, 956 .location = {.poolIndex = 0, .offset = 0, .length = 8}, 957 }, 958 { 959 .type = OperandType::TENSOR_QUANT8_ASYMM, 960 .dimensions = {4, 2}, 961 .numberOfConsumers = 1, 962 .scale = 0.00408021f, 963 .zeroPoint = 100, 964 .lifetime = OperandLifeTime::CONSTANT_COPY, 965 .location = {.poolIndex = 0, .offset = 8, .length = 8}, 966 }, 967 { 968 .type = OperandType::TENSOR_QUANT8_ASYMM, 969 .dimensions = {4, 2}, 970 .numberOfConsumers = 1, 971 .scale = 0.00408021f, 972 .zeroPoint = 100, 973 .lifetime = OperandLifeTime::CONSTANT_COPY, 974 .location = {.poolIndex = 0, .offset = 16, .length = 8}, 975 }, 976 { 977 .type = OperandType::TENSOR_QUANT8_ASYMM, 978 .dimensions = {4, 2}, 979 .numberOfConsumers = 1, 980 .scale = 0.00408021f, 981 .zeroPoint = 100, 982 .lifetime = OperandLifeTime::CONSTANT_COPY, 983 .location = {.poolIndex = 0, .offset = 24, .length = 8}, 984 }, 985 { 986 .type = OperandType::TENSOR_QUANT8_ASYMM, 987 .dimensions = {4, 4}, 988 .numberOfConsumers = 1, 989 .scale = 0.00408021f, 990 .zeroPoint = 100, 991 .lifetime = OperandLifeTime::CONSTANT_COPY, 992 .location = {.poolIndex = 0, .offset = 32, .length = 16}, 993 }, 994 { 995 .type = OperandType::TENSOR_QUANT8_ASYMM, 996 .dimensions = {4, 4}, 997 .numberOfConsumers = 1, 998 .scale = 0.00408021f, 999 .zeroPoint = 100, 1000 .lifetime = OperandLifeTime::CONSTANT_COPY, 1001 .location = {.poolIndex = 0, .offset = 48, .length = 16}, 1002 }, 1003 { 1004 .type = OperandType::TENSOR_QUANT8_ASYMM, 1005 .dimensions = {4, 4}, 1006 .numberOfConsumers = 1, 1007 .scale = 0.00408021f, 1008 .zeroPoint = 100, 1009 .lifetime = OperandLifeTime::CONSTANT_COPY, 1010 .location = {.poolIndex = 0, .offset = 64, .length = 16}, 1011 }, 1012 { 1013 .type = OperandType::TENSOR_QUANT8_ASYMM, 1014 .dimensions = {4, 4}, 1015 .numberOfConsumers = 1, 1016 .scale = 0.00408021f, 1017 .zeroPoint = 100, 1018 .lifetime = OperandLifeTime::CONSTANT_COPY, 1019 .location = {.poolIndex = 0, .offset = 80, .length = 16}, 1020 }, 1021 { 1022 .type = OperandType::TENSOR_INT32, 1023 .dimensions = {4}, 1024 .numberOfConsumers = 1, 1025 .scale = 3.1876640625e-05f, 1026 .zeroPoint = 0, 1027 .lifetime = OperandLifeTime::CONSTANT_COPY, 1028 .location = {.poolIndex = 0, .offset = 96, .length = 16}, 1029 }, 1030 { 1031 .type = OperandType::TENSOR_INT32, 1032 .dimensions = {4}, 1033 .numberOfConsumers = 1, 1034 .scale = 3.1876640625e-05f, 1035 .zeroPoint = 0, 1036 .lifetime = OperandLifeTime::CONSTANT_COPY, 1037 .location = {.poolIndex = 0, .offset = 112, .length = 16}, 1038 }, 1039 { 1040 .type = OperandType::TENSOR_INT32, 1041 .dimensions = {4}, 1042 .numberOfConsumers = 1, 1043 .scale = 3.1876640625e-05f, 1044 .zeroPoint = 0, 1045 .lifetime = OperandLifeTime::CONSTANT_COPY, 1046 .location = {.poolIndex = 0, .offset = 128, .length = 16}, 1047 }, 1048 { 1049 .type = OperandType::TENSOR_INT32, 1050 .dimensions = {4}, 1051 .numberOfConsumers = 1, 1052 .scale = 3.1876640625e-05f, 1053 .zeroPoint = 0, 1054 .lifetime = OperandLifeTime::CONSTANT_COPY, 1055 .location = {.poolIndex = 0, .offset = 144, .length = 16}, 1056 }, 1057 { 1058 .type = OperandType::TENSOR_QUANT16_SYMM, 1059 .dimensions = {1, 4}, 1060 .numberOfConsumers = 1, 1061 .scale = 0.00048828125f, 1062 .zeroPoint = 0, 1063 .lifetime = OperandLifeTime::MODEL_INPUT, 1064 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1065 }, 1066 { 1067 .type = OperandType::TENSOR_QUANT8_ASYMM, 1068 .dimensions = {1, 4}, 1069 .numberOfConsumers = 1, 1070 .scale = 0.0078125f, 1071 .zeroPoint = 128, 1072 .lifetime = OperandLifeTime::MODEL_INPUT, 1073 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1074 }, 1075 { 1076 .type = OperandType::TENSOR_QUANT16_SYMM, 1077 .dimensions = {1, 4}, 1078 .numberOfConsumers = 0, 1079 .scale = 0.00048828125f, 1080 .zeroPoint = 0, 1081 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1082 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1083 }, 1084 { 1085 .type = OperandType::TENSOR_QUANT8_ASYMM, 1086 .dimensions = {1, 4}, 1087 .numberOfConsumers = 0, 1088 .scale = 0.0078125f, 1089 .zeroPoint = 128, 1090 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1091 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1092 } 1093 }; 1094 1095 const std::vector<Operation> operations = { 1096 { 1097 .type = OperationType::QUANTIZED_16BIT_LSTM, 1098 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, 1099 .outputs = {15, 16}, 1100 } 1101 }; 1102 1103 const std::vector<uint32_t> inputIndexes = {0, 13, 14}; 1104 const std::vector<uint32_t> outputIndexes = {15, 16}; 1105 std::vector<uint8_t> operandValues = { 1106 146, 250, 235, 171, 10, 218, 171, 108, 24, 50, 132, 179, 158, 110, 3, 169, 133, 34, 29, 49, 206, 109, 54, 183, 195, 187, 11, 99, 109, 10, 218, 48, 254, 206, 77, 168, 71, 20, 215, 6, 223, 7, 118, 225, 59, 130, 174, 26, 137, 240, 103, 52, 68, 51, 237, 112, 0, 220, 89, 23, 69, 4, 207, 253, 172, 60, 205, 65, 14, 0, 140, 168, 240, 223, 133, 56, 142, 64, 246, 216, 106, 214, 67, 23, 59, 158, 45, 3, 119, 132, 49, 205, 129, 218, 11, 98, 60, 225, 255, 255, 176, 52, 0, 0, 42, 253, 255, 255, 71, 128, 0, 0, 246, 35, 0, 0, 220, 72, 255, 255, 83, 210, 255, 255, 188, 104, 255, 255, 57, 154, 0, 0, 240, 189, 0, 0, 80, 191, 0, 0, 85, 172, 255, 255, 137, 25, 255, 255, 102, 189, 255, 255, 132, 92, 255, 255, 166, 97, 255, 255 1107 }; 1108 const std::vector<hidl_memory> pools = {}; 1109 1110 return { 1111 .operands = operands, 1112 .operations = operations, 1113 .inputIndexes = inputIndexes, 1114 .outputIndexes = outputIndexes, 1115 .operandValues = operandValues, 1116 .pools = pools, 1117 .relaxComputationFloat32toFloat16 = true, 1118 }; 1119 } 1120 1121 inline bool is_ignored_relaxed_2(int i) { 1122 static std::set<int> ignore = {}; 1123 return ignore.find(i) != ignore.end(); 1124 } 1125 1126 // Create the model 1127 Model createTestModel_dynamic_output_shape_2() { 1128 const std::vector<Operand> operands = { 1129 { 1130 .type = OperandType::TENSOR_QUANT8_ASYMM, 1131 .dimensions = {1, 2}, 1132 .numberOfConsumers = 1, 1133 .scale = 0.0078125f, 1134 .zeroPoint = 128, 1135 .lifetime = OperandLifeTime::MODEL_INPUT, 1136 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1137 }, 1138 { 1139 .type = OperandType::TENSOR_QUANT8_ASYMM, 1140 .dimensions = {4, 2}, 1141 .numberOfConsumers = 1, 1142 .scale = 0.00408021f, 1143 .zeroPoint = 100, 1144 .lifetime = OperandLifeTime::CONSTANT_COPY, 1145 .location = {.poolIndex = 0, .offset = 0, .length = 8}, 1146 }, 1147 { 1148 .type = OperandType::TENSOR_QUANT8_ASYMM, 1149 .dimensions = {4, 2}, 1150 .numberOfConsumers = 1, 1151 .scale = 0.00408021f, 1152 .zeroPoint = 100, 1153 .lifetime = OperandLifeTime::CONSTANT_COPY, 1154 .location = {.poolIndex = 0, .offset = 8, .length = 8}, 1155 }, 1156 { 1157 .type = OperandType::TENSOR_QUANT8_ASYMM, 1158 .dimensions = {4, 2}, 1159 .numberOfConsumers = 1, 1160 .scale = 0.00408021f, 1161 .zeroPoint = 100, 1162 .lifetime = OperandLifeTime::CONSTANT_COPY, 1163 .location = {.poolIndex = 0, .offset = 16, .length = 8}, 1164 }, 1165 { 1166 .type = OperandType::TENSOR_QUANT8_ASYMM, 1167 .dimensions = {4, 2}, 1168 .numberOfConsumers = 1, 1169 .scale = 0.00408021f, 1170 .zeroPoint = 100, 1171 .lifetime = OperandLifeTime::CONSTANT_COPY, 1172 .location = {.poolIndex = 0, .offset = 24, .length = 8}, 1173 }, 1174 { 1175 .type = OperandType::TENSOR_QUANT8_ASYMM, 1176 .dimensions = {4, 4}, 1177 .numberOfConsumers = 1, 1178 .scale = 0.00408021f, 1179 .zeroPoint = 100, 1180 .lifetime = OperandLifeTime::CONSTANT_COPY, 1181 .location = {.poolIndex = 0, .offset = 32, .length = 16}, 1182 }, 1183 { 1184 .type = OperandType::TENSOR_QUANT8_ASYMM, 1185 .dimensions = {4, 4}, 1186 .numberOfConsumers = 1, 1187 .scale = 0.00408021f, 1188 .zeroPoint = 100, 1189 .lifetime = OperandLifeTime::CONSTANT_COPY, 1190 .location = {.poolIndex = 0, .offset = 48, .length = 16}, 1191 }, 1192 { 1193 .type = OperandType::TENSOR_QUANT8_ASYMM, 1194 .dimensions = {4, 4}, 1195 .numberOfConsumers = 1, 1196 .scale = 0.00408021f, 1197 .zeroPoint = 100, 1198 .lifetime = OperandLifeTime::CONSTANT_COPY, 1199 .location = {.poolIndex = 0, .offset = 64, .length = 16}, 1200 }, 1201 { 1202 .type = OperandType::TENSOR_QUANT8_ASYMM, 1203 .dimensions = {4, 4}, 1204 .numberOfConsumers = 1, 1205 .scale = 0.00408021f, 1206 .zeroPoint = 100, 1207 .lifetime = OperandLifeTime::CONSTANT_COPY, 1208 .location = {.poolIndex = 0, .offset = 80, .length = 16}, 1209 }, 1210 { 1211 .type = OperandType::TENSOR_INT32, 1212 .dimensions = {4}, 1213 .numberOfConsumers = 1, 1214 .scale = 3.1876640625e-05f, 1215 .zeroPoint = 0, 1216 .lifetime = OperandLifeTime::CONSTANT_COPY, 1217 .location = {.poolIndex = 0, .offset = 96, .length = 16}, 1218 }, 1219 { 1220 .type = OperandType::TENSOR_INT32, 1221 .dimensions = {4}, 1222 .numberOfConsumers = 1, 1223 .scale = 3.1876640625e-05f, 1224 .zeroPoint = 0, 1225 .lifetime = OperandLifeTime::CONSTANT_COPY, 1226 .location = {.poolIndex = 0, .offset = 112, .length = 16}, 1227 }, 1228 { 1229 .type = OperandType::TENSOR_INT32, 1230 .dimensions = {4}, 1231 .numberOfConsumers = 1, 1232 .scale = 3.1876640625e-05f, 1233 .zeroPoint = 0, 1234 .lifetime = OperandLifeTime::CONSTANT_COPY, 1235 .location = {.poolIndex = 0, .offset = 128, .length = 16}, 1236 }, 1237 { 1238 .type = OperandType::TENSOR_INT32, 1239 .dimensions = {4}, 1240 .numberOfConsumers = 1, 1241 .scale = 3.1876640625e-05f, 1242 .zeroPoint = 0, 1243 .lifetime = OperandLifeTime::CONSTANT_COPY, 1244 .location = {.poolIndex = 0, .offset = 144, .length = 16}, 1245 }, 1246 { 1247 .type = OperandType::TENSOR_QUANT16_SYMM, 1248 .dimensions = {1, 4}, 1249 .numberOfConsumers = 1, 1250 .scale = 0.00048828125f, 1251 .zeroPoint = 0, 1252 .lifetime = OperandLifeTime::MODEL_INPUT, 1253 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1254 }, 1255 { 1256 .type = OperandType::TENSOR_QUANT8_ASYMM, 1257 .dimensions = {1, 4}, 1258 .numberOfConsumers = 1, 1259 .scale = 0.0078125f, 1260 .zeroPoint = 128, 1261 .lifetime = OperandLifeTime::MODEL_INPUT, 1262 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1263 }, 1264 { 1265 .type = OperandType::TENSOR_QUANT16_SYMM, 1266 .dimensions = {0, 0}, 1267 .numberOfConsumers = 0, 1268 .scale = 0.00048828125f, 1269 .zeroPoint = 0, 1270 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1271 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1272 }, 1273 { 1274 .type = OperandType::TENSOR_QUANT8_ASYMM, 1275 .dimensions = {0, 0}, 1276 .numberOfConsumers = 0, 1277 .scale = 0.0078125f, 1278 .zeroPoint = 128, 1279 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1280 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1281 } 1282 }; 1283 1284 const std::vector<Operation> operations = { 1285 { 1286 .type = OperationType::QUANTIZED_16BIT_LSTM, 1287 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, 1288 .outputs = {15, 16}, 1289 } 1290 }; 1291 1292 const std::vector<uint32_t> inputIndexes = {0, 13, 14}; 1293 const std::vector<uint32_t> outputIndexes = {15, 16}; 1294 std::vector<uint8_t> operandValues = { 1295 146, 250, 235, 171, 10, 218, 171, 108, 24, 50, 132, 179, 158, 110, 3, 169, 133, 34, 29, 49, 206, 109, 54, 183, 195, 187, 11, 99, 109, 10, 218, 48, 254, 206, 77, 168, 71, 20, 215, 6, 223, 7, 118, 225, 59, 130, 174, 26, 137, 240, 103, 52, 68, 51, 237, 112, 0, 220, 89, 23, 69, 4, 207, 253, 172, 60, 205, 65, 14, 0, 140, 168, 240, 223, 133, 56, 142, 64, 246, 216, 106, 214, 67, 23, 59, 158, 45, 3, 119, 132, 49, 205, 129, 218, 11, 98, 60, 225, 255, 255, 176, 52, 0, 0, 42, 253, 255, 255, 71, 128, 0, 0, 246, 35, 0, 0, 220, 72, 255, 255, 83, 210, 255, 255, 188, 104, 255, 255, 57, 154, 0, 0, 240, 189, 0, 0, 80, 191, 0, 0, 85, 172, 255, 255, 137, 25, 255, 255, 102, 189, 255, 255, 132, 92, 255, 255, 166, 97, 255, 255 1296 }; 1297 const std::vector<hidl_memory> pools = {}; 1298 1299 return { 1300 .operands = operands, 1301 .operations = operations, 1302 .inputIndexes = inputIndexes, 1303 .outputIndexes = outputIndexes, 1304 .operandValues = operandValues, 1305 .pools = pools, 1306 }; 1307 } 1308 1309 inline bool is_ignored_dynamic_output_shape_2(int i) { 1310 static std::set<int> ignore = {}; 1311 return ignore.find(i) != ignore.end(); 1312 } 1313 1314 // Create the model 1315 Model createTestModel_dynamic_output_shape_relaxed_2() { 1316 const std::vector<Operand> operands = { 1317 { 1318 .type = OperandType::TENSOR_QUANT8_ASYMM, 1319 .dimensions = {1, 2}, 1320 .numberOfConsumers = 1, 1321 .scale = 0.0078125f, 1322 .zeroPoint = 128, 1323 .lifetime = OperandLifeTime::MODEL_INPUT, 1324 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1325 }, 1326 { 1327 .type = OperandType::TENSOR_QUANT8_ASYMM, 1328 .dimensions = {4, 2}, 1329 .numberOfConsumers = 1, 1330 .scale = 0.00408021f, 1331 .zeroPoint = 100, 1332 .lifetime = OperandLifeTime::CONSTANT_COPY, 1333 .location = {.poolIndex = 0, .offset = 0, .length = 8}, 1334 }, 1335 { 1336 .type = OperandType::TENSOR_QUANT8_ASYMM, 1337 .dimensions = {4, 2}, 1338 .numberOfConsumers = 1, 1339 .scale = 0.00408021f, 1340 .zeroPoint = 100, 1341 .lifetime = OperandLifeTime::CONSTANT_COPY, 1342 .location = {.poolIndex = 0, .offset = 8, .length = 8}, 1343 }, 1344 { 1345 .type = OperandType::TENSOR_QUANT8_ASYMM, 1346 .dimensions = {4, 2}, 1347 .numberOfConsumers = 1, 1348 .scale = 0.00408021f, 1349 .zeroPoint = 100, 1350 .lifetime = OperandLifeTime::CONSTANT_COPY, 1351 .location = {.poolIndex = 0, .offset = 16, .length = 8}, 1352 }, 1353 { 1354 .type = OperandType::TENSOR_QUANT8_ASYMM, 1355 .dimensions = {4, 2}, 1356 .numberOfConsumers = 1, 1357 .scale = 0.00408021f, 1358 .zeroPoint = 100, 1359 .lifetime = OperandLifeTime::CONSTANT_COPY, 1360 .location = {.poolIndex = 0, .offset = 24, .length = 8}, 1361 }, 1362 { 1363 .type = OperandType::TENSOR_QUANT8_ASYMM, 1364 .dimensions = {4, 4}, 1365 .numberOfConsumers = 1, 1366 .scale = 0.00408021f, 1367 .zeroPoint = 100, 1368 .lifetime = OperandLifeTime::CONSTANT_COPY, 1369 .location = {.poolIndex = 0, .offset = 32, .length = 16}, 1370 }, 1371 { 1372 .type = OperandType::TENSOR_QUANT8_ASYMM, 1373 .dimensions = {4, 4}, 1374 .numberOfConsumers = 1, 1375 .scale = 0.00408021f, 1376 .zeroPoint = 100, 1377 .lifetime = OperandLifeTime::CONSTANT_COPY, 1378 .location = {.poolIndex = 0, .offset = 48, .length = 16}, 1379 }, 1380 { 1381 .type = OperandType::TENSOR_QUANT8_ASYMM, 1382 .dimensions = {4, 4}, 1383 .numberOfConsumers = 1, 1384 .scale = 0.00408021f, 1385 .zeroPoint = 100, 1386 .lifetime = OperandLifeTime::CONSTANT_COPY, 1387 .location = {.poolIndex = 0, .offset = 64, .length = 16}, 1388 }, 1389 { 1390 .type = OperandType::TENSOR_QUANT8_ASYMM, 1391 .dimensions = {4, 4}, 1392 .numberOfConsumers = 1, 1393 .scale = 0.00408021f, 1394 .zeroPoint = 100, 1395 .lifetime = OperandLifeTime::CONSTANT_COPY, 1396 .location = {.poolIndex = 0, .offset = 80, .length = 16}, 1397 }, 1398 { 1399 .type = OperandType::TENSOR_INT32, 1400 .dimensions = {4}, 1401 .numberOfConsumers = 1, 1402 .scale = 3.1876640625e-05f, 1403 .zeroPoint = 0, 1404 .lifetime = OperandLifeTime::CONSTANT_COPY, 1405 .location = {.poolIndex = 0, .offset = 96, .length = 16}, 1406 }, 1407 { 1408 .type = OperandType::TENSOR_INT32, 1409 .dimensions = {4}, 1410 .numberOfConsumers = 1, 1411 .scale = 3.1876640625e-05f, 1412 .zeroPoint = 0, 1413 .lifetime = OperandLifeTime::CONSTANT_COPY, 1414 .location = {.poolIndex = 0, .offset = 112, .length = 16}, 1415 }, 1416 { 1417 .type = OperandType::TENSOR_INT32, 1418 .dimensions = {4}, 1419 .numberOfConsumers = 1, 1420 .scale = 3.1876640625e-05f, 1421 .zeroPoint = 0, 1422 .lifetime = OperandLifeTime::CONSTANT_COPY, 1423 .location = {.poolIndex = 0, .offset = 128, .length = 16}, 1424 }, 1425 { 1426 .type = OperandType::TENSOR_INT32, 1427 .dimensions = {4}, 1428 .numberOfConsumers = 1, 1429 .scale = 3.1876640625e-05f, 1430 .zeroPoint = 0, 1431 .lifetime = OperandLifeTime::CONSTANT_COPY, 1432 .location = {.poolIndex = 0, .offset = 144, .length = 16}, 1433 }, 1434 { 1435 .type = OperandType::TENSOR_QUANT16_SYMM, 1436 .dimensions = {1, 4}, 1437 .numberOfConsumers = 1, 1438 .scale = 0.00048828125f, 1439 .zeroPoint = 0, 1440 .lifetime = OperandLifeTime::MODEL_INPUT, 1441 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1442 }, 1443 { 1444 .type = OperandType::TENSOR_QUANT8_ASYMM, 1445 .dimensions = {1, 4}, 1446 .numberOfConsumers = 1, 1447 .scale = 0.0078125f, 1448 .zeroPoint = 128, 1449 .lifetime = OperandLifeTime::MODEL_INPUT, 1450 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1451 }, 1452 { 1453 .type = OperandType::TENSOR_QUANT16_SYMM, 1454 .dimensions = {0, 0}, 1455 .numberOfConsumers = 0, 1456 .scale = 0.00048828125f, 1457 .zeroPoint = 0, 1458 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1459 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1460 }, 1461 { 1462 .type = OperandType::TENSOR_QUANT8_ASYMM, 1463 .dimensions = {0, 0}, 1464 .numberOfConsumers = 0, 1465 .scale = 0.0078125f, 1466 .zeroPoint = 128, 1467 .lifetime = OperandLifeTime::MODEL_OUTPUT, 1468 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 1469 } 1470 }; 1471 1472 const std::vector<Operation> operations = { 1473 { 1474 .type = OperationType::QUANTIZED_16BIT_LSTM, 1475 .inputs = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, 1476 .outputs = {15, 16}, 1477 } 1478 }; 1479 1480 const std::vector<uint32_t> inputIndexes = {0, 13, 14}; 1481 const std::vector<uint32_t> outputIndexes = {15, 16}; 1482 std::vector<uint8_t> operandValues = { 1483 146, 250, 235, 171, 10, 218, 171, 108, 24, 50, 132, 179, 158, 110, 3, 169, 133, 34, 29, 49, 206, 109, 54, 183, 195, 187, 11, 99, 109, 10, 218, 48, 254, 206, 77, 168, 71, 20, 215, 6, 223, 7, 118, 225, 59, 130, 174, 26, 137, 240, 103, 52, 68, 51, 237, 112, 0, 220, 89, 23, 69, 4, 207, 253, 172, 60, 205, 65, 14, 0, 140, 168, 240, 223, 133, 56, 142, 64, 246, 216, 106, 214, 67, 23, 59, 158, 45, 3, 119, 132, 49, 205, 129, 218, 11, 98, 60, 225, 255, 255, 176, 52, 0, 0, 42, 253, 255, 255, 71, 128, 0, 0, 246, 35, 0, 0, 220, 72, 255, 255, 83, 210, 255, 255, 188, 104, 255, 255, 57, 154, 0, 0, 240, 189, 0, 0, 80, 191, 0, 0, 85, 172, 255, 255, 137, 25, 255, 255, 102, 189, 255, 255, 132, 92, 255, 255, 166, 97, 255, 255 1484 }; 1485 const std::vector<hidl_memory> pools = {}; 1486 1487 return { 1488 .operands = operands, 1489 .operations = operations, 1490 .inputIndexes = inputIndexes, 1491 .outputIndexes = outputIndexes, 1492 .operandValues = operandValues, 1493 .pools = pools, 1494 .relaxComputationFloat32toFloat16 = true, 1495 }; 1496 } 1497 1498 inline bool is_ignored_dynamic_output_shape_relaxed_2(int i) { 1499 static std::set<int> ignore = {}; 1500 return ignore.find(i) != ignore.end(); 1501 } 1502 1503