sign.hpp
1 // Copyright (C) 2018-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 #pragma once
6 
7 #include "ngraph/op/util/unary_elementwise_arithmetic.hpp"
8 
9 namespace ngraph
10 {
11  namespace op
12  {
13  namespace v0
14  {
15  /// \brief Elementwise sign operation.
16  ///
17  class NGRAPH_API Sign : public util::UnaryElementwiseArithmetic
18  {
19  public:
20  static constexpr NodeTypeInfo type_info{"Sign", 0};
21  const NodeTypeInfo& get_type_info() const override { return type_info; }
22  Sign() = default;
23  /// \brief Constructs an elementwise sign operation.
24  ///
25  /// \param arg Node that produces the input tensor.
26  Sign(const Output<Node>& arg);
27 
28  bool visit_attributes(AttributeVisitor& visitor) override;
29  virtual std::shared_ptr<Node>
30  clone_with_new_inputs(const OutputVector& new_args) const override;
31  bool evaluate(const HostTensorVector& outputs,
32  const HostTensorVector& inputs) const override;
33  bool has_evaluate() const override;
34  };
35  } // namespace v0
36  using v0::Sign;
37  } // namespace op
38 } // namespace ngraph
Visits the attributes of a node, primarily for serialization-like tasks.
Definition: attribute_visitor.hpp:59
A handle for one of a node's outputs.
Definition: node_output.hpp:33
Abstract base class for elementwise unary arithmetic operations, i.e., operations where the same scal...
Definition: unary_elementwise_arithmetic.hpp:37
Elementwise sign operation.
Definition: sign.hpp:18
const NodeTypeInfo & get_type_info() const override
Definition: sign.hpp:21
bool has_evaluate() const override
Allows to get information about availability of evaluate method for the current operation.
Sign(const Output< Node > &arg)
Constructs an elementwise sign operation.
bool evaluate(const HostTensorVector &outputs, const HostTensorVector &inputs) const override
Evaluates the op on input_values putting results in output_values.
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:16
Definition: type.hpp:27