1 // clang-format off
2 // Generated file (from: split_quant8_3.mod.py). Do not edit
CreateModel(Model * model)3 void CreateModel(Model *model) {
4   OperandType type0(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 2.0f, 3);
5   OperandType type1(Type::INT32, {});
6   OperandType type2(Type::TENSOR_QUANT8_ASYMM, {2, 1}, 2.0f, 3);
7   // Phase 1, operands
8   auto input0 = model->addOperand(&type0);
9   auto axis = model->addOperand(&type1);
10   auto num_splits = model->addOperand(&type1);
11   auto output0 = model->addOperand(&type2);
12   auto output1 = model->addOperand(&type2);
13   auto output2 = model->addOperand(&type2);
14   // Phase 2, operations
15   static int32_t axis_init[] = {1};
16   model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
17   static int32_t num_splits_init[] = {3};
18   model->setOperandValue(num_splits, num_splits_init, sizeof(int32_t) * 1);
19   model->addOperation(ANEURALNETWORKS_SPLIT, {input0, axis, num_splits}, {output0, output1, output2});
20   // Phase 3, inputs and outputs
21   model->identifyInputsAndOutputs(
22     {input0},
23     {output0, output1, output2});
24   assert(model->isValid());
25 }
26 
is_ignored(int i)27 inline bool is_ignored(int i) {
28   static std::set<int> ignore = {};
29   return ignore.find(i) != ignore.end();
30 }
31 
CreateModel_dynamic_output_shape(Model * model)32 void CreateModel_dynamic_output_shape(Model *model) {
33   OperandType type0(Type::TENSOR_QUANT8_ASYMM, {2, 3}, 2.0f, 3);
34   OperandType type1(Type::INT32, {});
35   OperandType type3(Type::TENSOR_QUANT8_ASYMM, {0, 0}, 2.0f, 3);
36   // Phase 1, operands
37   auto input0 = model->addOperand(&type0);
38   auto axis = model->addOperand(&type1);
39   auto num_splits = model->addOperand(&type1);
40   auto output0 = model->addOperand(&type3);
41   auto output1 = model->addOperand(&type3);
42   auto output2 = model->addOperand(&type3);
43   // Phase 2, operations
44   static int32_t axis_init[] = {1};
45   model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
46   static int32_t num_splits_init[] = {3};
47   model->setOperandValue(num_splits, num_splits_init, sizeof(int32_t) * 1);
48   model->addOperation(ANEURALNETWORKS_SPLIT, {input0, axis, num_splits}, {output0, output1, output2});
49   // Phase 3, inputs and outputs
50   model->identifyInputsAndOutputs(
51     {input0},
52     {output0, output1, output2});
53   assert(model->isValid());
54 }
55 
is_ignored_dynamic_output_shape(int i)56 inline bool is_ignored_dynamic_output_shape(int i) {
57   static std::set<int> ignore = {};
58   return ignore.find(i) != ignore.end();
59 }
60 
61