or.hpp
1 //*****************************************************************************
2 // Copyright 2017-2020 Intel Corporation
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 #pragma once
18 
19 #include <memory>
20 
21 #include "ngraph/op/util/binary_elementwise_logical.hpp"
22 
23 namespace ngraph
24 {
25  namespace op
26  {
27  namespace v1
28  {
29  /// \brief Elementwise logical-or operation.
30  ///
31  class NGRAPH_API LogicalOr : public util::BinaryElementwiseLogical
32  {
33  public:
34  NGRAPH_RTTI_DECLARATION;
35  LogicalOr() = default;
36  /// \brief Constructs a logical-or operation.
37  ///
38  /// \param arg0 Node that produces the first input tensor.<br>
39  /// `[d0, ...]`
40  /// \param arg1 Node that produces the second input tensor.<br>
41  /// `[d0, ...]`
42  /// \param auto_broadcast Auto broadcast specification
43  ///
44  /// Output `[d0, ...]`
45  ///
46  LogicalOr(const Output<Node>& arg0,
47  const Output<Node>& arg1,
48  const AutoBroadcastSpec& auto_broadcast =
49  AutoBroadcastSpec(AutoBroadcastType::NUMPY));
50 
51  virtual std::shared_ptr<Node>
52  clone_with_new_inputs(const OutputVector& new_args) const override;
53 
54  bool evaluate(const HostTensorVector& outputs,
55  const HostTensorVector& inputs) const override;
56  };
57  } // namespace v1
58  namespace v0
59  {
60  /// \brief Elementwise logical-or operation.
61  ///
62  class NGRAPH_DEPRECATED(
63  "This operation is deprecated and will be removed soon. "
64  "Use v1::LogicalOr instead of it.") NGRAPH_API Or
66  {
67  NGRAPH_SUPPRESS_DEPRECATED_START
68  public:
69  static constexpr NodeTypeInfo type_info{"Or", 0};
70  const NodeTypeInfo& get_type_info() const override { return type_info; }
71  Or() = default;
72  /// \brief Constructs a logical-or operation.
73  ///
74  /// \param arg0 Node that produces the first input tensor.<br>
75  /// `[d0, ...]`
76  /// \param arg1 Node that produces the second input tensor.<br>
77  /// `[d0, ...]`
78  /// \param auto_broadcast Auto broadcast specification
79  ///
80  /// Output `[d0, ...]`
81  ///
82  Or(const Output<Node>& arg0,
83  const Output<Node>& arg1,
84  const AutoBroadcastSpec& auto_broadcast = AutoBroadcastSpec());
85 
86  virtual std::shared_ptr<Node>
87  clone_with_new_inputs(const OutputVector& new_args) const override;
88 
89  bool evaluate(const HostTensorVector& outputs,
90  const HostTensorVector& inputs) const override;
91  NGRAPH_SUPPRESS_DEPRECATED_END
92  };
93  } // namespace v0
94 
95  NGRAPH_SUPPRESS_DEPRECATED_START
96  using v0::Or;
97  NGRAPH_SUPPRESS_DEPRECATED_END
98  } // namespace op
99 } // namespace ngraph
ngraph::op::AutoBroadcastSpec
Implicit broadcast specification.
Definition: attr_types.hpp:321
ngraph::op::util::BinaryElementwiseLogical
Abstract base class for elementwise binary logical operations, i.e., operations where the same scalar...
Definition: binary_elementwise_logical.hpp:54
ngraph
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:28
ngraph::op::v1::LogicalOr
Elementwise logical-or operation.
Definition: or.hpp:32
ngraph::op::v1::LogicalOr::LogicalOr
LogicalOr(const Output< Node > &arg0, const Output< Node > &arg1, const AutoBroadcastSpec &auto_broadcast=AutoBroadcastSpec(AutoBroadcastType::NUMPY))
Constructs a logical-or operation.