cos.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/util/unary_elementwise_arithmetic.hpp"
20 
21 namespace ngraph
22 {
23  namespace op
24  {
25  namespace v0
26  {
27  /// \brief Elementwise cosine operation.
28  class NGRAPH_API Cos : public util::UnaryElementwiseArithmetic
29  {
30  public:
31  static constexpr NodeTypeInfo type_info{"Cos", 0};
32  const NodeTypeInfo& get_type_info() const override { return type_info; }
33  /// \brief Constructs a cosine operation.
34  Cos() = default;
35  /// \brief Constructs a cosine operation.
36  ///
37  /// \param arg Node that produces the input tensor.
38  Cos(const Output<Node>& arg);
39  bool visit_attributes(AttributeVisitor& visitor) override;
40 
41  virtual std::shared_ptr<Node>
42  clone_with_new_inputs(const OutputVector& new_args) const override;
43  bool evaluate(const HostTensorVector& outputs,
44  const HostTensorVector& inputs) const override;
45  };
46  }
47  using v0::Cos;
48  }
49 }
ngraph::op::v0::Cos::Cos
Cos()=default
Constructs a cosine operation.
ngraph::op::util::UnaryElementwiseArithmetic
Abstract base class for elementwise unary arithmetic operations, i.e., operations where the same scal...
Definition: unary_elementwise_arithmetic.hpp:49
ngraph::op::v0::Cos::Cos
Cos(const Output< Node > &arg)
Constructs a cosine operation.
ngraph
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:28
ngraph::AttributeVisitor
Visits the attributes of a node, primarily for serialization-like tasks.
Definition: attribute_visitor.hpp:70
ngraph::op::v0::Cos::get_type_info
const NodeTypeInfo & get_type_info() const override
Definition: cos.hpp:32
ngraph::op::v0::Cos
Elementwise cosine operation.
Definition: cos.hpp:29