• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2020-2021 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 
17 #ifndef MINDSPORE_CORE_OPS_ADDER_FUSION_H_
18 #define MINDSPORE_CORE_OPS_ADDER_FUSION_H_
19 
20 #include <map>
21 #include <memory>
22 #include <string>
23 #include <vector>
24 #include "mindapi/base/types.h"
25 #include "ops/adder.h"
26 
27 namespace mindspore {
28 namespace ops {
29 constexpr auto kNameAdderFusion = "AdderFusion";
30 /// \brief AdderFusion defined Adder operator prototype of lite.
31 class MIND_API AdderFusion : public Adder {
32  public:
33   MIND_API_BASE_MEMBER(AdderFusion);
34   /// \brief Constructor.
AdderFusion()35   AdderFusion() : Adder(kNameAdderFusion) {}
36 
37   /// \brief Method to init the op's attributes.
38   ///
39   /// \param[in] in_channel Define the number of input channel.
40   /// \param[in] out_channel Define the number of output channel.
41   /// \param[in] kernel_size Define the size of the filter kernel.
42   /// \param[in] pad_mode Define the padding method.
43   /// \param[in] stride Define the moving size of the filter kernel.
44   /// \param[in] pad_list Define the concrete padding value on H and W dimension.
45   /// \param[in] dilation Define the coefficient of expansion of the filter kernel.
46   /// \param[in] group Define the number of group.
47   /// \param[in] format Define the format of input tensor.
48   /// \param[in] activation_type Define the activation type.
49   void Init(const int64_t in_channel, const int64_t out_channel, const std::vector<int64_t> &kernel_size,
50             const PadMode &pad_mode, const std::vector<int64_t> &stride, const std::vector<int64_t> &pad_list,
51             const std::vector<int64_t> &dilation, const int64_t group, const Format &format,
52             const ActivationType activation_type);
53 
54   /// \brief Method to set activation type.
55   ///
56   /// \param[in] activation_type Define the activation type.
57   void set_activation_type(const ActivationType activation_type);
58 
59   /// \brief Method to get activation type.
60   ///
61   /// \return activation type.
62   ActivationType get_activation_type() const;
63 };
64 }  // namespace ops
65 }  // namespace mindspore
66 
67 #endif  // MINDSPORE_CORE_OPS_ADDER_FUSION_H_
68