| 304 | } |
| 305 | |
| 306 | std::vector<TestArg> get_quantized_args_with_nlmode( |
| 307 | param::ConvBias::NonlineMode nlmode) { |
| 308 | std::vector<TestArg> args; |
| 309 | param::ConvBias cur_param; |
| 310 | |
| 311 | // clang-format off |
| 312 | for (auto mode : {param::ConvBias::Mode::CROSS_CORRELATION, |
| 313 | param::ConvBias::Mode::CONVOLUTION}) { |
| 314 | for (size_t ic : {1, 2, 3, 4, 5, 7}) { |
| 315 | for (size_t oc : {1, 2, 3, 4, 5, 7}) { |
| 316 | for (size_t i : {9, 63}) { |
| 317 | cur_param.mode = mode; |
| 318 | cur_param.nonlineMode = nlmode; |
| 319 | |
| 320 | cur_param.sparse = param::ConvBias::Sparse::DENSE; |
| 321 | cur_param.pad_h = cur_param.pad_w = 1; |
| 322 | |
| 323 | //! no bias |
| 324 | args.emplace_back(cur_param, TensorShape{2, ic, i, i}, |
| 325 | TensorShape{oc, ic, 3, 3}, TensorShape{}); |
| 326 | |
| 327 | //! bias |
| 328 | args.emplace_back(cur_param, TensorShape{2, ic, i, i}, |
| 329 | TensorShape{oc, ic, 3, 3}, TensorShape{2, oc, i, i}); |
| 330 | |
| 331 | //! bias channel |
| 332 | args.emplace_back(cur_param, TensorShape{2, ic, i, i}, |
| 333 | TensorShape{oc, ic, 3, 3}, TensorShape{1, oc, 1, 1}); |
| 334 | |
| 335 | cur_param.sparse = param::ConvBias::Sparse::GROUP; |
| 336 | args.emplace_back(cur_param, TensorShape{2, 2 * ic, i, i}, |
| 337 | TensorShape{2, oc, ic, 3, 3}, |
| 338 | TensorShape{2, 2 * oc, i, i}); |
| 339 | |
| 340 | args.emplace_back(cur_param, TensorShape{2, 2 * ic, i, i}, |
| 341 | TensorShape{2, oc, ic, 3, 3}, |
| 342 | TensorShape{1, 2 * oc, 1, 1}); |
| 343 | |
| 344 | cur_param.sparse = param::ConvBias::Sparse::DENSE; |
| 345 | cur_param.pad_h = cur_param.pad_w = 0; |
| 346 | args.emplace_back(cur_param, TensorShape{2, ic, i, i}, |
| 347 | TensorShape{oc, ic, 1, 1}, TensorShape{}); |
| 348 | } } } } |
| 349 | // clang-format on |
| 350 | |
| 351 | return args; |
| 352 | } |
| 353 | |
| 354 | std::vector<TestArg> get_quantized_args() { |
| 355 | using NLMode = param::ConvBias::NonlineMode; |
no test coverage detected