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.

tqt.h 1.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /**
  2. * \file dnn/test/common/tqt.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
  10. * implied.
  11. */
  12. #pragma once
  13. #include "megdnn/basic_types.h"
  14. #include "megdnn/opr_param_defs.h"
  15. namespace megdnn {
  16. namespace test {
  17. namespace tqt {
  18. struct TestArg {
  19. param::TQT param;
  20. TensorShape ishape;
  21. TensorShape scale_shape;
  22. TestArg(param::TQT param, TensorShape ishape, TensorShape scale_shape)
  23. : param(param), ishape(ishape), scale_shape(scale_shape) {}
  24. };
  25. inline std::vector<TestArg> get_args() {
  26. std::vector<TestArg> args;
  27. param::TQT cur_param;
  28. cur_param.qmin = -127;
  29. cur_param.qmax = 127;
  30. for (size_t i = 10; i < 30; i += 2) {
  31. args.emplace_back(cur_param, TensorShape{10, 64, i, i}, TensorShape{1});
  32. }
  33. return args;
  34. }
  35. } // namespace tqt
  36. } // namespace test
  37. } // namespace megdnn