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.

adaptive_pooling.h 1.4 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. #include <cstddef>
  3. #include "megdnn/basic_types.h"
  4. #include "megdnn/opr_param_defs.h"
  5. namespace megdnn {
  6. namespace test {
  7. namespace adaptive_pooling {
  8. struct TestArg {
  9. param::AdaptivePooling param;
  10. TensorShape ishape;
  11. TensorShape oshape;
  12. TestArg(param::AdaptivePooling param, TensorShape ishape, TensorShape oshape)
  13. : param(param), ishape(ishape), oshape(oshape) {}
  14. };
  15. inline std::vector<TestArg> get_args() {
  16. std::vector<TestArg> args;
  17. using Param = param::AdaptivePooling;
  18. using Mode = param::AdaptivePooling::Mode;
  19. for (size_t i = 36; i < 40; ++i) {
  20. args.emplace_back(
  21. Param{Mode::AVERAGE}, TensorShape{2, 3, i, i + 1},
  22. TensorShape{2, 3, i - 4, i - 2});
  23. args.emplace_back(
  24. Param{Mode::MAX}, TensorShape{2, 3, i, i + 1},
  25. TensorShape{2, 3, i - 4, i - 2});
  26. }
  27. for (size_t i = 5; i < 10; ++i) {
  28. args.emplace_back(
  29. Param{Mode::AVERAGE}, TensorShape{2, 3, i, i + 1},
  30. TensorShape{2, 3, i - 3, i - 2});
  31. args.emplace_back(
  32. Param{Mode::MAX}, TensorShape{2, 3, i, i + 1},
  33. TensorShape{2, 3, i - 3, i - 2});
  34. }
  35. return args;
  36. }
  37. } // namespace adaptive_pooling
  38. } // namespace test
  39. } // namespace megdnn
  40. // vim: syntax=cpp.doxygen