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.

eye.cpp 1.1 kB

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * \file dnn/test/cuda/eye.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/oprs.h"
  13. #include "test/common/checker.h"
  14. namespace megdnn {
  15. namespace test {
  16. TEST_F(CUDA, EYE) {
  17. Checker<Eye> checker(handle_cuda());
  18. for (DType dtype :
  19. std::vector<DType>{dtype::Float16(), dtype::Int32(), dtype::Float32()})
  20. for (int k = -20; k < 20; ++k) {
  21. checker.set_param({k, dtype.enumv()});
  22. checker.set_dtype(0, dtype);
  23. checker.exec(TensorShapeArray{{3, 4}});
  24. checker.exec(TensorShapeArray{{4, 3}});
  25. }
  26. }
  27. } // namespace test
  28. } // namespace megdnn
  29. // vim: syntax=cpp.doxygen foldmethod=marker foldmarker=f{{{,f}}}