diff --git a/src/common/low_precision_transformations/src/slice.cpp b/src/common/low_precision_transformations/src/slice.cpp index 701dc47f467ad9..99c51f4e3f5ac3 100644 --- a/src/common/low_precision_transformations/src/slice.cpp +++ b/src/common/low_precision_transformations/src/slice.cpp @@ -39,7 +39,6 @@ bool SliceTransformation::transform(TransformationContext& context, ov::pass::pa } const auto strided_slice = NetworkHelper::separateInStandaloneBranch(m.get_match_root(), defaultPrecisions); - auto dequantization = NetworkHelper::getDequantization(strided_slice, defaultPrecisions); const auto newOperation = moveDequantizationAfter(context, strided_slice, NetworkHelper::getDequantization(strided_slice, defaultPrecisions)); OPENVINO_DEBUG("LPT: done: ", newOperation); diff --git a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/low_precision_transformations/slice_transformation.cpp b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/low_precision_transformations/slice_transformation.cpp new file mode 100644 index 00000000000000..41f20832b51924 --- /dev/null +++ b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/low_precision_transformations/slice_transformation.cpp @@ -0,0 +1,64 @@ +// Copyright (C) 2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include + +#include +#include "low_precision_transformations/slice_transformation.hpp" + + +using namespace LayerTestsDefinitions; + +namespace { +const std::vector netPrecisions = { + ov::element::f32 +}; + +const std::vector trasformationParamValues = { + LayerTestsUtils::LayerTransformationParamsNGraphFactory::createParams() +}; + +const std::vector params = { + { + { + 256ul, + ov::Shape{ 1, 1, 1, 1 }, + { 0.f }, + { 25.5f }, + { 0.f }, + { 12.8f } + }, + { 0 }, // start + { 2147483647 }, // end + { 2 }, // step + { 2 }, // axes + "u8" + }, + { + { + 256ul, + ov::Shape{ 1, 3, 1, 1 }, + { 0.f, 0.f, 0.f }, + { 255.f / 1.f, 255.f / 2.f, 255.f / 3.f }, + { 0.f, 0.f, 0.f }, + { 255.f / 1.f, 255.f / 2.f, 255.f / 3.f } + }, + { 0 }, // start + { 2147483647 }, // end + { 2 }, // step + { 2 }, // axes + "u8" + }, +}; + +INSTANTIATE_TEST_SUITE_P(smoke_LPT, SliceTransformation, + ::testing::Combine( + ::testing::ValuesIn(netPrecisions), + ::testing::Values(ov::PartialShape({ 1, 3, 24, 24 })), + ::testing::Values(ov::test::utils::DEVICE_GPU), + ::testing::ValuesIn(trasformationParamValues), + ::testing::ValuesIn(params)), + SliceTransformation::getTestCaseName); + +} // namespace diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/slice_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/slice_transformation.cpp index 78dd8d1550f090..d45fbe550351ee 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/slice_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/slice_transformation.cpp @@ -11,18 +11,6 @@ namespace LayerTestsDefinitions { -inline std::ostream& operator<<(std::ostream& os, const std::vector& values) { - os << "{ "; - for (size_t i = 0; i < values.size(); ++i) { - os << values[i]; - if (i != (values.size() - 1ul)) { - os << ", "; - } - } - os << " }"; - return os; -} - std::string SliceTransformation::getTestCaseName(const testing::TestParamInfo& obj) { ov::element::Type netPrecision; ov::PartialShape inputShape; @@ -34,10 +22,10 @@ std::string SliceTransformation::getTestCaseName(const testing::TestParamInfo SliceFunction::get( const std::vector& axes) { const auto input = std::make_shared(inputPrecision, inputShape); input->set_friendly_name("input"); - const auto fqOnData = makeFakeQuantize(input, inputPrecision, fakeQuantize); + + std::shared_ptr parent = input; + if (!fakeQuantize.empty()) { + parent = makeFakeQuantize(parent, inputPrecision, fakeQuantize); + } const auto start_constant = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{ start.size() }, start); start_constant->set_friendly_name("start"); @@ -32,7 +36,12 @@ std::shared_ptr SliceFunction::get( const auto axes_constant = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{ axes.size() }, axes); axes_constant->set_friendly_name("axes "); - const auto stridedSlice = std::make_shared(fqOnData, start_constant, stop_constant, step_constant, axes_constant); + const auto stridedSlice = std::make_shared( + parent, + start_constant, + stop_constant, + step_constant, + axes_constant); stridedSlice->set_friendly_name("slice"); const auto res = std::make_shared(stridedSlice);