• 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_EXP_FUSION_H_
18 #define MINDSPORE_CORE_OPS_EXP_FUSION_H_
19 #include "ops/exp.h"
20 #include "abstract/abstract_value.h"
21 #include "utils/check_convert_utils.h"
22 
23 namespace mindspore {
24 namespace ops {
25 constexpr auto kNameExpFusion = "ExpFusion";
26 /// \brief ExpFusion defined Exp operator prototype of lite.
27 class MS_CORE_API ExpFusion : public Exp {
28  public:
29   /// \brief Constructor.
ExpFusion()30   ExpFusion() : Exp(kNameExpFusion) { InitIOName({"x"}, {"y"}); }
31 
32   /// \brief Destructor.
33   ~ExpFusion() = default;
34 
35   MS_DECLARE_PARENT(ExpFusion, Exp);
36 
37   /// \brief Method to init the op's attributes.
38   ///
39   /// \param[in] base Define a base number. If base is -1, it represents e. In addition to this, base must be larger
40   ///            than 0.
41   /// \param[in] scale Define a size factor of input.
42   /// \param[in] shift Define a bias of input.
43   void Init(const float base = -1.0, const float scale = 1.0, const float shift = 0.0);
44 
45   /// \brief Method to set base attribute.
46   ///
47   /// \param[in] base Define a base number. If base is -1, it represents e. In addition to this, base must be larger
48   ///            than 0. Default is -1.
49   void set_base(const float base);
50 
51   /// \brief Method to set scale attribute. Default is 1.0.
52   ///
53   /// \param[in] scale Define a size factor of input.
54   void set_scale(const float scale);
55 
56   /// \brief Method to set shift attribute. Default is 0.0.
57   ///
58   /// \param[in] shift Define a bias of input.
59   void set_shift(const float shift);
60 
61   /// \brief Method to get base attribute.
62   ///
63   /// \return base number.
64   float get_base() const;
65 
66   /// \brief Method to get scale attribute.
67   ///
68   /// \return a size factor of input.
69   float get_scale() const;
70 
71   /// \brief Method to get shift attribute.
72   ///
73   /// \return a bias of input.
74   float get_shift() const;
75 };
76 }  // namespace ops
77 }  // namespace mindspore
78 
79 #endif  // MINDSPORE_CORE_OPS_EXP_FUSION_H_
80