relu.hpp
1 // Copyright (C) 2018-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 #pragma once
6 
7 #include "ngraph/node.hpp"
8 #include "ngraph/op/op.hpp"
9 #include "ngraph/op/util/binary_elementwise_arithmetic.hpp"
10 #include "ngraph/op/util/unary_elementwise_arithmetic.hpp"
11 
12 #include <memory>
13 
14 namespace ngraph
15 {
16  namespace op
17  {
18  namespace v0
19  {
20  /// \brief Elementwise Relu operation.
21  ///
23  {
24  public:
25  NGRAPH_RTTI_DECLARATION;
26  Relu() = default;
27  /// \brief Constructs a Relu operation.
28  ///
29  /// \param arg Node that produces the input tensor.
31 
32  virtual std::shared_ptr<Node>
33  clone_with_new_inputs(const OutputVector& new_args) const override;
34 
35  bool evaluate(const HostTensorVector& outputs,
36  const HostTensorVector& inputs) const override;
37  bool has_evaluate() const override;
38  bool visit_attributes(AttributeVisitor& visitor) override;
39  };
40  } // namespace v0
41  using v0::Relu;
42  } // namespace op
43 } // namespace ngraph
Visits the attributes of a node, primarily for serialization-like tasks.
Definition: attribute_visitor.hpp:59
Abstract base class for elementwise unary arithmetic operations, i.e., operations where the same scal...
Definition: unary_elementwise_arithmetic.hpp:37
Elementwise Relu operation.
Definition: relu.hpp:23
Relu(const Output< ngraph::Node > &arg)
Constructs a Relu operation.
bool has_evaluate() const override
Allows to get information about availability of evaluate method for the current 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