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.

linspace.cpp 829 B

12345678910111213141516171819202122232425262728
  1. #include "test/cuda/fixture.h"
  2. #include "megdnn/oprs.h"
  3. #include "test/common/checker.h"
  4. namespace megdnn {
  5. namespace test {
  6. TEST_F(CUDA, LINSPACE) {
  7. Checker<Linspace> checker(handle_cuda());
  8. Linspace::Param param;
  9. param.start = 0.5;
  10. param.stop = 1.5;
  11. param.endpoint = true;
  12. for (DType dtype :
  13. std::vector<DType>{dtype::Float16(), dtype::Int32(), dtype::Float32()}) {
  14. checker.set_dtype(0, dtype).set_param(param).exec(TensorShapeArray{{11}});
  15. }
  16. param.endpoint = false;
  17. for (DType dtype :
  18. std::vector<DType>{dtype::Float16(), dtype::Int32(), dtype::Float32()}) {
  19. checker.set_dtype(0, dtype).set_param(param).exec(TensorShapeArray{{11}});
  20. }
  21. }
  22. } // namespace test
  23. } // namespace megdnn
  24. // vim: syntax=cpp.doxygen foldmethod=marker foldmarker=f{{{,f}}}