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.

test_noop.cpp 1.1 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright 2020 Tencent
  2. // SPDX-License-Identifier: BSD-3-Clause
  3. #include "testutil.h"
  4. static int test_noop(const ncnn::Mat& a)
  5. {
  6. ncnn::ParamDict pd;
  7. std::vector<ncnn::Mat> weights(0);
  8. std::vector<ncnn::Mat> as(1);
  9. as[0] = a;
  10. int ret = test_layer("Noop", pd, weights, as, 1);
  11. if (ret != 0)
  12. {
  13. fprintf(stderr, "test_noop failed a.dims=%d a=(%d %d %d)\n", a.dims, a.w, a.h, a.c);
  14. }
  15. return ret;
  16. }
  17. static int test_noop_0()
  18. {
  19. return 0
  20. || test_noop(RandomMat(5, 7, 24))
  21. || test_noop(RandomMat(7, 9, 12))
  22. || test_noop(RandomMat(3, 5, 13));
  23. }
  24. static int test_noop_1()
  25. {
  26. return 0
  27. || test_noop(RandomMat(15, 24))
  28. || test_noop(RandomMat(17, 12))
  29. || test_noop(RandomMat(19, 15));
  30. }
  31. static int test_noop_2()
  32. {
  33. return 0
  34. || test_noop(RandomMat(128))
  35. || test_noop(RandomMat(124))
  36. || test_noop(RandomMat(127));
  37. }
  38. int main()
  39. {
  40. SRAND(7767517);
  41. return 0
  42. || test_noop_0()
  43. || test_noop_1()
  44. || test_noop_2();
  45. }