not.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 "ngraph/op/op.hpp"
20 
21 namespace ngraph
22 {
23  namespace op
24  {
25  namespace v1
26  {
27  /// \brief Elementwise logical negation operation.
28  class NGRAPH_API LogicalNot : public Op
29  {
30  public:
31  NGRAPH_RTTI_DECLARATION;
32  /// \brief Constructs a logical negation operation.
33  LogicalNot() = default;
34  /// \brief Constructs a logical negation operation.
35  ///
36  /// \param arg Node that produces the input tensor.
37  LogicalNot(const Output<Node>& arg);
38 
39  bool visit_attributes(AttributeVisitor& visitor) override;
40  void validate_and_infer_types() override;
41 
42  virtual std::shared_ptr<Node>
43  clone_with_new_inputs(const OutputVector& new_args) const override;
44  bool evaluate(const HostTensorVector& outputs,
45  const HostTensorVector& inputs) const override;
46  };
47  }
48  namespace v0
49  {
50  /// \brief Elementwise logical negation operation.
51  class NGRAPH_DEPRECATED(
52  "This operation is deprecated and will be removed soon. "
53  "Use v1::LogicalNot instead of it.") NGRAPH_API Not : public Op
54  {
55  NGRAPH_SUPPRESS_DEPRECATED_START
56  public:
57  static constexpr NodeTypeInfo type_info{"Not", 0};
58  const NodeTypeInfo& get_type_info() const override { return type_info; }
59  /// \brief Constructs a logical negation operation.
60  Not() = default;
61  /// \brief Constructs a logical negation operation.
62  ///
63  /// \param arg Node that produces the input tensor.
64  Not(const Output<Node>& arg);
65 
66  void validate_and_infer_types() override;
67 
68  virtual std::shared_ptr<Node>
69  clone_with_new_inputs(const OutputVector& new_args) const override;
70  bool evaluate(const HostTensorVector& outputs,
71  const HostTensorVector& inputs) const override;
72  NGRAPH_SUPPRESS_DEPRECATED_END
73  };
74  }
75 
76  NGRAPH_SUPPRESS_DEPRECATED_START
77  using v0::Not;
78  NGRAPH_SUPPRESS_DEPRECATED_END
79  } // namespace op
80 } // namespace ngraph
ngraph::op::v1::LogicalNot
Elementwise logical negation operation.
Definition: not.hpp:29
ngraph
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:28
ngraph::op::v1::LogicalNot::LogicalNot
LogicalNot()=default
Constructs a logical negation operation.
ngraph::AttributeVisitor
Visits the attributes of a node, primarily for serialization-like tasks.
Definition: attribute_visitor.hpp:70
ngraph::op::v1::LogicalNot::LogicalNot
LogicalNot(const Output< Node > &arg)
Constructs a logical negation operation.
ngraph::op::v1::LogicalNot::validate_and_infer_types
void validate_and_infer_types() override
Verifies that attributes and inputs are consistent and computes output shapes and element types....
ngraph::op::Op
Root of all actual ops.
Definition: op.hpp:29