tan.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  // clang-format off
16  /// \brief Elementwise tangent operation.
17  ///
18  /// ## Inputs
19  ///
20  /// | | Type | Description |
21  /// | ----- | --------------------------------- | ----------------------------------------------- |
22  /// | `arg` | \f$N[d_1,\dots,d_n]~(n \geq 0)\f$ | A tensor of any shape and numeric element type. |
23  ///
24  /// ## Output
25  ///
26  /// | Type | Description |
27  /// | ---------------------- | ------------------------------------------------------------------------------------ |
28  /// | \f$N[d_1,\dots,d_n]\f$ | The tensor \f$T\f$, where \f$T[i_1,\dots,i_n] = \tan(\texttt{arg}[i_1,\dots,i_n])\f$ |
29  // clang-format on
30  class NGRAPH_API Tan : public util::UnaryElementwiseArithmetic
31  {
32  public:
33  static constexpr NodeTypeInfo type_info{"Tan", 0};
34  const NodeTypeInfo& get_type_info() const override { return type_info; }
35  /// \brief Constructs a tangent operation.
36  ///
37  /// \param arg Node that produces the input tensor.
38  Tan(const Output<Node>& arg);
39  Tan() = default;
40 
41  bool visit_attributes(AttributeVisitor& visitor) override;
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  bool has_evaluate() const override;
47  };
48  } // namespace v0
49  using v0::Tan;
50  } // namespace op
51 } // 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 tangent operation.
Definition: tan.hpp:31
const NodeTypeInfo & get_type_info() const override
Definition: tan.hpp:34
bool evaluate(const HostTensorVector &outputs, const HostTensorVector &inputs) const override
Evaluates the op on input_values putting results in output_values.
Tan(const Output< Node > &arg)
Constructs a tangent operation.
bool has_evaluate() const override
Allows to get information about availability of evaluate method for the current operation.
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:16
Definition: type.hpp:27