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.

softmax.h 1.1 kB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * \file dnn/test/common/softmax.h
  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. #pragma once
  12. #include <cstddef>
  13. #include "megdnn/basic_types.h"
  14. #include "megdnn/opr_param_defs.h"
  15. namespace megdnn {
  16. namespace test {
  17. namespace softmax {
  18. struct TestArg {
  19. param::Softmax param;
  20. TensorShape ishape;
  21. TestArg(param::Softmax param, TensorShape ishape) : param(param), ishape(ishape) {}
  22. };
  23. inline std::vector<TestArg> get_args() {
  24. std::vector<TestArg> args;
  25. using Param = param::Softmax;
  26. for (int32_t axis = 0; axis < 5; axis++) {
  27. args.emplace_back(Param{axis}, TensorShape{2, 23, 32, 30, 17});
  28. }
  29. return args;
  30. }
  31. } // namespace softmax
  32. } // namespace test
  33. } // namespace megdnn
  34. // vim: syntax=cpp.doxygen