1 // clang-format off
2 // Generated file (from: mul_v1_2.mod.py). Do not edit
CreateModel(Model * model)3 void CreateModel(Model *model) {
4 OperandType type0(Type::TENSOR_FLOAT16, {3});
5 OperandType type1(Type::INT32, {});
6 // Phase 1, operands
7 auto op1 = model->addOperand(&type0);
8 auto op2 = model->addOperand(&type0);
9 auto act = model->addOperand(&type1);
10 auto op3 = model->addOperand(&type0);
11 // Phase 2, operations
12 static int32_t act_init[] = {0};
13 model->setOperandValue(act, act_init, sizeof(int32_t) * 1);
14 model->addOperation(ANEURALNETWORKS_MUL, {op1, op2, act}, {op3});
15 // Phase 3, inputs and outputs
16 model->identifyInputsAndOutputs(
17 {op1, op2},
18 {op3});
19 assert(model->isValid());
20 }
21
is_ignored(int i)22 inline bool is_ignored(int i) {
23 static std::set<int> ignore = {};
24 return ignore.find(i) != ignore.end();
25 }
26
CreateModel_dynamic_output_shape(Model * model)27 void CreateModel_dynamic_output_shape(Model *model) {
28 OperandType type0(Type::TENSOR_FLOAT16, {3});
29 OperandType type1(Type::INT32, {});
30 OperandType type15(Type::TENSOR_FLOAT16, {0});
31 // Phase 1, operands
32 auto op1 = model->addOperand(&type0);
33 auto op2 = model->addOperand(&type0);
34 auto act = model->addOperand(&type1);
35 auto op3 = model->addOperand(&type15);
36 // Phase 2, operations
37 static int32_t act_init[] = {0};
38 model->setOperandValue(act, act_init, sizeof(int32_t) * 1);
39 model->addOperation(ANEURALNETWORKS_MUL, {op1, op2, act}, {op3});
40 // Phase 3, inputs and outputs
41 model->identifyInputsAndOutputs(
42 {op1, op2},
43 {op3});
44 assert(model->isValid());
45 }
46
is_ignored_dynamic_output_shape(int i)47 inline bool is_ignored_dynamic_output_shape(int i) {
48 static std::set<int> ignore = {};
49 return ignore.find(i) != ignore.end();
50 }
51
CreateModel_2(Model * model)52 void CreateModel_2(Model *model) {
53 OperandType type1(Type::INT32, {});
54 OperandType type2(Type::TENSOR_FLOAT16, {1, 2});
55 OperandType type3(Type::TENSOR_FLOAT16, {2, 2});
56 // Phase 1, operands
57 auto op11 = model->addOperand(&type2);
58 auto op21 = model->addOperand(&type3);
59 auto act1 = model->addOperand(&type1);
60 auto op31 = model->addOperand(&type3);
61 // Phase 2, operations
62 static int32_t act1_init[] = {0};
63 model->setOperandValue(act1, act1_init, sizeof(int32_t) * 1);
64 model->addOperation(ANEURALNETWORKS_MUL, {op11, op21, act1}, {op31});
65 // Phase 3, inputs and outputs
66 model->identifyInputsAndOutputs(
67 {op11, op21},
68 {op31});
69 assert(model->isValid());
70 }
71
is_ignored_2(int i)72 inline bool is_ignored_2(int i) {
73 static std::set<int> ignore = {};
74 return ignore.find(i) != ignore.end();
75 }
76
CreateModel_dynamic_output_shape_2(Model * model)77 void CreateModel_dynamic_output_shape_2(Model *model) {
78 OperandType type1(Type::INT32, {});
79 OperandType type16(Type::TENSOR_FLOAT16, {0, 0});
80 OperandType type2(Type::TENSOR_FLOAT16, {1, 2});
81 OperandType type3(Type::TENSOR_FLOAT16, {2, 2});
82 // Phase 1, operands
83 auto op11 = model->addOperand(&type2);
84 auto op21 = model->addOperand(&type3);
85 auto act1 = model->addOperand(&type1);
86 auto op31 = model->addOperand(&type16);
87 // Phase 2, operations
88 static int32_t act1_init[] = {0};
89 model->setOperandValue(act1, act1_init, sizeof(int32_t) * 1);
90 model->addOperation(ANEURALNETWORKS_MUL, {op11, op21, act1}, {op31});
91 // Phase 3, inputs and outputs
92 model->identifyInputsAndOutputs(
93 {op11, op21},
94 {op31});
95 assert(model->isValid());
96 }
97
is_ignored_dynamic_output_shape_2(int i)98 inline bool is_ignored_dynamic_output_shape_2(int i) {
99 static std::set<int> ignore = {};
100 return ignore.find(i) != ignore.end();
101 }
102
CreateModel_zero_sized(Model * model)103 void CreateModel_zero_sized(Model *model) {
104 OperandType type1(Type::INT32, {});
105 OperandType type10(Type::FLOAT32, {});
106 OperandType type11(Type::BOOL, {});
107 OperandType type12(Type::TENSOR_FLOAT32, {1, 1, 1, 2});
108 OperandType type13(Type::TENSOR_FLOAT32, {0, 2, 2, 2});
109 OperandType type14(Type::TENSOR_FLOAT32, {1, 2, 2, 1});
110 OperandType type4(Type::TENSOR_FLOAT32, {1, 2});
111 OperandType type5(Type::TENSOR_FLOAT32, {1, 8});
112 OperandType type6(Type::TENSOR_FLOAT32, {0});
113 OperandType type7(Type::TENSOR_INT32, {0});
114 OperandType type8(Type::TENSOR_FLOAT32, {0, 4});
115 OperandType type9(Type::TENSOR_INT32, {1});
116 // Phase 1, operands
117 auto scores = model->addOperand(&type4);
118 auto roi = model->addOperand(&type5);
119 auto param = model->addOperand(&type9);
120 auto param1 = model->addOperand(&type10);
121 auto param2 = model->addOperand(&type1);
122 auto param3 = model->addOperand(&type1);
123 auto param4 = model->addOperand(&type10);
124 auto param5 = model->addOperand(&type10);
125 auto param6 = model->addOperand(&type10);
126 auto scoresOut = model->addOperand(&type6);
127 auto roiOut = model->addOperand(&type8);
128 auto classesOut = model->addOperand(&type7);
129 auto batchSplitOut = model->addOperand(&type7);
130 auto in = model->addOperand(&type12);
131 auto param7 = model->addOperand(&type1);
132 auto param8 = model->addOperand(&type1);
133 auto param9 = model->addOperand(&type10);
134 auto param10 = model->addOperand(&type10);
135 auto param11 = model->addOperand(&type1);
136 auto param12 = model->addOperand(&type1);
137 auto layout = model->addOperand(&type11);
138 auto featureMap = model->addOperand(&type13);
139 auto op = model->addOperand(&type14);
140 auto param13 = model->addOperand(&type1);
141 auto out = model->addOperand(&type13);
142 // Phase 2, operations
143 static float scores_init[] = {0.9f, 0.1f};
144 model->setOperandValue(scores, scores_init, sizeof(float) * 2);
145 static float roi_init[] = {1.0f, 1.0f, 10.0f, 10.0f, 0.0f, 0.0f, 10.0f, 10.0f};
146 model->setOperandValue(roi, roi_init, sizeof(float) * 8);
147 static int32_t param_init[] = {0};
148 model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
149 static float param1_init[] = {0.3f};
150 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
151 static int32_t param2_init[] = {-1};
152 model->setOperandValue(param2, param2_init, sizeof(int32_t) * 1);
153 static int32_t param3_init[] = {0};
154 model->setOperandValue(param3, param3_init, sizeof(int32_t) * 1);
155 static float param4_init[] = {0.4f};
156 model->setOperandValue(param4, param4_init, sizeof(float) * 1);
157 static float param5_init[] = {1.0f};
158 model->setOperandValue(param5, param5_init, sizeof(float) * 1);
159 static float param6_init[] = {0.3f};
160 model->setOperandValue(param6, param6_init, sizeof(float) * 1);
161 static int32_t param7_init[] = {2};
162 model->setOperandValue(param7, param7_init, sizeof(int32_t) * 1);
163 static int32_t param8_init[] = {2};
164 model->setOperandValue(param8, param8_init, sizeof(int32_t) * 1);
165 static float param9_init[] = {2.0f};
166 model->setOperandValue(param9, param9_init, sizeof(float) * 1);
167 static float param10_init[] = {2.0f};
168 model->setOperandValue(param10, param10_init, sizeof(float) * 1);
169 static int32_t param11_init[] = {4};
170 model->setOperandValue(param11, param11_init, sizeof(int32_t) * 1);
171 static int32_t param12_init[] = {4};
172 model->setOperandValue(param12, param12_init, sizeof(int32_t) * 1);
173 static bool8 layout_init[] = {false};
174 model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
175 static float op_init[] = {1.0f, 2.0f, 3.0f, 4.0f};
176 model->setOperandValue(op, op_init, sizeof(float) * 4);
177 static int32_t param13_init[] = {0};
178 model->setOperandValue(param13, param13_init, sizeof(int32_t) * 1);
179 model->addOperation(ANEURALNETWORKS_BOX_WITH_NMS_LIMIT, {scores, roi, param, param1, param2, param3, param4, param5, param6}, {scoresOut, roiOut, classesOut, batchSplitOut});
180 model->addOperation(ANEURALNETWORKS_ROI_ALIGN, {in, roiOut, batchSplitOut, param7, param8, param9, param10, param11, param12, layout}, {featureMap});
181 model->addOperation(ANEURALNETWORKS_MUL, {featureMap, op, param13}, {out});
182 // Phase 3, inputs and outputs
183 model->identifyInputsAndOutputs(
184 {in},
185 {scoresOut, classesOut, out});
186 assert(model->isValid());
187 }
188
is_ignored_zero_sized(int i)189 inline bool is_ignored_zero_sized(int i) {
190 static std::set<int> ignore = {};
191 return ignore.find(i) != ignore.end();
192 }
193
CreateModel_zero_sized_relaxed(Model * model)194 void CreateModel_zero_sized_relaxed(Model *model) {
195 OperandType type1(Type::INT32, {});
196 OperandType type10(Type::FLOAT32, {});
197 OperandType type11(Type::BOOL, {});
198 OperandType type12(Type::TENSOR_FLOAT32, {1, 1, 1, 2});
199 OperandType type13(Type::TENSOR_FLOAT32, {0, 2, 2, 2});
200 OperandType type14(Type::TENSOR_FLOAT32, {1, 2, 2, 1});
201 OperandType type4(Type::TENSOR_FLOAT32, {1, 2});
202 OperandType type5(Type::TENSOR_FLOAT32, {1, 8});
203 OperandType type6(Type::TENSOR_FLOAT32, {0});
204 OperandType type7(Type::TENSOR_INT32, {0});
205 OperandType type8(Type::TENSOR_FLOAT32, {0, 4});
206 OperandType type9(Type::TENSOR_INT32, {1});
207 // Phase 1, operands
208 auto scores = model->addOperand(&type4);
209 auto roi = model->addOperand(&type5);
210 auto param = model->addOperand(&type9);
211 auto param1 = model->addOperand(&type10);
212 auto param2 = model->addOperand(&type1);
213 auto param3 = model->addOperand(&type1);
214 auto param4 = model->addOperand(&type10);
215 auto param5 = model->addOperand(&type10);
216 auto param6 = model->addOperand(&type10);
217 auto scoresOut = model->addOperand(&type6);
218 auto roiOut = model->addOperand(&type8);
219 auto classesOut = model->addOperand(&type7);
220 auto batchSplitOut = model->addOperand(&type7);
221 auto in = model->addOperand(&type12);
222 auto param7 = model->addOperand(&type1);
223 auto param8 = model->addOperand(&type1);
224 auto param9 = model->addOperand(&type10);
225 auto param10 = model->addOperand(&type10);
226 auto param11 = model->addOperand(&type1);
227 auto param12 = model->addOperand(&type1);
228 auto layout = model->addOperand(&type11);
229 auto featureMap = model->addOperand(&type13);
230 auto op = model->addOperand(&type14);
231 auto param13 = model->addOperand(&type1);
232 auto out = model->addOperand(&type13);
233 // Phase 2, operations
234 static float scores_init[] = {0.9f, 0.1f};
235 model->setOperandValue(scores, scores_init, sizeof(float) * 2);
236 static float roi_init[] = {1.0f, 1.0f, 10.0f, 10.0f, 0.0f, 0.0f, 10.0f, 10.0f};
237 model->setOperandValue(roi, roi_init, sizeof(float) * 8);
238 static int32_t param_init[] = {0};
239 model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
240 static float param1_init[] = {0.3f};
241 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
242 static int32_t param2_init[] = {-1};
243 model->setOperandValue(param2, param2_init, sizeof(int32_t) * 1);
244 static int32_t param3_init[] = {0};
245 model->setOperandValue(param3, param3_init, sizeof(int32_t) * 1);
246 static float param4_init[] = {0.4f};
247 model->setOperandValue(param4, param4_init, sizeof(float) * 1);
248 static float param5_init[] = {1.0f};
249 model->setOperandValue(param5, param5_init, sizeof(float) * 1);
250 static float param6_init[] = {0.3f};
251 model->setOperandValue(param6, param6_init, sizeof(float) * 1);
252 static int32_t param7_init[] = {2};
253 model->setOperandValue(param7, param7_init, sizeof(int32_t) * 1);
254 static int32_t param8_init[] = {2};
255 model->setOperandValue(param8, param8_init, sizeof(int32_t) * 1);
256 static float param9_init[] = {2.0f};
257 model->setOperandValue(param9, param9_init, sizeof(float) * 1);
258 static float param10_init[] = {2.0f};
259 model->setOperandValue(param10, param10_init, sizeof(float) * 1);
260 static int32_t param11_init[] = {4};
261 model->setOperandValue(param11, param11_init, sizeof(int32_t) * 1);
262 static int32_t param12_init[] = {4};
263 model->setOperandValue(param12, param12_init, sizeof(int32_t) * 1);
264 static bool8 layout_init[] = {false};
265 model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
266 static float op_init[] = {1.0f, 2.0f, 3.0f, 4.0f};
267 model->setOperandValue(op, op_init, sizeof(float) * 4);
268 static int32_t param13_init[] = {0};
269 model->setOperandValue(param13, param13_init, sizeof(int32_t) * 1);
270 model->addOperation(ANEURALNETWORKS_BOX_WITH_NMS_LIMIT, {scores, roi, param, param1, param2, param3, param4, param5, param6}, {scoresOut, roiOut, classesOut, batchSplitOut});
271 model->addOperation(ANEURALNETWORKS_ROI_ALIGN, {in, roiOut, batchSplitOut, param7, param8, param9, param10, param11, param12, layout}, {featureMap});
272 model->addOperation(ANEURALNETWORKS_MUL, {featureMap, op, param13}, {out});
273 // Phase 3, inputs and outputs
274 model->identifyInputsAndOutputs(
275 {in},
276 {scoresOut, classesOut, out});
277 // Phase 4: set relaxed execution
278 model->relaxComputationFloat32toFloat16(true);
279 assert(model->isValid());
280 }
281
is_ignored_zero_sized_relaxed(int i)282 inline bool is_ignored_zero_sized_relaxed(int i) {
283 static std::set<int> ignore = {};
284 return ignore.find(i) != ignore.end();
285 }
286
CreateModel_zero_sized_quant8(Model * model)287 void CreateModel_zero_sized_quant8(Model *model) {
288 OperandType type1(Type::INT32, {});
289 OperandType type10(Type::FLOAT32, {});
290 OperandType type11(Type::BOOL, {});
291 OperandType type17(Type::TENSOR_QUANT8_ASYMM, {0, 2, 2, 2}, 0.1f, 128);
292 OperandType type18(Type::TENSOR_QUANT8_ASYMM, {1, 1, 1, 2}, 0.1f, 128);
293 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {1, 2, 2, 1}, 0.1f, 128);
294 OperandType type20(Type::TENSOR_QUANT16_ASYMM, {1, 8}, 0.125f, 0);
295 OperandType type21(Type::TENSOR_QUANT16_ASYMM, {0, 4}, 0.125f, 0);
296 OperandType type22(Type::TENSOR_QUANT8_ASYMM, {1, 2}, 0.1f, 128);
297 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {0}, 0.1f, 128);
298 OperandType type7(Type::TENSOR_INT32, {0});
299 OperandType type9(Type::TENSOR_INT32, {1});
300 // Phase 1, operands
301 auto scores = model->addOperand(&type22);
302 auto roi = model->addOperand(&type20);
303 auto param = model->addOperand(&type9);
304 auto param1 = model->addOperand(&type10);
305 auto param2 = model->addOperand(&type1);
306 auto param3 = model->addOperand(&type1);
307 auto param4 = model->addOperand(&type10);
308 auto param5 = model->addOperand(&type10);
309 auto param6 = model->addOperand(&type10);
310 auto scoresOut = model->addOperand(&type23);
311 auto roiOut = model->addOperand(&type21);
312 auto classesOut = model->addOperand(&type7);
313 auto batchSplitOut = model->addOperand(&type7);
314 auto in = model->addOperand(&type18);
315 auto param7 = model->addOperand(&type1);
316 auto param8 = model->addOperand(&type1);
317 auto param9 = model->addOperand(&type10);
318 auto param10 = model->addOperand(&type10);
319 auto param11 = model->addOperand(&type1);
320 auto param12 = model->addOperand(&type1);
321 auto layout = model->addOperand(&type11);
322 auto featureMap = model->addOperand(&type17);
323 auto op = model->addOperand(&type19);
324 auto param13 = model->addOperand(&type1);
325 auto out = model->addOperand(&type17);
326 // Phase 2, operations
327 static uint8_t scores_init[] = {137, 129};
328 model->setOperandValue(scores, scores_init, sizeof(uint8_t) * 2);
329 static uint16_t roi_init[] = {8, 8, 80, 80, 0, 0, 80, 80};
330 model->setOperandValue(roi, roi_init, sizeof(uint16_t) * 8);
331 static int32_t param_init[] = {0};
332 model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
333 static float param1_init[] = {0.3f};
334 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
335 static int32_t param2_init[] = {-1};
336 model->setOperandValue(param2, param2_init, sizeof(int32_t) * 1);
337 static int32_t param3_init[] = {0};
338 model->setOperandValue(param3, param3_init, sizeof(int32_t) * 1);
339 static float param4_init[] = {0.4f};
340 model->setOperandValue(param4, param4_init, sizeof(float) * 1);
341 static float param5_init[] = {1.0f};
342 model->setOperandValue(param5, param5_init, sizeof(float) * 1);
343 static float param6_init[] = {0.3f};
344 model->setOperandValue(param6, param6_init, sizeof(float) * 1);
345 static int32_t param7_init[] = {2};
346 model->setOperandValue(param7, param7_init, sizeof(int32_t) * 1);
347 static int32_t param8_init[] = {2};
348 model->setOperandValue(param8, param8_init, sizeof(int32_t) * 1);
349 static float param9_init[] = {2.0f};
350 model->setOperandValue(param9, param9_init, sizeof(float) * 1);
351 static float param10_init[] = {2.0f};
352 model->setOperandValue(param10, param10_init, sizeof(float) * 1);
353 static int32_t param11_init[] = {4};
354 model->setOperandValue(param11, param11_init, sizeof(int32_t) * 1);
355 static int32_t param12_init[] = {4};
356 model->setOperandValue(param12, param12_init, sizeof(int32_t) * 1);
357 static bool8 layout_init[] = {false};
358 model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
359 static uint8_t op_init[] = {138, 148, 158, 168};
360 model->setOperandValue(op, op_init, sizeof(uint8_t) * 4);
361 static int32_t param13_init[] = {0};
362 model->setOperandValue(param13, param13_init, sizeof(int32_t) * 1);
363 model->addOperation(ANEURALNETWORKS_BOX_WITH_NMS_LIMIT, {scores, roi, param, param1, param2, param3, param4, param5, param6}, {scoresOut, roiOut, classesOut, batchSplitOut});
364 model->addOperation(ANEURALNETWORKS_ROI_ALIGN, {in, roiOut, batchSplitOut, param7, param8, param9, param10, param11, param12, layout}, {featureMap});
365 model->addOperation(ANEURALNETWORKS_MUL, {featureMap, op, param13}, {out});
366 // Phase 3, inputs and outputs
367 model->identifyInputsAndOutputs(
368 {in},
369 {scoresOut, classesOut, out});
370 assert(model->isValid());
371 }
372
is_ignored_zero_sized_quant8(int i)373 inline bool is_ignored_zero_sized_quant8(int i) {
374 static std::set<int> ignore = {};
375 return ignore.find(i) != ignore.end();
376 }
377
CreateModel_zero_sized_float16(Model * model)378 void CreateModel_zero_sized_float16(Model *model) {
379 OperandType type1(Type::INT32, {});
380 OperandType type11(Type::BOOL, {});
381 OperandType type24(Type::TENSOR_FLOAT16, {0, 2, 2, 2});
382 OperandType type25(Type::TENSOR_FLOAT16, {1, 1, 1, 2});
383 OperandType type26(Type::TENSOR_FLOAT16, {1, 2, 2, 1});
384 OperandType type27(Type::FLOAT16, {});
385 OperandType type28(Type::TENSOR_FLOAT16, {1, 8});
386 OperandType type29(Type::TENSOR_FLOAT16, {0, 4});
387 OperandType type30(Type::TENSOR_FLOAT16, {1, 2});
388 OperandType type31(Type::TENSOR_FLOAT16, {0});
389 OperandType type7(Type::TENSOR_INT32, {0});
390 OperandType type9(Type::TENSOR_INT32, {1});
391 // Phase 1, operands
392 auto scores = model->addOperand(&type30);
393 auto roi = model->addOperand(&type28);
394 auto param = model->addOperand(&type9);
395 auto param1 = model->addOperand(&type27);
396 auto param2 = model->addOperand(&type1);
397 auto param3 = model->addOperand(&type1);
398 auto param4 = model->addOperand(&type27);
399 auto param5 = model->addOperand(&type27);
400 auto param6 = model->addOperand(&type27);
401 auto scoresOut = model->addOperand(&type31);
402 auto roiOut = model->addOperand(&type29);
403 auto classesOut = model->addOperand(&type7);
404 auto batchSplitOut = model->addOperand(&type7);
405 auto in = model->addOperand(&type25);
406 auto param7 = model->addOperand(&type1);
407 auto param8 = model->addOperand(&type1);
408 auto param9 = model->addOperand(&type27);
409 auto param10 = model->addOperand(&type27);
410 auto param11 = model->addOperand(&type1);
411 auto param12 = model->addOperand(&type1);
412 auto layout = model->addOperand(&type11);
413 auto featureMap = model->addOperand(&type24);
414 auto op = model->addOperand(&type26);
415 auto param13 = model->addOperand(&type1);
416 auto out = model->addOperand(&type24);
417 // Phase 2, operations
418 static _Float16 scores_init[] = {0.8999999761581421f, 0.10000000149011612f};
419 model->setOperandValue(scores, scores_init, sizeof(_Float16) * 2);
420 static _Float16 roi_init[] = {1.0f, 1.0f, 10.0f, 10.0f, 0.0f, 0.0f, 10.0f, 10.0f};
421 model->setOperandValue(roi, roi_init, sizeof(_Float16) * 8);
422 static int32_t param_init[] = {0};
423 model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
424 static _Float16 param1_init[] = {0.30000001192092896f};
425 model->setOperandValue(param1, param1_init, sizeof(_Float16) * 1);
426 static int32_t param2_init[] = {-1};
427 model->setOperandValue(param2, param2_init, sizeof(int32_t) * 1);
428 static int32_t param3_init[] = {0};
429 model->setOperandValue(param3, param3_init, sizeof(int32_t) * 1);
430 static _Float16 param4_init[] = {0.4000000059604645f};
431 model->setOperandValue(param4, param4_init, sizeof(_Float16) * 1);
432 static _Float16 param5_init[] = {1.0f};
433 model->setOperandValue(param5, param5_init, sizeof(_Float16) * 1);
434 static _Float16 param6_init[] = {0.30000001192092896f};
435 model->setOperandValue(param6, param6_init, sizeof(_Float16) * 1);
436 static int32_t param7_init[] = {2};
437 model->setOperandValue(param7, param7_init, sizeof(int32_t) * 1);
438 static int32_t param8_init[] = {2};
439 model->setOperandValue(param8, param8_init, sizeof(int32_t) * 1);
440 static _Float16 param9_init[] = {2.0f};
441 model->setOperandValue(param9, param9_init, sizeof(_Float16) * 1);
442 static _Float16 param10_init[] = {2.0f};
443 model->setOperandValue(param10, param10_init, sizeof(_Float16) * 1);
444 static int32_t param11_init[] = {4};
445 model->setOperandValue(param11, param11_init, sizeof(int32_t) * 1);
446 static int32_t param12_init[] = {4};
447 model->setOperandValue(param12, param12_init, sizeof(int32_t) * 1);
448 static bool8 layout_init[] = {false};
449 model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
450 static _Float16 op_init[] = {1.0f, 2.0f, 3.0f, 4.0f};
451 model->setOperandValue(op, op_init, sizeof(_Float16) * 4);
452 static int32_t param13_init[] = {0};
453 model->setOperandValue(param13, param13_init, sizeof(int32_t) * 1);
454 model->addOperation(ANEURALNETWORKS_BOX_WITH_NMS_LIMIT, {scores, roi, param, param1, param2, param3, param4, param5, param6}, {scoresOut, roiOut, classesOut, batchSplitOut});
455 model->addOperation(ANEURALNETWORKS_ROI_ALIGN, {in, roiOut, batchSplitOut, param7, param8, param9, param10, param11, param12, layout}, {featureMap});
456 model->addOperation(ANEURALNETWORKS_MUL, {featureMap, op, param13}, {out});
457 // Phase 3, inputs and outputs
458 model->identifyInputsAndOutputs(
459 {in},
460 {scoresOut, classesOut, out});
461 assert(model->isValid());
462 }
463
is_ignored_zero_sized_float16(int i)464 inline bool is_ignored_zero_sized_float16(int i) {
465 static std::set<int> ignore = {};
466 return ignore.find(i) != ignore.end();
467 }
468
CreateModel_zero_sized_dynamic_output_shape(Model * model)469 void CreateModel_zero_sized_dynamic_output_shape(Model *model) {
470 OperandType type1(Type::INT32, {});
471 OperandType type10(Type::FLOAT32, {});
472 OperandType type11(Type::BOOL, {});
473 OperandType type12(Type::TENSOR_FLOAT32, {1, 1, 1, 2});
474 OperandType type13(Type::TENSOR_FLOAT32, {0, 2, 2, 2});
475 OperandType type14(Type::TENSOR_FLOAT32, {1, 2, 2, 1});
476 OperandType type32(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
477 OperandType type4(Type::TENSOR_FLOAT32, {1, 2});
478 OperandType type5(Type::TENSOR_FLOAT32, {1, 8});
479 OperandType type6(Type::TENSOR_FLOAT32, {0});
480 OperandType type7(Type::TENSOR_INT32, {0});
481 OperandType type8(Type::TENSOR_FLOAT32, {0, 4});
482 OperandType type9(Type::TENSOR_INT32, {1});
483 // Phase 1, operands
484 auto scores = model->addOperand(&type4);
485 auto roi = model->addOperand(&type5);
486 auto param = model->addOperand(&type9);
487 auto param1 = model->addOperand(&type10);
488 auto param2 = model->addOperand(&type1);
489 auto param3 = model->addOperand(&type1);
490 auto param4 = model->addOperand(&type10);
491 auto param5 = model->addOperand(&type10);
492 auto param6 = model->addOperand(&type10);
493 auto scoresOut = model->addOperand(&type6);
494 auto roiOut = model->addOperand(&type8);
495 auto classesOut = model->addOperand(&type7);
496 auto batchSplitOut = model->addOperand(&type7);
497 auto in = model->addOperand(&type12);
498 auto param7 = model->addOperand(&type1);
499 auto param8 = model->addOperand(&type1);
500 auto param9 = model->addOperand(&type10);
501 auto param10 = model->addOperand(&type10);
502 auto param11 = model->addOperand(&type1);
503 auto param12 = model->addOperand(&type1);
504 auto layout = model->addOperand(&type11);
505 auto featureMap = model->addOperand(&type13);
506 auto op = model->addOperand(&type14);
507 auto param13 = model->addOperand(&type1);
508 auto out = model->addOperand(&type32);
509 // Phase 2, operations
510 static float scores_init[] = {0.9f, 0.1f};
511 model->setOperandValue(scores, scores_init, sizeof(float) * 2);
512 static float roi_init[] = {1.0f, 1.0f, 10.0f, 10.0f, 0.0f, 0.0f, 10.0f, 10.0f};
513 model->setOperandValue(roi, roi_init, sizeof(float) * 8);
514 static int32_t param_init[] = {0};
515 model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
516 static float param1_init[] = {0.3f};
517 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
518 static int32_t param2_init[] = {-1};
519 model->setOperandValue(param2, param2_init, sizeof(int32_t) * 1);
520 static int32_t param3_init[] = {0};
521 model->setOperandValue(param3, param3_init, sizeof(int32_t) * 1);
522 static float param4_init[] = {0.4f};
523 model->setOperandValue(param4, param4_init, sizeof(float) * 1);
524 static float param5_init[] = {1.0f};
525 model->setOperandValue(param5, param5_init, sizeof(float) * 1);
526 static float param6_init[] = {0.3f};
527 model->setOperandValue(param6, param6_init, sizeof(float) * 1);
528 static int32_t param7_init[] = {2};
529 model->setOperandValue(param7, param7_init, sizeof(int32_t) * 1);
530 static int32_t param8_init[] = {2};
531 model->setOperandValue(param8, param8_init, sizeof(int32_t) * 1);
532 static float param9_init[] = {2.0f};
533 model->setOperandValue(param9, param9_init, sizeof(float) * 1);
534 static float param10_init[] = {2.0f};
535 model->setOperandValue(param10, param10_init, sizeof(float) * 1);
536 static int32_t param11_init[] = {4};
537 model->setOperandValue(param11, param11_init, sizeof(int32_t) * 1);
538 static int32_t param12_init[] = {4};
539 model->setOperandValue(param12, param12_init, sizeof(int32_t) * 1);
540 static bool8 layout_init[] = {false};
541 model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
542 static float op_init[] = {1.0f, 2.0f, 3.0f, 4.0f};
543 model->setOperandValue(op, op_init, sizeof(float) * 4);
544 static int32_t param13_init[] = {0};
545 model->setOperandValue(param13, param13_init, sizeof(int32_t) * 1);
546 model->addOperation(ANEURALNETWORKS_BOX_WITH_NMS_LIMIT, {scores, roi, param, param1, param2, param3, param4, param5, param6}, {scoresOut, roiOut, classesOut, batchSplitOut});
547 model->addOperation(ANEURALNETWORKS_ROI_ALIGN, {in, roiOut, batchSplitOut, param7, param8, param9, param10, param11, param12, layout}, {featureMap});
548 model->addOperation(ANEURALNETWORKS_MUL, {featureMap, op, param13}, {out});
549 // Phase 3, inputs and outputs
550 model->identifyInputsAndOutputs(
551 {in},
552 {scoresOut, classesOut, out});
553 assert(model->isValid());
554 }
555
is_ignored_zero_sized_dynamic_output_shape(int i)556 inline bool is_ignored_zero_sized_dynamic_output_shape(int i) {
557 static std::set<int> ignore = {};
558 return ignore.find(i) != ignore.end();
559 }
560
CreateModel_zero_sized_dynamic_output_shape_relaxed(Model * model)561 void CreateModel_zero_sized_dynamic_output_shape_relaxed(Model *model) {
562 OperandType type1(Type::INT32, {});
563 OperandType type10(Type::FLOAT32, {});
564 OperandType type11(Type::BOOL, {});
565 OperandType type12(Type::TENSOR_FLOAT32, {1, 1, 1, 2});
566 OperandType type13(Type::TENSOR_FLOAT32, {0, 2, 2, 2});
567 OperandType type14(Type::TENSOR_FLOAT32, {1, 2, 2, 1});
568 OperandType type32(Type::TENSOR_FLOAT32, {0, 0, 0, 0});
569 OperandType type4(Type::TENSOR_FLOAT32, {1, 2});
570 OperandType type5(Type::TENSOR_FLOAT32, {1, 8});
571 OperandType type6(Type::TENSOR_FLOAT32, {0});
572 OperandType type7(Type::TENSOR_INT32, {0});
573 OperandType type8(Type::TENSOR_FLOAT32, {0, 4});
574 OperandType type9(Type::TENSOR_INT32, {1});
575 // Phase 1, operands
576 auto scores = model->addOperand(&type4);
577 auto roi = model->addOperand(&type5);
578 auto param = model->addOperand(&type9);
579 auto param1 = model->addOperand(&type10);
580 auto param2 = model->addOperand(&type1);
581 auto param3 = model->addOperand(&type1);
582 auto param4 = model->addOperand(&type10);
583 auto param5 = model->addOperand(&type10);
584 auto param6 = model->addOperand(&type10);
585 auto scoresOut = model->addOperand(&type6);
586 auto roiOut = model->addOperand(&type8);
587 auto classesOut = model->addOperand(&type7);
588 auto batchSplitOut = model->addOperand(&type7);
589 auto in = model->addOperand(&type12);
590 auto param7 = model->addOperand(&type1);
591 auto param8 = model->addOperand(&type1);
592 auto param9 = model->addOperand(&type10);
593 auto param10 = model->addOperand(&type10);
594 auto param11 = model->addOperand(&type1);
595 auto param12 = model->addOperand(&type1);
596 auto layout = model->addOperand(&type11);
597 auto featureMap = model->addOperand(&type13);
598 auto op = model->addOperand(&type14);
599 auto param13 = model->addOperand(&type1);
600 auto out = model->addOperand(&type32);
601 // Phase 2, operations
602 static float scores_init[] = {0.9f, 0.1f};
603 model->setOperandValue(scores, scores_init, sizeof(float) * 2);
604 static float roi_init[] = {1.0f, 1.0f, 10.0f, 10.0f, 0.0f, 0.0f, 10.0f, 10.0f};
605 model->setOperandValue(roi, roi_init, sizeof(float) * 8);
606 static int32_t param_init[] = {0};
607 model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
608 static float param1_init[] = {0.3f};
609 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
610 static int32_t param2_init[] = {-1};
611 model->setOperandValue(param2, param2_init, sizeof(int32_t) * 1);
612 static int32_t param3_init[] = {0};
613 model->setOperandValue(param3, param3_init, sizeof(int32_t) * 1);
614 static float param4_init[] = {0.4f};
615 model->setOperandValue(param4, param4_init, sizeof(float) * 1);
616 static float param5_init[] = {1.0f};
617 model->setOperandValue(param5, param5_init, sizeof(float) * 1);
618 static float param6_init[] = {0.3f};
619 model->setOperandValue(param6, param6_init, sizeof(float) * 1);
620 static int32_t param7_init[] = {2};
621 model->setOperandValue(param7, param7_init, sizeof(int32_t) * 1);
622 static int32_t param8_init[] = {2};
623 model->setOperandValue(param8, param8_init, sizeof(int32_t) * 1);
624 static float param9_init[] = {2.0f};
625 model->setOperandValue(param9, param9_init, sizeof(float) * 1);
626 static float param10_init[] = {2.0f};
627 model->setOperandValue(param10, param10_init, sizeof(float) * 1);
628 static int32_t param11_init[] = {4};
629 model->setOperandValue(param11, param11_init, sizeof(int32_t) * 1);
630 static int32_t param12_init[] = {4};
631 model->setOperandValue(param12, param12_init, sizeof(int32_t) * 1);
632 static bool8 layout_init[] = {false};
633 model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
634 static float op_init[] = {1.0f, 2.0f, 3.0f, 4.0f};
635 model->setOperandValue(op, op_init, sizeof(float) * 4);
636 static int32_t param13_init[] = {0};
637 model->setOperandValue(param13, param13_init, sizeof(int32_t) * 1);
638 model->addOperation(ANEURALNETWORKS_BOX_WITH_NMS_LIMIT, {scores, roi, param, param1, param2, param3, param4, param5, param6}, {scoresOut, roiOut, classesOut, batchSplitOut});
639 model->addOperation(ANEURALNETWORKS_ROI_ALIGN, {in, roiOut, batchSplitOut, param7, param8, param9, param10, param11, param12, layout}, {featureMap});
640 model->addOperation(ANEURALNETWORKS_MUL, {featureMap, op, param13}, {out});
641 // Phase 3, inputs and outputs
642 model->identifyInputsAndOutputs(
643 {in},
644 {scoresOut, classesOut, out});
645 // Phase 4: set relaxed execution
646 model->relaxComputationFloat32toFloat16(true);
647 assert(model->isValid());
648 }
649
is_ignored_zero_sized_dynamic_output_shape_relaxed(int i)650 inline bool is_ignored_zero_sized_dynamic_output_shape_relaxed(int i) {
651 static std::set<int> ignore = {};
652 return ignore.find(i) != ignore.end();
653 }
654
CreateModel_zero_sized_dynamic_output_shape_quant8(Model * model)655 void CreateModel_zero_sized_dynamic_output_shape_quant8(Model *model) {
656 OperandType type1(Type::INT32, {});
657 OperandType type10(Type::FLOAT32, {});
658 OperandType type11(Type::BOOL, {});
659 OperandType type17(Type::TENSOR_QUANT8_ASYMM, {0, 2, 2, 2}, 0.1f, 128);
660 OperandType type18(Type::TENSOR_QUANT8_ASYMM, {1, 1, 1, 2}, 0.1f, 128);
661 OperandType type19(Type::TENSOR_QUANT8_ASYMM, {1, 2, 2, 1}, 0.1f, 128);
662 OperandType type20(Type::TENSOR_QUANT16_ASYMM, {1, 8}, 0.125f, 0);
663 OperandType type21(Type::TENSOR_QUANT16_ASYMM, {0, 4}, 0.125f, 0);
664 OperandType type22(Type::TENSOR_QUANT8_ASYMM, {1, 2}, 0.1f, 128);
665 OperandType type23(Type::TENSOR_QUANT8_ASYMM, {0}, 0.1f, 128);
666 OperandType type33(Type::TENSOR_QUANT8_ASYMM, {0, 0, 0, 0}, 0.1f, 128);
667 OperandType type7(Type::TENSOR_INT32, {0});
668 OperandType type9(Type::TENSOR_INT32, {1});
669 // Phase 1, operands
670 auto scores = model->addOperand(&type22);
671 auto roi = model->addOperand(&type20);
672 auto param = model->addOperand(&type9);
673 auto param1 = model->addOperand(&type10);
674 auto param2 = model->addOperand(&type1);
675 auto param3 = model->addOperand(&type1);
676 auto param4 = model->addOperand(&type10);
677 auto param5 = model->addOperand(&type10);
678 auto param6 = model->addOperand(&type10);
679 auto scoresOut = model->addOperand(&type23);
680 auto roiOut = model->addOperand(&type21);
681 auto classesOut = model->addOperand(&type7);
682 auto batchSplitOut = model->addOperand(&type7);
683 auto in = model->addOperand(&type18);
684 auto param7 = model->addOperand(&type1);
685 auto param8 = model->addOperand(&type1);
686 auto param9 = model->addOperand(&type10);
687 auto param10 = model->addOperand(&type10);
688 auto param11 = model->addOperand(&type1);
689 auto param12 = model->addOperand(&type1);
690 auto layout = model->addOperand(&type11);
691 auto featureMap = model->addOperand(&type17);
692 auto op = model->addOperand(&type19);
693 auto param13 = model->addOperand(&type1);
694 auto out = model->addOperand(&type33);
695 // Phase 2, operations
696 static uint8_t scores_init[] = {137, 129};
697 model->setOperandValue(scores, scores_init, sizeof(uint8_t) * 2);
698 static uint16_t roi_init[] = {8, 8, 80, 80, 0, 0, 80, 80};
699 model->setOperandValue(roi, roi_init, sizeof(uint16_t) * 8);
700 static int32_t param_init[] = {0};
701 model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
702 static float param1_init[] = {0.3f};
703 model->setOperandValue(param1, param1_init, sizeof(float) * 1);
704 static int32_t param2_init[] = {-1};
705 model->setOperandValue(param2, param2_init, sizeof(int32_t) * 1);
706 static int32_t param3_init[] = {0};
707 model->setOperandValue(param3, param3_init, sizeof(int32_t) * 1);
708 static float param4_init[] = {0.4f};
709 model->setOperandValue(param4, param4_init, sizeof(float) * 1);
710 static float param5_init[] = {1.0f};
711 model->setOperandValue(param5, param5_init, sizeof(float) * 1);
712 static float param6_init[] = {0.3f};
713 model->setOperandValue(param6, param6_init, sizeof(float) * 1);
714 static int32_t param7_init[] = {2};
715 model->setOperandValue(param7, param7_init, sizeof(int32_t) * 1);
716 static int32_t param8_init[] = {2};
717 model->setOperandValue(param8, param8_init, sizeof(int32_t) * 1);
718 static float param9_init[] = {2.0f};
719 model->setOperandValue(param9, param9_init, sizeof(float) * 1);
720 static float param10_init[] = {2.0f};
721 model->setOperandValue(param10, param10_init, sizeof(float) * 1);
722 static int32_t param11_init[] = {4};
723 model->setOperandValue(param11, param11_init, sizeof(int32_t) * 1);
724 static int32_t param12_init[] = {4};
725 model->setOperandValue(param12, param12_init, sizeof(int32_t) * 1);
726 static bool8 layout_init[] = {false};
727 model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
728 static uint8_t op_init[] = {138, 148, 158, 168};
729 model->setOperandValue(op, op_init, sizeof(uint8_t) * 4);
730 static int32_t param13_init[] = {0};
731 model->setOperandValue(param13, param13_init, sizeof(int32_t) * 1);
732 model->addOperation(ANEURALNETWORKS_BOX_WITH_NMS_LIMIT, {scores, roi, param, param1, param2, param3, param4, param5, param6}, {scoresOut, roiOut, classesOut, batchSplitOut});
733 model->addOperation(ANEURALNETWORKS_ROI_ALIGN, {in, roiOut, batchSplitOut, param7, param8, param9, param10, param11, param12, layout}, {featureMap});
734 model->addOperation(ANEURALNETWORKS_MUL, {featureMap, op, param13}, {out});
735 // Phase 3, inputs and outputs
736 model->identifyInputsAndOutputs(
737 {in},
738 {scoresOut, classesOut, out});
739 assert(model->isValid());
740 }
741
is_ignored_zero_sized_dynamic_output_shape_quant8(int i)742 inline bool is_ignored_zero_sized_dynamic_output_shape_quant8(int i) {
743 static std::set<int> ignore = {};
744 return ignore.find(i) != ignore.end();
745 }
746
CreateModel_zero_sized_dynamic_output_shape_float16(Model * model)747 void CreateModel_zero_sized_dynamic_output_shape_float16(Model *model) {
748 OperandType type1(Type::INT32, {});
749 OperandType type11(Type::BOOL, {});
750 OperandType type15(Type::TENSOR_FLOAT16, {0});
751 OperandType type24(Type::TENSOR_FLOAT16, {0, 2, 2, 2});
752 OperandType type25(Type::TENSOR_FLOAT16, {1, 1, 1, 2});
753 OperandType type26(Type::TENSOR_FLOAT16, {1, 2, 2, 1});
754 OperandType type27(Type::FLOAT16, {});
755 OperandType type28(Type::TENSOR_FLOAT16, {1, 8});
756 OperandType type29(Type::TENSOR_FLOAT16, {0, 4});
757 OperandType type30(Type::TENSOR_FLOAT16, {1, 2});
758 OperandType type34(Type::TENSOR_FLOAT16, {0, 0, 0, 0});
759 OperandType type7(Type::TENSOR_INT32, {0});
760 OperandType type9(Type::TENSOR_INT32, {1});
761 // Phase 1, operands
762 auto scores = model->addOperand(&type30);
763 auto roi = model->addOperand(&type28);
764 auto param = model->addOperand(&type9);
765 auto param1 = model->addOperand(&type27);
766 auto param2 = model->addOperand(&type1);
767 auto param3 = model->addOperand(&type1);
768 auto param4 = model->addOperand(&type27);
769 auto param5 = model->addOperand(&type27);
770 auto param6 = model->addOperand(&type27);
771 auto scoresOut = model->addOperand(&type15);
772 auto roiOut = model->addOperand(&type29);
773 auto classesOut = model->addOperand(&type7);
774 auto batchSplitOut = model->addOperand(&type7);
775 auto in = model->addOperand(&type25);
776 auto param7 = model->addOperand(&type1);
777 auto param8 = model->addOperand(&type1);
778 auto param9 = model->addOperand(&type27);
779 auto param10 = model->addOperand(&type27);
780 auto param11 = model->addOperand(&type1);
781 auto param12 = model->addOperand(&type1);
782 auto layout = model->addOperand(&type11);
783 auto featureMap = model->addOperand(&type24);
784 auto op = model->addOperand(&type26);
785 auto param13 = model->addOperand(&type1);
786 auto out = model->addOperand(&type34);
787 // Phase 2, operations
788 static _Float16 scores_init[] = {0.8999999761581421f, 0.10000000149011612f};
789 model->setOperandValue(scores, scores_init, sizeof(_Float16) * 2);
790 static _Float16 roi_init[] = {1.0f, 1.0f, 10.0f, 10.0f, 0.0f, 0.0f, 10.0f, 10.0f};
791 model->setOperandValue(roi, roi_init, sizeof(_Float16) * 8);
792 static int32_t param_init[] = {0};
793 model->setOperandValue(param, param_init, sizeof(int32_t) * 1);
794 static _Float16 param1_init[] = {0.30000001192092896f};
795 model->setOperandValue(param1, param1_init, sizeof(_Float16) * 1);
796 static int32_t param2_init[] = {-1};
797 model->setOperandValue(param2, param2_init, sizeof(int32_t) * 1);
798 static int32_t param3_init[] = {0};
799 model->setOperandValue(param3, param3_init, sizeof(int32_t) * 1);
800 static _Float16 param4_init[] = {0.4000000059604645f};
801 model->setOperandValue(param4, param4_init, sizeof(_Float16) * 1);
802 static _Float16 param5_init[] = {1.0f};
803 model->setOperandValue(param5, param5_init, sizeof(_Float16) * 1);
804 static _Float16 param6_init[] = {0.30000001192092896f};
805 model->setOperandValue(param6, param6_init, sizeof(_Float16) * 1);
806 static int32_t param7_init[] = {2};
807 model->setOperandValue(param7, param7_init, sizeof(int32_t) * 1);
808 static int32_t param8_init[] = {2};
809 model->setOperandValue(param8, param8_init, sizeof(int32_t) * 1);
810 static _Float16 param9_init[] = {2.0f};
811 model->setOperandValue(param9, param9_init, sizeof(_Float16) * 1);
812 static _Float16 param10_init[] = {2.0f};
813 model->setOperandValue(param10, param10_init, sizeof(_Float16) * 1);
814 static int32_t param11_init[] = {4};
815 model->setOperandValue(param11, param11_init, sizeof(int32_t) * 1);
816 static int32_t param12_init[] = {4};
817 model->setOperandValue(param12, param12_init, sizeof(int32_t) * 1);
818 static bool8 layout_init[] = {false};
819 model->setOperandValue(layout, layout_init, sizeof(bool8) * 1);
820 static _Float16 op_init[] = {1.0f, 2.0f, 3.0f, 4.0f};
821 model->setOperandValue(op, op_init, sizeof(_Float16) * 4);
822 static int32_t param13_init[] = {0};
823 model->setOperandValue(param13, param13_init, sizeof(int32_t) * 1);
824 model->addOperation(ANEURALNETWORKS_BOX_WITH_NMS_LIMIT, {scores, roi, param, param1, param2, param3, param4, param5, param6}, {scoresOut, roiOut, classesOut, batchSplitOut});
825 model->addOperation(ANEURALNETWORKS_ROI_ALIGN, {in, roiOut, batchSplitOut, param7, param8, param9, param10, param11, param12, layout}, {featureMap});
826 model->addOperation(ANEURALNETWORKS_MUL, {featureMap, op, param13}, {out});
827 // Phase 3, inputs and outputs
828 model->identifyInputsAndOutputs(
829 {in},
830 {scoresOut, classesOut, out});
831 assert(model->isValid());
832 }
833
is_ignored_zero_sized_dynamic_output_shape_float16(int i)834 inline bool is_ignored_zero_sized_dynamic_output_shape_float16(int i) {
835 static std::set<int> ignore = {};
836 return ignore.find(i) != ignore.end();
837 }
838
839