1 //*****************************************************************************
2 // Copyright 2017-2020 Intel Corporation
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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 //*****************************************************************************
21 #include "ngraph/op/util/binary_elementwise_arithmetic.hpp"
29 /// \brief Elementwise addition operation.
31 class NGRAPH_DEPRECATED(
32 "This operation is deprecated and will be removed soon. Use v1::Add instead of it.")
33 NGRAPH_API Add : public util::BinaryElementwiseArithmetic
35 NGRAPH_SUPPRESS_DEPRECATED_START
37 static constexpr NodeTypeInfo type_info{"Add", 0};
38 const NodeTypeInfo& get_type_info() const override { return type_info; }
39 /// \brief Constructs an uninitialized addition operation
41 : util::BinaryElementwiseArithmetic(AutoBroadcastSpec::NONE)
45 /// \brief Constructs an addition operation.
47 /// \param arg0 Output that produces the first input tensor.<br>
49 /// \param arg1 Output that produces the second input tensor.<br>
51 /// \param auto_broadcast Auto broadcast specification
53 /// Output `[d0, ...]`
55 Add(const Output<Node>& arg0,
56 const Output<Node>& arg1,
57 const AutoBroadcastSpec& auto_broadcast = AutoBroadcastSpec());
60 clone_with_new_inputs(const OutputVector& new_args) const override;
62 bool visit_attributes(AttributeVisitor& visitor) override;
63 bool evaluate(const HostTensorVector& outputs,
64 const HostTensorVector& inputs) const override;
65 NGRAPH_SUPPRESS_DEPRECATED_END
71 /// \brief Elementwise addition operation.
73 class NGRAPH_API Add : public util::BinaryElementwiseArithmetic
76 NGRAPH_RTTI_DECLARATION;
78 /// \brief Constructs an uninitialized addition operation
80 : util::BinaryElementwiseArithmetic(AutoBroadcastSpec::NUMPY)
84 /// \brief Constructs an addition operation.
86 /// \param arg0 Output that produces the first input tensor.<br>
88 /// \param arg1 Output that produces the second input tensor.<br>
90 /// \param auto_broadcast Auto broadcast specification. Default is Numpy-style
91 /// implicit broadcasting.
93 /// Output `[d0, ...]`
95 Add(const Output<Node>& arg0,
96 const Output<Node>& arg1,
97 const AutoBroadcastSpec& auto_broadcast =
98 AutoBroadcastSpec(AutoBroadcastType::NUMPY));
100 std::shared_ptr<Node>
101 clone_with_new_inputs(const OutputVector& new_args) const override;
102 bool visit_attributes(AttributeVisitor& visitor) override;
103 size_t get_version() const override { return 1; }
104 bool evaluate(const HostTensorVector& outputs,
105 const HostTensorVector& inputs) const override;
109 NGRAPH_SUPPRESS_DEPRECATED_START
111 NGRAPH_SUPPRESS_DEPRECATED_END
114 NGRAPH_DEPRECATED("This operator was deprecated and will be removed with v0 operation.")
116 std::shared_ptr<Node> operator+(const Output<Node>& arg0, const Output<Node>& arg1);
117 } // namespace ngraph