1 // clang-format off 2 // Generated file (from: tile_1.mod.py). Do not edit 3 // Create the model 4 Model createTestModel() { 5 const std::vector<Operand> operands = { 6 { 7 .type = OperandType::TENSOR_FLOAT32, 8 .dimensions = {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_INT32, 17 .dimensions = {1}, 18 .numberOfConsumers = 1, 19 .scale = 0.0f, 20 .zeroPoint = 0, 21 .lifetime = OperandLifeTime::MODEL_INPUT, 22 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 23 }, 24 { 25 .type = OperandType::TENSOR_FLOAT32, 26 .dimensions = {6}, 27 .numberOfConsumers = 0, 28 .scale = 0.0f, 29 .zeroPoint = 0, 30 .lifetime = OperandLifeTime::MODEL_OUTPUT, 31 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 32 } 33 }; 34 35 const std::vector<Operation> operations = { 36 { 37 .type = OperationType::TILE, 38 .inputs = {0, 1}, 39 .outputs = {2}, 40 } 41 }; 42 43 const std::vector<uint32_t> inputIndexes = {0, 1}; 44 const std::vector<uint32_t> outputIndexes = {2}; 45 std::vector<uint8_t> operandValues = {}; 46 const std::vector<hidl_memory> pools = {}; 47 48 return { 49 .operands = operands, 50 .operations = operations, 51 .inputIndexes = inputIndexes, 52 .outputIndexes = outputIndexes, 53 .operandValues = operandValues, 54 .pools = pools, 55 }; 56 } 57 58 inline bool is_ignored(int i) { 59 static std::set<int> ignore = {}; 60 return ignore.find(i) != ignore.end(); 61 } 62 63 // Create the model 64 Model createTestModel_relaxed() { 65 const std::vector<Operand> operands = { 66 { 67 .type = OperandType::TENSOR_FLOAT32, 68 .dimensions = {3}, 69 .numberOfConsumers = 1, 70 .scale = 0.0f, 71 .zeroPoint = 0, 72 .lifetime = OperandLifeTime::MODEL_INPUT, 73 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 74 }, 75 { 76 .type = OperandType::TENSOR_INT32, 77 .dimensions = {1}, 78 .numberOfConsumers = 1, 79 .scale = 0.0f, 80 .zeroPoint = 0, 81 .lifetime = OperandLifeTime::MODEL_INPUT, 82 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 83 }, 84 { 85 .type = OperandType::TENSOR_FLOAT32, 86 .dimensions = {6}, 87 .numberOfConsumers = 0, 88 .scale = 0.0f, 89 .zeroPoint = 0, 90 .lifetime = OperandLifeTime::MODEL_OUTPUT, 91 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 92 } 93 }; 94 95 const std::vector<Operation> operations = { 96 { 97 .type = OperationType::TILE, 98 .inputs = {0, 1}, 99 .outputs = {2}, 100 } 101 }; 102 103 const std::vector<uint32_t> inputIndexes = {0, 1}; 104 const std::vector<uint32_t> outputIndexes = {2}; 105 std::vector<uint8_t> operandValues = {}; 106 const std::vector<hidl_memory> pools = {}; 107 108 return { 109 .operands = operands, 110 .operations = operations, 111 .inputIndexes = inputIndexes, 112 .outputIndexes = outputIndexes, 113 .operandValues = operandValues, 114 .pools = pools, 115 .relaxComputationFloat32toFloat16 = true, 116 }; 117 } 118 119 inline bool is_ignored_relaxed(int i) { 120 static std::set<int> ignore = {}; 121 return ignore.find(i) != ignore.end(); 122 } 123 124 // Create the model 125 Model createTestModel_float16() { 126 const std::vector<Operand> operands = { 127 { 128 .type = OperandType::TENSOR_FLOAT16, 129 .dimensions = {3}, 130 .numberOfConsumers = 1, 131 .scale = 0.0f, 132 .zeroPoint = 0, 133 .lifetime = OperandLifeTime::MODEL_INPUT, 134 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 135 }, 136 { 137 .type = OperandType::TENSOR_INT32, 138 .dimensions = {1}, 139 .numberOfConsumers = 1, 140 .scale = 0.0f, 141 .zeroPoint = 0, 142 .lifetime = OperandLifeTime::MODEL_INPUT, 143 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 144 }, 145 { 146 .type = OperandType::TENSOR_FLOAT16, 147 .dimensions = {6}, 148 .numberOfConsumers = 0, 149 .scale = 0.0f, 150 .zeroPoint = 0, 151 .lifetime = OperandLifeTime::MODEL_OUTPUT, 152 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 153 } 154 }; 155 156 const std::vector<Operation> operations = { 157 { 158 .type = OperationType::TILE, 159 .inputs = {0, 1}, 160 .outputs = {2}, 161 } 162 }; 163 164 const std::vector<uint32_t> inputIndexes = {0, 1}; 165 const std::vector<uint32_t> outputIndexes = {2}; 166 std::vector<uint8_t> operandValues = {}; 167 const std::vector<hidl_memory> pools = {}; 168 169 return { 170 .operands = operands, 171 .operations = operations, 172 .inputIndexes = inputIndexes, 173 .outputIndexes = outputIndexes, 174 .operandValues = operandValues, 175 .pools = pools, 176 }; 177 } 178 179 inline bool is_ignored_float16(int i) { 180 static std::set<int> ignore = {}; 181 return ignore.find(i) != ignore.end(); 182 } 183 184 // Create the model 185 Model createTestModel_quant8() { 186 const std::vector<Operand> operands = { 187 { 188 .type = OperandType::TENSOR_QUANT8_ASYMM, 189 .dimensions = {3}, 190 .numberOfConsumers = 1, 191 .scale = 0.5f, 192 .zeroPoint = 127, 193 .lifetime = OperandLifeTime::MODEL_INPUT, 194 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 195 }, 196 { 197 .type = OperandType::TENSOR_INT32, 198 .dimensions = {1}, 199 .numberOfConsumers = 1, 200 .scale = 0.0f, 201 .zeroPoint = 0, 202 .lifetime = OperandLifeTime::MODEL_INPUT, 203 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 204 }, 205 { 206 .type = OperandType::TENSOR_QUANT8_ASYMM, 207 .dimensions = {6}, 208 .numberOfConsumers = 0, 209 .scale = 0.5f, 210 .zeroPoint = 127, 211 .lifetime = OperandLifeTime::MODEL_OUTPUT, 212 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 213 } 214 }; 215 216 const std::vector<Operation> operations = { 217 { 218 .type = OperationType::TILE, 219 .inputs = {0, 1}, 220 .outputs = {2}, 221 } 222 }; 223 224 const std::vector<uint32_t> inputIndexes = {0, 1}; 225 const std::vector<uint32_t> outputIndexes = {2}; 226 std::vector<uint8_t> operandValues = {}; 227 const std::vector<hidl_memory> pools = {}; 228 229 return { 230 .operands = operands, 231 .operations = operations, 232 .inputIndexes = inputIndexes, 233 .outputIndexes = outputIndexes, 234 .operandValues = operandValues, 235 .pools = pools, 236 }; 237 } 238 239 inline bool is_ignored_quant8(int i) { 240 static std::set<int> ignore = {}; 241 return ignore.find(i) != ignore.end(); 242 } 243 244 // Create the model 245 Model createTestModel_dynamic_output_shape() { 246 const std::vector<Operand> operands = { 247 { 248 .type = OperandType::TENSOR_FLOAT32, 249 .dimensions = {3}, 250 .numberOfConsumers = 1, 251 .scale = 0.0f, 252 .zeroPoint = 0, 253 .lifetime = OperandLifeTime::MODEL_INPUT, 254 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 255 }, 256 { 257 .type = OperandType::TENSOR_INT32, 258 .dimensions = {1}, 259 .numberOfConsumers = 1, 260 .scale = 0.0f, 261 .zeroPoint = 0, 262 .lifetime = OperandLifeTime::MODEL_INPUT, 263 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 264 }, 265 { 266 .type = OperandType::TENSOR_FLOAT32, 267 .dimensions = {0}, 268 .numberOfConsumers = 0, 269 .scale = 0.0f, 270 .zeroPoint = 0, 271 .lifetime = OperandLifeTime::MODEL_OUTPUT, 272 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 273 } 274 }; 275 276 const std::vector<Operation> operations = { 277 { 278 .type = OperationType::TILE, 279 .inputs = {0, 1}, 280 .outputs = {2}, 281 } 282 }; 283 284 const std::vector<uint32_t> inputIndexes = {0, 1}; 285 const std::vector<uint32_t> outputIndexes = {2}; 286 std::vector<uint8_t> operandValues = {}; 287 const std::vector<hidl_memory> pools = {}; 288 289 return { 290 .operands = operands, 291 .operations = operations, 292 .inputIndexes = inputIndexes, 293 .outputIndexes = outputIndexes, 294 .operandValues = operandValues, 295 .pools = pools, 296 }; 297 } 298 299 inline bool is_ignored_dynamic_output_shape(int i) { 300 static std::set<int> ignore = {}; 301 return ignore.find(i) != ignore.end(); 302 } 303 304 // Create the model 305 Model createTestModel_dynamic_output_shape_relaxed() { 306 const std::vector<Operand> operands = { 307 { 308 .type = OperandType::TENSOR_FLOAT32, 309 .dimensions = {3}, 310 .numberOfConsumers = 1, 311 .scale = 0.0f, 312 .zeroPoint = 0, 313 .lifetime = OperandLifeTime::MODEL_INPUT, 314 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 315 }, 316 { 317 .type = OperandType::TENSOR_INT32, 318 .dimensions = {1}, 319 .numberOfConsumers = 1, 320 .scale = 0.0f, 321 .zeroPoint = 0, 322 .lifetime = OperandLifeTime::MODEL_INPUT, 323 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 324 }, 325 { 326 .type = OperandType::TENSOR_FLOAT32, 327 .dimensions = {0}, 328 .numberOfConsumers = 0, 329 .scale = 0.0f, 330 .zeroPoint = 0, 331 .lifetime = OperandLifeTime::MODEL_OUTPUT, 332 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 333 } 334 }; 335 336 const std::vector<Operation> operations = { 337 { 338 .type = OperationType::TILE, 339 .inputs = {0, 1}, 340 .outputs = {2}, 341 } 342 }; 343 344 const std::vector<uint32_t> inputIndexes = {0, 1}; 345 const std::vector<uint32_t> outputIndexes = {2}; 346 std::vector<uint8_t> operandValues = {}; 347 const std::vector<hidl_memory> pools = {}; 348 349 return { 350 .operands = operands, 351 .operations = operations, 352 .inputIndexes = inputIndexes, 353 .outputIndexes = outputIndexes, 354 .operandValues = operandValues, 355 .pools = pools, 356 .relaxComputationFloat32toFloat16 = true, 357 }; 358 } 359 360 inline bool is_ignored_dynamic_output_shape_relaxed(int i) { 361 static std::set<int> ignore = {}; 362 return ignore.find(i) != ignore.end(); 363 } 364 365 // Create the model 366 Model createTestModel_dynamic_output_shape_float16() { 367 const std::vector<Operand> operands = { 368 { 369 .type = OperandType::TENSOR_FLOAT16, 370 .dimensions = {3}, 371 .numberOfConsumers = 1, 372 .scale = 0.0f, 373 .zeroPoint = 0, 374 .lifetime = OperandLifeTime::MODEL_INPUT, 375 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 376 }, 377 { 378 .type = OperandType::TENSOR_INT32, 379 .dimensions = {1}, 380 .numberOfConsumers = 1, 381 .scale = 0.0f, 382 .zeroPoint = 0, 383 .lifetime = OperandLifeTime::MODEL_INPUT, 384 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 385 }, 386 { 387 .type = OperandType::TENSOR_FLOAT16, 388 .dimensions = {0}, 389 .numberOfConsumers = 0, 390 .scale = 0.0f, 391 .zeroPoint = 0, 392 .lifetime = OperandLifeTime::MODEL_OUTPUT, 393 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 394 } 395 }; 396 397 const std::vector<Operation> operations = { 398 { 399 .type = OperationType::TILE, 400 .inputs = {0, 1}, 401 .outputs = {2}, 402 } 403 }; 404 405 const std::vector<uint32_t> inputIndexes = {0, 1}; 406 const std::vector<uint32_t> outputIndexes = {2}; 407 std::vector<uint8_t> operandValues = {}; 408 const std::vector<hidl_memory> pools = {}; 409 410 return { 411 .operands = operands, 412 .operations = operations, 413 .inputIndexes = inputIndexes, 414 .outputIndexes = outputIndexes, 415 .operandValues = operandValues, 416 .pools = pools, 417 }; 418 } 419 420 inline bool is_ignored_dynamic_output_shape_float16(int i) { 421 static std::set<int> ignore = {}; 422 return ignore.find(i) != ignore.end(); 423 } 424 425 // Create the model 426 Model createTestModel_dynamic_output_shape_quant8() { 427 const std::vector<Operand> operands = { 428 { 429 .type = OperandType::TENSOR_QUANT8_ASYMM, 430 .dimensions = {3}, 431 .numberOfConsumers = 1, 432 .scale = 0.5f, 433 .zeroPoint = 127, 434 .lifetime = OperandLifeTime::MODEL_INPUT, 435 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 436 }, 437 { 438 .type = OperandType::TENSOR_INT32, 439 .dimensions = {1}, 440 .numberOfConsumers = 1, 441 .scale = 0.0f, 442 .zeroPoint = 0, 443 .lifetime = OperandLifeTime::MODEL_INPUT, 444 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 445 }, 446 { 447 .type = OperandType::TENSOR_QUANT8_ASYMM, 448 .dimensions = {0}, 449 .numberOfConsumers = 0, 450 .scale = 0.5f, 451 .zeroPoint = 127, 452 .lifetime = OperandLifeTime::MODEL_OUTPUT, 453 .location = {.poolIndex = 0, .offset = 0, .length = 0}, 454 } 455 }; 456 457 const std::vector<Operation> operations = { 458 { 459 .type = OperationType::TILE, 460 .inputs = {0, 1}, 461 .outputs = {2}, 462 } 463 }; 464 465 const std::vector<uint32_t> inputIndexes = {0, 1}; 466 const std::vector<uint32_t> outputIndexes = {2}; 467 std::vector<uint8_t> operandValues = {}; 468 const std::vector<hidl_memory> pools = {}; 469 470 return { 471 .operands = operands, 472 .operations = operations, 473 .inputIndexes = inputIndexes, 474 .outputIndexes = outputIndexes, 475 .operandValues = operandValues, 476 .pools = pools, 477 }; 478 } 479 480 inline bool is_ignored_dynamic_output_shape_quant8(int i) { 481 static std::set<int> ignore = {}; 482 return ignore.find(i) != ignore.end(); 483 } 484 485