diff --git a/src/plugins/intel_cpu/src/graph_optimizer.cpp b/src/plugins/intel_cpu/src/graph_optimizer.cpp index be94a8b433c46e..9e966e8ae04920 100644 --- a/src/plugins/intel_cpu/src/graph_optimizer.cpp +++ b/src/plugins/intel_cpu/src/graph_optimizer.cpp @@ -2611,24 +2611,7 @@ void GraphOptimizer::MergeReorderAndTranspose(Graph &graph) { && !node->isDynamicNode(); }; - auto checkReshapeShapes = [](const Shape& biggerShape, const Shape& smallerShape) { - if (biggerShape.getRank() - smallerShape.getRank() > 1) - return false; - - const auto biggerPShape = biggerShape.toPartialShape(); - const auto smallerPShape = smallerShape.toPartialShape(); - size_t mismatchCount = 0; - for (size_t i = 0; i < smallerPShape.size(); ++i) { - if (smallerPShape[i] != biggerPShape[i + mismatchCount]) { - mismatchCount++; - if (mismatchCount > 1) - return false; - } - } - return true; - }; - - auto isSuitableReshape = [&checkReshapeShapes](NodePtr node) { + auto isSuitableReshape = [](NodePtr node) { if (node->getChildEdges().size() != 1) return false; // Reshape supported only in one case: if two consecutive input dims are merged into 1