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.

roi_copy.h 1.9 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /**
  2. * \file dnn/test/common/roi_copy.h
  3. * MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
  4. *
  5. * Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
  6. *
  7. * Unless required by applicable law or agreed to in writing,
  8. * software distributed under the License is distributed on an
  9. * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. */
  11. #pragma once
  12. #include "megdnn/basic_types.h"
  13. #include "megdnn/opr_param_defs.h"
  14. namespace megdnn {
  15. namespace test {
  16. namespace roi_copy {
  17. struct TestArg {
  18. param::ROICopy param;
  19. TensorShape src;
  20. TestArg(param::ROICopy param_, TensorShape src_) : param(param_), src(src_) {}
  21. };
  22. static inline std::vector<TestArg> get_args() {
  23. std::vector<TestArg> args;
  24. param::ROICopy cur_param;
  25. cur_param.row_from = 2;
  26. cur_param.row_to = 5;
  27. cur_param.col_from = 3;
  28. cur_param.col_to = 5;
  29. //! Inner region
  30. args.emplace_back(cur_param, TensorShape{2, 7, 8, 1});
  31. args.emplace_back(cur_param, TensorShape{2, 7, 8, 3});
  32. //! row start from begin
  33. cur_param.row_from = 0;
  34. args.emplace_back(cur_param, TensorShape{2, 7, 8, 1});
  35. args.emplace_back(cur_param, TensorShape{2, 7, 8, 3});
  36. //! col start from begin
  37. cur_param.col_from = 0;
  38. args.emplace_back(cur_param, TensorShape{2, 7, 8, 1});
  39. args.emplace_back(cur_param, TensorShape{2, 7, 8, 3});
  40. //! col end to the end
  41. cur_param.col_to = 8;
  42. args.emplace_back(cur_param, TensorShape{2, 7, 8, 1});
  43. args.emplace_back(cur_param, TensorShape{2, 7, 8, 3});
  44. //! row end to the end
  45. cur_param.row_to = 7;
  46. args.emplace_back(cur_param, TensorShape{2, 7, 8, 1});
  47. args.emplace_back(cur_param, TensorShape{2, 7, 8, 3});
  48. return args;
  49. }
  50. } // namespace roi_copy
  51. } // namespace test
  52. } // namespace megdnn
  53. // vim: syntax=cpp.doxygen