MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / get_quantized_args_with_nlmode

Function get_quantized_args_with_nlmode

dnn/test/common/conv_bias.cpp:306–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304}
305
306std::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
354std::vector<TestArg> get_quantized_args() {
355 using NLMode = param::ConvBias::NonlineMode;

Callers 1

get_quantized_argsFunction · 0.85

Calls 1

emplace_backMethod · 0.80

Tested by

no test coverage detected