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.

dct_ref.h 1.1 kB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include <math.h>
  3. #include <vector>
  4. #include "megdnn/dtype.h"
  5. #include "megdnn/oprs/nn.h"
  6. #include "test/common/checker.h"
  7. #include "test/common/opr_proxy.h"
  8. #include "test/common/rng.h"
  9. namespace megdnn {
  10. namespace test {
  11. using Param = DctChannelSelectForward::Param;
  12. struct DctTestcase {
  13. using TensorValueArray = TensorNDArray;
  14. TensorValueArray testcase_in;
  15. TensorValueArray testcase_out;
  16. std::vector<uint8_t> inp_vec;
  17. std::vector<int> mask_offset_vec;
  18. std::vector<int> mask_val_vec;
  19. std::vector<float> output_vec;
  20. static std::shared_ptr<DctTestcase> make() {
  21. return std::make_shared<DctTestcase>();
  22. }
  23. };
  24. CheckerHelper::TensorsConstriant gen_dct_constriant(
  25. const size_t n, const size_t ic, const size_t ih, const size_t iw,
  26. const size_t oc, Param param);
  27. std::shared_ptr<DctTestcase> gen_dct_case(
  28. const size_t n, const size_t ic, const size_t ih, const size_t iw,
  29. const size_t oc, Param param, DType dst_dtype = dtype::Float32(),
  30. bool correct_result = true);
  31. } // namespace test
  32. } // namespace megdnn
  33. // vim: syntax=cpp.doxygen