• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2022 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_RANDOM_NORMAL_H_
18 #define MINDSPORE_CORE_OPS_RANDOM_NORMAL_H_
19 #include <string>
20 #include "mindapi/base/types.h"
21 #include "ops/base_operator.h"
22 
23 namespace mindspore {
24 namespace ops {
25 constexpr auto kNameRandomNormal = "RandomNormal";
26 /// \brief RandomNormal defined RandomNormal operator prototype of lite.
27 class MIND_API RandomNormal : public BaseOperator {
28  public:
29   MIND_API_BASE_MEMBER(RandomNormal);
30   /// \brief Constructor.
RandomNormal()31   RandomNormal() : BaseOperator(kNameRandomNormal) {}
32 
33   /// \brief Method to init the op's attributes.
34   ///
35   /// \param[in] seed Define random seed.
36   /// \param[in] mean Define random mean.
37   /// \param[in] scale Define random standard deviation.
38   void Init(float seed, float mean, float scale);
39 
40   /// \brief Method to set seed attributes.
41   ///
42   /// \param[in] seed Define random seed.
43   void set_seed(float seed);
44 
45   /// \brief Method to set mean attributes.
46   ///
47   /// \param[in] mean Define random mean.
48   void set_mean(float mean);
49 
50   /// \brief Method to set scale attributes.
51   ///
52   /// \param[in] scale Define random standard deviation.
53   void set_scale(float scale);
54 
55   /// \brief Method to get seed attributes.
56   ///
57   /// \return seed attributes.
58   float get_seed() const;
59 
60   /// \brief Method to get mean attributes.
61   ///
62   /// \return mean attributes.
63   float get_mean() const;
64 
65   /// \brief Method to get scale attributes.
66   ///
67   /// \return scale attributes.
68   float get_scale() const;
69 };
70 }  // namespace ops
71 }  // namespace mindspore
72 
73 #endif  // MINDSPORE_CORE_OPS_RANDOM_NORMAL_H_
74