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 //*****************************************************************************
19 #include "ngraph/op/util/binary_elementwise_arithmetic.hpp"
28 /// \brief Elementwise exponentiation operation.
32 /// | | Type | Description |
33 /// | ------ | --------------------------------- | ------------------------------------------------------ |
34 /// | `arg0` | \f$N[d_1,\dots,d_n]~(n \geq 0)\f$ | A tensor of any shape and numeric element type. |
35 /// | `arg1` | \f$N[d_1,\dots,d_n]~(n \geq 0)\f$ | A tensor of the same shape and element type as `arg0`. |
39 /// | Type | Description |
40 /// | ---------------------- | -------------------------------------------------------------------------------------------------------------- |
41 /// | \f$N[d_1,\dots,d_n]\f$ | The tensor \f$T\f$, where \f$T[i_1,\dots,i_n] = \texttt{arg0}[i_1,\dots,i_n]^{\texttt{arg1}[i_1,\dots,i_n]}\f$ |
43 class NGRAPH_DEPRECATED(
44 "This operation is deprecated and will be removed soon. "
45 "Use v1::Power instead of it.") NGRAPH_API Power
46 : public util::BinaryElementwiseArithmetic
48 NGRAPH_SUPPRESS_DEPRECATED_START
50 static constexpr NodeTypeInfo type_info{"Power", 0};
51 const NodeTypeInfo& get_type_info() const override { return type_info; }
53 : util::BinaryElementwiseArithmetic(AutoBroadcastSpec::NONE)
56 /// \brief Constructs an exponentiation operation.
58 /// \param arg0 Node that produces the first input tensor.
59 /// \param arg1 Node that produces the second input tensor.
60 /// \param auto_broadcast Auto broadcast specification
61 Power(const Output<Node>& arg0,
62 const Output<Node>& arg1,
63 const AutoBroadcastSpec& auto_broadcast = AutoBroadcastSpec());
65 virtual std::shared_ptr<Node>
66 clone_with_new_inputs(const OutputVector& new_args) const override;
67 bool evaluate(const HostTensorVector& outputs,
68 const HostTensorVector& inputs) const override;
69 NGRAPH_SUPPRESS_DEPRECATED_END
76 /// \brief Elementwise exponentiation operation.
80 /// | | Type | Description |
81 /// | ------ | --------------------------------- | ------------------------------------------------------ |
82 /// | `arg0` | \f$N[d_1,\dots,d_n]~(n \geq 0)\f$ | A tensor of any shape and numeric element type. |
83 /// | `arg1` | \f$N[d_1,\dots,d_n]~(n \geq 0)\f$ | A tensor of the same shape and element type as `arg0`. |
87 /// | Type | Description |
88 /// | ---------------------- | -------------------------------------------------------------------------------------------------------------- |
89 /// | \f$N[d_1,\dots,d_n]\f$ | The tensor \f$T\f$, where \f$T[i_1,\dots,i_n] = \texttt{arg0}[i_1,\dots,i_n]^{\texttt{arg1}[i_1,\dots,i_n]}\f$ |
91 class NGRAPH_API Power : public util::BinaryElementwiseArithmetic
94 static constexpr NodeTypeInfo type_info{"Power", 1};
95 const NodeTypeInfo& get_type_info() const override { return type_info; }
97 : util::BinaryElementwiseArithmetic(AutoBroadcastSpec::NUMPY)
101 /// \brief Constructs an exponentiation operation.
103 /// \param arg0 Node that produces the first input tensor.
104 /// \param arg1 Node that produces the second input tensor.
105 /// \param auto_broadcast Auto broadcast specification
106 Power(const Output<Node>& arg0,
107 const Output<Node>& arg1,
108 const AutoBroadcastSpec& auto_broadcast =
109 AutoBroadcastSpec(AutoBroadcastType::NUMPY));
111 virtual std::shared_ptr<Node>
112 clone_with_new_inputs(const OutputVector& new_args) const override;
113 bool evaluate(const HostTensorVector& outputs,
114 const HostTensorVector& inputs) const override;
118 NGRAPH_SUPPRESS_DEPRECATED_START
120 NGRAPH_SUPPRESS_DEPRECATED_END