1 // clang-format off
2 // Generated file (from: sqrt.mod.py). Do not edit
3 // Create the model
createTestModel()4 Model createTestModel() {
5 const std::vector<Operand> operands = {
6 {
7 .type = OperandType::TENSOR_FLOAT32,
8 .dimensions = {1, 2, 3, 4, 5},
9 .numberOfConsumers = 1,
10 .scale = 0.0f,
11 .zeroPoint = 0,
12 .lifetime = OperandLifeTime::MODEL_INPUT,
13 .location = {.poolIndex = 0, .offset = 0, .length = 0},
14 },
15 {
16 .type = OperandType::TENSOR_FLOAT32,
17 .dimensions = {1, 2, 3, 4, 5},
18 .numberOfConsumers = 0,
19 .scale = 0.0f,
20 .zeroPoint = 0,
21 .lifetime = OperandLifeTime::MODEL_OUTPUT,
22 .location = {.poolIndex = 0, .offset = 0, .length = 0},
23 }
24 };
25
26 const std::vector<Operation> operations = {
27 {
28 .type = OperationType::SQRT,
29 .inputs = {0},
30 .outputs = {1},
31 }
32 };
33
34 const std::vector<uint32_t> inputIndexes = {0};
35 const std::vector<uint32_t> outputIndexes = {1};
36 std::vector<uint8_t> operandValues = {};
37 const std::vector<hidl_memory> pools = {};
38
39 return {
40 .operands = operands,
41 .operations = operations,
42 .inputIndexes = inputIndexes,
43 .outputIndexes = outputIndexes,
44 .operandValues = operandValues,
45 .pools = pools,
46 };
47 }
48
is_ignored(int i)49 inline bool is_ignored(int i) {
50 static std::set<int> ignore = {};
51 return ignore.find(i) != ignore.end();
52 }
53
54 // Create the model
createTestModel_relaxed()55 Model createTestModel_relaxed() {
56 const std::vector<Operand> operands = {
57 {
58 .type = OperandType::TENSOR_FLOAT32,
59 .dimensions = {1, 2, 3, 4, 5},
60 .numberOfConsumers = 1,
61 .scale = 0.0f,
62 .zeroPoint = 0,
63 .lifetime = OperandLifeTime::MODEL_INPUT,
64 .location = {.poolIndex = 0, .offset = 0, .length = 0},
65 },
66 {
67 .type = OperandType::TENSOR_FLOAT32,
68 .dimensions = {1, 2, 3, 4, 5},
69 .numberOfConsumers = 0,
70 .scale = 0.0f,
71 .zeroPoint = 0,
72 .lifetime = OperandLifeTime::MODEL_OUTPUT,
73 .location = {.poolIndex = 0, .offset = 0, .length = 0},
74 }
75 };
76
77 const std::vector<Operation> operations = {
78 {
79 .type = OperationType::SQRT,
80 .inputs = {0},
81 .outputs = {1},
82 }
83 };
84
85 const std::vector<uint32_t> inputIndexes = {0};
86 const std::vector<uint32_t> outputIndexes = {1};
87 std::vector<uint8_t> operandValues = {};
88 const std::vector<hidl_memory> pools = {};
89
90 return {
91 .operands = operands,
92 .operations = operations,
93 .inputIndexes = inputIndexes,
94 .outputIndexes = outputIndexes,
95 .operandValues = operandValues,
96 .pools = pools,
97 .relaxComputationFloat32toFloat16 = true,
98 };
99 }
100
is_ignored_relaxed(int i)101 inline bool is_ignored_relaxed(int i) {
102 static std::set<int> ignore = {};
103 return ignore.find(i) != ignore.end();
104 }
105
106 // Create the model
createTestModel_float16()107 Model createTestModel_float16() {
108 const std::vector<Operand> operands = {
109 {
110 .type = OperandType::TENSOR_FLOAT16,
111 .dimensions = {1, 2, 3, 4, 5},
112 .numberOfConsumers = 1,
113 .scale = 0.0f,
114 .zeroPoint = 0,
115 .lifetime = OperandLifeTime::MODEL_INPUT,
116 .location = {.poolIndex = 0, .offset = 0, .length = 0},
117 },
118 {
119 .type = OperandType::TENSOR_FLOAT16,
120 .dimensions = {1, 2, 3, 4, 5},
121 .numberOfConsumers = 0,
122 .scale = 0.0f,
123 .zeroPoint = 0,
124 .lifetime = OperandLifeTime::MODEL_OUTPUT,
125 .location = {.poolIndex = 0, .offset = 0, .length = 0},
126 }
127 };
128
129 const std::vector<Operation> operations = {
130 {
131 .type = OperationType::SQRT,
132 .inputs = {0},
133 .outputs = {1},
134 }
135 };
136
137 const std::vector<uint32_t> inputIndexes = {0};
138 const std::vector<uint32_t> outputIndexes = {1};
139 std::vector<uint8_t> operandValues = {};
140 const std::vector<hidl_memory> pools = {};
141
142 return {
143 .operands = operands,
144 .operations = operations,
145 .inputIndexes = inputIndexes,
146 .outputIndexes = outputIndexes,
147 .operandValues = operandValues,
148 .pools = pools,
149 };
150 }
151
is_ignored_float16(int i)152 inline bool is_ignored_float16(int i) {
153 static std::set<int> ignore = {};
154 return ignore.find(i) != ignore.end();
155 }
156
157 // Create the model
createTestModel_dynamic_output_shape()158 Model createTestModel_dynamic_output_shape() {
159 const std::vector<Operand> operands = {
160 {
161 .type = OperandType::TENSOR_FLOAT32,
162 .dimensions = {1, 2, 3, 4, 5},
163 .numberOfConsumers = 1,
164 .scale = 0.0f,
165 .zeroPoint = 0,
166 .lifetime = OperandLifeTime::MODEL_INPUT,
167 .location = {.poolIndex = 0, .offset = 0, .length = 0},
168 },
169 {
170 .type = OperandType::TENSOR_FLOAT32,
171 .dimensions = {0, 0, 0, 0, 0},
172 .numberOfConsumers = 0,
173 .scale = 0.0f,
174 .zeroPoint = 0,
175 .lifetime = OperandLifeTime::MODEL_OUTPUT,
176 .location = {.poolIndex = 0, .offset = 0, .length = 0},
177 }
178 };
179
180 const std::vector<Operation> operations = {
181 {
182 .type = OperationType::SQRT,
183 .inputs = {0},
184 .outputs = {1},
185 }
186 };
187
188 const std::vector<uint32_t> inputIndexes = {0};
189 const std::vector<uint32_t> outputIndexes = {1};
190 std::vector<uint8_t> operandValues = {};
191 const std::vector<hidl_memory> pools = {};
192
193 return {
194 .operands = operands,
195 .operations = operations,
196 .inputIndexes = inputIndexes,
197 .outputIndexes = outputIndexes,
198 .operandValues = operandValues,
199 .pools = pools,
200 };
201 }
202
is_ignored_dynamic_output_shape(int i)203 inline bool is_ignored_dynamic_output_shape(int i) {
204 static std::set<int> ignore = {};
205 return ignore.find(i) != ignore.end();
206 }
207
208 // Create the model
createTestModel_dynamic_output_shape_relaxed()209 Model createTestModel_dynamic_output_shape_relaxed() {
210 const std::vector<Operand> operands = {
211 {
212 .type = OperandType::TENSOR_FLOAT32,
213 .dimensions = {1, 2, 3, 4, 5},
214 .numberOfConsumers = 1,
215 .scale = 0.0f,
216 .zeroPoint = 0,
217 .lifetime = OperandLifeTime::MODEL_INPUT,
218 .location = {.poolIndex = 0, .offset = 0, .length = 0},
219 },
220 {
221 .type = OperandType::TENSOR_FLOAT32,
222 .dimensions = {0, 0, 0, 0, 0},
223 .numberOfConsumers = 0,
224 .scale = 0.0f,
225 .zeroPoint = 0,
226 .lifetime = OperandLifeTime::MODEL_OUTPUT,
227 .location = {.poolIndex = 0, .offset = 0, .length = 0},
228 }
229 };
230
231 const std::vector<Operation> operations = {
232 {
233 .type = OperationType::SQRT,
234 .inputs = {0},
235 .outputs = {1},
236 }
237 };
238
239 const std::vector<uint32_t> inputIndexes = {0};
240 const std::vector<uint32_t> outputIndexes = {1};
241 std::vector<uint8_t> operandValues = {};
242 const std::vector<hidl_memory> pools = {};
243
244 return {
245 .operands = operands,
246 .operations = operations,
247 .inputIndexes = inputIndexes,
248 .outputIndexes = outputIndexes,
249 .operandValues = operandValues,
250 .pools = pools,
251 .relaxComputationFloat32toFloat16 = true,
252 };
253 }
254
is_ignored_dynamic_output_shape_relaxed(int i)255 inline bool is_ignored_dynamic_output_shape_relaxed(int i) {
256 static std::set<int> ignore = {};
257 return ignore.find(i) != ignore.end();
258 }
259
260 // Create the model
createTestModel_dynamic_output_shape_float16()261 Model createTestModel_dynamic_output_shape_float16() {
262 const std::vector<Operand> operands = {
263 {
264 .type = OperandType::TENSOR_FLOAT16,
265 .dimensions = {1, 2, 3, 4, 5},
266 .numberOfConsumers = 1,
267 .scale = 0.0f,
268 .zeroPoint = 0,
269 .lifetime = OperandLifeTime::MODEL_INPUT,
270 .location = {.poolIndex = 0, .offset = 0, .length = 0},
271 },
272 {
273 .type = OperandType::TENSOR_FLOAT16,
274 .dimensions = {0, 0, 0, 0, 0},
275 .numberOfConsumers = 0,
276 .scale = 0.0f,
277 .zeroPoint = 0,
278 .lifetime = OperandLifeTime::MODEL_OUTPUT,
279 .location = {.poolIndex = 0, .offset = 0, .length = 0},
280 }
281 };
282
283 const std::vector<Operation> operations = {
284 {
285 .type = OperationType::SQRT,
286 .inputs = {0},
287 .outputs = {1},
288 }
289 };
290
291 const std::vector<uint32_t> inputIndexes = {0};
292 const std::vector<uint32_t> outputIndexes = {1};
293 std::vector<uint8_t> operandValues = {};
294 const std::vector<hidl_memory> pools = {};
295
296 return {
297 .operands = operands,
298 .operations = operations,
299 .inputIndexes = inputIndexes,
300 .outputIndexes = outputIndexes,
301 .operandValues = operandValues,
302 .pools = pools,
303 };
304 }
305
is_ignored_dynamic_output_shape_float16(int i)306 inline bool is_ignored_dynamic_output_shape_float16(int i) {
307 static std::set<int> ignore = {};
308 return ignore.find(i) != ignore.end();
309 }
310
311