diff --git a/inference-engine/src/low_precision_transformations/include/low_precision/fake_quantize.hpp b/inference-engine/src/low_precision_transformations/include/low_precision/fake_quantize.hpp index 5e29b04adffb81..15975782ef07f5 100644 --- a/inference-engine/src/low_precision_transformations/include/low_precision/fake_quantize.hpp +++ b/inference-engine/src/low_precision_transformations/include/low_precision/fake_quantize.hpp @@ -25,7 +25,7 @@ class LP_TRANSFORMATIONS_API FakeQuantizeTransformation : public LayerTransforma private: std::shared_ptr fuseElementwise( TransformationContext& context, - MatcherPass& matcherPass, + MatcherPass* matcherPass, const std::shared_ptr& fakeQuantize) const; }; diff --git a/inference-engine/src/low_precision_transformations/src/fake_quantize.cpp b/inference-engine/src/low_precision_transformations/src/fake_quantize.cpp index fd4414fc86f2ef..12ce63328d8fa4 100644 --- a/inference-engine/src/low_precision_transformations/src/fake_quantize.cpp +++ b/inference-engine/src/low_precision_transformations/src/fake_quantize.cpp @@ -42,7 +42,7 @@ bool FakeQuantizeTransformation::transform(TransformationContext& context, ngrap bool wasHandled = false; std::shared_ptr fakeQuantize = layer; do { - fakeQuantize = fuseElementwise(context, *this, fakeQuantize); + fakeQuantize = fuseElementwise(context, this, fakeQuantize); wasHandled = wasHandled || (fakeQuantize != nullptr); } while (fakeQuantize != nullptr); @@ -127,7 +127,7 @@ bool FakeQuantizeTransformation::checkElementwise(const std::shared_ptr& e std::shared_ptr FakeQuantizeTransformation::fuseElementwise( TransformationContext& context, - MatcherPass& matcherPass, + MatcherPass* matcherPass, const std::shared_ptr& fakeQuantize) const { const std::shared_ptr eltwise = fakeQuantize->get_input_node_shared_ptr(0); @@ -198,7 +198,7 @@ std::shared_ptr FakeQuantizeTransformation::fuseElementwis foldConvert(fakeQuantize->input_value(3), deqPrecision), foldConvert(fakeQuantize->input_value(4), deqPrecision) })); - matcherPass.register_new_node(newFakeQuantize); + matcherPass->register_new_node(newFakeQuantize); replace_node(fakeQuantize, newFakeQuantize); ngraph::copy_runtime_info({ fakeQuantize, eltwise }, newFakeQuantize); diff --git a/inference-engine/src/low_precision_transformations/src/fake_quantize_decomposition.cpp b/inference-engine/src/low_precision_transformations/src/fake_quantize_decomposition.cpp index b814331d4e4c44..6ce11b3a43b609 100644 --- a/inference-engine/src/low_precision_transformations/src/fake_quantize_decomposition.cpp +++ b/inference-engine/src/low_precision_transformations/src/fake_quantize_decomposition.cpp @@ -157,6 +157,7 @@ DataPrecision getDataPrecisionByOutputPort(std::shared_ptr // TODO: LPT: refactor: use one way to decompose FakeQuantize std::shared_ptr decomposeFakeQuantize( + MatcherPass* matcherPass, std::shared_ptr& layer, const std::shared_ptr& intervalsAlignment, const DataPrecision& dataPrecision, @@ -196,6 +197,7 @@ std::shared_ptr decomposeFakeQuantize( roundf(updatedOutputLowValue), roundf(updatedOutputHighValue), false); + matcherPass->register_new_node(newFakeQuantizeLayer); newFakeQuantizeLayer->set_levels(levels); auto dequantization = ngraph::pass::low_precision::NetworkHelper::makeDequantization( @@ -232,6 +234,7 @@ std::shared_ptr decomposeFakeQuantize( dataPrecision.hasZeroPoint, updatePrecisions); + matcherPass->register_new_node(std::get<0>(QDQ)); dequantize = std::get<1>(QDQ); } @@ -375,6 +378,7 @@ bool FakeQuantizeDecompositionTransformation::transform(TransformationContext& c } std::shared_ptr dequantize = fq_decomposition::decomposeFakeQuantize( + this, layer, intervalsAlignment, dataPrecision,