From bdae6c0c433ea76f489c477ec7f78c1e10751503 Mon Sep 17 00:00:00 2001 From: Vladislav Golubev Date: Wed, 8 Jan 2025 14:10:39 +0100 Subject: [PATCH] TransformationContext is removed from canBeTransformed --- .../include/low_precision/add.hpp | 2 +- .../include/low_precision/assign_and_read_value.hpp | 2 +- .../include/low_precision/avg_pool.hpp | 2 +- .../include/low_precision/batch_to_space.hpp | 2 +- .../include/low_precision/broadcast.hpp | 2 +- .../include/low_precision/clamp.hpp | 2 +- .../include/low_precision/cleanup_transformation.hpp | 2 +- .../include/low_precision/concat.hpp | 2 +- .../low_precision/convolution_backprop_data.hpp | 2 +- .../include/low_precision/depth_to_space.hpp | 2 +- .../low_precision/eliminate_fake_quantize.hpp | 2 +- .../low_precision/eltwise_base_transformation.hpp | 2 +- .../include/low_precision/fold_convert.hpp | 2 +- .../include/low_precision/fold_fake_quantize.hpp | 2 +- .../include/low_precision/fuse_convert.hpp | 2 +- .../fuse_elementwise_to_fake_quantize.hpp | 2 +- .../include/low_precision/gather.hpp | 2 +- .../include/low_precision/interpolate.hpp | 2 +- .../include/low_precision/layer_transformation.hpp | 2 +- .../include/low_precision/mat_mul.hpp | 2 +- .../include/low_precision/max_pool.hpp | 2 +- .../include/low_precision/move_fake_quantize.hpp | 2 +- .../include/low_precision/multiply_partial.hpp | 2 +- .../low_precision/multiply_to_group_convolution.hpp | 2 +- .../include/low_precision/mvn.hpp | 2 +- .../include/low_precision/normalize_l2.hpp | 2 +- .../include/low_precision/pad.hpp | 2 +- .../include/low_precision/prelu.hpp | 2 +- .../include/low_precision/recurrent_cell.hpp | 2 +- .../low_precision/reduce_base_transformation.hpp | 2 +- .../include/low_precision/reduce_max.hpp | 2 +- .../include/low_precision/reduce_mean.hpp | 2 +- .../include/low_precision/reduce_min.hpp | 2 +- .../include/low_precision/reduce_sum.hpp | 2 +- .../include/low_precision/relu.hpp | 2 +- .../include/low_precision/reshape.hpp | 2 +- .../include/low_precision/shuffle_channels.hpp | 2 +- .../include/low_precision/slice.hpp | 2 +- .../include/low_precision/space_to_batch.hpp | 2 +- .../include/low_precision/split.hpp | 2 +- .../include/low_precision/squeeze.hpp | 2 +- .../include/low_precision/strided_slice.hpp | 2 +- .../transparent_base_transformation.hpp | 2 +- .../include/low_precision/transpose.hpp | 2 +- .../include/low_precision/unsqueeze.hpp | 2 +- .../weightable_layer_transformation.hpp | 12 +++--------- src/common/low_precision_transformations/src/add.cpp | 6 +++--- .../src/assign_and_read_value.cpp | 6 +++--- .../low_precision_transformations/src/avg_pool.cpp | 6 +++--- .../src/batch_to_space.cpp | 6 +++--- .../low_precision_transformations/src/broadcast.cpp | 4 ++-- .../low_precision_transformations/src/clamp.cpp | 6 +++--- .../src/cleanup_transformation.cpp | 2 +- .../low_precision_transformations/src/concat.cpp | 4 ++-- .../low_precision_transformations/src/convert.cpp | 2 +- .../src/convolution.cpp | 2 +- .../src/convolution_backprop_data.cpp | 6 +++--- .../src/depth_to_space.cpp | 4 ++-- .../src/eliminate_fake_quantize.cpp | 6 +++--- .../src/eltwise_base_transformation.cpp | 4 ++-- .../src/fold_convert.cpp | 6 +++--- .../src/fold_fake_quantize.cpp | 4 ++-- .../src/fuse_convert.cpp | 6 +++--- .../src/fuse_elementwise_to_fake_quantize.cpp | 4 ++-- .../src/fuse_multiply_to_fake_quantize.cpp | 2 +- .../src/fuse_subtract_to_fake_quantize.cpp | 2 +- .../low_precision_transformations/src/gather.cpp | 6 +++--- .../src/group_convolution.cpp | 2 +- .../src/interpolate.cpp | 6 +++--- .../src/layer_transformation.cpp | 2 +- .../low_precision_transformations/src/mat_mul.cpp | 4 ++-- .../low_precision_transformations/src/max_pool.cpp | 6 +++--- .../src/move_fake_quantize.cpp | 4 ++-- .../low_precision_transformations/src/multiply.cpp | 2 +- .../src/multiply_partial.cpp | 6 +++--- .../src/multiply_to_group_convolution.cpp | 6 +++--- src/common/low_precision_transformations/src/mvn.cpp | 6 +++--- .../src/normalize_l2.cpp | 6 +++--- src/common/low_precision_transformations/src/pad.cpp | 4 ++-- .../low_precision_transformations/src/prelu.cpp | 6 +++--- .../src/recurrent_cell.cpp | 4 ++-- .../src/reduce_base_transformation.cpp | 4 ++-- .../low_precision_transformations/src/reduce_max.cpp | 4 ++-- .../src/reduce_mean.cpp | 4 ++-- .../low_precision_transformations/src/reduce_min.cpp | 4 ++-- .../low_precision_transformations/src/reduce_sum.cpp | 4 ++-- .../low_precision_transformations/src/relu.cpp | 6 +++--- .../low_precision_transformations/src/reshape.cpp | 6 +++--- .../src/shuffle_channels.cpp | 4 ++-- .../low_precision_transformations/src/slice.cpp | 6 +++--- .../src/space_to_batch.cpp | 6 +++--- .../low_precision_transformations/src/split.cpp | 4 ++-- .../low_precision_transformations/src/squeeze.cpp | 6 +++--- .../src/strided_slice.cpp | 4 ++-- .../low_precision_transformations/src/subtract.cpp | 2 +- .../src/transparent_base_transformation.cpp | 4 ++-- .../low_precision_transformations/src/transpose.cpp | 6 +++--- .../low_precision_transformations/src/unsqueeze.cpp | 6 +++--- .../src/weightable_layer_transformation.cpp | 11 ++++++----- 99 files changed, 173 insertions(+), 178 deletions(-) diff --git a/src/common/low_precision_transformations/include/low_precision/add.hpp b/src/common/low_precision_transformations/include/low_precision/add.hpp index 2c97087696d2f7..4e43ec067c3098 100644 --- a/src/common/low_precision_transformations/include/low_precision/add.hpp +++ b/src/common/low_precision_transformations/include/low_precision/add.hpp @@ -25,7 +25,7 @@ class LP_TRANSFORMATIONS_API AddTransformation : public EltwiseBaseTransformatio OPENVINO_RTTI("AddTransformation", "0", EltwiseBaseTransformation); AddTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; }; } // namespace low_precision diff --git a/src/common/low_precision_transformations/include/low_precision/assign_and_read_value.hpp b/src/common/low_precision_transformations/include/low_precision/assign_and_read_value.hpp index edef4d63aa134a..aac5201cf5db94 100644 --- a/src/common/low_precision_transformations/include/low_precision/assign_and_read_value.hpp +++ b/src/common/low_precision_transformations/include/low_precision/assign_and_read_value.hpp @@ -16,7 +16,7 @@ class LP_TRANSFORMATIONS_API AssignAndReadValueTransformation : public LayerTran OPENVINO_RTTI("AssignAndReadValueTransformation", "0", LayerTransformation); AssignAndReadValueTransformation(const std::shared_ptr model, const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher& m) override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr op) const override; + bool canBeTransformed(const std::shared_ptr& op) const override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; private: std::shared_ptr model; diff --git a/src/common/low_precision_transformations/include/low_precision/avg_pool.hpp b/src/common/low_precision_transformations/include/low_precision/avg_pool.hpp index ac8b91aeb57504..3e6dcec3d6aed9 100644 --- a/src/common/low_precision_transformations/include/low_precision/avg_pool.hpp +++ b/src/common/low_precision_transformations/include/low_precision/avg_pool.hpp @@ -25,7 +25,7 @@ class LP_TRANSFORMATIONS_API AvgPoolTransformation : public LayerTransformation AvgPoolTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; bool isPrecisionPreserved(std::shared_ptr layer) const override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; }; } // namespace low_precision diff --git a/src/common/low_precision_transformations/include/low_precision/batch_to_space.hpp b/src/common/low_precision_transformations/include/low_precision/batch_to_space.hpp index 7859a29ec3a046..53121a5fbd4364 100644 --- a/src/common/low_precision_transformations/include/low_precision/batch_to_space.hpp +++ b/src/common/low_precision_transformations/include/low_precision/batch_to_space.hpp @@ -24,7 +24,7 @@ class LP_TRANSFORMATIONS_API BatchToSpaceTransformation : public LayerTransforma public: OPENVINO_RTTI("BatchToSpaceTransformation", "0", LayerTransformation); BatchToSpaceTransformation(const Params& params = Params()); - bool canBeTransformed(const TransformationContext& context, std::shared_ptr op) const override; + bool canBeTransformed(const std::shared_ptr& op) const override; bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; }; diff --git a/src/common/low_precision_transformations/include/low_precision/broadcast.hpp b/src/common/low_precision_transformations/include/low_precision/broadcast.hpp index 05f7cadb88e888..75096e322a6571 100644 --- a/src/common/low_precision_transformations/include/low_precision/broadcast.hpp +++ b/src/common/low_precision_transformations/include/low_precision/broadcast.hpp @@ -22,7 +22,7 @@ class LP_TRANSFORMATIONS_API BroadcastTransformation : public TransparentBaseTra public: OPENVINO_RTTI("BroadcastTransformation", "0", TransparentBaseTransformation); BroadcastTransformation(const Params& params = Params()); - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; }; } // namespace low_precision diff --git a/src/common/low_precision_transformations/include/low_precision/clamp.hpp b/src/common/low_precision_transformations/include/low_precision/clamp.hpp index d79a6ad159e21b..b9eb35f07b00e6 100644 --- a/src/common/low_precision_transformations/include/low_precision/clamp.hpp +++ b/src/common/low_precision_transformations/include/low_precision/clamp.hpp @@ -25,7 +25,7 @@ class LP_TRANSFORMATIONS_API ClampTransformation : public LayerTransformation { OPENVINO_RTTI("ClampTransformation", "0", LayerTransformation); ClampTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher& m) override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr op) const override; + bool canBeTransformed(const std::shared_ptr& op) const override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; }; diff --git a/src/common/low_precision_transformations/include/low_precision/cleanup_transformation.hpp b/src/common/low_precision_transformations/include/low_precision/cleanup_transformation.hpp index 503c519ea60f22..52de352c0bb5d9 100644 --- a/src/common/low_precision_transformations/include/low_precision/cleanup_transformation.hpp +++ b/src/common/low_precision_transformations/include/low_precision/cleanup_transformation.hpp @@ -19,7 +19,7 @@ class LP_TRANSFORMATIONS_API CleanupTransformation : public LayerTransformation CleanupTransformation(const Params& params); virtual ~CleanupTransformation() = default; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; static bool canBeTransformedStatic( const std::shared_ptr& layer, const std::vector& defaultPrecisions = precision_set::get_int8_support()); diff --git a/src/common/low_precision_transformations/include/low_precision/concat.hpp b/src/common/low_precision_transformations/include/low_precision/concat.hpp index c082e30dfa1ecd..ffc7554e8506dd 100644 --- a/src/common/low_precision_transformations/include/low_precision/concat.hpp +++ b/src/common/low_precision_transformations/include/low_precision/concat.hpp @@ -33,7 +33,7 @@ class LP_TRANSFORMATIONS_API ConcatTransformation : public LayerTransformation { ConcatTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; static bool isQuantizedStatic(const std::shared_ptr& layer); }; diff --git a/src/common/low_precision_transformations/include/low_precision/convolution_backprop_data.hpp b/src/common/low_precision_transformations/include/low_precision/convolution_backprop_data.hpp index 6221a75aca5fb2..de28b23bc3ccb3 100644 --- a/src/common/low_precision_transformations/include/low_precision/convolution_backprop_data.hpp +++ b/src/common/low_precision_transformations/include/low_precision/convolution_backprop_data.hpp @@ -22,7 +22,7 @@ class LP_TRANSFORMATIONS_API ConvolutionBackpropDataTransformation : public Weig public: ConvolutionBackpropDataTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr op) const override; + bool canBeTransformed(const std::shared_ptr& op) const override; bool isQuantized(const std::shared_ptr& layer, const std::vector&defaultPrecisions) const override; static bool isQuantizedStatic(const std::shared_ptr& layer, diff --git a/src/common/low_precision_transformations/include/low_precision/depth_to_space.hpp b/src/common/low_precision_transformations/include/low_precision/depth_to_space.hpp index e86a2de2941b3c..1ace395ac8331d 100644 --- a/src/common/low_precision_transformations/include/low_precision/depth_to_space.hpp +++ b/src/common/low_precision_transformations/include/low_precision/depth_to_space.hpp @@ -22,7 +22,7 @@ class LP_TRANSFORMATIONS_API DepthToSpaceTransformation : public TransparentBase public: OPENVINO_RTTI("DepthToSpaceTransformation", "0", TransparentBaseTransformation); DepthToSpaceTransformation(const Params& params = Params()); - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; }; } // namespace low_precision diff --git a/src/common/low_precision_transformations/include/low_precision/eliminate_fake_quantize.hpp b/src/common/low_precision_transformations/include/low_precision/eliminate_fake_quantize.hpp index bfaa0c3b3a2b1b..27c54e174d8d73 100644 --- a/src/common/low_precision_transformations/include/low_precision/eliminate_fake_quantize.hpp +++ b/src/common/low_precision_transformations/include/low_precision/eliminate_fake_quantize.hpp @@ -25,7 +25,7 @@ class LP_TRANSFORMATIONS_API EliminateFakeQuantizeTransformation : public Cleanu OPENVINO_RTTI("EliminateFakeQuantizeTransformation", "0", CleanupTransformation); EliminateFakeQuantizeTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; }; diff --git a/src/common/low_precision_transformations/include/low_precision/eltwise_base_transformation.hpp b/src/common/low_precision_transformations/include/low_precision/eltwise_base_transformation.hpp index 5d3361e7283eb9..9c3c5d1c3b2a5d 100644 --- a/src/common/low_precision_transformations/include/low_precision/eltwise_base_transformation.hpp +++ b/src/common/low_precision_transformations/include/low_precision/eltwise_base_transformation.hpp @@ -19,7 +19,7 @@ namespace low_precision { class LP_TRANSFORMATIONS_API EltwiseBaseTransformation : public LayerTransformation { public: EltwiseBaseTransformation(const Params& params) : LayerTransformation(params) {} - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; static bool isBroadcasted(const PartialShape& shape); diff --git a/src/common/low_precision_transformations/include/low_precision/fold_convert.hpp b/src/common/low_precision_transformations/include/low_precision/fold_convert.hpp index bc5342b5cca4f1..ba9302bdd5bbf1 100644 --- a/src/common/low_precision_transformations/include/low_precision/fold_convert.hpp +++ b/src/common/low_precision_transformations/include/low_precision/fold_convert.hpp @@ -26,7 +26,7 @@ class LP_TRANSFORMATIONS_API FoldConvertTransformation : public CleanupTransform OPENVINO_RTTI("FoldConvertTransformation", "0", CleanupTransformation); FoldConvertTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; }; diff --git a/src/common/low_precision_transformations/include/low_precision/fold_fake_quantize.hpp b/src/common/low_precision_transformations/include/low_precision/fold_fake_quantize.hpp index c47c39a78ef081..edf8802a4e3e21 100644 --- a/src/common/low_precision_transformations/include/low_precision/fold_fake_quantize.hpp +++ b/src/common/low_precision_transformations/include/low_precision/fold_fake_quantize.hpp @@ -24,7 +24,7 @@ class LP_TRANSFORMATIONS_API FoldFakeQuantizeTransformation : public LayerTransf OPENVINO_RTTI("FoldFakeQuantizeTransformation", "0", LayerTransformation); FoldFakeQuantizeTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; bool isConstantOutput(std::shared_ptr op) const; }; diff --git a/src/common/low_precision_transformations/include/low_precision/fuse_convert.hpp b/src/common/low_precision_transformations/include/low_precision/fuse_convert.hpp index 0ff0dc60821486..fc40baaea6692f 100644 --- a/src/common/low_precision_transformations/include/low_precision/fuse_convert.hpp +++ b/src/common/low_precision_transformations/include/low_precision/fuse_convert.hpp @@ -23,7 +23,7 @@ class LP_TRANSFORMATIONS_API FuseConvertTransformation : public CleanupTransform OPENVINO_RTTI("FuseConvertTransformation", "0", CleanupTransformation); FuseConvertTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; }; diff --git a/src/common/low_precision_transformations/include/low_precision/fuse_elementwise_to_fake_quantize.hpp b/src/common/low_precision_transformations/include/low_precision/fuse_elementwise_to_fake_quantize.hpp index ab1a589845aa10..13b73a1112f4c5 100644 --- a/src/common/low_precision_transformations/include/low_precision/fuse_elementwise_to_fake_quantize.hpp +++ b/src/common/low_precision_transformations/include/low_precision/fuse_elementwise_to_fake_quantize.hpp @@ -21,7 +21,7 @@ class LP_TRANSFORMATIONS_API FuseElementwiseToFakeQuantizeTransformation : publi FuseElementwiseToFakeQuantizeTransformation(const Params& params); virtual ~FuseElementwiseToFakeQuantizeTransformation() = default; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; }; } // namespace low_precision diff --git a/src/common/low_precision_transformations/include/low_precision/gather.hpp b/src/common/low_precision_transformations/include/low_precision/gather.hpp index 6aebd3fb094e0a..2d8a15a221de80 100644 --- a/src/common/low_precision_transformations/include/low_precision/gather.hpp +++ b/src/common/low_precision_transformations/include/low_precision/gather.hpp @@ -17,7 +17,7 @@ class LP_TRANSFORMATIONS_API GatherTransformation : public LayerTransformation { GatherTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; bool isPrecisionPreserved(std::shared_ptr layer) const override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; }; } // namespace low_precision diff --git a/src/common/low_precision_transformations/include/low_precision/interpolate.hpp b/src/common/low_precision_transformations/include/low_precision/interpolate.hpp index 634d422dc2b09b..3d51bc64af50b2 100644 --- a/src/common/low_precision_transformations/include/low_precision/interpolate.hpp +++ b/src/common/low_precision_transformations/include/low_precision/interpolate.hpp @@ -24,7 +24,7 @@ class LP_TRANSFORMATIONS_API InterpolateTransformation : public LayerTransformat InterpolateTransformation(const Params& params = Params()); bool transform(TransformationContext &context, ov::pass::pattern::Matcher &m) override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; }; } // namespace low_precision diff --git a/src/common/low_precision_transformations/include/low_precision/layer_transformation.hpp b/src/common/low_precision_transformations/include/low_precision/layer_transformation.hpp index ca835d614e1c1d..4eb18a4627a592 100644 --- a/src/common/low_precision_transformations/include/low_precision/layer_transformation.hpp +++ b/src/common/low_precision_transformations/include/low_precision/layer_transformation.hpp @@ -296,7 +296,7 @@ class LP_TRANSFORMATIONS_API LayerTransformation : public ov::pass::MatcherPass void setDefaultPrecisions(const std::vector& defaultPrecisions); - virtual bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const; + virtual bool canBeTransformed(const std::shared_ptr& layer) const; static bool canBeTransformedStatic(const std::shared_ptr& layer, const std::vector& defaultPrecisions = precision_set::get_int8_support()); diff --git a/src/common/low_precision_transformations/include/low_precision/mat_mul.hpp b/src/common/low_precision_transformations/include/low_precision/mat_mul.hpp index 0b6115e9345b0e..61c5c98d1e4230 100644 --- a/src/common/low_precision_transformations/include/low_precision/mat_mul.hpp +++ b/src/common/low_precision_transformations/include/low_precision/mat_mul.hpp @@ -25,7 +25,7 @@ class LP_TRANSFORMATIONS_API MatMulTransformation : public LayerTransformation { MatMulTransformation(const Params& params = Params()); bool transform(TransformationContext &context, ov::pass::pattern::Matcher &m) override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; }; } // namespace low_precision diff --git a/src/common/low_precision_transformations/include/low_precision/max_pool.hpp b/src/common/low_precision_transformations/include/low_precision/max_pool.hpp index 7d499c9ec254f3..e0eab505022f8f 100644 --- a/src/common/low_precision_transformations/include/low_precision/max_pool.hpp +++ b/src/common/low_precision_transformations/include/low_precision/max_pool.hpp @@ -24,7 +24,7 @@ class LP_TRANSFORMATIONS_API MaxPoolTransformation : public LayerTransformation public: OPENVINO_RTTI("MaxPoolTransformation", "0", LayerTransformation); MaxPoolTransformation(const Params& params = Params()); - bool canBeTransformed(const TransformationContext& context, std::shared_ptr op) const override; + bool canBeTransformed(const std::shared_ptr& op) const override; bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; }; diff --git a/src/common/low_precision_transformations/include/low_precision/move_fake_quantize.hpp b/src/common/low_precision_transformations/include/low_precision/move_fake_quantize.hpp index 628c88b38992e4..f5ec56c57577c5 100644 --- a/src/common/low_precision_transformations/include/low_precision/move_fake_quantize.hpp +++ b/src/common/low_precision_transformations/include/low_precision/move_fake_quantize.hpp @@ -17,7 +17,7 @@ class LP_TRANSFORMATIONS_API MoveFakeQuantize : public LayerTransformation { OPENVINO_RTTI("MoveFakeQuantize", "0", LayerTransformation); MoveFakeQuantize(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; }; diff --git a/src/common/low_precision_transformations/include/low_precision/multiply_partial.hpp b/src/common/low_precision_transformations/include/low_precision/multiply_partial.hpp index 3bee03cfb1a265..d29b067295c153 100644 --- a/src/common/low_precision_transformations/include/low_precision/multiply_partial.hpp +++ b/src/common/low_precision_transformations/include/low_precision/multiply_partial.hpp @@ -24,7 +24,7 @@ class LP_TRANSFORMATIONS_API MultiplyPartialTransformation : public EltwiseBaseT OPENVINO_RTTI("MultiplyPartialTransformation", "0", EltwiseBaseTransformation); MultiplyPartialTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; }; } // namespace low_precision diff --git a/src/common/low_precision_transformations/include/low_precision/multiply_to_group_convolution.hpp b/src/common/low_precision_transformations/include/low_precision/multiply_to_group_convolution.hpp index 45252777252fc6..7a2ee304690ea8 100644 --- a/src/common/low_precision_transformations/include/low_precision/multiply_to_group_convolution.hpp +++ b/src/common/low_precision_transformations/include/low_precision/multiply_to_group_convolution.hpp @@ -28,7 +28,7 @@ class LP_TRANSFORMATIONS_API MultiplyToGroupConvolutionTransformation : public C const PrecisionsRestriction::PrecisionsByPorts& restrictions = {}); ~MultiplyToGroupConvolutionTransformation() override {} bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; bool isQuantized(const std::shared_ptr& layer, const std::vector& defaultPrecisions) const override; diff --git a/src/common/low_precision_transformations/include/low_precision/mvn.hpp b/src/common/low_precision_transformations/include/low_precision/mvn.hpp index cd73075ad5740b..f70c56ba4125e4 100644 --- a/src/common/low_precision_transformations/include/low_precision/mvn.hpp +++ b/src/common/low_precision_transformations/include/low_precision/mvn.hpp @@ -23,7 +23,7 @@ class LP_TRANSFORMATIONS_API MVNTransformation : public LayerTransformation { OPENVINO_RTTI("MVNTransformation", "0", LayerTransformation); MVNTransformation(const Params& params = Params()); bool transform(TransformationContext &context, ov::pass::pattern::Matcher &m) override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; }; diff --git a/src/common/low_precision_transformations/include/low_precision/normalize_l2.hpp b/src/common/low_precision_transformations/include/low_precision/normalize_l2.hpp index c2777ca0652a07..14d8c80fb50b5e 100644 --- a/src/common/low_precision_transformations/include/low_precision/normalize_l2.hpp +++ b/src/common/low_precision_transformations/include/low_precision/normalize_l2.hpp @@ -23,7 +23,7 @@ class LP_TRANSFORMATIONS_API NormalizeL2Transformation : public LayerTransformat OPENVINO_RTTI("NormalizeL2Transformation", "0", LayerTransformation); NormalizeL2Transformation(const Params& params = Params()); bool transform(TransformationContext &context, ov::pass::pattern::Matcher &m) override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; }; diff --git a/src/common/low_precision_transformations/include/low_precision/pad.hpp b/src/common/low_precision_transformations/include/low_precision/pad.hpp index 49012e19a604e8..c1539179ee19ee 100644 --- a/src/common/low_precision_transformations/include/low_precision/pad.hpp +++ b/src/common/low_precision_transformations/include/low_precision/pad.hpp @@ -25,7 +25,7 @@ class LP_TRANSFORMATIONS_API PadTransformation : public LayerTransformation { OPENVINO_RTTI("PadTransformation", "0", LayerTransformation); PadTransformation(const Params& params = Params()); bool transform(TransformationContext& context, pattern::Matcher& m) override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr op) const override; + bool canBeTransformed(const std::shared_ptr& op) const override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; }; diff --git a/src/common/low_precision_transformations/include/low_precision/prelu.hpp b/src/common/low_precision_transformations/include/low_precision/prelu.hpp index df64677b861dbb..64e68ae0f6e655 100644 --- a/src/common/low_precision_transformations/include/low_precision/prelu.hpp +++ b/src/common/low_precision_transformations/include/low_precision/prelu.hpp @@ -26,7 +26,7 @@ class LP_TRANSFORMATIONS_API PReluTransformation : public LayerTransformation { PReluTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr op) const override; + bool canBeTransformed(const std::shared_ptr& op) const override; }; } // namespace low_precision diff --git a/src/common/low_precision_transformations/include/low_precision/recurrent_cell.hpp b/src/common/low_precision_transformations/include/low_precision/recurrent_cell.hpp index fc0401b08dd74e..5b5321545e69d9 100644 --- a/src/common/low_precision_transformations/include/low_precision/recurrent_cell.hpp +++ b/src/common/low_precision_transformations/include/low_precision/recurrent_cell.hpp @@ -17,7 +17,7 @@ class LP_TRANSFORMATIONS_API RecurrentCellTransformation : public LayerTransform OPENVINO_RTTI("RecurrentCellTransformation", "0", LayerTransformation); RecurrentCellTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; void propagateSkipCleanupAttribute(std::shared_ptr dequantization_multiply); static std::shared_ptr wrap_fake_quantize(const std::shared_ptr parameter); diff --git a/src/common/low_precision_transformations/include/low_precision/reduce_base_transformation.hpp b/src/common/low_precision_transformations/include/low_precision/reduce_base_transformation.hpp index 4a42edd60d80c8..cd0e8c625bd336 100644 --- a/src/common/low_precision_transformations/include/low_precision/reduce_base_transformation.hpp +++ b/src/common/low_precision_transformations/include/low_precision/reduce_base_transformation.hpp @@ -23,7 +23,7 @@ class LP_TRANSFORMATIONS_API ReduceBaseTransformation : public LayerTransformati public: ReduceBaseTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher& m) override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr reduce) const override; + bool canBeTransformed(const std::shared_ptr& reduce) const override; protected: virtual void changeDequantizationValues( diff --git a/src/common/low_precision_transformations/include/low_precision/reduce_max.hpp b/src/common/low_precision_transformations/include/low_precision/reduce_max.hpp index 33f685ba8ca74c..f4e824a43fdec7 100644 --- a/src/common/low_precision_transformations/include/low_precision/reduce_max.hpp +++ b/src/common/low_precision_transformations/include/low_precision/reduce_max.hpp @@ -27,7 +27,7 @@ class LP_TRANSFORMATIONS_API ReduceMaxTransformation : public ReduceBaseTransfor OPENVINO_RTTI("ReduceMaxTransformation", "0", ReduceBaseTransformation); ReduceMaxTransformation(const Params& params = Params()); bool isPrecisionPreserved(std::shared_ptr reduce) const noexcept override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr reduce) const override; + bool canBeTransformed(const std::shared_ptr& reduce) const override; protected: bool getUpdatePrecision(const std::shared_ptr& reduce) const override; diff --git a/src/common/low_precision_transformations/include/low_precision/reduce_mean.hpp b/src/common/low_precision_transformations/include/low_precision/reduce_mean.hpp index c5f9d7d0a5e239..4a689cc4007317 100644 --- a/src/common/low_precision_transformations/include/low_precision/reduce_mean.hpp +++ b/src/common/low_precision_transformations/include/low_precision/reduce_mean.hpp @@ -27,7 +27,7 @@ class LP_TRANSFORMATIONS_API ReduceMeanTransformation : public ReduceBaseTransfo OPENVINO_RTTI("ReduceMeanTransformation", "0", ReduceBaseTransformation); ReduceMeanTransformation(const Params& params = Params()); bool isPrecisionPreserved(std::shared_ptr reduce) const noexcept override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr reduce) const override; + bool canBeTransformed(const std::shared_ptr& reduce) const override; protected: bool getUpdatePrecision(const std::shared_ptr& reduce) const override; diff --git a/src/common/low_precision_transformations/include/low_precision/reduce_min.hpp b/src/common/low_precision_transformations/include/low_precision/reduce_min.hpp index a229b441b8b6da..f41630989de361 100644 --- a/src/common/low_precision_transformations/include/low_precision/reduce_min.hpp +++ b/src/common/low_precision_transformations/include/low_precision/reduce_min.hpp @@ -27,7 +27,7 @@ class LP_TRANSFORMATIONS_API ReduceMinTransformation : public ReduceBaseTransfor OPENVINO_RTTI("ReduceMinTransformation", "0", ReduceBaseTransformation); ReduceMinTransformation(const Params& params = Params()); bool isPrecisionPreserved(std::shared_ptr reduce) const noexcept override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr reduce) const override; + bool canBeTransformed(const std::shared_ptr& reduce) const override; protected: bool getUpdatePrecision(const std::shared_ptr& reduce) const override; diff --git a/src/common/low_precision_transformations/include/low_precision/reduce_sum.hpp b/src/common/low_precision_transformations/include/low_precision/reduce_sum.hpp index aba35e0f793c83..0efd79b2472624 100644 --- a/src/common/low_precision_transformations/include/low_precision/reduce_sum.hpp +++ b/src/common/low_precision_transformations/include/low_precision/reduce_sum.hpp @@ -27,7 +27,7 @@ class LP_TRANSFORMATIONS_API ReduceSumTransformation : public ReduceBaseTransfor OPENVINO_RTTI("ReduceSumTransformation", "0", ReduceBaseTransformation); ReduceSumTransformation(const Params& params = Params()); bool isPrecisionPreserved(std::shared_ptr reduce) const noexcept override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr reduce) const override; + bool canBeTransformed(const std::shared_ptr& reduce) const override; protected: void changeDequantizationValues( diff --git a/src/common/low_precision_transformations/include/low_precision/relu.hpp b/src/common/low_precision_transformations/include/low_precision/relu.hpp index 936d4f3f8fc9a8..cee4295df56ffb 100644 --- a/src/common/low_precision_transformations/include/low_precision/relu.hpp +++ b/src/common/low_precision_transformations/include/low_precision/relu.hpp @@ -26,7 +26,7 @@ class LP_TRANSFORMATIONS_API ReluTransformation : public LayerTransformation { ReluTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr op) const override; + bool canBeTransformed(const std::shared_ptr& op) const override; }; } // namespace low_precision diff --git a/src/common/low_precision_transformations/include/low_precision/reshape.hpp b/src/common/low_precision_transformations/include/low_precision/reshape.hpp index 43858e67cce21a..5af2bce33c9a91 100644 --- a/src/common/low_precision_transformations/include/low_precision/reshape.hpp +++ b/src/common/low_precision_transformations/include/low_precision/reshape.hpp @@ -25,7 +25,7 @@ class LP_TRANSFORMATIONS_API ReshapeTransformation : public LayerTransformation ReshapeTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr op) const override; + bool canBeTransformed(const std::shared_ptr& op) const override; static bool canBeTransformed( const ov::Shape& subtractShape, diff --git a/src/common/low_precision_transformations/include/low_precision/shuffle_channels.hpp b/src/common/low_precision_transformations/include/low_precision/shuffle_channels.hpp index 12a60b128d707d..90babac1a35a63 100644 --- a/src/common/low_precision_transformations/include/low_precision/shuffle_channels.hpp +++ b/src/common/low_precision_transformations/include/low_precision/shuffle_channels.hpp @@ -25,7 +25,7 @@ class LP_TRANSFORMATIONS_API ShuffleChannelsTransformation : public LayerTransfo ShuffleChannelsTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher& m) override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr op) const override; + bool canBeTransformed(const std::shared_ptr& op) const override; }; } // namespace low_precision diff --git a/src/common/low_precision_transformations/include/low_precision/slice.hpp b/src/common/low_precision_transformations/include/low_precision/slice.hpp index c00028f0d71169..34fc06d7b9fb4b 100644 --- a/src/common/low_precision_transformations/include/low_precision/slice.hpp +++ b/src/common/low_precision_transformations/include/low_precision/slice.hpp @@ -25,7 +25,7 @@ class LP_TRANSFORMATIONS_API SliceTransformation : public LayerTransformation { OPENVINO_RTTI("SliceTransformation", "0", LayerTransformation); SliceTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher& m) override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr op) const override; + bool canBeTransformed(const std::shared_ptr& op) const override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; }; diff --git a/src/common/low_precision_transformations/include/low_precision/space_to_batch.hpp b/src/common/low_precision_transformations/include/low_precision/space_to_batch.hpp index e05353aaf24d1c..4e3831ef9a4fb6 100644 --- a/src/common/low_precision_transformations/include/low_precision/space_to_batch.hpp +++ b/src/common/low_precision_transformations/include/low_precision/space_to_batch.hpp @@ -24,7 +24,7 @@ class LP_TRANSFORMATIONS_API SpaceToBatchTransformation : public LayerTransforma public: OPENVINO_RTTI("SpaceToBatchTransformation", "0", LayerTransformation); SpaceToBatchTransformation(const Params& params = Params()); - bool canBeTransformed(const TransformationContext& context, std::shared_ptr op) const override; + bool canBeTransformed(const std::shared_ptr& op) const override; bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; }; diff --git a/src/common/low_precision_transformations/include/low_precision/split.hpp b/src/common/low_precision_transformations/include/low_precision/split.hpp index bd3294fba7e691..b5c18dafa590b5 100644 --- a/src/common/low_precision_transformations/include/low_precision/split.hpp +++ b/src/common/low_precision_transformations/include/low_precision/split.hpp @@ -27,7 +27,7 @@ class LP_TRANSFORMATIONS_API SplitTransformation : public LayerTransformation { SplitTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher& m) override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; void updateOutputs( TransformationContext& context, std::vector> lastNodes, diff --git a/src/common/low_precision_transformations/include/low_precision/squeeze.hpp b/src/common/low_precision_transformations/include/low_precision/squeeze.hpp index b19a676c6de1fd..7226f28d30eae0 100644 --- a/src/common/low_precision_transformations/include/low_precision/squeeze.hpp +++ b/src/common/low_precision_transformations/include/low_precision/squeeze.hpp @@ -25,7 +25,7 @@ class LP_TRANSFORMATIONS_API SqueezeTransformation : public LayerTransformation SqueezeTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; }; } // namespace low_precision diff --git a/src/common/low_precision_transformations/include/low_precision/strided_slice.hpp b/src/common/low_precision_transformations/include/low_precision/strided_slice.hpp index 5081903c751dfb..bfde97ebac89bc 100644 --- a/src/common/low_precision_transformations/include/low_precision/strided_slice.hpp +++ b/src/common/low_precision_transformations/include/low_precision/strided_slice.hpp @@ -25,7 +25,7 @@ class LP_TRANSFORMATIONS_API StridedSliceTransformation : public LayerTransforma OPENVINO_RTTI("StridedSliceTransformation", "0", LayerTransformation); StridedSliceTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher& m) override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr op) const override; + bool canBeTransformed(const std::shared_ptr& op) const override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; }; diff --git a/src/common/low_precision_transformations/include/low_precision/transparent_base_transformation.hpp b/src/common/low_precision_transformations/include/low_precision/transparent_base_transformation.hpp index 792c749f525b53..edfbb516d99b8c 100644 --- a/src/common/low_precision_transformations/include/low_precision/transparent_base_transformation.hpp +++ b/src/common/low_precision_transformations/include/low_precision/transparent_base_transformation.hpp @@ -21,7 +21,7 @@ class LP_TRANSFORMATIONS_API TransparentBaseTransformation : public LayerTransfo TransparentBaseTransformation(const Params& params) : LayerTransformation(params) {} ~TransparentBaseTransformation() override {}; bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; }; diff --git a/src/common/low_precision_transformations/include/low_precision/transpose.hpp b/src/common/low_precision_transformations/include/low_precision/transpose.hpp index f2cedb31e2e5a7..9f4544d1ea1b48 100644 --- a/src/common/low_precision_transformations/include/low_precision/transpose.hpp +++ b/src/common/low_precision_transformations/include/low_precision/transpose.hpp @@ -26,7 +26,7 @@ class LP_TRANSFORMATIONS_API TransposeTransformation : public LayerTransformatio TransposeTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr op) const override; + bool canBeTransformed(const std::shared_ptr& op) const override; }; } // namespace low_precision diff --git a/src/common/low_precision_transformations/include/low_precision/unsqueeze.hpp b/src/common/low_precision_transformations/include/low_precision/unsqueeze.hpp index 98152eaf919524..ec6526fb310f98 100644 --- a/src/common/low_precision_transformations/include/low_precision/unsqueeze.hpp +++ b/src/common/low_precision_transformations/include/low_precision/unsqueeze.hpp @@ -25,7 +25,7 @@ class LP_TRANSFORMATIONS_API UnsqueezeTransformation : public LayerTransformatio UnsqueezeTransformation(const Params& params = Params()); bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const std::shared_ptr& layer) const override; }; } // namespace low_precision diff --git a/src/common/low_precision_transformations/include/low_precision/weightable_layer_transformation.hpp b/src/common/low_precision_transformations/include/low_precision/weightable_layer_transformation.hpp index dfb75067ff426b..5f7b50716ca6cf 100644 --- a/src/common/low_precision_transformations/include/low_precision/weightable_layer_transformation.hpp +++ b/src/common/low_precision_transformations/include/low_precision/weightable_layer_transformation.hpp @@ -42,17 +42,11 @@ class LP_TRANSFORMATIONS_API WeightableLayerTransformation : public LayerTransfo WeightableLayerTransformation(const Params& params, const CanBeTransformedParams& canBeTransformedParams = {}); - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; - bool canConvolutionBeTransformed(const TransformationContext& context, std::shared_ptr layer, - const std::vector& defaultPrecisions) const; + bool canBeTransformed(const std::shared_ptr& layer) const override; + bool canConvolutionBeTransformed(const std::shared_ptr& layer, + const ov::element::TypeVector& defaultPrecisions) const; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; - static bool checkPrecisionOnActivation( - const std::shared_ptr& node, - const std::vector& supportedPrecisionsOnActivations) { - return true; - } - static bool isQuantizedStatic(const std::shared_ptr& layer, const bool reshapeIsRequired, const std::vector& defaultPrecisions = precision_set::get_int8_support()); diff --git a/src/common/low_precision_transformations/src/add.cpp b/src/common/low_precision_transformations/src/add.cpp index c260e0178ec98c..cc021bc9d56251 100644 --- a/src/common/low_precision_transformations/src/add.cpp +++ b/src/common/low_precision_transformations/src/add.cpp @@ -104,7 +104,7 @@ AddTransformation::AddTransformation(const Params& params) : EltwiseBaseTransfor bool AddTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher &m) { std::shared_ptr op = ov::as_type_ptr(m.get_match_root()); - if ((op == nullptr) || (!canBeTransformed(context, op))) { + if ((op == nullptr) || (!canBeTransformed(op))) { return false; } @@ -240,7 +240,7 @@ bool AddTransformation::transform(TransformationContext& context, ov::pass::patt return true; } -bool AddTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const { +bool AddTransformation::canBeTransformed(const std::shared_ptr& layer) const { const FakeQuantizeDequantization dequantization1 = pass::low_precision::NetworkHelper::getDequantization(layer, defaultPrecisions, 0ul); if (dequantization1.multiplyHasZeroOrDenormal()) { return false; @@ -251,7 +251,7 @@ bool AddTransformation::canBeTransformed(const TransformationContext& context, s return false; } - return EltwiseBaseTransformation::canBeTransformed(context, layer); + return EltwiseBaseTransformation::canBeTransformed(layer); } } // namespace low_precision diff --git a/src/common/low_precision_transformations/src/assign_and_read_value.cpp b/src/common/low_precision_transformations/src/assign_and_read_value.cpp index 27b79e4d347102..f74047f4703395 100644 --- a/src/common/low_precision_transformations/src/assign_and_read_value.cpp +++ b/src/common/low_precision_transformations/src/assign_and_read_value.cpp @@ -49,7 +49,7 @@ AssignAndReadValueTransformation::AssignAndReadValueTransformation(const std::sh } bool AssignAndReadValueTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher& m) { - if (!canBeTransformed(context, m.get_match_root())) { + if (!canBeTransformed(m.get_match_root())) { return false; } @@ -104,8 +104,8 @@ bool AssignAndReadValueTransformation::transform(TransformationContext& context, return true; } -bool AssignAndReadValueTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr op) const { - if (!LayerTransformation::canBeTransformed(context, op)) { +bool AssignAndReadValueTransformation::canBeTransformed(const std::shared_ptr& op) const { + if (!LayerTransformation::canBeTransformed(op)) { return false; } diff --git a/src/common/low_precision_transformations/src/avg_pool.cpp b/src/common/low_precision_transformations/src/avg_pool.cpp index 3962ebe2ab2d6d..c519693ccc6d12 100644 --- a/src/common/low_precision_transformations/src/avg_pool.cpp +++ b/src/common/low_precision_transformations/src/avg_pool.cpp @@ -35,7 +35,7 @@ AvgPoolTransformation::AvgPoolTransformation(const Params& params) : LayerTransf } bool AvgPoolTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher &m) { - if (!canBeTransformed(context, m.get_match_root())) { + if (!canBeTransformed(m.get_match_root())) { return false; } @@ -47,8 +47,8 @@ bool AvgPoolTransformation::transform(TransformationContext& context, ov::pass:: return true; } -bool AvgPoolTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr operation) const { - if (!LayerTransformation::canBeTransformed(context, operation)) { +bool AvgPoolTransformation::canBeTransformed(const std::shared_ptr& operation) const { + if (!LayerTransformation::canBeTransformed(operation)) { return false; } diff --git a/src/common/low_precision_transformations/src/batch_to_space.cpp b/src/common/low_precision_transformations/src/batch_to_space.cpp index 85cfe1ad8f2e3e..70a424082d32cb 100644 --- a/src/common/low_precision_transformations/src/batch_to_space.cpp +++ b/src/common/low_precision_transformations/src/batch_to_space.cpp @@ -33,8 +33,8 @@ BatchToSpaceTransformation::BatchToSpaceTransformation(const Params& params) : L this->register_matcher(m, callback); } -bool BatchToSpaceTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr op) const { - if (!LayerTransformation::canBeTransformed(context, op)) { +bool BatchToSpaceTransformation::canBeTransformed(const std::shared_ptr& op) const { + if (!LayerTransformation::canBeTransformed(op)) { return false; } @@ -47,7 +47,7 @@ bool BatchToSpaceTransformation::canBeTransformed(const TransformationContext& c } bool BatchToSpaceTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher& m) { - if (!canBeTransformed(context, m.get_match_root())) { + if (!canBeTransformed(m.get_match_root())) { return false; } diff --git a/src/common/low_precision_transformations/src/broadcast.cpp b/src/common/low_precision_transformations/src/broadcast.cpp index 5e78ca0ef50996..27977b42cbd9e1 100644 --- a/src/common/low_precision_transformations/src/broadcast.cpp +++ b/src/common/low_precision_transformations/src/broadcast.cpp @@ -42,8 +42,8 @@ BroadcastTransformation::BroadcastTransformation(const Params& params) : Transpa this->register_matcher(m, callback); } -bool BroadcastTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const { - if (!LayerTransformation::canBeTransformed(context, layer)) { +bool BroadcastTransformation::canBeTransformed(const std::shared_ptr& layer) const { + if (!LayerTransformation::canBeTransformed(layer)) { return false; } diff --git a/src/common/low_precision_transformations/src/clamp.cpp b/src/common/low_precision_transformations/src/clamp.cpp index a727d7c7a1aad8..fe7ba6345cd630 100644 --- a/src/common/low_precision_transformations/src/clamp.cpp +++ b/src/common/low_precision_transformations/src/clamp.cpp @@ -32,7 +32,7 @@ ClampTransformation::ClampTransformation(const Params& params) : LayerTransforma } bool ClampTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher& m) { - if (!canBeTransformed(context, m.get_match_root())) { + if (!canBeTransformed(m.get_match_root())) { return false; } @@ -81,8 +81,8 @@ bool ClampTransformation::transform(TransformationContext& context, ov::pass::pa return true; } -bool ClampTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr op) const { - if (!LayerTransformation::canBeTransformed(context, op)) { +bool ClampTransformation::canBeTransformed(const std::shared_ptr& op) const { + if (!LayerTransformation::canBeTransformed(op)) { return false; } diff --git a/src/common/low_precision_transformations/src/cleanup_transformation.cpp b/src/common/low_precision_transformations/src/cleanup_transformation.cpp index 3a7cb0da5d5c36..e3c363818013b5 100644 --- a/src/common/low_precision_transformations/src/cleanup_transformation.cpp +++ b/src/common/low_precision_transformations/src/cleanup_transformation.cpp @@ -13,7 +13,7 @@ namespace low_precision { CleanupTransformation::CleanupTransformation(const Params& params) : LayerTransformation(params) { } -bool CleanupTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const { +bool CleanupTransformation::canBeTransformed(const std::shared_ptr& layer) const { return canBeTransformedStatic(layer); } diff --git a/src/common/low_precision_transformations/src/concat.cpp b/src/common/low_precision_transformations/src/concat.cpp index 1141f2a09929f0..edebcf3eb37ec8 100644 --- a/src/common/low_precision_transformations/src/concat.cpp +++ b/src/common/low_precision_transformations/src/concat.cpp @@ -40,7 +40,7 @@ ConcatTransformation::ConcatTransformation(const Params& params) : LayerTransfor } bool ConcatTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher &m) { - if (!canBeTransformed(context, m.get_match_root())) { + if (!canBeTransformed(m.get_match_root())) { return false; } @@ -203,7 +203,7 @@ bool ConcatTransformation::isPrecisionPreserved(std::shared_ptr) const noe return true; } -bool ConcatTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const { +bool ConcatTransformation::canBeTransformed(const std::shared_ptr& layer) const { std::shared_ptr concat = ov::as_type_ptr(layer); if (concat == nullptr) { return false; diff --git a/src/common/low_precision_transformations/src/convert.cpp b/src/common/low_precision_transformations/src/convert.cpp index 4b773fc67c52c1..a5b5ff1b1144ad 100644 --- a/src/common/low_precision_transformations/src/convert.cpp +++ b/src/common/low_precision_transformations/src/convert.cpp @@ -44,7 +44,7 @@ bool ConvertTransformation::transform(TransformationContext& context, ov::pass:: return false; } - if (!canBeTransformed(context, convert)) { + if (!canBeTransformed(convert)) { return false; } diff --git a/src/common/low_precision_transformations/src/convolution.cpp b/src/common/low_precision_transformations/src/convolution.cpp index f2705200c55ba9..f00659a9e3e874 100644 --- a/src/common/low_precision_transformations/src/convolution.cpp +++ b/src/common/low_precision_transformations/src/convolution.cpp @@ -65,7 +65,7 @@ size_t ConvolutionTransformation::getInputChannels(const std::shared_ptrget_input_node_shared_ptr(1); const auto reshapeFromWeights = ov::as_type_ptr(weightInput); FakeQuantizeDequantization dequantization = reshapeFromWeights == nullptr ? diff --git a/src/common/low_precision_transformations/src/convolution_backprop_data.cpp b/src/common/low_precision_transformations/src/convolution_backprop_data.cpp index b9e91137e5c9a2..2fff4aa7c1b44e 100644 --- a/src/common/low_precision_transformations/src/convolution_backprop_data.cpp +++ b/src/common/low_precision_transformations/src/convolution_backprop_data.cpp @@ -77,7 +77,7 @@ size_t ConvolutionBackpropDataTransformation::getInputChannels(const std::shared bool ConvolutionBackpropDataTransformation::transform(TransformationContext &context, ov::pass::pattern::Matcher &m) { auto convolutionBackpropData = m.get_match_root(); - if (!canBeTransformed(context, convolutionBackpropData)) { + if (!canBeTransformed(convolutionBackpropData)) { auto weightsInput = convolutionBackpropData->get_input_node_shared_ptr(1); std::shared_ptr reshapeFromWeights = ov::as_type_ptr(weightsInput); FakeQuantizeDequantization dequantization = reshapeFromWeights == nullptr ? @@ -245,8 +245,8 @@ bool ConvolutionBackpropDataTransformation::transform(TransformationContext &con return true; } -bool ConvolutionBackpropDataTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr op) const { - return canConvolutionBeTransformed(context, op, defaultPrecisions); +bool ConvolutionBackpropDataTransformation::canBeTransformed(const std::shared_ptr& op) const { + return canConvolutionBeTransformed(op, defaultPrecisions); } } // namespace low_precision diff --git a/src/common/low_precision_transformations/src/depth_to_space.cpp b/src/common/low_precision_transformations/src/depth_to_space.cpp index eb518d62202840..0574c4bbc2215d 100644 --- a/src/common/low_precision_transformations/src/depth_to_space.cpp +++ b/src/common/low_precision_transformations/src/depth_to_space.cpp @@ -27,8 +27,8 @@ DepthToSpaceTransformation::DepthToSpaceTransformation(const Params& params) : T this->register_matcher(m, callback); } -bool DepthToSpaceTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const { - if (!LayerTransformation::canBeTransformed(context, layer)) { +bool DepthToSpaceTransformation::canBeTransformed(const std::shared_ptr& layer) const { + if (!LayerTransformation::canBeTransformed(layer)) { return false; } diff --git a/src/common/low_precision_transformations/src/eliminate_fake_quantize.cpp b/src/common/low_precision_transformations/src/eliminate_fake_quantize.cpp index cb5d9270a43768..334b2fa8e8c720 100644 --- a/src/common/low_precision_transformations/src/eliminate_fake_quantize.cpp +++ b/src/common/low_precision_transformations/src/eliminate_fake_quantize.cpp @@ -39,7 +39,7 @@ EliminateFakeQuantizeTransformation::EliminateFakeQuantizeTransformation(const P bool EliminateFakeQuantizeTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher& m) { const auto root = m.get_match_root(); - if (!canBeTransformed(context, root)) { + if (!canBeTransformed(root)) { return false; } @@ -115,8 +115,8 @@ bool check_intervals(const std::shared_ptr& fakeQuanti } } // namespace -bool EliminateFakeQuantizeTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr operation) const { - if (!CleanupTransformation::canBeTransformed(context, operation)) { +bool EliminateFakeQuantizeTransformation::canBeTransformed(const std::shared_ptr& operation) const { + if (!CleanupTransformation::canBeTransformed(operation)) { return false; } diff --git a/src/common/low_precision_transformations/src/eltwise_base_transformation.cpp b/src/common/low_precision_transformations/src/eltwise_base_transformation.cpp index f7cf7033543b40..f5594fc9fcf8cb 100644 --- a/src/common/low_precision_transformations/src/eltwise_base_transformation.cpp +++ b/src/common/low_precision_transformations/src/eltwise_base_transformation.cpp @@ -33,8 +33,8 @@ bool EltwiseBaseTransformation::isBroadcasted(const PartialShape& shape) { return true; } -bool EltwiseBaseTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr operation) const { - if (!LayerTransformation::canBeTransformed(context, operation)) { +bool EltwiseBaseTransformation::canBeTransformed(const std::shared_ptr& operation) const { + if (!LayerTransformation::canBeTransformed(operation)) { return false; } diff --git a/src/common/low_precision_transformations/src/fold_convert.cpp b/src/common/low_precision_transformations/src/fold_convert.cpp index 4726c49a7f8a95..673285c2073072 100644 --- a/src/common/low_precision_transformations/src/fold_convert.cpp +++ b/src/common/low_precision_transformations/src/fold_convert.cpp @@ -32,7 +32,7 @@ FoldConvertTransformation::FoldConvertTransformation(const Params& params) : Cle bool FoldConvertTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher &m) { const auto subtract = m.get_match_root(); - if (!canBeTransformed(context, subtract)) { + if (!canBeTransformed(subtract)) { return false; } @@ -55,9 +55,9 @@ bool FoldConvertTransformation::transform(TransformationContext& context, ov::pa return true; } -bool FoldConvertTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr operation) const { +bool FoldConvertTransformation::canBeTransformed(const std::shared_ptr& operation) const { return - CleanupTransformation::canBeTransformed(context, operation) && + CleanupTransformation::canBeTransformed(operation) && ((ov::is_type(operation->get_input_node_ptr(1)) && ov::is_type(operation->get_input_node_ptr(1)->get_input_node_ptr(0))) || (ov::is_type(operation->get_input_node_ptr(0)) && diff --git a/src/common/low_precision_transformations/src/fold_fake_quantize.cpp b/src/common/low_precision_transformations/src/fold_fake_quantize.cpp index 2f275ccb995c4f..b6622cb6595222 100644 --- a/src/common/low_precision_transformations/src/fold_fake_quantize.cpp +++ b/src/common/low_precision_transformations/src/fold_fake_quantize.cpp @@ -39,7 +39,7 @@ bool FoldFakeQuantizeTransformation::transform(TransformationContext& context, o return false; } - if (!canBeTransformed(context, fakeQuantize)) { + if (!canBeTransformed(fakeQuantize)) { return false; } @@ -76,7 +76,7 @@ bool FoldFakeQuantizeTransformation::isConstantOutput(std::shared_ptr return vecLow == vecHigh; } -bool FoldFakeQuantizeTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr op) const { +bool FoldFakeQuantizeTransformation::canBeTransformed(const std::shared_ptr& op) const { if (!NetworkHelper::isConstantPath(op) && !isConstantOutput(op)) { return false; } diff --git a/src/common/low_precision_transformations/src/fuse_convert.cpp b/src/common/low_precision_transformations/src/fuse_convert.cpp index bda3cd8b3d38c8..a54b1f17ad53eb 100644 --- a/src/common/low_precision_transformations/src/fuse_convert.cpp +++ b/src/common/low_precision_transformations/src/fuse_convert.cpp @@ -70,7 +70,7 @@ std::shared_ptr removeConvertIfPossibleForSubtract( bool FuseConvertTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher &m) { const auto op = m.get_match_root(); - if (!canBeTransformed(context, op)) { + if (!canBeTransformed(op)) { return false; } @@ -114,8 +114,8 @@ bool FuseConvertTransformation::transform(TransformationContext& context, ov::pa return true; } -bool FuseConvertTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr op) const { - if (!CleanupTransformation::canBeTransformed(context, op)) { +bool FuseConvertTransformation::canBeTransformed(const std::shared_ptr& op) const { + if (!CleanupTransformation::canBeTransformed(op)) { return false; } diff --git a/src/common/low_precision_transformations/src/fuse_elementwise_to_fake_quantize.cpp b/src/common/low_precision_transformations/src/fuse_elementwise_to_fake_quantize.cpp index e9418da055c929..5f8d9be15eb20b 100644 --- a/src/common/low_precision_transformations/src/fuse_elementwise_to_fake_quantize.cpp +++ b/src/common/low_precision_transformations/src/fuse_elementwise_to_fake_quantize.cpp @@ -15,8 +15,8 @@ namespace low_precision { FuseElementwiseToFakeQuantizeTransformation::FuseElementwiseToFakeQuantizeTransformation(const Params& params) : CleanupTransformation(params) { } -bool FuseElementwiseToFakeQuantizeTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr operation) const { - if (!CleanupTransformation::canBeTransformed(context, operation)) { +bool FuseElementwiseToFakeQuantizeTransformation::canBeTransformed(const std::shared_ptr& operation) const { + if (!CleanupTransformation::canBeTransformed(operation)) { return false; } diff --git a/src/common/low_precision_transformations/src/fuse_multiply_to_fake_quantize.cpp b/src/common/low_precision_transformations/src/fuse_multiply_to_fake_quantize.cpp index f1087013561fbd..473ed1923f333f 100644 --- a/src/common/low_precision_transformations/src/fuse_multiply_to_fake_quantize.cpp +++ b/src/common/low_precision_transformations/src/fuse_multiply_to_fake_quantize.cpp @@ -34,7 +34,7 @@ FuseMultiplyToFakeQuantizeTransformation::FuseMultiplyToFakeQuantizeTransformati bool FuseMultiplyToFakeQuantizeTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher &m) { const auto multiply = m.get_match_root(); - if (!canBeTransformed(context, multiply)) { + if (!canBeTransformed(multiply)) { return false; } diff --git a/src/common/low_precision_transformations/src/fuse_subtract_to_fake_quantize.cpp b/src/common/low_precision_transformations/src/fuse_subtract_to_fake_quantize.cpp index a47c15c82c1954..a0603c0aee0b59 100644 --- a/src/common/low_precision_transformations/src/fuse_subtract_to_fake_quantize.cpp +++ b/src/common/low_precision_transformations/src/fuse_subtract_to_fake_quantize.cpp @@ -34,7 +34,7 @@ FuseSubtractToFakeQuantizeTransformation::FuseSubtractToFakeQuantizeTransformati bool FuseSubtractToFakeQuantizeTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher &m) { const auto subtract = m.get_match_root(); - if (!canBeTransformed(context, subtract)) { + if (!canBeTransformed(subtract)) { return false; } diff --git a/src/common/low_precision_transformations/src/gather.cpp b/src/common/low_precision_transformations/src/gather.cpp index 9f8c6fe6cb857d..7a226c9e664bc6 100644 --- a/src/common/low_precision_transformations/src/gather.cpp +++ b/src/common/low_precision_transformations/src/gather.cpp @@ -104,7 +104,7 @@ GatherTransformation::GatherTransformation(const Params& params) : LayerTransfor bool GatherTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher &m) { auto node = m.get_match_root(); - if (!canBeTransformed(context, m.get_match_root())) { + if (!canBeTransformed(m.get_match_root())) { return false; } @@ -126,8 +126,8 @@ bool GatherTransformation::transform(TransformationContext& context, ov::pass::p return true; } -bool GatherTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr operation) const { - if (!LayerTransformation::canBeTransformed(context, operation)) { +bool GatherTransformation::canBeTransformed(const std::shared_ptr& operation) const { + if (!LayerTransformation::canBeTransformed(operation)) { return false; } diff --git a/src/common/low_precision_transformations/src/group_convolution.cpp b/src/common/low_precision_transformations/src/group_convolution.cpp index 6e2f48cd10e734..0d8eb43e51f778 100644 --- a/src/common/low_precision_transformations/src/group_convolution.cpp +++ b/src/common/low_precision_transformations/src/group_convolution.cpp @@ -40,7 +40,7 @@ bool GroupConvolutionTransformation::isQuantized(const std::shared_ptr interpolate = m.get_match_root(); - if (!canBeTransformed(context, m.get_match_root())) { + if (!canBeTransformed(m.get_match_root())) { return false; } interpolate = NetworkHelper::separateInStandaloneBranch(interpolate, defaultPrecisions); @@ -84,8 +84,8 @@ bool InterpolateTransformation::isPrecisionPreserved(std::shared_ptr layer return false; } -bool InterpolateTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const { - if (!LayerTransformation::canBeTransformed(context, layer)) { +bool InterpolateTransformation::canBeTransformed(const std::shared_ptr& layer) const { + if (!LayerTransformation::canBeTransformed(layer)) { return false; } diff --git a/src/common/low_precision_transformations/src/layer_transformation.cpp b/src/common/low_precision_transformations/src/layer_transformation.cpp index 24bc7e9000eb6d..fc852fe1d7b9f1 100644 --- a/src/common/low_precision_transformations/src/layer_transformation.cpp +++ b/src/common/low_precision_transformations/src/layer_transformation.cpp @@ -56,7 +56,7 @@ void LayerTransformation::setDefaultPrecisions(const std::vectordefaultPrecisions = defaultPrecisions; } -bool LayerTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const { +bool LayerTransformation::canBeTransformed(const std::shared_ptr& layer) const { if (!isQuantized(layer, defaultPrecisions)) { return false; } diff --git a/src/common/low_precision_transformations/src/mat_mul.cpp b/src/common/low_precision_transformations/src/mat_mul.cpp index d8f23d467de7af..696bec133f23f0 100644 --- a/src/common/low_precision_transformations/src/mat_mul.cpp +++ b/src/common/low_precision_transformations/src/mat_mul.cpp @@ -41,7 +41,7 @@ MatMulTransformation::MatMulTransformation(const Params& params) : LayerTransfor bool MatMulTransformation::transform(TransformationContext &context, ov::pass::pattern::Matcher &m) { std::shared_ptr matMul = ov::as_type_ptr(m.get_match_root()); - if ((matMul == nullptr) || !canBeTransformed(context, matMul)) { + if ((matMul == nullptr) || !canBeTransformed(matMul)) { return false; } @@ -184,7 +184,7 @@ bool MatMulTransformation::isPrecisionPreserved(std::shared_ptr layer) con return false; } -bool MatMulTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const { +bool MatMulTransformation::canBeTransformed(const std::shared_ptr& layer) const { if (!LayerTransformation::canBeTransformedSpatialDimension(layer)) { return false; } diff --git a/src/common/low_precision_transformations/src/max_pool.cpp b/src/common/low_precision_transformations/src/max_pool.cpp index 738e08adaec5a8..a3cf52587a45d2 100644 --- a/src/common/low_precision_transformations/src/max_pool.cpp +++ b/src/common/low_precision_transformations/src/max_pool.cpp @@ -33,8 +33,8 @@ MaxPoolTransformation::MaxPoolTransformation(const Params& params) : LayerTransf this->register_matcher(m, callback); } -bool MaxPoolTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr op) const { - if (!LayerTransformation::canBeTransformed(context, op)) { +bool MaxPoolTransformation::canBeTransformed(const std::shared_ptr& op) const { + if (!LayerTransformation::canBeTransformed(op)) { return false; } @@ -52,7 +52,7 @@ bool MaxPoolTransformation::canBeTransformed(const TransformationContext& contex } bool MaxPoolTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher &m) { - if (!canBeTransformed(context, m.get_match_root())) { + if (!canBeTransformed(m.get_match_root())) { return false; } diff --git a/src/common/low_precision_transformations/src/move_fake_quantize.cpp b/src/common/low_precision_transformations/src/move_fake_quantize.cpp index 902ce083787a03..7d08f268d4bbe0 100644 --- a/src/common/low_precision_transformations/src/move_fake_quantize.cpp +++ b/src/common/low_precision_transformations/src/move_fake_quantize.cpp @@ -57,7 +57,7 @@ MoveFakeQuantize::MoveFakeQuantize(const Params& params) : LayerTransformation(p bool MoveFakeQuantize::transform(TransformationContext& context, ov::pass::pattern::Matcher& m) { const auto fq = m.get_match_root(); - if (!canBeTransformed(context, fq)) { + if (!canBeTransformed(fq)) { return false; } @@ -165,7 +165,7 @@ bool MoveFakeQuantize::transform(TransformationContext& context, ov::pass::patte return true; } -bool MoveFakeQuantize::canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const { +bool MoveFakeQuantize::canBeTransformed(const std::shared_ptr& layer) const { auto operation = layer->get_input_node_shared_ptr(0); std::shared_ptr concat; if (is_type(operation)) { diff --git a/src/common/low_precision_transformations/src/multiply.cpp b/src/common/low_precision_transformations/src/multiply.cpp index 0f1e10e881c13a..6c12c6ef7a3ccc 100644 --- a/src/common/low_precision_transformations/src/multiply.cpp +++ b/src/common/low_precision_transformations/src/multiply.cpp @@ -42,7 +42,7 @@ MultiplyTransformation::MultiplyTransformation(const Params& params) : bool MultiplyTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher& m) { auto multiply = m.get_match_root(); - if (!canBeTransformed(context, multiply)) { + if (!canBeTransformed(multiply)) { return false; } diff --git a/src/common/low_precision_transformations/src/multiply_partial.cpp b/src/common/low_precision_transformations/src/multiply_partial.cpp index c546a379b5137e..7c7e3c4dbc67dc 100644 --- a/src/common/low_precision_transformations/src/multiply_partial.cpp +++ b/src/common/low_precision_transformations/src/multiply_partial.cpp @@ -41,7 +41,7 @@ MultiplyPartialTransformation::MultiplyPartialTransformation(const Params& param bool MultiplyPartialTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher& m) { auto multiply = m.get_match_root(); - if (!canBeTransformed(context, multiply)) { + if (!canBeTransformed(multiply)) { return false; } @@ -178,7 +178,7 @@ bool MultiplyPartialTransformation::transform(TransformationContext& context, ov return true; } -bool MultiplyPartialTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const { +bool MultiplyPartialTransformation::canBeTransformed(const std::shared_ptr& layer) const { FakeQuantizeDequantization dequantization1 = pass::low_precision::NetworkHelper::getDequantization(layer, defaultPrecisions, 0ul); FakeQuantizeDequantization dequantization2 = pass::low_precision::NetworkHelper::getDequantization(layer, defaultPrecisions, 1ul); @@ -193,7 +193,7 @@ bool MultiplyPartialTransformation::canBeTransformed(const TransformationContext return false; } - return EltwiseBaseTransformation::canBeTransformed(context, layer); + return EltwiseBaseTransformation::canBeTransformed(layer); } } // namespace low_precision diff --git a/src/common/low_precision_transformations/src/multiply_to_group_convolution.cpp b/src/common/low_precision_transformations/src/multiply_to_group_convolution.cpp index 466b7ad6c75e5d..b2e33545bcb85b 100644 --- a/src/common/low_precision_transformations/src/multiply_to_group_convolution.cpp +++ b/src/common/low_precision_transformations/src/multiply_to_group_convolution.cpp @@ -33,7 +33,7 @@ MultiplyToGroupConvolutionTransformation::MultiplyToGroupConvolutionTransformati bool MultiplyToGroupConvolutionTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher &m) { const auto multiply = m.get_match_root(); - if (!canBeTransformed(context, multiply)) { + if (!canBeTransformed(multiply)) { return false; } @@ -142,8 +142,8 @@ bool MultiplyToGroupConvolutionTransformation::transform(TransformationContext& return true; } -bool MultiplyToGroupConvolutionTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr operation) const { - if (!CleanupTransformation::canBeTransformed(context, operation)) { +bool MultiplyToGroupConvolutionTransformation::canBeTransformed(const std::shared_ptr& operation) const { + if (!CleanupTransformation::canBeTransformed(operation)) { return false; } diff --git a/src/common/low_precision_transformations/src/mvn.cpp b/src/common/low_precision_transformations/src/mvn.cpp index ec4b349ed679ce..a53115ca986da3 100644 --- a/src/common/low_precision_transformations/src/mvn.cpp +++ b/src/common/low_precision_transformations/src/mvn.cpp @@ -59,8 +59,8 @@ MVNTransformation::MVNTransformation(const Params& params) : LayerTransformation this->register_matcher(m, callback); } -bool MVNTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr operation) const { - if (!LayerTransformation::canBeTransformed(context, operation)) { +bool MVNTransformation::canBeTransformed(const std::shared_ptr& operation) const { + if (!LayerTransformation::canBeTransformed(operation)) { return false; } @@ -119,7 +119,7 @@ bool MVNTransformation::canBeTransformed(const TransformationContext& context, s bool MVNTransformation::transform(TransformationContext &context, ov::pass::pattern::Matcher &m) { std::shared_ptr operation = m.get_match_root(); - if (!canBeTransformed(context, operation)) { + if (!canBeTransformed(operation)) { return false; } diff --git a/src/common/low_precision_transformations/src/normalize_l2.cpp b/src/common/low_precision_transformations/src/normalize_l2.cpp index ce6a1768e4cf8e..dec95ae4eb667d 100644 --- a/src/common/low_precision_transformations/src/normalize_l2.cpp +++ b/src/common/low_precision_transformations/src/normalize_l2.cpp @@ -54,8 +54,8 @@ NormalizeL2Transformation::NormalizeL2Transformation(const Params& params) : Lay this->register_matcher(m, callback); } -bool NormalizeL2Transformation::canBeTransformed(const TransformationContext& context, std::shared_ptr operation) const { - if (!LayerTransformation::canBeTransformed(context, operation)) { +bool NormalizeL2Transformation::canBeTransformed(const std::shared_ptr& operation) const { + if (!LayerTransformation::canBeTransformed(operation)) { return false; } @@ -99,7 +99,7 @@ bool NormalizeL2Transformation::canBeTransformed(const TransformationContext& co bool NormalizeL2Transformation::transform(TransformationContext &context, ov::pass::pattern::Matcher &m) { std::shared_ptr operation = m.get_match_root(); - if (!canBeTransformed(context, operation)) { + if (!canBeTransformed(operation)) { return false; } diff --git a/src/common/low_precision_transformations/src/pad.cpp b/src/common/low_precision_transformations/src/pad.cpp index e269b3e59a17b7..9e67913416c9f0 100644 --- a/src/common/low_precision_transformations/src/pad.cpp +++ b/src/common/low_precision_transformations/src/pad.cpp @@ -51,7 +51,7 @@ namespace { } // namespace bool PadTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher& m) { - if (!canBeTransformed(context, m.get_match_root())) { + if (!canBeTransformed(m.get_match_root())) { return false; } @@ -170,7 +170,7 @@ bool PadTransformation::transform(TransformationContext& context, ov::pass::patt return true; } -bool PadTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr op) const { +bool PadTransformation::canBeTransformed(const std::shared_ptr& op) const { if (!LayerTransformation::canBeTransformedSpatialDimension(op)) { return false; } diff --git a/src/common/low_precision_transformations/src/prelu.cpp b/src/common/low_precision_transformations/src/prelu.cpp index 5b64e9b30d68a0..bef136f438a9d6 100644 --- a/src/common/low_precision_transformations/src/prelu.cpp +++ b/src/common/low_precision_transformations/src/prelu.cpp @@ -37,7 +37,7 @@ PReluTransformation::PReluTransformation(const Params& params) : LayerTransforma bool PReluTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher &m) { std::shared_ptr prelu = m.get_match_root(); - if (!canBeTransformed(context, prelu)) { + if (!canBeTransformed(prelu)) { return false; } @@ -53,8 +53,8 @@ bool PReluTransformation::isPrecisionPreserved(std::shared_ptr op) const n return false; } -bool PReluTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr op) const { - if (!LayerTransformation::canBeTransformed(context, op)) { +bool PReluTransformation::canBeTransformed(const std::shared_ptr& op) const { + if (!LayerTransformation::canBeTransformed(op)) { return false; } diff --git a/src/common/low_precision_transformations/src/recurrent_cell.cpp b/src/common/low_precision_transformations/src/recurrent_cell.cpp index ea697516a56174..1bc9c6b6437d3b 100644 --- a/src/common/low_precision_transformations/src/recurrent_cell.cpp +++ b/src/common/low_precision_transformations/src/recurrent_cell.cpp @@ -185,7 +185,7 @@ bool RecurrentCellTransformation::transform(TransformationContext& context, ov:: } } - if (!canBeTransformed(context, lstm)) { + if (!canBeTransformed(lstm)) { return false; } @@ -245,7 +245,7 @@ bool RecurrentCellTransformation::transform(TransformationContext& context, ov:: return true; } -bool RecurrentCellTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr lstm) const { +bool RecurrentCellTransformation::canBeTransformed(const std::shared_ptr& lstm) const { const auto inputs = get_supported_precisions(lstm); for (const auto& index : inputs) { const auto& input = lstm->get_input_node_ptr(index.first); diff --git a/src/common/low_precision_transformations/src/reduce_base_transformation.cpp b/src/common/low_precision_transformations/src/reduce_base_transformation.cpp index 9b4d67c4f48867..d6dfc0b24420f3 100644 --- a/src/common/low_precision_transformations/src/reduce_base_transformation.cpp +++ b/src/common/low_precision_transformations/src/reduce_base_transformation.cpp @@ -17,7 +17,7 @@ namespace low_precision { ReduceBaseTransformation::ReduceBaseTransformation(const Params& params) : LayerTransformation(params) {} bool ReduceBaseTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher& m) { - if (!canBeTransformed(context, m.get_match_root())) { + if (!canBeTransformed(m.get_match_root())) { return false; } @@ -35,7 +35,7 @@ bool ReduceBaseTransformation::transform(TransformationContext& context, ov::pas return true; } -bool ReduceBaseTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr reduce) const { +bool ReduceBaseTransformation::canBeTransformed(const std::shared_ptr& reduce) const { const auto dequantization = NetworkHelper::getDequantization(reduce, defaultPrecisions); if (dequantization.empty()) { return false; diff --git a/src/common/low_precision_transformations/src/reduce_max.cpp b/src/common/low_precision_transformations/src/reduce_max.cpp index 4cf9c2ed2100aa..ff5d83cca45174 100644 --- a/src/common/low_precision_transformations/src/reduce_max.cpp +++ b/src/common/low_precision_transformations/src/reduce_max.cpp @@ -30,12 +30,12 @@ ReduceMaxTransformation::ReduceMaxTransformation(const Params& params) : ReduceB this->register_matcher(m, callback); } -bool ReduceMaxTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr reduce) const { +bool ReduceMaxTransformation::canBeTransformed(const std::shared_ptr& reduce) const { if (!ov::is_type(reduce)) { return false; } - if (!ReduceBaseTransformation::canBeTransformed(context, reduce)) { + if (!ReduceBaseTransformation::canBeTransformed(reduce)) { return false; } diff --git a/src/common/low_precision_transformations/src/reduce_mean.cpp b/src/common/low_precision_transformations/src/reduce_mean.cpp index 451a1d4c3804df..48b2536c22fb04 100644 --- a/src/common/low_precision_transformations/src/reduce_mean.cpp +++ b/src/common/low_precision_transformations/src/reduce_mean.cpp @@ -30,8 +30,8 @@ ReduceMeanTransformation::ReduceMeanTransformation(const Params& params) : Reduc this->register_matcher(m, callback); } -bool ReduceMeanTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr reduce) const { - return ov::is_type(reduce) ? ReduceBaseTransformation::canBeTransformed(context, reduce) : false; +bool ReduceMeanTransformation::canBeTransformed(const std::shared_ptr& reduce) const { + return ov::is_type(reduce) ? ReduceBaseTransformation::canBeTransformed(reduce) : false; } bool ReduceMeanTransformation::isPrecisionPreserved(std::shared_ptr reduce) const noexcept { diff --git a/src/common/low_precision_transformations/src/reduce_min.cpp b/src/common/low_precision_transformations/src/reduce_min.cpp index d7433c322718c0..8bed438f8e3d15 100644 --- a/src/common/low_precision_transformations/src/reduce_min.cpp +++ b/src/common/low_precision_transformations/src/reduce_min.cpp @@ -29,12 +29,12 @@ ReduceMinTransformation::ReduceMinTransformation(const Params& params) : ReduceB this->register_matcher(m, callback); } -bool ReduceMinTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr reduce) const { +bool ReduceMinTransformation::canBeTransformed(const std::shared_ptr& reduce) const { if (!ov::is_type(reduce)) { return false; } - if (!ReduceBaseTransformation::canBeTransformed(context, reduce)) { + if (!ReduceBaseTransformation::canBeTransformed(reduce)) { return false; } diff --git a/src/common/low_precision_transformations/src/reduce_sum.cpp b/src/common/low_precision_transformations/src/reduce_sum.cpp index 1bc8bf75d27a7f..d7fac8eaea8be3 100644 --- a/src/common/low_precision_transformations/src/reduce_sum.cpp +++ b/src/common/low_precision_transformations/src/reduce_sum.cpp @@ -30,9 +30,9 @@ ReduceSumTransformation::ReduceSumTransformation(const Params& params) : ReduceB this->register_matcher(m, callback); } -bool ReduceSumTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr reduce) const { +bool ReduceSumTransformation::canBeTransformed(const std::shared_ptr& reduce) const { const auto reduceSum = ov::as_type_ptr(reduce); - if (!reduceSum || !ReduceBaseTransformation::canBeTransformed(context, reduceSum)) { + if (!reduceSum || !ReduceBaseTransformation::canBeTransformed(reduceSum)) { return false; } diff --git a/src/common/low_precision_transformations/src/relu.cpp b/src/common/low_precision_transformations/src/relu.cpp index b1bf47d76f29cd..f5b8328881ab83 100644 --- a/src/common/low_precision_transformations/src/relu.cpp +++ b/src/common/low_precision_transformations/src/relu.cpp @@ -37,7 +37,7 @@ ReluTransformation::ReluTransformation(const Params& params) : LayerTransformati bool ReluTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher &m) { std::shared_ptr relu = m.get_match_root(); - if (!canBeTransformed(context, relu)) { + if (!canBeTransformed(relu)) { return false; } @@ -53,8 +53,8 @@ bool ReluTransformation::isPrecisionPreserved(std::shared_ptr op) const no return true; } -bool ReluTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr op) const { - if (!LayerTransformation::canBeTransformed(context, op)) { +bool ReluTransformation::canBeTransformed(const std::shared_ptr& op) const { + if (!LayerTransformation::canBeTransformed(op)) { return false; } diff --git a/src/common/low_precision_transformations/src/reshape.cpp b/src/common/low_precision_transformations/src/reshape.cpp index 1037c8431a77ba..c51c36e403ec2e 100644 --- a/src/common/low_precision_transformations/src/reshape.cpp +++ b/src/common/low_precision_transformations/src/reshape.cpp @@ -152,7 +152,7 @@ bool ReshapeTransformation::transform(TransformationContext& context, ov::pass:: return false; } - if (!canBeTransformed(context, reshape)) { + if (!canBeTransformed(reshape)) { return false; } @@ -188,8 +188,8 @@ inline size_t getFirstChangedDimension(const PartialShape& shape1, const Partial return i; } -bool ReshapeTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr op) const { - if (!LayerTransformation::canBeTransformed(context, op)) { +bool ReshapeTransformation::canBeTransformed(const std::shared_ptr& op) const { + if (!LayerTransformation::canBeTransformed(op)) { return false; } diff --git a/src/common/low_precision_transformations/src/shuffle_channels.cpp b/src/common/low_precision_transformations/src/shuffle_channels.cpp index 3f4a771dc84fb1..75abd781aa0330 100644 --- a/src/common/low_precision_transformations/src/shuffle_channels.cpp +++ b/src/common/low_precision_transformations/src/shuffle_channels.cpp @@ -34,7 +34,7 @@ ShuffleChannelsTransformation::ShuffleChannelsTransformation(const Params& param } bool ShuffleChannelsTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher& m) { - if (!canBeTransformed(context, m.get_match_root())) { + if (!canBeTransformed(m.get_match_root())) { return false; } @@ -79,7 +79,7 @@ bool ShuffleChannelsTransformation::transform(TransformationContext& context, ov return true; } -bool ShuffleChannelsTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr op) const { +bool ShuffleChannelsTransformation::canBeTransformed(const std::shared_ptr& op) const { if (!LayerTransformation::canBeTransformedSpatialDimension(op)) { return false; } diff --git a/src/common/low_precision_transformations/src/slice.cpp b/src/common/low_precision_transformations/src/slice.cpp index 23bb229505cbb5..595b94cb518df4 100644 --- a/src/common/low_precision_transformations/src/slice.cpp +++ b/src/common/low_precision_transformations/src/slice.cpp @@ -34,7 +34,7 @@ SliceTransformation::SliceTransformation(const Params& params) : LayerTransforma } bool SliceTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher& m) { - if (!SliceTransformation::canBeTransformed(context, m.get_match_root())) { + if (!SliceTransformation::canBeTransformed(m.get_match_root())) { return false; } @@ -45,8 +45,8 @@ bool SliceTransformation::transform(TransformationContext& context, ov::pass::pa return true; } -bool SliceTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr operation) const { - if (!LayerTransformation::canBeTransformed(context, operation)) { +bool SliceTransformation::canBeTransformed(const std::shared_ptr& operation) const { + if (!LayerTransformation::canBeTransformed(operation)) { return false; } diff --git a/src/common/low_precision_transformations/src/space_to_batch.cpp b/src/common/low_precision_transformations/src/space_to_batch.cpp index c9a69007282f12..d5df2f206abfcb 100644 --- a/src/common/low_precision_transformations/src/space_to_batch.cpp +++ b/src/common/low_precision_transformations/src/space_to_batch.cpp @@ -33,8 +33,8 @@ SpaceToBatchTransformation::SpaceToBatchTransformation(const Params& params) : L this->register_matcher(m, callback); } -bool SpaceToBatchTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr op) const { - if (!LayerTransformation::canBeTransformed(context, op)) { +bool SpaceToBatchTransformation::canBeTransformed(const std::shared_ptr& op) const { + if (!LayerTransformation::canBeTransformed(op)) { return false; } @@ -47,7 +47,7 @@ bool SpaceToBatchTransformation::canBeTransformed(const TransformationContext& c } bool SpaceToBatchTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher& m) { - if (!canBeTransformed(context, m.get_match_root())) { + if (!canBeTransformed(m.get_match_root())) { return false; } diff --git a/src/common/low_precision_transformations/src/split.cpp b/src/common/low_precision_transformations/src/split.cpp index 04058bc4322ce4..1c0fa6c69341e6 100644 --- a/src/common/low_precision_transformations/src/split.cpp +++ b/src/common/low_precision_transformations/src/split.cpp @@ -32,7 +32,7 @@ SplitTransformation::SplitTransformation(const Params& params) : LayerTransforma } bool SplitTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher& m) { - if (!canBeTransformed(context, m.get_match_root())) { + if (!canBeTransformed(m.get_match_root())) { return false; } @@ -154,7 +154,7 @@ bool SplitTransformation::isPrecisionPreserved(std::shared_ptr layer) cons return true; } -bool SplitTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const { +bool SplitTransformation::canBeTransformed(const std::shared_ptr& layer) const { return !NetworkHelper::getDequantization(layer, defaultPrecisions).empty() && layer->get_input_partial_shape(0).rank().is_static(); } diff --git a/src/common/low_precision_transformations/src/squeeze.cpp b/src/common/low_precision_transformations/src/squeeze.cpp index 67e78fb55deaaa..9c084c977939b8 100644 --- a/src/common/low_precision_transformations/src/squeeze.cpp +++ b/src/common/low_precision_transformations/src/squeeze.cpp @@ -34,7 +34,7 @@ SqueezeTransformation::SqueezeTransformation(const Params& params) : LayerTransf } bool SqueezeTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher &m) { - if (!canBeTransformed(context, m.get_match_root())) { + if (!canBeTransformed(m.get_match_root())) { return false; } @@ -76,8 +76,8 @@ bool SqueezeTransformation::isPrecisionPreserved(std::shared_ptr layer) co return true; } -bool SqueezeTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const { - return (!NetworkHelper::getDequantization(layer, defaultPrecisions).empty()) && LayerTransformation::canBeTransformed(context, layer); +bool SqueezeTransformation::canBeTransformed(const std::shared_ptr& layer) const { + return (!NetworkHelper::getDequantization(layer, defaultPrecisions).empty()) && LayerTransformation::canBeTransformed(layer); } } // namespace low_precision diff --git a/src/common/low_precision_transformations/src/strided_slice.cpp b/src/common/low_precision_transformations/src/strided_slice.cpp index 5dcd25ec3ed572..dc752048ec4dfd 100644 --- a/src/common/low_precision_transformations/src/strided_slice.cpp +++ b/src/common/low_precision_transformations/src/strided_slice.cpp @@ -115,7 +115,7 @@ StridedSliceTransformation::StridedSliceTransformation(const Params& params) : L } bool StridedSliceTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher& m) { - if (!StridedSliceTransformation::canBeTransformed(context, m.get_match_root())) { + if (!StridedSliceTransformation::canBeTransformed(m.get_match_root())) { return false; } @@ -138,7 +138,7 @@ bool StridedSliceTransformation::transform(TransformationContext& context, ov::p return true; } -bool StridedSliceTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr operation) const { +bool StridedSliceTransformation::canBeTransformed(const std::shared_ptr& operation) const { if (!ov::is_type(operation)) { return false; } diff --git a/src/common/low_precision_transformations/src/subtract.cpp b/src/common/low_precision_transformations/src/subtract.cpp index d67a8dc1e0e288..5cdc94a5f0ee85 100644 --- a/src/common/low_precision_transformations/src/subtract.cpp +++ b/src/common/low_precision_transformations/src/subtract.cpp @@ -43,7 +43,7 @@ SubtractTransformation::SubtractTransformation(const Params& params) : LayerTran bool SubtractTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher &m) { std::shared_ptr subtract = ov::as_type_ptr(m.get_match_root()); - if (!canBeTransformed(context, subtract)) { + if (!canBeTransformed(subtract)) { return false; } diff --git a/src/common/low_precision_transformations/src/transparent_base_transformation.cpp b/src/common/low_precision_transformations/src/transparent_base_transformation.cpp index 6b453ba53fe1be..aa7fc866ea1501 100644 --- a/src/common/low_precision_transformations/src/transparent_base_transformation.cpp +++ b/src/common/low_precision_transformations/src/transparent_base_transformation.cpp @@ -16,7 +16,7 @@ using namespace ov::pass::low_precision; bool TransparentBaseTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher &m) { std::shared_ptr op = m.get_match_root(); - if (!canBeTransformed(context, op)) { + if (!canBeTransformed(op)) { return false; } @@ -27,7 +27,7 @@ bool TransparentBaseTransformation::transform(TransformationContext& context, ov return true; } -bool TransparentBaseTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const { +bool TransparentBaseTransformation::canBeTransformed(const std::shared_ptr& layer) const { return true; } diff --git a/src/common/low_precision_transformations/src/transpose.cpp b/src/common/low_precision_transformations/src/transpose.cpp index 46f7024e0efff7..57400aaa9dca46 100644 --- a/src/common/low_precision_transformations/src/transpose.cpp +++ b/src/common/low_precision_transformations/src/transpose.cpp @@ -85,7 +85,7 @@ void transposeDequantizationConstant(std::shared_ptr& transpose, const std bool TransposeTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher &m) { std::shared_ptr transpose = m.get_match_root(); - if (!canBeTransformed(context, transpose)) { + if (!canBeTransformed(transpose)) { return false; } @@ -101,8 +101,8 @@ bool TransposeTransformation::isPrecisionPreserved(std::shared_ptr op) con return true; } -bool TransposeTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr op) const { - if (!LayerTransformation::canBeTransformed(context, op)) { +bool TransposeTransformation::canBeTransformed(const std::shared_ptr& op) const { + if (!LayerTransformation::canBeTransformed(op)) { return false; } diff --git a/src/common/low_precision_transformations/src/unsqueeze.cpp b/src/common/low_precision_transformations/src/unsqueeze.cpp index bf8279ad0e8d6f..74090d6c00f8f0 100644 --- a/src/common/low_precision_transformations/src/unsqueeze.cpp +++ b/src/common/low_precision_transformations/src/unsqueeze.cpp @@ -34,7 +34,7 @@ UnsqueezeTransformation::UnsqueezeTransformation(const Params& params) : LayerTr } bool UnsqueezeTransformation::transform(TransformationContext& context, ov::pass::pattern::Matcher &m) { - if (!canBeTransformed(context, m.get_match_root())) { + if (!canBeTransformed(m.get_match_root())) { return false; } @@ -78,8 +78,8 @@ bool UnsqueezeTransformation::isPrecisionPreserved(std::shared_ptr layer) return true; } -bool UnsqueezeTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const { - return (!NetworkHelper::getDequantization(layer, defaultPrecisions).empty()) && LayerTransformation::canBeTransformed(context, layer); +bool UnsqueezeTransformation::canBeTransformed(const std::shared_ptr& layer) const { + return (!NetworkHelper::getDequantization(layer, defaultPrecisions).empty()) && LayerTransformation::canBeTransformed(layer); } diff --git a/src/common/low_precision_transformations/src/weightable_layer_transformation.cpp b/src/common/low_precision_transformations/src/weightable_layer_transformation.cpp index 9bd43e8a73fe9b..64c6e15cd81356 100644 --- a/src/common/low_precision_transformations/src/weightable_layer_transformation.cpp +++ b/src/common/low_precision_transformations/src/weightable_layer_transformation.cpp @@ -49,9 +49,10 @@ WeightableLayerTransformation::WeightableLayerTransformation(const Params& param canBeTransformedParams(canBeTransformedParams) { } -bool WeightableLayerTransformation::canConvolutionBeTransformed(const TransformationContext& context, std::shared_ptr layer, - const std::vector& defaultPrecisions) const { - if (!WeightableLayerTransformation::canBeTransformed(context, layer)) { +bool WeightableLayerTransformation::canConvolutionBeTransformed( + const std::shared_ptr& layer, + const ov::element::TypeVector& defaultPrecisions) const { + if (!WeightableLayerTransformation::canBeTransformed(layer)) { return false; } @@ -88,8 +89,8 @@ bool WeightableLayerTransformation::canConvolutionBeTransformed(const Transforma return true; } -bool WeightableLayerTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const { - if (!LayerTransformation::canBeTransformed(context, layer)) { +bool WeightableLayerTransformation::canBeTransformed(const std::shared_ptr& layer) const { + if (!LayerTransformation::canBeTransformed(layer)) { return false; }