• 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 <vector>
21 #include <string>
22 #include <memory>
23 #include "ops/primitive_c.h"
24 #include "ops/op_utils.h"
25 #include "abstract/abstract_value.h"
26 #include "utils/check_convert_utils.h"
27 
28 namespace mindspore {
29 namespace ops {
30 constexpr auto kNameScale = "Scale";
31 /// \brief Scale defined Scale operator prototype of lite.
32 class MS_CORE_API Scale : public PrimitiveC {
33  public:
34   /// \brief Constructor.
Scale()35   Scale() : PrimitiveC(kNameScale) {}
36 
37   /// \brief Constructor.
Scale(const std::string k_name)38   explicit Scale(const std::string k_name) : PrimitiveC(k_name) {}
39 
40   /// \brief Destructor.
41   ~Scale() = default;
42 
43   MS_DECLARE_PARENT(Scale, PrimitiveC);
44 
45   /// \brief Method to init the op's attributes.
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 Init(const int64_t axis = -1);
50 
51   /// \brief Method to set axis attribute.
52   ///
53   /// \param[in] axis Define the first axis of input[0] along which to apply input[1], can be negative to index from
54   ///            the end. Default -1.
55   void set_axis(const int64_t axis);
56 
57   /// \brief Method to get axis attribute.
58   ///
59   /// \return axis attribute.
60   int64_t get_axis() const;
61 };
62 }  // namespace ops
63 }  // namespace mindspore
64 
65 #endif  // MINDSPORE_CORE_OPS_SCALE_H_
66