1 // Copyright 2020 Google LLC
2 //
3 // This source code is licensed under the BSD-style license found in the
4 // LICENSE file in the root directory of this source tree.
5
6 #include <xnnpack.h>
7
8 #include <array>
9 #include <algorithm>
10 #include <functional>
11 #include <iostream>
12 #include <limits>
13 #include <random>
14
15 #include <xnnpack/cache.h>
16
17 #include "models/models.h"
18
19 namespace models {
20
FP32SparseMobileNetV1(float sparsity,pthreadpool_t threadpool)21 ExecutionPlan FP32SparseMobileNetV1(float sparsity, pthreadpool_t threadpool) {
22 alignas(16) static std::array<float, 150528> v0;
23 alignas(16) static std::array<float, 401408> v1;
24 alignas(16) static std::array<float, 401408> v2;
25 alignas(16) static std::array<float, 802816> v3;
26 alignas(16) static std::array<float, 200704> v4;
27 alignas(16) static std::array<float, 401408> v5;
28 alignas(16) static std::array<float, 401408> v6;
29 alignas(16) static std::array<float, 401408> v7;
30 alignas(16) static std::array<float, 100352> v8;
31 alignas(16) static std::array<float, 200704> v9;
32 alignas(16) static std::array<float, 200704> v10;
33 alignas(16) static std::array<float, 200704> v11;
34 alignas(16) static std::array<float, 50176> v12;
35 alignas(16) static std::array<float, 100352> v13;
36 alignas(16) static std::array<float, 100352> v14;
37 alignas(16) static std::array<float, 100352> v15;
38 alignas(16) static std::array<float, 100352> v16;
39 alignas(16) static std::array<float, 100352> v17;
40 alignas(16) static std::array<float, 100352> v18;
41 alignas(16) static std::array<float, 100352> v19;
42 alignas(16) static std::array<float, 100352> v20;
43 alignas(16) static std::array<float, 100352> v21;
44 alignas(16) static std::array<float, 100352> v22;
45 alignas(16) static std::array<float, 100352> v23;
46 alignas(16) static std::array<float, 25088> v24;
47 alignas(16) static std::array<float, 50176> v25;
48 alignas(16) static std::array<float, 50176> v26;
49 alignas(16) static std::array<float, 50176> v27;
50 alignas(16) static std::array<float, 1024> v28;
51 alignas(16) static std::array<float, 1001> v29;
52 alignas(16) static std::array<float, 864> w30;
53 alignas(16) static std::array<float, 32> w31;
54 alignas(16) static std::array<float, 288> w32;
55 alignas(16) static std::array<float, 32> w33;
56 alignas(16) static std::array<float, 2048> w34;
57 alignas(16) static std::array<float, 64> w35;
58 alignas(16) static std::array<float, 576> w36;
59 alignas(16) static std::array<float, 64> w37;
60 alignas(16) static std::array<float, 8192> w38;
61 alignas(16) static std::array<float, 128> w39;
62 alignas(16) static std::array<float, 1152> w40;
63 alignas(16) static std::array<float, 128> w41;
64 alignas(16) static std::array<float, 16384> w42;
65 alignas(16) static std::array<float, 128> w43;
66 alignas(16) static std::array<float, 1152> w44;
67 alignas(16) static std::array<float, 128> w45;
68 alignas(16) static std::array<float, 32768> w46;
69 alignas(16) static std::array<float, 256> w47;
70 alignas(16) static std::array<float, 2304> w48;
71 alignas(16) static std::array<float, 256> w49;
72 alignas(16) static std::array<float, 65536> w50;
73 alignas(16) static std::array<float, 256> w51;
74 alignas(16) static std::array<float, 2304> w52;
75 alignas(16) static std::array<float, 256> w53;
76 alignas(16) static std::array<float, 131072> w54;
77 alignas(16) static std::array<float, 512> w55;
78 alignas(16) static std::array<float, 4608> w56;
79 alignas(16) static std::array<float, 512> w57;
80 alignas(16) static std::array<float, 262144> w58;
81 alignas(16) static std::array<float, 512> w59;
82 alignas(16) static std::array<float, 4608> w60;
83 alignas(16) static std::array<float, 512> w61;
84 alignas(16) static std::array<float, 262144> w62;
85 alignas(16) static std::array<float, 512> w63;
86 alignas(16) static std::array<float, 4608> w64;
87 alignas(16) static std::array<float, 512> w65;
88 alignas(16) static std::array<float, 262144> w66;
89 alignas(16) static std::array<float, 512> w67;
90 alignas(16) static std::array<float, 4608> w68;
91 alignas(16) static std::array<float, 512> w69;
92 alignas(16) static std::array<float, 262144> w70;
93 alignas(16) static std::array<float, 512> w71;
94 alignas(16) static std::array<float, 4608> w72;
95 alignas(16) static std::array<float, 512> w73;
96 alignas(16) static std::array<float, 262144> w74;
97 alignas(16) static std::array<float, 512> w75;
98 alignas(16) static std::array<float, 4608> w76;
99 alignas(16) static std::array<float, 512> w77;
100 alignas(16) static std::array<float, 524288> w78;
101 alignas(16) static std::array<float, 1024> w79;
102 alignas(16) static std::array<float, 9216> w80;
103 alignas(16) static std::array<float, 1024> w81;
104 alignas(16) static std::array<float, 1048576> w82;
105 alignas(16) static std::array<float, 1024> w83;
106 alignas(16) static std::array<float, 1025024> w84;
107 alignas(16) static std::array<float, 1001> w85;
108
109 std::random_device random_device;
110 auto rng = std::mt19937(random_device());
111 auto f32rng = std::bind(std::uniform_real_distribution<float>(-1.0f, +1.0f), std::ref(rng));
112 std::generate(v0.begin(), v0.end(), std::ref(f32rng));
113 std::generate(v1.begin(), v1.end(), std::ref(f32rng));
114 std::generate(v2.begin(), v2.end(), std::ref(f32rng));
115 std::generate(v3.begin(), v3.end(), std::ref(f32rng));
116 std::generate(v4.begin(), v4.end(), std::ref(f32rng));
117 std::generate(v5.begin(), v5.end(), std::ref(f32rng));
118 std::generate(v6.begin(), v6.end(), std::ref(f32rng));
119 std::generate(v7.begin(), v7.end(), std::ref(f32rng));
120 std::generate(v8.begin(), v8.end(), std::ref(f32rng));
121 std::generate(v9.begin(), v9.end(), std::ref(f32rng));
122 std::generate(v10.begin(), v10.end(), std::ref(f32rng));
123 std::generate(v11.begin(), v11.end(), std::ref(f32rng));
124 std::generate(v12.begin(), v12.end(), std::ref(f32rng));
125 std::generate(v13.begin(), v13.end(), std::ref(f32rng));
126 std::generate(v14.begin(), v14.end(), std::ref(f32rng));
127 std::generate(v15.begin(), v15.end(), std::ref(f32rng));
128 std::generate(v16.begin(), v16.end(), std::ref(f32rng));
129 std::generate(v17.begin(), v17.end(), std::ref(f32rng));
130 std::generate(v18.begin(), v18.end(), std::ref(f32rng));
131 std::generate(v19.begin(), v19.end(), std::ref(f32rng));
132 std::generate(v20.begin(), v20.end(), std::ref(f32rng));
133 std::generate(v21.begin(), v21.end(), std::ref(f32rng));
134 std::generate(v22.begin(), v22.end(), std::ref(f32rng));
135 std::generate(v23.begin(), v23.end(), std::ref(f32rng));
136 std::generate(v24.begin(), v24.end(), std::ref(f32rng));
137 std::generate(v25.begin(), v25.end(), std::ref(f32rng));
138 std::generate(v26.begin(), v26.end(), std::ref(f32rng));
139 std::generate(v27.begin(), v27.end(), std::ref(f32rng));
140 std::generate(v28.begin(), v28.end(), std::ref(f32rng));
141 std::generate(v29.begin(), v29.end(), std::ref(f32rng));
142 std::generate(w30.begin(), w30.end(), std::ref(f32rng));
143 std::generate(w31.begin(), w31.end(), std::ref(f32rng));
144 std::generate(w32.begin(), w32.end(), std::ref(f32rng));
145 std::generate(w33.begin(), w33.end(), std::ref(f32rng));
146 std::fill(w34.begin(), w34.end(), 0.0f);
147 std::generate(w34.begin(), w34.end() - size_t(sparsity * w34.size()), std::ref(f32rng));
148 std::shuffle(w34.begin(), w34.end(), rng);
149 std::generate(w35.begin(), w35.end(), std::ref(f32rng));
150 std::generate(w36.begin(), w36.end(), std::ref(f32rng));
151 std::generate(w37.begin(), w37.end(), std::ref(f32rng));
152 std::fill(w38.begin(), w38.end(), 0.0f);
153 std::generate(w38.begin(), w38.end() - size_t(sparsity * w38.size()), std::ref(f32rng));
154 std::shuffle(w38.begin(), w38.end(), rng);
155 std::generate(w39.begin(), w39.end(), std::ref(f32rng));
156 std::generate(w40.begin(), w40.end(), std::ref(f32rng));
157 std::generate(w41.begin(), w41.end(), std::ref(f32rng));
158 std::fill(w42.begin(), w42.end(), 0.0f);
159 std::generate(w42.begin(), w42.end() - size_t(sparsity * w42.size()), std::ref(f32rng));
160 std::shuffle(w42.begin(), w42.end(), rng);
161 std::generate(w43.begin(), w43.end(), std::ref(f32rng));
162 std::generate(w44.begin(), w44.end(), std::ref(f32rng));
163 std::generate(w45.begin(), w45.end(), std::ref(f32rng));
164 std::fill(w46.begin(), w46.end(), 0.0f);
165 std::generate(w46.begin(), w46.end() - size_t(sparsity * w46.size()), std::ref(f32rng));
166 std::shuffle(w46.begin(), w46.end(), rng);
167 std::generate(w47.begin(), w47.end(), std::ref(f32rng));
168 std::generate(w48.begin(), w48.end(), std::ref(f32rng));
169 std::generate(w49.begin(), w49.end(), std::ref(f32rng));
170 std::fill(w50.begin(), w50.end(), 0.0f);
171 std::generate(w50.begin(), w50.end() - size_t(sparsity * w50.size()), std::ref(f32rng));
172 std::shuffle(w50.begin(), w50.end(), rng);
173 std::generate(w51.begin(), w51.end(), std::ref(f32rng));
174 std::generate(w52.begin(), w52.end(), std::ref(f32rng));
175 std::generate(w53.begin(), w53.end(), std::ref(f32rng));
176 std::fill(w54.begin(), w54.end(), 0.0f);
177 std::generate(w54.begin(), w54.end() - size_t(sparsity * w54.size()), std::ref(f32rng));
178 std::shuffle(w54.begin(), w54.end(), rng);
179 std::generate(w55.begin(), w55.end(), std::ref(f32rng));
180 std::generate(w56.begin(), w56.end(), std::ref(f32rng));
181 std::generate(w57.begin(), w57.end(), std::ref(f32rng));
182 std::fill(w58.begin(), w58.end(), 0.0f);
183 std::generate(w58.begin(), w58.end() - size_t(sparsity * w58.size()), std::ref(f32rng));
184 std::shuffle(w58.begin(), w58.end(), rng);
185 std::generate(w59.begin(), w59.end(), std::ref(f32rng));
186 std::generate(w60.begin(), w60.end(), std::ref(f32rng));
187 std::generate(w61.begin(), w61.end(), std::ref(f32rng));
188 std::fill(w62.begin(), w62.end(), 0.0f);
189 std::generate(w62.begin(), w62.end() - size_t(sparsity * w62.size()), std::ref(f32rng));
190 std::shuffle(w62.begin(), w62.end(), rng);
191 std::generate(w63.begin(), w63.end(), std::ref(f32rng));
192 std::generate(w64.begin(), w64.end(), std::ref(f32rng));
193 std::generate(w65.begin(), w65.end(), std::ref(f32rng));
194 std::fill(w66.begin(), w66.end(), 0.0f);
195 std::generate(w66.begin(), w66.end() - size_t(sparsity * w66.size()), std::ref(f32rng));
196 std::shuffle(w66.begin(), w66.end(), rng);
197 std::generate(w67.begin(), w67.end(), std::ref(f32rng));
198 std::generate(w68.begin(), w68.end(), std::ref(f32rng));
199 std::generate(w69.begin(), w69.end(), std::ref(f32rng));
200 std::fill(w70.begin(), w70.end(), 0.0f);
201 std::generate(w70.begin(), w70.end() - size_t(sparsity * w70.size()), std::ref(f32rng));
202 std::shuffle(w70.begin(), w70.end(), rng);
203 std::generate(w71.begin(), w71.end(), std::ref(f32rng));
204 std::generate(w72.begin(), w72.end(), std::ref(f32rng));
205 std::generate(w73.begin(), w73.end(), std::ref(f32rng));
206 std::fill(w74.begin(), w74.end(), 0.0f);
207 std::generate(w74.begin(), w74.end() - size_t(sparsity * w74.size()), std::ref(f32rng));
208 std::shuffle(w74.begin(), w74.end(), rng);
209 std::generate(w75.begin(), w75.end(), std::ref(f32rng));
210 std::generate(w76.begin(), w76.end(), std::ref(f32rng));
211 std::generate(w77.begin(), w77.end(), std::ref(f32rng));
212 std::fill(w78.begin(), w78.end(), 0.0f);
213 std::generate(w78.begin(), w78.end() - size_t(sparsity * w78.size()), std::ref(f32rng));
214 std::shuffle(w78.begin(), w78.end(), rng);
215 std::generate(w79.begin(), w79.end(), std::ref(f32rng));
216 std::generate(w80.begin(), w80.end(), std::ref(f32rng));
217 std::generate(w81.begin(), w81.end(), std::ref(f32rng));
218 std::fill(w82.begin(), w82.end(), 0.0f);
219 std::generate(w82.begin(), w82.end() - size_t(sparsity * w82.size()), std::ref(f32rng));
220 std::shuffle(w82.begin(), w82.end(), rng);
221 std::generate(w83.begin(), w83.end(), std::ref(f32rng));
222 std::generate(w84.begin(), w84.end(), std::ref(f32rng));
223 std::generate(w85.begin(), w85.end(), std::ref(f32rng));
224
225 ExecutionPlan operators;
226 xnn_status status;
227 xnn_code_cache code_cache;
228 #if XNN_PLATFORM_JIT
229 xnn_init_code_cache(&code_cache);
230 #endif
231 xnn_caches caches = { 0 };
232 caches.code_cache = &code_cache;
233
234 xnn_operator_t op0 = nullptr;
235 status = xnn_create_convolution2d_nchw_f32(
236 1 /* top padding */, 1 /* right padding */,
237 1 /* bottom padding */, 1 /* left padding */,
238 3 /* kernel height */, 3 /* kernel width */,
239 2 /* subsampling height */, 2 /* subsampling width */,
240 1 /* dilation_height */, 1 /* dilation_width */,
241 1 /* groups */,
242 3 /* input channels per group */,
243 32 /* output_channels_per_group */,
244 3 /* input pixel stride */,
245 32 /* output pixel stride */,
246 w30.data(), w31.data(),
247 0.0f /* output min */, 6.0f /* output max */,
248 XNN_FLAG_INPUT_NHWC /* flags */,
249 &caches,
250 &op0);
251 if (status != xnn_status_success) {
252 std::cerr << "failed to create operation #0" << std::endl;
253 return ExecutionPlan();
254 }
255 operators.emplace_back(op0, xnn_delete_operator);
256
257 xnn_operator_t op1 = nullptr;
258 status = xnn_create_convolution2d_nchw_f32(
259 1 /* top padding */, 1 /* right padding */,
260 1 /* bottom padding */, 1 /* left padding */,
261 3 /* kernel height */, 3 /* kernel width */,
262 1 /* subsampling height */, 1 /* subsampling width */,
263 1 /* dilation_height */, 1 /* dilation_width */,
264 32 /* groups */,
265 1 /* input channels per group */,
266 1 /* output_channels_per_group */,
267 32 /* input pixel stride */,
268 32 /* output pixel stride */,
269 w32.data(), w33.data(),
270 0.0f /* output min */, 6.0f /* output max */,
271 0 /* flags */,
272 &caches,
273 &op1);
274 if (status != xnn_status_success) {
275 std::cerr << "failed to create operation #1" << std::endl;
276 return ExecutionPlan();
277 }
278 operators.emplace_back(op1, xnn_delete_operator);
279
280 xnn_operator_t op2 = nullptr;
281 status = xnn_create_convolution2d_nchw_f32(
282 0 /* top padding */, 0 /* right padding */,
283 0 /* bottom padding */, 0 /* left padding */,
284 1 /* kernel height */, 1 /* kernel width */,
285 1 /* subsampling height */, 1 /* subsampling width */,
286 1 /* dilation_height */, 1 /* dilation_width */,
287 1 /* groups */,
288 32 /* input channels per group */,
289 64 /* output_channels_per_group */,
290 32 /* input pixel stride */,
291 64 /* output pixel stride */,
292 w34.data(), w35.data(),
293 0.0f /* output min */, 6.0f /* output max */,
294 0 /* flags */,
295 &caches,
296 &op2);
297 if (status != xnn_status_success) {
298 std::cerr << "failed to create operation #2" << std::endl;
299 return ExecutionPlan();
300 }
301 operators.emplace_back(op2, xnn_delete_operator);
302
303 xnn_operator_t op3 = nullptr;
304 status = xnn_create_convolution2d_nchw_f32(
305 1 /* top padding */, 1 /* right padding */,
306 1 /* bottom padding */, 1 /* left padding */,
307 3 /* kernel height */, 3 /* kernel width */,
308 2 /* subsampling height */, 2 /* subsampling width */,
309 1 /* dilation_height */, 1 /* dilation_width */,
310 64 /* groups */,
311 1 /* input channels per group */,
312 1 /* output_channels_per_group */,
313 64 /* input pixel stride */,
314 64 /* output pixel stride */,
315 w36.data(), w37.data(),
316 0.0f /* output min */, 6.0f /* output max */,
317 0 /* flags */,
318 &caches,
319 &op3);
320 if (status != xnn_status_success) {
321 std::cerr << "failed to create operation #3" << std::endl;
322 return ExecutionPlan();
323 }
324 operators.emplace_back(op3, xnn_delete_operator);
325
326 xnn_operator_t op4 = nullptr;
327 status = xnn_create_convolution2d_nchw_f32(
328 0 /* top padding */, 0 /* right padding */,
329 0 /* bottom padding */, 0 /* left padding */,
330 1 /* kernel height */, 1 /* kernel width */,
331 1 /* subsampling height */, 1 /* subsampling width */,
332 1 /* dilation_height */, 1 /* dilation_width */,
333 1 /* groups */,
334 64 /* input channels per group */,
335 128 /* output_channels_per_group */,
336 64 /* input pixel stride */,
337 128 /* output pixel stride */,
338 w38.data(), w39.data(),
339 0.0f /* output min */, 6.0f /* output max */,
340 0 /* flags */,
341 &caches,
342 &op4);
343 if (status != xnn_status_success) {
344 std::cerr << "failed to create operation #4" << std::endl;
345 return ExecutionPlan();
346 }
347 operators.emplace_back(op4, xnn_delete_operator);
348
349 xnn_operator_t op5 = nullptr;
350 status = xnn_create_convolution2d_nchw_f32(
351 1 /* top padding */, 1 /* right padding */,
352 1 /* bottom padding */, 1 /* left padding */,
353 3 /* kernel height */, 3 /* kernel width */,
354 1 /* subsampling height */, 1 /* subsampling width */,
355 1 /* dilation_height */, 1 /* dilation_width */,
356 128 /* groups */,
357 1 /* input channels per group */,
358 1 /* output_channels_per_group */,
359 128 /* input pixel stride */,
360 128 /* output pixel stride */,
361 w40.data(), w41.data(),
362 0.0f /* output min */, 6.0f /* output max */,
363 0 /* flags */,
364 &caches,
365 &op5);
366 if (status != xnn_status_success) {
367 std::cerr << "failed to create operation #5" << std::endl;
368 return ExecutionPlan();
369 }
370 operators.emplace_back(op5, xnn_delete_operator);
371
372 xnn_operator_t op6 = nullptr;
373 status = xnn_create_convolution2d_nchw_f32(
374 0 /* top padding */, 0 /* right padding */,
375 0 /* bottom padding */, 0 /* left padding */,
376 1 /* kernel height */, 1 /* kernel width */,
377 1 /* subsampling height */, 1 /* subsampling width */,
378 1 /* dilation_height */, 1 /* dilation_width */,
379 1 /* groups */,
380 128 /* input channels per group */,
381 128 /* output_channels_per_group */,
382 128 /* input pixel stride */,
383 128 /* output pixel stride */,
384 w42.data(), w43.data(),
385 0.0f /* output min */, 6.0f /* output max */,
386 0 /* flags */,
387 &caches,
388 &op6);
389 if (status != xnn_status_success) {
390 std::cerr << "failed to create operation #6" << std::endl;
391 return ExecutionPlan();
392 }
393 operators.emplace_back(op6, xnn_delete_operator);
394
395 xnn_operator_t op7 = nullptr;
396 status = xnn_create_convolution2d_nchw_f32(
397 1 /* top padding */, 1 /* right padding */,
398 1 /* bottom padding */, 1 /* left padding */,
399 3 /* kernel height */, 3 /* kernel width */,
400 2 /* subsampling height */, 2 /* subsampling width */,
401 1 /* dilation_height */, 1 /* dilation_width */,
402 128 /* groups */,
403 1 /* input channels per group */,
404 1 /* output_channels_per_group */,
405 128 /* input pixel stride */,
406 128 /* output pixel stride */,
407 w44.data(), w45.data(),
408 0.0f /* output min */, 6.0f /* output max */,
409 0 /* flags */,
410 &caches,
411 &op7);
412 if (status != xnn_status_success) {
413 std::cerr << "failed to create operation #7" << std::endl;
414 return ExecutionPlan();
415 }
416 operators.emplace_back(op7, xnn_delete_operator);
417
418 xnn_operator_t op8 = nullptr;
419 status = xnn_create_convolution2d_nchw_f32(
420 0 /* top padding */, 0 /* right padding */,
421 0 /* bottom padding */, 0 /* left padding */,
422 1 /* kernel height */, 1 /* kernel width */,
423 1 /* subsampling height */, 1 /* subsampling width */,
424 1 /* dilation_height */, 1 /* dilation_width */,
425 1 /* groups */,
426 128 /* input channels per group */,
427 256 /* output_channels_per_group */,
428 128 /* input pixel stride */,
429 256 /* output pixel stride */,
430 w46.data(), w47.data(),
431 0.0f /* output min */, 6.0f /* output max */,
432 0 /* flags */,
433 &caches,
434 &op8);
435 if (status != xnn_status_success) {
436 std::cerr << "failed to create operation #8" << std::endl;
437 return ExecutionPlan();
438 }
439 operators.emplace_back(op8, xnn_delete_operator);
440
441 xnn_operator_t op9 = nullptr;
442 status = xnn_create_convolution2d_nchw_f32(
443 1 /* top padding */, 1 /* right padding */,
444 1 /* bottom padding */, 1 /* left padding */,
445 3 /* kernel height */, 3 /* kernel width */,
446 1 /* subsampling height */, 1 /* subsampling width */,
447 1 /* dilation_height */, 1 /* dilation_width */,
448 256 /* groups */,
449 1 /* input channels per group */,
450 1 /* output_channels_per_group */,
451 256 /* input pixel stride */,
452 256 /* output pixel stride */,
453 w48.data(), w49.data(),
454 0.0f /* output min */, 6.0f /* output max */,
455 0 /* flags */,
456 &caches,
457 &op9);
458 if (status != xnn_status_success) {
459 std::cerr << "failed to create operation #9" << std::endl;
460 return ExecutionPlan();
461 }
462 operators.emplace_back(op9, xnn_delete_operator);
463
464 xnn_operator_t op10 = nullptr;
465 status = xnn_create_convolution2d_nchw_f32(
466 0 /* top padding */, 0 /* right padding */,
467 0 /* bottom padding */, 0 /* left padding */,
468 1 /* kernel height */, 1 /* kernel width */,
469 1 /* subsampling height */, 1 /* subsampling width */,
470 1 /* dilation_height */, 1 /* dilation_width */,
471 1 /* groups */,
472 256 /* input channels per group */,
473 256 /* output_channels_per_group */,
474 256 /* input pixel stride */,
475 256 /* output pixel stride */,
476 w50.data(), w51.data(),
477 0.0f /* output min */, 6.0f /* output max */,
478 0 /* flags */,
479 &caches,
480 &op10);
481 if (status != xnn_status_success) {
482 std::cerr << "failed to create operation #10" << std::endl;
483 return ExecutionPlan();
484 }
485 operators.emplace_back(op10, xnn_delete_operator);
486
487 xnn_operator_t op11 = nullptr;
488 status = xnn_create_convolution2d_nchw_f32(
489 1 /* top padding */, 1 /* right padding */,
490 1 /* bottom padding */, 1 /* left padding */,
491 3 /* kernel height */, 3 /* kernel width */,
492 2 /* subsampling height */, 2 /* subsampling width */,
493 1 /* dilation_height */, 1 /* dilation_width */,
494 256 /* groups */,
495 1 /* input channels per group */,
496 1 /* output_channels_per_group */,
497 256 /* input pixel stride */,
498 256 /* output pixel stride */,
499 w52.data(), w53.data(),
500 0.0f /* output min */, 6.0f /* output max */,
501 0 /* flags */,
502 &caches,
503 &op11);
504 if (status != xnn_status_success) {
505 std::cerr << "failed to create operation #11" << std::endl;
506 return ExecutionPlan();
507 }
508 operators.emplace_back(op11, xnn_delete_operator);
509
510 xnn_operator_t op12 = nullptr;
511 status = xnn_create_convolution2d_nchw_f32(
512 0 /* top padding */, 0 /* right padding */,
513 0 /* bottom padding */, 0 /* left padding */,
514 1 /* kernel height */, 1 /* kernel width */,
515 1 /* subsampling height */, 1 /* subsampling width */,
516 1 /* dilation_height */, 1 /* dilation_width */,
517 1 /* groups */,
518 256 /* input channels per group */,
519 512 /* output_channels_per_group */,
520 256 /* input pixel stride */,
521 512 /* output pixel stride */,
522 w54.data(), w55.data(),
523 0.0f /* output min */, 6.0f /* output max */,
524 0 /* flags */,
525 &caches,
526 &op12);
527 if (status != xnn_status_success) {
528 std::cerr << "failed to create operation #12" << std::endl;
529 return ExecutionPlan();
530 }
531 operators.emplace_back(op12, xnn_delete_operator);
532
533 xnn_operator_t op13 = nullptr;
534 status = xnn_create_convolution2d_nchw_f32(
535 1 /* top padding */, 1 /* right padding */,
536 1 /* bottom padding */, 1 /* left padding */,
537 3 /* kernel height */, 3 /* kernel width */,
538 1 /* subsampling height */, 1 /* subsampling width */,
539 1 /* dilation_height */, 1 /* dilation_width */,
540 512 /* groups */,
541 1 /* input channels per group */,
542 1 /* output_channels_per_group */,
543 512 /* input pixel stride */,
544 512 /* output pixel stride */,
545 w56.data(), w57.data(),
546 0.0f /* output min */, 6.0f /* output max */,
547 0 /* flags */,
548 &caches,
549 &op13);
550 if (status != xnn_status_success) {
551 std::cerr << "failed to create operation #13" << std::endl;
552 return ExecutionPlan();
553 }
554 operators.emplace_back(op13, xnn_delete_operator);
555
556 xnn_operator_t op14 = nullptr;
557 status = xnn_create_convolution2d_nchw_f32(
558 0 /* top padding */, 0 /* right padding */,
559 0 /* bottom padding */, 0 /* left padding */,
560 1 /* kernel height */, 1 /* kernel width */,
561 1 /* subsampling height */, 1 /* subsampling width */,
562 1 /* dilation_height */, 1 /* dilation_width */,
563 1 /* groups */,
564 512 /* input channels per group */,
565 512 /* output_channels_per_group */,
566 512 /* input pixel stride */,
567 512 /* output pixel stride */,
568 w58.data(), w59.data(),
569 0.0f /* output min */, 6.0f /* output max */,
570 0 /* flags */,
571 &caches,
572 &op14);
573 if (status != xnn_status_success) {
574 std::cerr << "failed to create operation #14" << std::endl;
575 return ExecutionPlan();
576 }
577 operators.emplace_back(op14, xnn_delete_operator);
578
579 xnn_operator_t op15 = nullptr;
580 status = xnn_create_convolution2d_nchw_f32(
581 1 /* top padding */, 1 /* right padding */,
582 1 /* bottom padding */, 1 /* left padding */,
583 3 /* kernel height */, 3 /* kernel width */,
584 1 /* subsampling height */, 1 /* subsampling width */,
585 1 /* dilation_height */, 1 /* dilation_width */,
586 512 /* groups */,
587 1 /* input channels per group */,
588 1 /* output_channels_per_group */,
589 512 /* input pixel stride */,
590 512 /* output pixel stride */,
591 w60.data(), w61.data(),
592 0.0f /* output min */, 6.0f /* output max */,
593 0 /* flags */,
594 &caches,
595 &op15);
596 if (status != xnn_status_success) {
597 std::cerr << "failed to create operation #15" << std::endl;
598 return ExecutionPlan();
599 }
600 operators.emplace_back(op15, xnn_delete_operator);
601
602 xnn_operator_t op16 = nullptr;
603 status = xnn_create_convolution2d_nchw_f32(
604 0 /* top padding */, 0 /* right padding */,
605 0 /* bottom padding */, 0 /* left padding */,
606 1 /* kernel height */, 1 /* kernel width */,
607 1 /* subsampling height */, 1 /* subsampling width */,
608 1 /* dilation_height */, 1 /* dilation_width */,
609 1 /* groups */,
610 512 /* input channels per group */,
611 512 /* output_channels_per_group */,
612 512 /* input pixel stride */,
613 512 /* output pixel stride */,
614 w62.data(), w63.data(),
615 0.0f /* output min */, 6.0f /* output max */,
616 0 /* flags */,
617 &caches,
618 &op16);
619 if (status != xnn_status_success) {
620 std::cerr << "failed to create operation #16" << std::endl;
621 return ExecutionPlan();
622 }
623 operators.emplace_back(op16, xnn_delete_operator);
624
625 xnn_operator_t op17 = nullptr;
626 status = xnn_create_convolution2d_nchw_f32(
627 1 /* top padding */, 1 /* right padding */,
628 1 /* bottom padding */, 1 /* left padding */,
629 3 /* kernel height */, 3 /* kernel width */,
630 1 /* subsampling height */, 1 /* subsampling width */,
631 1 /* dilation_height */, 1 /* dilation_width */,
632 512 /* groups */,
633 1 /* input channels per group */,
634 1 /* output_channels_per_group */,
635 512 /* input pixel stride */,
636 512 /* output pixel stride */,
637 w64.data(), w65.data(),
638 0.0f /* output min */, 6.0f /* output max */,
639 0 /* flags */,
640 &caches,
641 &op17);
642 if (status != xnn_status_success) {
643 std::cerr << "failed to create operation #17" << std::endl;
644 return ExecutionPlan();
645 }
646 operators.emplace_back(op17, xnn_delete_operator);
647
648 xnn_operator_t op18 = nullptr;
649 status = xnn_create_convolution2d_nchw_f32(
650 0 /* top padding */, 0 /* right padding */,
651 0 /* bottom padding */, 0 /* left padding */,
652 1 /* kernel height */, 1 /* kernel width */,
653 1 /* subsampling height */, 1 /* subsampling width */,
654 1 /* dilation_height */, 1 /* dilation_width */,
655 1 /* groups */,
656 512 /* input channels per group */,
657 512 /* output_channels_per_group */,
658 512 /* input pixel stride */,
659 512 /* output pixel stride */,
660 w66.data(), w67.data(),
661 0.0f /* output min */, 6.0f /* output max */,
662 0 /* flags */,
663 &caches,
664 &op18);
665 if (status != xnn_status_success) {
666 std::cerr << "failed to create operation #18" << std::endl;
667 return ExecutionPlan();
668 }
669 operators.emplace_back(op18, xnn_delete_operator);
670
671 xnn_operator_t op19 = nullptr;
672 status = xnn_create_convolution2d_nchw_f32(
673 1 /* top padding */, 1 /* right padding */,
674 1 /* bottom padding */, 1 /* left padding */,
675 3 /* kernel height */, 3 /* kernel width */,
676 1 /* subsampling height */, 1 /* subsampling width */,
677 1 /* dilation_height */, 1 /* dilation_width */,
678 512 /* groups */,
679 1 /* input channels per group */,
680 1 /* output_channels_per_group */,
681 512 /* input pixel stride */,
682 512 /* output pixel stride */,
683 w68.data(), w69.data(),
684 0.0f /* output min */, 6.0f /* output max */,
685 0 /* flags */,
686 &caches,
687 &op19);
688 if (status != xnn_status_success) {
689 std::cerr << "failed to create operation #19" << std::endl;
690 return ExecutionPlan();
691 }
692 operators.emplace_back(op19, xnn_delete_operator);
693
694 xnn_operator_t op20 = nullptr;
695 status = xnn_create_convolution2d_nchw_f32(
696 0 /* top padding */, 0 /* right padding */,
697 0 /* bottom padding */, 0 /* left padding */,
698 1 /* kernel height */, 1 /* kernel width */,
699 1 /* subsampling height */, 1 /* subsampling width */,
700 1 /* dilation_height */, 1 /* dilation_width */,
701 1 /* groups */,
702 512 /* input channels per group */,
703 512 /* output_channels_per_group */,
704 512 /* input pixel stride */,
705 512 /* output pixel stride */,
706 w70.data(), w71.data(),
707 0.0f /* output min */, 6.0f /* output max */,
708 0 /* flags */,
709 &caches,
710 &op20);
711 if (status != xnn_status_success) {
712 std::cerr << "failed to create operation #20" << std::endl;
713 return ExecutionPlan();
714 }
715 operators.emplace_back(op20, xnn_delete_operator);
716
717 xnn_operator_t op21 = nullptr;
718 status = xnn_create_convolution2d_nchw_f32(
719 1 /* top padding */, 1 /* right padding */,
720 1 /* bottom padding */, 1 /* left padding */,
721 3 /* kernel height */, 3 /* kernel width */,
722 1 /* subsampling height */, 1 /* subsampling width */,
723 1 /* dilation_height */, 1 /* dilation_width */,
724 512 /* groups */,
725 1 /* input channels per group */,
726 1 /* output_channels_per_group */,
727 512 /* input pixel stride */,
728 512 /* output pixel stride */,
729 w72.data(), w73.data(),
730 0.0f /* output min */, 6.0f /* output max */,
731 0 /* flags */,
732 &caches,
733 &op21);
734 if (status != xnn_status_success) {
735 std::cerr << "failed to create operation #21" << std::endl;
736 return ExecutionPlan();
737 }
738 operators.emplace_back(op21, xnn_delete_operator);
739
740 xnn_operator_t op22 = nullptr;
741 status = xnn_create_convolution2d_nchw_f32(
742 0 /* top padding */, 0 /* right padding */,
743 0 /* bottom padding */, 0 /* left padding */,
744 1 /* kernel height */, 1 /* kernel width */,
745 1 /* subsampling height */, 1 /* subsampling width */,
746 1 /* dilation_height */, 1 /* dilation_width */,
747 1 /* groups */,
748 512 /* input channels per group */,
749 512 /* output_channels_per_group */,
750 512 /* input pixel stride */,
751 512 /* output pixel stride */,
752 w74.data(), w75.data(),
753 0.0f /* output min */, 6.0f /* output max */,
754 0 /* flags */,
755 &caches,
756 &op22);
757 if (status != xnn_status_success) {
758 std::cerr << "failed to create operation #22" << std::endl;
759 return ExecutionPlan();
760 }
761 operators.emplace_back(op22, xnn_delete_operator);
762
763 xnn_operator_t op23 = nullptr;
764 status = xnn_create_convolution2d_nchw_f32(
765 1 /* top padding */, 1 /* right padding */,
766 1 /* bottom padding */, 1 /* left padding */,
767 3 /* kernel height */, 3 /* kernel width */,
768 2 /* subsampling height */, 2 /* subsampling width */,
769 1 /* dilation_height */, 1 /* dilation_width */,
770 512 /* groups */,
771 1 /* input channels per group */,
772 1 /* output_channels_per_group */,
773 512 /* input pixel stride */,
774 512 /* output pixel stride */,
775 w76.data(), w77.data(),
776 0.0f /* output min */, 6.0f /* output max */,
777 0 /* flags */,
778 &caches,
779 &op23);
780 if (status != xnn_status_success) {
781 std::cerr << "failed to create operation #23" << std::endl;
782 return ExecutionPlan();
783 }
784 operators.emplace_back(op23, xnn_delete_operator);
785
786 xnn_operator_t op24 = nullptr;
787 status = xnn_create_convolution2d_nchw_f32(
788 0 /* top padding */, 0 /* right padding */,
789 0 /* bottom padding */, 0 /* left padding */,
790 1 /* kernel height */, 1 /* kernel width */,
791 1 /* subsampling height */, 1 /* subsampling width */,
792 1 /* dilation_height */, 1 /* dilation_width */,
793 1 /* groups */,
794 512 /* input channels per group */,
795 1024 /* output_channels_per_group */,
796 512 /* input pixel stride */,
797 1024 /* output pixel stride */,
798 w78.data(), w79.data(),
799 0.0f /* output min */, 6.0f /* output max */,
800 0 /* flags */,
801 &caches,
802 &op24);
803 if (status != xnn_status_success) {
804 std::cerr << "failed to create operation #24" << std::endl;
805 return ExecutionPlan();
806 }
807 operators.emplace_back(op24, xnn_delete_operator);
808
809 xnn_operator_t op25 = nullptr;
810 status = xnn_create_convolution2d_nchw_f32(
811 1 /* top padding */, 1 /* right padding */,
812 1 /* bottom padding */, 1 /* left padding */,
813 3 /* kernel height */, 3 /* kernel width */,
814 1 /* subsampling height */, 1 /* subsampling width */,
815 1 /* dilation_height */, 1 /* dilation_width */,
816 1024 /* groups */,
817 1 /* input channels per group */,
818 1 /* output_channels_per_group */,
819 1024 /* input pixel stride */,
820 1024 /* output pixel stride */,
821 w80.data(), w81.data(),
822 0.0f /* output min */, 6.0f /* output max */,
823 0 /* flags */,
824 &caches,
825 &op25);
826 if (status != xnn_status_success) {
827 std::cerr << "failed to create operation #25" << std::endl;
828 return ExecutionPlan();
829 }
830 operators.emplace_back(op25, xnn_delete_operator);
831
832 xnn_operator_t op26 = nullptr;
833 status = xnn_create_convolution2d_nchw_f32(
834 0 /* top padding */, 0 /* right padding */,
835 0 /* bottom padding */, 0 /* left padding */,
836 1 /* kernel height */, 1 /* kernel width */,
837 1 /* subsampling height */, 1 /* subsampling width */,
838 1 /* dilation_height */, 1 /* dilation_width */,
839 1 /* groups */,
840 1024 /* input channels per group */,
841 1024 /* output_channels_per_group */,
842 1024 /* input pixel stride */,
843 1024 /* output pixel stride */,
844 w82.data(), w83.data(),
845 0.0f /* output min */, 6.0f /* output max */,
846 0 /* flags */,
847 &caches,
848 &op26);
849 if (status != xnn_status_success) {
850 std::cerr << "failed to create operation #26" << std::endl;
851 return ExecutionPlan();
852 }
853 operators.emplace_back(op26, xnn_delete_operator);
854
855 xnn_operator_t op27 = nullptr;
856 status = xnn_create_global_average_pooling_ncw_f32(
857 1024 /* channels */,
858 -std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(),
859 0 /* flags */,
860 &op27);
861 if (status != xnn_status_success) {
862 std::cerr << "failed to create operation #27" << std::endl;
863 return ExecutionPlan();
864 }
865 operators.emplace_back(op27, xnn_delete_operator);
866
867 xnn_operator_t op28 = nullptr;
868 status = xnn_create_convolution2d_nhwc_f32(
869 0 /* top padding */, 0 /* right padding */,
870 0 /* bottom padding */, 0 /* left padding */,
871 1 /* kernel height */, 1 /* kernel width */,
872 1 /* subsampling height */, 1 /* subsampling width */,
873 1 /* dilation_height */, 1 /* dilation_width */,
874 1 /* groups */,
875 1024 /* input channels per group */,
876 1001 /* output_channels_per_group */,
877 1024 /* input pixel stride */,
878 1001 /* output pixel stride */,
879 w84.data(), w85.data(),
880 -std::numeric_limits<float>::infinity() /* output min */, std::numeric_limits<float>::infinity() /* output max */,
881 0 /* flags */,
882 &caches,
883 &op28);
884 if (status != xnn_status_success) {
885 std::cerr << "failed to create operation #28" << std::endl;
886 return ExecutionPlan();
887 }
888 operators.emplace_back(op28, xnn_delete_operator);
889
890 #if XNN_PLATFORM_JIT
891 xnn_finalize_code_memory(&code_cache.cache.code);
892 #endif
893
894 status = xnn_setup_convolution2d_nchw_f32(
895 op0,
896 1 /* batch size */, 224 /* input height */, 224 /* input width */,
897 v0.data() /* input */, v1.data() /* output */,
898 threadpool /* threadpool */);
899 if (status != xnn_status_success) {
900 std::cerr << "failed to setup operation #0" << std::endl;
901 return ExecutionPlan();
902 }
903
904 status = xnn_setup_convolution2d_nchw_f32(
905 op1,
906 1 /* batch size */, 112 /* input height */, 112 /* input width */,
907 v1.data() /* input */, v2.data() /* output */,
908 threadpool /* threadpool */);
909 if (status != xnn_status_success) {
910 std::cerr << "failed to setup operation #1" << std::endl;
911 return ExecutionPlan();
912 }
913
914 status = xnn_setup_convolution2d_nchw_f32(
915 op2,
916 1 /* batch size */, 112 /* input height */, 112 /* input width */,
917 v2.data() /* input */, v3.data() /* output */,
918 threadpool /* threadpool */);
919 if (status != xnn_status_success) {
920 std::cerr << "failed to setup operation #2" << std::endl;
921 return ExecutionPlan();
922 }
923
924 status = xnn_setup_convolution2d_nchw_f32(
925 op3,
926 1 /* batch size */, 112 /* input height */, 112 /* input width */,
927 v3.data() /* input */, v4.data() /* output */,
928 threadpool /* threadpool */);
929 if (status != xnn_status_success) {
930 std::cerr << "failed to setup operation #3" << std::endl;
931 return ExecutionPlan();
932 }
933
934 status = xnn_setup_convolution2d_nchw_f32(
935 op4,
936 1 /* batch size */, 56 /* input height */, 56 /* input width */,
937 v4.data() /* input */, v5.data() /* output */,
938 threadpool /* threadpool */);
939 if (status != xnn_status_success) {
940 std::cerr << "failed to setup operation #4" << std::endl;
941 return ExecutionPlan();
942 }
943
944 status = xnn_setup_convolution2d_nchw_f32(
945 op5,
946 1 /* batch size */, 56 /* input height */, 56 /* input width */,
947 v5.data() /* input */, v6.data() /* output */,
948 threadpool /* threadpool */);
949 if (status != xnn_status_success) {
950 std::cerr << "failed to setup operation #5" << std::endl;
951 return ExecutionPlan();
952 }
953
954 status = xnn_setup_convolution2d_nchw_f32(
955 op6,
956 1 /* batch size */, 56 /* input height */, 56 /* input width */,
957 v6.data() /* input */, v7.data() /* output */,
958 threadpool /* threadpool */);
959 if (status != xnn_status_success) {
960 std::cerr << "failed to setup operation #6" << std::endl;
961 return ExecutionPlan();
962 }
963
964 status = xnn_setup_convolution2d_nchw_f32(
965 op7,
966 1 /* batch size */, 56 /* input height */, 56 /* input width */,
967 v7.data() /* input */, v8.data() /* output */,
968 threadpool /* threadpool */);
969 if (status != xnn_status_success) {
970 std::cerr << "failed to setup operation #7" << std::endl;
971 return ExecutionPlan();
972 }
973
974 status = xnn_setup_convolution2d_nchw_f32(
975 op8,
976 1 /* batch size */, 28 /* input height */, 28 /* input width */,
977 v8.data() /* input */, v9.data() /* output */,
978 threadpool /* threadpool */);
979 if (status != xnn_status_success) {
980 std::cerr << "failed to setup operation #8" << std::endl;
981 return ExecutionPlan();
982 }
983
984 status = xnn_setup_convolution2d_nchw_f32(
985 op9,
986 1 /* batch size */, 28 /* input height */, 28 /* input width */,
987 v9.data() /* input */, v10.data() /* output */,
988 threadpool /* threadpool */);
989 if (status != xnn_status_success) {
990 std::cerr << "failed to setup operation #9" << std::endl;
991 return ExecutionPlan();
992 }
993
994 status = xnn_setup_convolution2d_nchw_f32(
995 op10,
996 1 /* batch size */, 28 /* input height */, 28 /* input width */,
997 v10.data() /* input */, v11.data() /* output */,
998 threadpool /* threadpool */);
999 if (status != xnn_status_success) {
1000 std::cerr << "failed to setup operation #10" << std::endl;
1001 return ExecutionPlan();
1002 }
1003
1004 status = xnn_setup_convolution2d_nchw_f32(
1005 op11,
1006 1 /* batch size */, 28 /* input height */, 28 /* input width */,
1007 v11.data() /* input */, v12.data() /* output */,
1008 threadpool /* threadpool */);
1009 if (status != xnn_status_success) {
1010 std::cerr << "failed to setup operation #11" << std::endl;
1011 return ExecutionPlan();
1012 }
1013
1014 status = xnn_setup_convolution2d_nchw_f32(
1015 op12,
1016 1 /* batch size */, 14 /* input height */, 14 /* input width */,
1017 v12.data() /* input */, v13.data() /* output */,
1018 threadpool /* threadpool */);
1019 if (status != xnn_status_success) {
1020 std::cerr << "failed to setup operation #12" << std::endl;
1021 return ExecutionPlan();
1022 }
1023
1024 status = xnn_setup_convolution2d_nchw_f32(
1025 op13,
1026 1 /* batch size */, 14 /* input height */, 14 /* input width */,
1027 v13.data() /* input */, v14.data() /* output */,
1028 threadpool /* threadpool */);
1029 if (status != xnn_status_success) {
1030 std::cerr << "failed to setup operation #13" << std::endl;
1031 return ExecutionPlan();
1032 }
1033
1034 status = xnn_setup_convolution2d_nchw_f32(
1035 op14,
1036 1 /* batch size */, 14 /* input height */, 14 /* input width */,
1037 v14.data() /* input */, v15.data() /* output */,
1038 threadpool /* threadpool */);
1039 if (status != xnn_status_success) {
1040 std::cerr << "failed to setup operation #14" << std::endl;
1041 return ExecutionPlan();
1042 }
1043
1044 status = xnn_setup_convolution2d_nchw_f32(
1045 op15,
1046 1 /* batch size */, 14 /* input height */, 14 /* input width */,
1047 v15.data() /* input */, v16.data() /* output */,
1048 threadpool /* threadpool */);
1049 if (status != xnn_status_success) {
1050 std::cerr << "failed to setup operation #15" << std::endl;
1051 return ExecutionPlan();
1052 }
1053
1054 status = xnn_setup_convolution2d_nchw_f32(
1055 op16,
1056 1 /* batch size */, 14 /* input height */, 14 /* input width */,
1057 v16.data() /* input */, v17.data() /* output */,
1058 threadpool /* threadpool */);
1059 if (status != xnn_status_success) {
1060 std::cerr << "failed to setup operation #16" << std::endl;
1061 return ExecutionPlan();
1062 }
1063
1064 status = xnn_setup_convolution2d_nchw_f32(
1065 op17,
1066 1 /* batch size */, 14 /* input height */, 14 /* input width */,
1067 v17.data() /* input */, v18.data() /* output */,
1068 threadpool /* threadpool */);
1069 if (status != xnn_status_success) {
1070 std::cerr << "failed to setup operation #17" << std::endl;
1071 return ExecutionPlan();
1072 }
1073
1074 status = xnn_setup_convolution2d_nchw_f32(
1075 op18,
1076 1 /* batch size */, 14 /* input height */, 14 /* input width */,
1077 v18.data() /* input */, v19.data() /* output */,
1078 threadpool /* threadpool */);
1079 if (status != xnn_status_success) {
1080 std::cerr << "failed to setup operation #18" << std::endl;
1081 return ExecutionPlan();
1082 }
1083
1084 status = xnn_setup_convolution2d_nchw_f32(
1085 op19,
1086 1 /* batch size */, 14 /* input height */, 14 /* input width */,
1087 v19.data() /* input */, v20.data() /* output */,
1088 threadpool /* threadpool */);
1089 if (status != xnn_status_success) {
1090 std::cerr << "failed to setup operation #19" << std::endl;
1091 return ExecutionPlan();
1092 }
1093
1094 status = xnn_setup_convolution2d_nchw_f32(
1095 op20,
1096 1 /* batch size */, 14 /* input height */, 14 /* input width */,
1097 v20.data() /* input */, v21.data() /* output */,
1098 threadpool /* threadpool */);
1099 if (status != xnn_status_success) {
1100 std::cerr << "failed to setup operation #20" << std::endl;
1101 return ExecutionPlan();
1102 }
1103
1104 status = xnn_setup_convolution2d_nchw_f32(
1105 op21,
1106 1 /* batch size */, 14 /* input height */, 14 /* input width */,
1107 v21.data() /* input */, v22.data() /* output */,
1108 threadpool /* threadpool */);
1109 if (status != xnn_status_success) {
1110 std::cerr << "failed to setup operation #21" << std::endl;
1111 return ExecutionPlan();
1112 }
1113
1114 status = xnn_setup_convolution2d_nchw_f32(
1115 op22,
1116 1 /* batch size */, 14 /* input height */, 14 /* input width */,
1117 v22.data() /* input */, v23.data() /* output */,
1118 threadpool /* threadpool */);
1119 if (status != xnn_status_success) {
1120 std::cerr << "failed to setup operation #22" << std::endl;
1121 return ExecutionPlan();
1122 }
1123
1124 status = xnn_setup_convolution2d_nchw_f32(
1125 op23,
1126 1 /* batch size */, 14 /* input height */, 14 /* input width */,
1127 v23.data() /* input */, v24.data() /* output */,
1128 threadpool /* threadpool */);
1129 if (status != xnn_status_success) {
1130 std::cerr << "failed to setup operation #23" << std::endl;
1131 return ExecutionPlan();
1132 }
1133
1134 status = xnn_setup_convolution2d_nchw_f32(
1135 op24,
1136 1 /* batch size */, 7 /* input height */, 7 /* input width */,
1137 v24.data() /* input */, v25.data() /* output */,
1138 threadpool /* threadpool */);
1139 if (status != xnn_status_success) {
1140 std::cerr << "failed to setup operation #24" << std::endl;
1141 return ExecutionPlan();
1142 }
1143
1144 status = xnn_setup_convolution2d_nchw_f32(
1145 op25,
1146 1 /* batch size */, 7 /* input height */, 7 /* input width */,
1147 v25.data() /* input */, v26.data() /* output */,
1148 threadpool /* threadpool */);
1149 if (status != xnn_status_success) {
1150 std::cerr << "failed to setup operation #25" << std::endl;
1151 return ExecutionPlan();
1152 }
1153
1154 status = xnn_setup_convolution2d_nchw_f32(
1155 op26,
1156 1 /* batch size */, 7 /* input height */, 7 /* input width */,
1157 v26.data() /* input */, v27.data() /* output */,
1158 threadpool /* threadpool */);
1159 if (status != xnn_status_success) {
1160 std::cerr << "failed to setup operation #26" << std::endl;
1161 return ExecutionPlan();
1162 }
1163
1164 status = xnn_setup_global_average_pooling_ncw_f32(
1165 op27,
1166 1 /* batch size */, 49 /* width */,
1167 v27.data() /* input */, v28.data() /* output */,
1168 threadpool /* threadpool */);
1169 if (status != xnn_status_success) {
1170 std::cerr << "failed to setup operation #27" << std::endl;
1171 return ExecutionPlan();
1172 }
1173
1174 status = xnn_setup_convolution2d_nhwc_f32(
1175 op28,
1176 1 /* batch size */, 1 /* input height */, 1 /* input width */,
1177 v28.data() /* input */, v29.data() /* output */,
1178 threadpool /* threadpool */);
1179 if (status != xnn_status_success) {
1180 std::cerr << "failed to setup operation #28" << std::endl;
1181 return ExecutionPlan();
1182 }
1183
1184 #pragma clang diagnostic push
1185 #pragma clang diagnostic ignored "-Wpessimizing-move"
1186 return operators;
1187 #pragma clang diagnostic pop
1188 }
1189
1190 } // namespace models
1191