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.

split.cpp 1.5 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * \file dnn/test/fallback/split.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/fallback/fixture.h"
  12. #include "test/common/checker.h"
  13. #include "test/common/task_record_check.h"
  14. namespace megdnn {
  15. namespace test {
  16. TEST_F(FALLBACK, SPLIT) {
  17. Checker<Split> checker(handle());
  18. using Param = Split::Param;
  19. for (size_t axis = 0; axis < 4; ++axis) {
  20. Param param;
  21. param.axis = axis;
  22. TensorShapeArray shapes(5, TensorShape({2, 3, 4, 5}));
  23. shapes[0].shape[axis] = 10;
  24. for (size_t i = 1; i < 5; ++i) {
  25. shapes[i].shape[axis] = i;
  26. }
  27. checker.set_param(param).exec(shapes);
  28. }
  29. }
  30. TEST_F(FALLBACK, SPLIT_RECORD) {
  31. TaskRecordChecker<Split> checker(1);
  32. using Param = Split::Param;
  33. for (size_t axis = 0; axis < 4; ++axis) {
  34. Param param;
  35. param.axis = axis;
  36. TensorShapeArray shapes(5, TensorShape({2, 3, 4, 5}));
  37. shapes[0].shape[axis] = 10;
  38. for (size_t i = 1; i < 5; ++i) {
  39. shapes[i].shape[axis] = i;
  40. }
  41. checker.set_param(param).exec(shapes);
  42. }
  43. }
  44. } // namespace test
  45. } // namespace megdnn
  46. // vim: syntax=cpp.doxygen