log.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 natural log operation.
16  class NGRAPH_API Log : public util::UnaryElementwiseArithmetic
17  {
18  public:
19  static constexpr NodeTypeInfo type_info{"Log", 0};
20  const NodeTypeInfo& get_type_info() const override { return type_info; }
21  /// \brief Constructs a natural log operation.
22  Log() = default;
23  /// \brief Constructs a natural log operation.
24  ///
25  /// \param arg Node that produces the input tensor.
26  Log(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::Log;
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 natural log operation.
Definition: log.hpp:17
bool has_evaluate() const override
Allows to get information about availability of evaluate method for the current operation.
const NodeTypeInfo & get_type_info() const override
Definition: log.hpp:20
Log()=default
Constructs a natural log operation.
bool evaluate(const HostTensorVector &outputs, const HostTensorVector &inputs) const override
Evaluates the op on input_values putting results in output_values.
Log(const Output< Node > &arg)
Constructs a natural log operation.
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:16
Definition: type.hpp:27