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