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.

adder.h 2.3 kB

5 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /**
  2. * Copyright 2020 Huawei Technologies Co., Ltd
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef MINDSPORE_CORE_OPS_ADDER_H_
  17. #define MINDSPORE_CORE_OPS_ADDER_H_
  18. #include <map>
  19. #include <vector>
  20. #include <string>
  21. #include <memory>
  22. #include "ops/primitive_c.h"
  23. #include "abstract/abstract_value.h"
  24. #include "utils/check_convert_utils.h"
  25. namespace mindspore {
  26. namespace ops {
  27. constexpr auto kNameAdder = "Adder";
  28. class Adder : public PrimitiveC {
  29. public:
  30. explicit Adder(const std::string &k_name = kNameAdder) : PrimitiveC(k_name) {}
  31. ~Adder() = default;
  32. MS_DECLARE_PARENT(Adder, PrimitiveC);
  33. void Init(const int64_t in_channel, const int64_t out_channel, const std::vector<int64_t> &kernel_size,
  34. const PadMode &pad_mode, const std::vector<int64_t> &stride, const std::vector<int64_t> &pad_list,
  35. const std::vector<int64_t> &dilation, const int64_t group, const Format &format);
  36. void set_in_channel(const int64_t in_channel);
  37. void set_out_channel(const int64_t out_channel);
  38. void set_kernel_size(const std::vector<int64_t> &kernel_size);
  39. void set_pad_mode(const PadMode &pad_mode);
  40. void set_stride(const std::vector<int64_t> &stride);
  41. void set_pad_list(const std::vector<int64_t> &pad_list);
  42. void set_dilation(const std::vector<int64_t> &dilation);
  43. void set_group(const int64_t group);
  44. void set_format(const Format &format);
  45. int64_t get_in_channel() const;
  46. int64_t get_out_channel() const;
  47. std::vector<int64_t> get_kernel_size() const;
  48. PadMode get_pad_mode() const;
  49. std::vector<int64_t> get_stride() const;
  50. std::vector<int64_t> get_pad_list() const;
  51. std::vector<int64_t> get_dilation() const;
  52. int64_t get_group() const;
  53. Format get_format() const;
  54. };
  55. } // namespace ops
  56. } // namespace mindspore
  57. #endif // MINDSPORE_CORE_OPS_ADDER_H_