diff --git a/inference-engine/src/low_precision_transformations/src/reshape.cpp b/inference-engine/src/low_precision_transformations/src/reshape.cpp index 4988328c654ba7..4b12741c2fc933 100644 --- a/inference-engine/src/low_precision_transformations/src/reshape.cpp +++ b/inference-engine/src/low_precision_transformations/src/reshape.cpp @@ -80,14 +80,10 @@ void reshapeDequantizationConstant(const std::shared_ptr& resha return constant; } - std::shared_ptr updatedConstant = constant; Shape newOperationConstantBroadcastedShape = constant->get_shape(); // add dimensions to broadcast values if (newOperationConstantBroadcastedShape.size() == 2ul) { - newOperationConstantBroadcastedShape.push_back(dimensionsToBroadcast); - - const auto unsqueezeConst = opset1::Constant::create(element::i32, Shape{}, { 2 }); - updatedConstant = fold(constant, unsqueezeConst); + newOperationConstantBroadcastedShape[0] = dimensionsToBroadcast; } else { newOperationConstantBroadcastedShape[2] = dimensionsToBroadcast; } @@ -97,7 +93,7 @@ void reshapeDequantizationConstant(const std::shared_ptr& resha Shape{ newOperationConstantBroadcastedShape.size() }, newOperationConstantBroadcastedShape); - return fold(updatedConstant, targetShapeConstant); + return fold(constant, targetShapeConstant); }; const std::shared_ptr broadcastedConstant = getBCastedConst(originalConstant, dimensionsToBroadcast); diff --git a/inference-engine/tests/functional/inference_engine/lp_transformations/reshape_transformation.cpp b/inference-engine/tests/functional/inference_engine/lp_transformations/reshape_transformation.cpp index 6a67202125cfbd..38502dc6834490 100644 --- a/inference-engine/tests/functional/inference_engine/lp_transformations/reshape_transformation.cpp +++ b/inference-engine/tests/functional/inference_engine/lp_transformations/reshape_transformation.cpp @@ -931,6 +931,30 @@ const std::vector testValues = { {{0.1f, 0.01f, 0.1f}, ngraph::element::f32, {1, 3}} } } + }, + // U8: without subtract 2D -> 2D + { + { Dimension::dynamic(), 2 }, + { -1, 6 }, + LayerTransformation::createParamsU8I8(), + { + ngraph::element::u8, + { + {ngraph::element::f32}, + {}, + {{0.1f, 0.02f}, ngraph::element::f32, {1, 2}} + } + }, + { + ngraph::element::u8, + {{}, {}, {}}, + ngraph::element::u8, + { + {ngraph::element::f32}, + {}, + {{0.1f, 0.02f, 0.1f, 0.02f, 0.1f, 0.02f}, ngraph::element::f32, {1, 6}} + } + } } };