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