87a4dabb45385dadaa739f42da1bcbc256b98581
[platform/upstream/dldt.git] / inference-engine / src / low_precision_transformations / include / low_precision / common / fake_quantize_dequantization.hpp
1 // Copyright (C) 2020 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4
5 #pragma once
6
7 #include <memory>
8 #include <tuple>
9 #include <ngraph/ngraph.hpp>
10 #include <ngraph/opsets/opset1.hpp>
11
12 namespace ngraph {
13 namespace pass {
14 namespace low_precision {
15
16 typedef std::tuple<std::shared_ptr<Node>, std::shared_ptr<Node>> FakeQuantizeDequantizationValues;
17
18 class FakeQuantizeDequantization {
19 public:
20     FakeQuantizeDequantization();
21
22     FakeQuantizeDequantization(
23         Output<Node> data,
24         std::shared_ptr<ngraph::opset1::Convert> convert,
25         std::shared_ptr<ngraph::opset1::Subtract> subtract,
26         std::shared_ptr<ngraph::opset1::Multiply> multiply);
27
28     bool empty() const;
29     bool isShared() const;
30     bool isLowPrecision() const;
31     static bool checkElementwise(const std::shared_ptr<ngraph::Node>& elementwise);
32
33     Output<Node> data;
34     std::shared_ptr<opset1::Convert> convert;
35     std::shared_ptr<opset1::Subtract> subtract;
36     std::shared_ptr<opset1::Multiply> multiply;
37 };
38
39 } // namespace low_precision
40 } // namespace pass
41 } // namespace ngraph