• 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_SELECT_H_
18 #define MINDSPORE_CORE_OPS_SELECT_H_
19 
20 #include <map>
21 #include <vector>
22 #include <string>
23 #include <memory>
24 #include <algorithm>
25 #include "ops/op_utils.h"
26 #include "ops/primitive_c.h"
27 #include "abstract/primitive_infer_map.h"
28 #include "abstract/abstract_value.h"
29 #include "utils/check_convert_utils.h"
30 
31 namespace mindspore {
32 namespace ops {
33 constexpr auto kNameSelect = "Select";
34 /// \brief Returns the selected elements, either from input x or input y, depending on the condition.
35 /// Refer to Python API @ref mindspore.ops.Select for more details.
36 class MS_CORE_API Select : public PrimitiveC {
37  public:
38   /// \brief Constructor.
Select()39   Select() : PrimitiveC(kNameSelect) { InitIOName({"condition", "x", "y"}, {"output"}); }
40   /// \brief Destructor.
41   ~Select() = default;
42   MS_DECLARE_PARENT(Select, PrimitiveC);
43   /// \brief Init.
Init()44   void Init() {}
45 };
46 }  // namespace ops
47 }  // namespace mindspore
48 
49 #endif  // MINDSPORE_CORE_OPS_SELECT_H_
50