From 83f4428f488b279dcaddc91c5041d6b4375fe55d Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Mon, 20 Mar 2023 18:01:35 +0100 Subject: [PATCH] Corrected reshape paterns --- .../transformations/gather_sinking_transpose_reshape.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/intel_gna/src/transformations/gather_sinking_transpose_reshape.cpp b/src/plugins/intel_gna/src/transformations/gather_sinking_transpose_reshape.cpp index f5ff10ff8fc..068ae4fc077 100644 --- a/src/plugins/intel_gna/src/transformations/gather_sinking_transpose_reshape.cpp +++ b/src/plugins/intel_gna/src/transformations/gather_sinking_transpose_reshape.cpp @@ -163,8 +163,8 @@ bool IsTailFlatten(const Output& output) { if (reshape_node->get_output_partial_shape(0).rank().is_dynamic() || reshape_node->get_input_partial_shape(0).rank().is_dynamic()) return false; - const Shape& input_shape = reshape_node->get_input_shape(0); - const Shape& output_shape = reshape_node->get_output_shape(0); + const Shape& input_shape = helper::SqueezeShape(reshape_node->get_input_shape(0)); + const Shape& output_shape = helper::SqueezeShape(reshape_node->get_output_shape(0)); return output_shape.size() < input_shape.size() && AreFlattenShapes(input_shape, output_shape); } @@ -173,8 +173,8 @@ bool IsTailUnflatten(const Output& output) { if (reshape_node->get_output_partial_shape(0).rank().is_dynamic() || reshape_node->get_input_partial_shape(0).rank().is_dynamic()) return false; - const Shape& input_shape = reshape_node->get_input_shape(0); - const Shape& output_shape = reshape_node->get_output_shape(0); + const Shape& input_shape = helper::SqueezeShape(reshape_node->get_input_shape(0)); + const Shape& output_shape = helper::SqueezeShape(reshape_node->get_output_shape(0)); return output_shape.size() > input_shape.size() && AreFlattenShapes(input_shape, output_shape); } } // namespace