You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

gaussian_blur.h 2.2 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #pragma once
  2. #include "megdnn/basic_types.h"
  3. #include "megdnn/opr_param_defs.h"
  4. namespace megdnn {
  5. namespace test {
  6. namespace gaussian_blur {
  7. struct TestArg {
  8. param::GaussianBlur param;
  9. TensorShape src;
  10. TestArg(param::GaussianBlur param, TensorShape src) : param(param), src(src) {}
  11. };
  12. inline static std::vector<TestArg> get_args() {
  13. std::vector<TestArg> args;
  14. param::GaussianBlur cur_param;
  15. for (size_t i : {8, 11}) {
  16. for (size_t j : {8, 23}) {
  17. for (size_t kh = 3; kh <= 9; kh += 2) {
  18. for (size_t kw = 3; kw <= 9; kw += 2) {
  19. cur_param.kernel_height = kh;
  20. cur_param.kernel_width = kw;
  21. cur_param.border_mode =
  22. param::GaussianBlur::BorderMode::BORDER_REPLICATE;
  23. args.emplace_back(cur_param, TensorShape{1, i, j, 1});
  24. args.emplace_back(cur_param, TensorShape{3, i, j, 3});
  25. cur_param.border_mode =
  26. param::GaussianBlur::BorderMode::BORDER_REFLECT;
  27. args.emplace_back(cur_param, TensorShape{3, i, j, 3});
  28. args.emplace_back(cur_param, TensorShape{3, i, j, 1});
  29. cur_param.border_mode =
  30. param::GaussianBlur::BorderMode::BORDER_REFLECT_101;
  31. args.emplace_back(cur_param, TensorShape{3, i, j, 3});
  32. args.emplace_back(cur_param, TensorShape{3, i, j, 1});
  33. cur_param.border_mode =
  34. param::GaussianBlur::BorderMode::BORDER_CONSTANT;
  35. args.emplace_back(cur_param, TensorShape{3, i, j, 3});
  36. args.emplace_back(cur_param, TensorShape{3, i, j, 1});
  37. }
  38. }
  39. }
  40. }
  41. cur_param.kernel_height = 0;
  42. cur_param.kernel_width = 0;
  43. cur_param.sigma_x = 0.8;
  44. cur_param.sigma_y = 0.9;
  45. args.emplace_back(cur_param, TensorShape{1, 8, 9, 3});
  46. args.emplace_back(cur_param, TensorShape{1, 8, 9, 1});
  47. return args;
  48. }
  49. } // namespace gaussian_blur
  50. } // namespace test
  51. } // namespace megdnn
  52. // vim: syntax=cpp.doxygen