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