diff --git a/src/common/low_precision_transformations/src/reshape.cpp b/src/common/low_precision_transformations/src/reshape.cpp index 7e6bd4411b1..b2a3fc0aad1 100644 --- a/src/common/low_precision_transformations/src/reshape.cpp +++ b/src/common/low_precision_transformations/src/reshape.cpp @@ -236,20 +236,18 @@ bool ReshapeTransformation::canBeTransformed(const TransformationContext& contex multiplyShapeWithBatch.insert(multiplyShapeWithBatch.begin(), 1ul); } - if (subtractShapeWithBatch.size() > 1 && multiplyShapeWithBatch.size() > 1) { - const size_t outputChannel = static_cast(outputPShape[1].get_length()); - if (!subtractShapeWithBatch.empty() && (outputChannel < subtractShapeWithBatch[1])) { - return false; - } - if (!multiplyShapeWithBatch.empty() && (outputChannel < multiplyShapeWithBatch[1])) { - return false; - } + const size_t outputChannel = static_cast(outputPShape[1].get_length()); + if ((subtractShapeWithBatch.size() > 1) && (outputChannel < subtractShapeWithBatch[1])) { + return false; + } + if ((multiplyShapeWithBatch.size() > 1) && (outputChannel < multiplyShapeWithBatch[1])) { + return false; + } - if (outputPShape.is_static() && - ((!subtractShapeWithBatch.empty() && ((outputChannel % subtractShapeWithBatch[1]) != 0)) || - (!multiplyShapeWithBatch.empty() && (outputChannel % multiplyShapeWithBatch[1] != 0)))) { - return false; - } + if (outputPShape.is_static() && + (((subtractShapeWithBatch.size() > 1) && ((outputChannel % subtractShapeWithBatch[1]) != 0)) || + ((multiplyShapeWithBatch.size() > 1) && (outputChannel % multiplyShapeWithBatch[1] != 0)))) { + return false; } return canBeTransformed(subtractShapeWithBatch, multiplyShapeWithBatch, inputPShape, outputPShape);