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.

concat.cpp 1.2 kB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * \file dnn/test/cuda/concat.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 "test/common/checker.h"
  13. namespace megdnn {
  14. namespace test {
  15. TEST_F(CUDA, CONCAT) {
  16. Checker<Concat> checker(handle_cuda());
  17. using Param = Concat::Param;
  18. for (auto dtype : std::vector<DType>{dtype::Float32(), dtype::Float16()})
  19. for (size_t axis = 0; axis < 4; ++axis) {
  20. Param param;
  21. param.axis = axis;
  22. TensorShapeArray shapes(4, TensorShape({2, 3, 4, 5}));
  23. for (size_t i = 0; i < 4; ++i) {
  24. shapes[i].shape[axis] = i + 1;
  25. }
  26. shapes.emplace_back();
  27. for (size_t i = 0; i < shapes.size(); ++i)
  28. checker.set_dtype(i, dtype);
  29. checker.set_param(param).exec(shapes);
  30. }
  31. }
  32. } // namespace test
  33. } // namespace megdnn
  34. // vim: syntax=cpp.doxygen