• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 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_RANDOM_STANDARD_NORMAL_H_
18 #define MINDSPORE_CORE_OPS_RANDOM_STANDARD_NORMAL_H_
19 #include <map>
20 #include <vector>
21 #include <string>
22 #include <memory>
23 #include "ops/primitive_c.h"
24 #include "abstract/abstract_value.h"
25 #include "utils/check_convert_utils.h"
26 
27 namespace mindspore {
28 namespace ops {
29 constexpr auto kNameRandomStandardNormal = "RandomStandardNormal";
30 /// \brief RandomStandardNormal defined RandomStandardNormal operator prototype of lite.
31 class MS_CORE_API RandomStandardNormal : public PrimitiveC {
32  public:
33   /// \brief Constructor.
RandomStandardNormal()34   RandomStandardNormal() : PrimitiveC(kNameRandomStandardNormal) {}
35 
36   /// \brief Destructor.
37   ~RandomStandardNormal() = default;
38 
39   MS_DECLARE_PARENT(RandomStandardNormal, PrimitiveC);
40 
41   /// \brief Method to init the op's attributes.
42   ///
43   /// \param[in] seed Define random seed.
44   /// \param[in] seed2 Define random seed2.
45   void Init(int64_t seed, int64_t seed2);
46 
47   /// \brief Method to set seed attributes.
48   ///
49   /// \param[in] seed Define random seed.
50   void set_seed(int64_t seed);
51 
52   /// \brief Method to set seed2 attributes.
53   ///
54   /// \param[in] seed2 Define random seed2.
55   void set_seed2(int64_t seed2);
56 
57   /// \brief Method to get seed attributes.
58   ///
59   /// \return seed attributes.
60   int64_t get_seed() const;
61 
62   /// \brief Method to get seed2 attributes.
63   ///
64   /// \return seed2 attributes.
65   int64_t get_seed2() const;
66 };
67 using PrimRandomStandardNormalPtr = std::shared_ptr<RandomStandardNormal>;
68 }  // namespace ops
69 }  // namespace mindspore
70 
71 #endif  // MINDSPORE_CORE_OPS_RANDOM_STANDARD_NORMAL_H_
72