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"
27 /// \brief Elementwise division operation.
28 class NGRAPH_DEPRECATED(
29 "This operation is deprecated and will be removed soon. "
30 "Use v1::Divide instead of it.") NGRAPH_API Divide
31 : public util::BinaryElementwiseArithmetic
33 NGRAPH_SUPPRESS_DEPRECATED_START
35 static constexpr NodeTypeInfo type_info{"Divide", 0};
36 const NodeTypeInfo& get_type_info() const override { return type_info; }
37 /// \brief Constructs a division operation.
39 : util::BinaryElementwiseArithmetic(AutoBroadcastSpec::NONE)
42 /// \brief Constructs a division operation.
44 /// \param arg0 Node that produces the first input tensor.
45 /// \param arg1 Node that produces the second input tensor.
46 /// \param pythondiv Use Python style rounding for integral type
47 /// \param auto_broadcast Auto broadcast specification
48 Divide(const Output<Node>& arg0,
49 const Output<Node>& arg1,
51 const AutoBroadcastSpec& auto_broadcast = AutoBroadcastSpec());
53 /// \brief Constructs a division operation.
55 /// \param arg0 Node that produces the first input tensor.
56 /// \param arg1 Node that produces the second input tensor.
57 /// \param auto_broadcast Auto broadcast specification
58 Divide(const Output<Node>& arg0,
59 const Output<Node>& arg1,
60 const AutoBroadcastSpec& auto_broadcast = AutoBroadcastSpec());
61 bool visit_attributes(AttributeVisitor& visitor) override;
62 bool is_pythondiv() const { return m_pythondiv; }
63 void set_is_pythondiv(bool pythondiv) { m_pythondiv = pythondiv; }
64 virtual std::shared_ptr<Node>
65 clone_with_new_inputs(const OutputVector& new_args) const override;
67 bool evaluate(const HostTensorVector& outputs,
68 const HostTensorVector& inputs) const override;
71 bool m_pythondiv{true};
72 NGRAPH_SUPPRESS_DEPRECATED_END
78 /// \brief Elementwise division operation.
79 class NGRAPH_API Divide : public util::BinaryElementwiseArithmetic
82 NGRAPH_RTTI_DECLARATION;
83 /// \brief Constructs a division operation.
85 : util::BinaryElementwiseArithmetic(AutoBroadcastSpec::NUMPY)
89 /// \brief Constructs a division operation.
91 /// \param arg0 Node that produces the first input tensor.
92 /// \param arg1 Node that produces the second input tensor.
93 /// \param pythondiv Use Python style rounding for integral type
94 /// \param auto_broadcast Auto broadcast specification
95 Divide(const Output<Node>& arg0,
96 const Output<Node>& arg1,
98 const AutoBroadcastSpec& auto_broadcast =
99 AutoBroadcastSpec(AutoBroadcastType::NUMPY));
101 /// \brief Constructs a division 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 Divide(const Output<Node>& arg0,
107 const Output<Node>& arg1,
108 const AutoBroadcastSpec& auto_broadcast =
109 AutoBroadcastSpec(AutoBroadcastType::NUMPY));
110 bool visit_attributes(AttributeVisitor& visitor) override;
111 bool is_pythondiv() const { return m_pythondiv; }
112 void set_is_pythondiv(bool pythondiv) { m_pythondiv = pythondiv; }
113 virtual std::shared_ptr<Node>
114 clone_with_new_inputs(const OutputVector& new_args) const override;
116 size_t get_version() const override { return 1; }
117 bool evaluate(const HostTensorVector& outputs,
118 const HostTensorVector& inputs) const override;
121 bool m_pythondiv{true};
125 NGRAPH_SUPPRESS_DEPRECATED_START
127 NGRAPH_SUPPRESS_DEPRECATED_END
130 NGRAPH_DEPRECATED("This operator was deprecated and will be removed with v0 operation.")
132 std::shared_ptr<Node> operator/(const Output<Node>& arg0, const Output<Node>& arg1);
133 } // namespace ngraph