1 // clang-format off
2 // Generated file (from: transpose_conv2d_large.mod.py). Do not edit
CreateModel_quant8(Model * model)3 void CreateModel_quant8(Model *model) {
4 OperandType type0(Type::BOOL, {});
5 OperandType type10(Type::TENSOR_QUANT8_ASYMM, {25, 32, 32, 16}, 0.5f, 0);
6 OperandType type4(Type::TENSOR_INT32, {4});
7 OperandType type5(Type::INT32, {});
8 OperandType type7(Type::TENSOR_QUANT8_ASYMM, {25, 1, 1, 1}, 0.5f, 0);
9 OperandType type8(Type::TENSOR_QUANT8_ASYMM, {16, 1, 1, 1}, 0.5f, 0);
10 OperandType type9(Type::TENSOR_INT32, {16}, 0.25f, 0);
11 // Phase 1, operands
12 auto op1 = model->addOperand(&type7);
13 auto op2 = model->addOperand(&type8);
14 auto op3 = model->addOperand(&type9);
15 auto shape = model->addOperand(&type4);
16 auto param = model->addOperand(&type5);
17 auto param1 = model->addOperand(&type5);
18 auto param2 = model->addOperand(&type5);
19 auto act = model->addOperand(&type5);
20 auto layout = model->addOperand(&type0);
21 auto op4 = model->addOperand(&type10);
22 // Phase 2, operations
23 static uint8_t op2_init[] = {2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2};
24 model->setOperandValue(op2, op2_init, sizeof(uint8_t) * 16);
25 static int32_t op3_init[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
26 model->setOperandValue(op3, op3_init, sizeof(int32_t) * 16);
27 static int32_t shape_init[] = {25, 32, 32, 16};
28 model->setOperandValue(shape, shape_init, sizeof(int32_t) * 4);
29 static int32_t param_init[] = {1};
30 model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
31 static int32_t param1_init[] = {32};
32 model->setOperandValue(param1, param1_init, sizeof(int32_t) * 1);
33 static int32_t param2_init[] = {32};
34 model->setOperandValue(param2, param2_init, sizeof(int32_t) * 1);
35 static int32_t act_init[] = {0};
36 model->setOperandValue(act, act_init, sizeof(int32_t) * 1);
37 static bool8 layout_init[] = {false};
38 model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
39 model->addOperation(ANEURALNETWORKS_TRANSPOSE_CONV_2D, {op1, op2, op3, shape, param, param1, param2, act, layout}, {op4});
40 // Phase 3, inputs and outputs
41 model->identifyInputsAndOutputs(
42 {op1},
43 {op4});
44 assert(model->isValid());
45 }
46
is_ignored_quant8(int i)47 inline bool is_ignored_quant8(int i) {
48 static std::set<int> ignore = {};
49 return ignore.find(i) != ignore.end();
50 }
51
CreateModel_channelQuant8(Model * model)52 void CreateModel_channelQuant8(Model *model) {
53 OperandType type0(Type::BOOL, {});
54 OperandType type11(Type::TENSOR_QUANT8_ASYMM, {25, 1, 1, 1}, 0.25f, 100);
55 OperandType type12(Type::TENSOR_QUANT8_SYMM_PER_CHANNEL, {16, 1, 1, 1}, 0.0f, 0, SymmPerChannelQuantParams({0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f},0));
56 OperandType type13(Type::TENSOR_INT32, {16}, 0.0f, 0);
57 OperandType type14(Type::TENSOR_QUANT8_ASYMM, {25, 32, 32, 16}, 0.5f, 80);
58 OperandType type4(Type::TENSOR_INT32, {4});
59 OperandType type5(Type::INT32, {});
60 // Phase 1, operands
61 auto op1 = model->addOperand(&type11);
62 auto op2 = model->addOperand(&type12);
63 auto op3 = model->addOperand(&type13);
64 auto shape = model->addOperand(&type4);
65 auto param = model->addOperand(&type5);
66 auto param1 = model->addOperand(&type5);
67 auto param2 = model->addOperand(&type5);
68 auto act = model->addOperand(&type5);
69 auto layout = model->addOperand(&type0);
70 auto op4 = model->addOperand(&type14);
71 // Phase 2, operations
72 static int8_t op2_init[] = {2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2};
73 model->setOperandValue(op2, op2_init, sizeof(int8_t) * 16);
74 static int32_t op3_init[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
75 model->setOperandValue(op3, op3_init, sizeof(int32_t) * 16);
76 static int32_t shape_init[] = {25, 32, 32, 16};
77 model->setOperandValue(shape, shape_init, sizeof(int32_t) * 4);
78 static int32_t param_init[] = {1};
79 model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
80 static int32_t param1_init[] = {32};
81 model->setOperandValue(param1, param1_init, sizeof(int32_t) * 1);
82 static int32_t param2_init[] = {32};
83 model->setOperandValue(param2, param2_init, sizeof(int32_t) * 1);
84 static int32_t act_init[] = {0};
85 model->setOperandValue(act, act_init, sizeof(int32_t) * 1);
86 static bool8 layout_init[] = {false};
87 model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
88 model->addOperation(ANEURALNETWORKS_TRANSPOSE_CONV_2D, {op1, op2, op3, shape, param, param1, param2, act, layout}, {op4});
89 // Phase 3, inputs and outputs
90 model->identifyInputsAndOutputs(
91 {op1},
92 {op4});
93 assert(model->isValid());
94 }
95
is_ignored_channelQuant8(int i)96 inline bool is_ignored_channelQuant8(int i) {
97 static std::set<int> ignore = {};
98 return ignore.find(i) != ignore.end();
99 }
100
CreateModel_dynamic_output_shape_quant8(Model * model)101 void CreateModel_dynamic_output_shape_quant8(Model *model) {
102 OperandType type0(Type::BOOL, {});
103 OperandType type15(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.5f, 0);
104 OperandType type4(Type::TENSOR_INT32, {4});
105 OperandType type5(Type::INT32, {});
106 OperandType type7(Type::TENSOR_QUANT8_ASYMM, {25, 1, 1, 1}, 0.5f, 0);
107 OperandType type8(Type::TENSOR_QUANT8_ASYMM, {16, 1, 1, 1}, 0.5f, 0);
108 OperandType type9(Type::TENSOR_INT32, {16}, 0.25f, 0);
109 // Phase 1, operands
110 auto op1 = model->addOperand(&type7);
111 auto op2 = model->addOperand(&type8);
112 auto op3 = model->addOperand(&type9);
113 auto shape = model->addOperand(&type4);
114 auto param = model->addOperand(&type5);
115 auto param1 = model->addOperand(&type5);
116 auto param2 = model->addOperand(&type5);
117 auto act = model->addOperand(&type5);
118 auto layout = model->addOperand(&type0);
119 auto op4 = model->addOperand(&type15);
120 // Phase 2, operations
121 static uint8_t op2_init[] = {2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2};
122 model->setOperandValue(op2, op2_init, sizeof(uint8_t) * 16);
123 static int32_t op3_init[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
124 model->setOperandValue(op3, op3_init, sizeof(int32_t) * 16);
125 static int32_t shape_init[] = {25, 32, 32, 16};
126 model->setOperandValue(shape, shape_init, sizeof(int32_t) * 4);
127 static int32_t param_init[] = {1};
128 model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
129 static int32_t param1_init[] = {32};
130 model->setOperandValue(param1, param1_init, sizeof(int32_t) * 1);
131 static int32_t param2_init[] = {32};
132 model->setOperandValue(param2, param2_init, sizeof(int32_t) * 1);
133 static int32_t act_init[] = {0};
134 model->setOperandValue(act, act_init, sizeof(int32_t) * 1);
135 static bool8 layout_init[] = {false};
136 model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
137 model->addOperation(ANEURALNETWORKS_TRANSPOSE_CONV_2D, {op1, op2, op3, shape, param, param1, param2, act, layout}, {op4});
138 // Phase 3, inputs and outputs
139 model->identifyInputsAndOutputs(
140 {op1},
141 {op4});
142 assert(model->isValid());
143 }
144
is_ignored_dynamic_output_shape_quant8(int i)145 inline bool is_ignored_dynamic_output_shape_quant8(int i) {
146 static std::set<int> ignore = {};
147 return ignore.find(i) != ignore.end();
148 }
149
CreateModel_dynamic_output_shape_channelQuant8(Model * model)150 void CreateModel_dynamic_output_shape_channelQuant8(Model *model) {
151 OperandType type0(Type::BOOL, {});
152 OperandType type11(Type::TENSOR_QUANT8_ASYMM, {25, 1, 1, 1}, 0.25f, 100);
153 OperandType type12(Type::TENSOR_QUANT8_SYMM_PER_CHANNEL, {16, 1, 1, 1}, 0.0f, 0, SymmPerChannelQuantParams({0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f},0));
154 OperandType type13(Type::TENSOR_INT32, {16}, 0.0f, 0);
155 OperandType type16(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.5f, 80);
156 OperandType type4(Type::TENSOR_INT32, {4});
157 OperandType type5(Type::INT32, {});
158 // Phase 1, operands
159 auto op1 = model->addOperand(&type11);
160 auto op2 = model->addOperand(&type12);
161 auto op3 = model->addOperand(&type13);
162 auto shape = model->addOperand(&type4);
163 auto param = model->addOperand(&type5);
164 auto param1 = model->addOperand(&type5);
165 auto param2 = model->addOperand(&type5);
166 auto act = model->addOperand(&type5);
167 auto layout = model->addOperand(&type0);
168 auto op4 = model->addOperand(&type16);
169 // Phase 2, operations
170 static int8_t op2_init[] = {2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2};
171 model->setOperandValue(op2, op2_init, sizeof(int8_t) * 16);
172 static int32_t op3_init[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
173 model->setOperandValue(op3, op3_init, sizeof(int32_t) * 16);
174 static int32_t shape_init[] = {25, 32, 32, 16};
175 model->setOperandValue(shape, shape_init, sizeof(int32_t) * 4);
176 static int32_t param_init[] = {1};
177 model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
178 static int32_t param1_init[] = {32};
179 model->setOperandValue(param1, param1_init, sizeof(int32_t) * 1);
180 static int32_t param2_init[] = {32};
181 model->setOperandValue(param2, param2_init, sizeof(int32_t) * 1);
182 static int32_t act_init[] = {0};
183 model->setOperandValue(act, act_init, sizeof(int32_t) * 1);
184 static bool8 layout_init[] = {false};
185 model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
186 model->addOperation(ANEURALNETWORKS_TRANSPOSE_CONV_2D, {op1, op2, op3, shape, param, param1, param2, act, layout}, {op4});
187 // Phase 3, inputs and outputs
188 model->identifyInputsAndOutputs(
189 {op1},
190 {op4});
191 assert(model->isValid());
192 }
193
is_ignored_dynamic_output_shape_channelQuant8(int i)194 inline bool is_ignored_dynamic_output_shape_channelQuant8(int i) {
195 static std::set<int> ignore = {};
196 return ignore.find(i) != ignore.end();
197 }
198
199