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.

conv_pooling.cpp 1.9 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /**
  2. * \file dnn/test/cuda/conv_pooling.cpp
  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. #include "test/cuda/fixture.h"
  12. #include "megdnn/opr_param_defs.h"
  13. #include "megdnn/oprs.h"
  14. #include "test/common/checker.h"
  15. #include "test/common/conv_pooling.h"
  16. #include "test/common/rng.h"
  17. #include "test/common/tensor.h"
  18. #include "test/common/workspace_wrapper.h"
  19. namespace megdnn {
  20. namespace test {
  21. #if 0
  22. TEST_F(CUDA, CONV_POOLING_FORWARD)
  23. {
  24. using namespace conv_pooling;
  25. std::vector<TestArg> args = get_args();
  26. Checker<ConvPoolingForward> checker(handle_cuda());
  27. NormalRNG default_rng;
  28. ConstValue const_val;
  29. for (auto &&arg: args) {
  30. float scale = 1.0f / sqrt(arg.filter[1] * arg.filter[2] * arg.filter[3]);
  31. UniformFloatRNG rng(scale, 2 * scale);
  32. checker.
  33. set_dtype(0, dtype::Float32()).
  34. set_dtype(1, dtype::Float32()).
  35. set_dtype(2, dtype::Float32()).
  36. set_rng(0, &default_rng).
  37. set_rng(1, &default_rng).
  38. set_rng(2, &default_rng).
  39. set_epsilon(1e-3).
  40. set_param(arg.param).
  41. execs({arg.src, arg.filter, arg.bias, {}});
  42. /*checker.
  43. set_dtype(0, dtype::Float16()).
  44. set_dtype(1, dtype::Float16()).
  45. set_rng(0, &rng).
  46. set_rng(1, &rng).
  47. set_epsilon(1e-1).
  48. set_param(arg.param).
  49. execs({arg.src, arg.filter, {}});
  50. */
  51. }
  52. }
  53. #endif
  54. } // namespace test
  55. } // namespace megdnn
  56. // vim: syntax=cpp.doxygen