[LPT] POT support: absent convert fix & element-wise empty dequantization data (...
[platform/upstream/dldt.git] / inference-engine / tests / ngraph_functions / include / ngraph_functions / low_precision_transformations / elementwise_with_multi_parent_dequantization_function.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 <ngraph/ngraph.hpp>
9
10 #include "functional_test_utils/low_precision_transformations/layer_transformation.hpp"
11 #include "ngraph_functions/low_precision_transformations/common/dequantization_operations.hpp"
12 #include "ngraph_functions/subgraph_builders.hpp"
13 #include "ngraph_functions/low_precision_transformations/common/builders.hpp"
14
15 namespace ngraph {
16 namespace builder {
17 namespace subgraph {
18
19 class AddActualValues {
20 public:
21     ngraph::element::Type precision1;
22     std::vector<float> subtractValues1;
23     std::vector<float> mutliplyValues1;
24     ngraph::element::Type precision2;
25     std::vector<float> subtractValues2;
26     std::vector<float> mutliplyValues2;
27 };
28
29 inline std::ostream& operator<<(std::ostream& out, const AddActualValues& values) {
30     return out <<
31         "_" << values.precision1 <<
32         "_subtract" << values.subtractValues1.size() <<
33         "_mutliply" << values.mutliplyValues1.size() <<
34         "_" << values.precision2 <<
35         "_subtract" << values.subtractValues2.size() <<
36         "_mutliply" << values.mutliplyValues2.size();
37 }
38
39 class AddExpectedValues {
40 public:
41     ngraph::element::Type precision1;
42     std::vector<float> subtractValues1;
43     std::vector<float> mutliplyValues1;
44     ngraph::element::Type precision2;
45     std::vector<float> mutliplyValuesAfter;
46 };
47
48 inline std::ostream& operator<<(std::ostream& out, const AddExpectedValues& values) {
49     return out <<
50         "_" << values.precision1 <<
51         "_subtract" << values.subtractValues1.size() <<
52         "_mutliply" << values.mutliplyValues1.size() <<
53         "_" << values.precision2 <<
54         "_mutliply" << values.mutliplyValuesAfter.size();
55 }
56
57 class ElementwiseWithMultiParentDequantizationFunction {
58 public:
59     static std::shared_ptr<ngraph::Function> get(
60         const ngraph::element::Type precision,
61         const ngraph::Shape& inputShape,
62         const ngraph::pass::low_precision::LayerTransformation::Params& params,
63         const ngraph::element::Type& precision1,
64         const ngraph::builder::subgraph::DequantizationOperations& dequantization1,
65         const ngraph::element::Type& precision2,
66         const ngraph::builder::subgraph::DequantizationOperations& dequantization2);
67 };
68
69 }  // namespace subgraph
70 }  // namespace builder
71 }  // namespace ngraph