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