• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
17 #ifndef MINDSPORE_CORE_OPS_SCALE_H_
18 #define MINDSPORE_CORE_OPS_SCALE_H_
19 #include <map>
20 #include <memory>
21 #include <string>
22 
23 #include "mindapi/base/types.h"
24 #include "ops/base_operator.h"
25 
26 namespace mindspore {
27 namespace ops {
28 constexpr auto kNameScale = "Scale";
29 /// \brief Scale defined Scale operator prototype of lite.
30 class MIND_API Scale : public BaseOperator {
31  public:
32   MIND_API_BASE_MEMBER(Scale);
33   /// \brief Constructor.
Scale()34   Scale() : BaseOperator(kNameScale) {}
35 
36   /// \brief Constructor.
Scale(const std::string k_name)37   explicit Scale(const std::string k_name) : BaseOperator(k_name) {}
38 
39   /// \brief Method to init the op's attributes.
40   ///
41   /// \param[in] axis Define the first axis of input[0] along which to apply input[1], can be negative to index from
42   ///            the end. Default -1.
43   void Init(const int64_t axis = -1);
44 
45   /// \brief Method to set axis attribute.
46   ///
47   /// \param[in] axis Define the first axis of input[0] along which to apply input[1], can be negative to index from
48   ///            the end. Default -1.
49   void set_axis(const int64_t axis);
50 
51   /// \brief Method to get axis attribute.
52   ///
53   /// \return axis attribute.
54   int64_t get_axis() const;
55 };
56 }  // namespace ops
57 }  // namespace mindspore
58 
59 #endif  // MINDSPORE_CORE_OPS_SCALE_H_
60