Deprecate nGraph v0 ops and builders (#1856)
[platform/upstream/dldt.git] / ngraph / core / include / ngraph / op / dequantize.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/axis_set.hpp"
20 #include "ngraph/op/op.hpp"
21 #include "ngraph/type/element_type.hpp"
22
23 namespace ngraph
24 {
25     namespace op
26     {
27         namespace v0
28         {
29             /// \brief Dequantize operation
30             ///        Maps quantized input (q) to real output (r) using scale (s) and zero point
31             ///        (z):
32             ///        r = (q - o) * s
33             class NGRAPH_DEPRECATED(
34                 "This operation is deprecated and will be removed soon. Please do not use it.")
35                 NGRAPH_API Dequantize : public ngraph::op::Op
36             {
37                 NGRAPH_SUPPRESS_DEPRECATED_START
38             public:
39                 static constexpr NodeTypeInfo type_info{"Dequantize", 0};
40                 const NodeTypeInfo& get_type_info() const override { return type_info; }
41                 /// \brief Constructs a Dequantize operation
42                 Dequantize() = default;
43
44                 /// \brief Constructs a Dequantize operation
45                 /// \param input quantized input
46                 /// \param scale scale used for mapping
47                 /// \param zero_point zero point used for mapping
48                 /// \param type output element type
49                 /// \param axes axis positions on which `scale` and `zero_point` are specified
50                 Dequantize(const Output<Node>& input,
51                            const Output<Node>& scale,
52                            const Output<Node>& zero_point,
53                            const element::Type& type,
54                            const AxisSet& axes);
55
56                 void validate_and_infer_types() override;
57
58                 virtual std::shared_ptr<Node>
59                     clone_with_new_inputs(const OutputVector& new_args) const override;
60
61                 const AxisSet& get_axes() const { return m_axes; }
62                 void set_axes(const AxisSet& axes) { m_axes = axes; }
63                 const element::Type& get_type() const { return m_type; }
64                 void set_type(const element::Type& type) { m_type = type; }
65             private:
66                 element::Type m_type;
67                 AxisSet m_axes;
68                 NGRAPH_SUPPRESS_DEPRECATED_END
69             };
70         }
71         NGRAPH_SUPPRESS_DEPRECATED_START
72         using v0::Dequantize;
73         NGRAPH_SUPPRESS_DEPRECATED_END
74     }
75 }