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.

tensor_remap.h 675 B

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include "megdnn/oprs.h"
  3. #include "test/common/index.h"
  4. #include "test/common/rng.h"
  5. namespace megdnn {
  6. namespace test {
  7. namespace tensor_remap {
  8. class MapRNG final : public IIDRNG {
  9. public:
  10. MapRNG(TensorShape src) : m_cnt(0), m_src(src) {}
  11. dt_float32 gen_single_val() override;
  12. private:
  13. size_t m_cnt;
  14. TensorShape m_src;
  15. };
  16. class NonoverlappingMapRNG final : public IIDRNG {
  17. public:
  18. NonoverlappingMapRNG(TensorShape src);
  19. dt_float32 gen_single_val() override;
  20. private:
  21. size_t m_cnt;
  22. TensorShape m_src;
  23. Index m_idx;
  24. };
  25. } // namespace tensor_remap
  26. } // namespace test
  27. } // namespace megdnn
  28. // vim: syntax=cpp.doxygen