diff --git a/src/common/legacy/src/transformations/convert_opset1_to_legacy/convert_strided_slice_to_crop.cpp b/src/common/legacy/src/transformations/convert_opset1_to_legacy/convert_strided_slice_to_crop.cpp index adea1d8c3e7..bf16b62fc73 100644 --- a/src/common/legacy/src/transformations/convert_opset1_to_legacy/convert_strided_slice_to_crop.cpp +++ b/src/common/legacy/src/transformations/convert_opset1_to_legacy/convert_strided_slice_to_crop.cpp @@ -202,8 +202,7 @@ ngraph::pass::ConvertStridedSliceToCropMatcher::ConvertStridedSliceToCropMatcher } auto data_node_shape = data_output.get_shape(); - // Crop supports only 2d, 4d and 5d blobs - if (data_node_shape.size() != 2 && data_node_shape.size() != 4 && data_node_shape.size() != 5) { + if (data_node_shape.size() < 2 || data_node_shape.size() > 5) { return false; } diff --git a/src/tests/functional/inference_engine/transformations/legacy/convert_strided_slice_to_crop_test.cpp b/src/tests/functional/inference_engine/transformations/legacy/convert_strided_slice_to_crop_test.cpp index e0084ef6c58..af206ae7793 100644 --- a/src/tests/functional/inference_engine/transformations/legacy/convert_strided_slice_to_crop_test.cpp +++ b/src/tests/functional/inference_engine/transformations/legacy/convert_strided_slice_to_crop_test.cpp @@ -150,51 +150,6 @@ TEST_F(TransformationTestsF, ConvertStridedSliceToCropNegative) { } } -// in this test the Crop will get 3D input which is not supported so the transformation will not be applied -TEST_F(TransformationTestsF, ConvertStridedSliceToCropNegative2) { - { - auto input = std::make_shared(ngraph::element::f32, ngraph::Shape{128, 1}); - auto slice_begin = ngraph::opset1::Constant::create(ngraph::element::i64, ngraph::Shape{3}, {0, 0, 0}); - auto slice_end = ngraph::opset1::Constant::create(ngraph::element::i64, ngraph::Shape{3}, {0, 0, 0}); - auto slice_stride = ngraph::opset1::Constant::create(ngraph::element::i64, ngraph::Shape{3}, {1, 1, 1}); - - std::vector begin_mask = {0, 1, 1}; - std::vector end_mask = {0, 1, 1}; - std::vector new_axis_mask = {1, 0, 0}; - std::vector shrink_axis_mask = {0, 0, 0}; - std::vector ellipsis_mask = {0, 0, 0}; - - auto sslice = std::make_shared(input, slice_begin, slice_end, slice_stride, - begin_mask, end_mask, - new_axis_mask, shrink_axis_mask, ellipsis_mask); - sslice->set_friendly_name("strided_slice"); - - function = std::make_shared(ngraph::NodeVector{sslice}, ngraph::ParameterVector{input}); - manager.register_pass(); - } - - { - auto input = std::make_shared(ngraph::element::f32, ngraph::Shape{128, 1}); - auto slice_begin = ngraph::opset1::Constant::create(ngraph::element::i64, ngraph::Shape{3}, {0, 0, 0}); - auto slice_end = ngraph::opset1::Constant::create(ngraph::element::i64, ngraph::Shape{3}, {0, 0, 0}); - auto slice_stride = ngraph::opset1::Constant::create(ngraph::element::i64, ngraph::Shape{3}, {1, 1, 1}); - - std::vector begin_mask = {0, 1, 1}; - std::vector end_mask = {0, 1, 1}; - std::vector new_axis_mask = {1, 0, 0}; - std::vector shrink_axis_mask = {0, 0, 0}; - std::vector ellipsis_mask = {0, 0, 0}; - - auto sslice = std::make_shared(input, slice_begin, slice_end, slice_stride, - begin_mask, end_mask, - new_axis_mask, shrink_axis_mask, ellipsis_mask); - sslice->set_friendly_name("strided_slice"); - - function_ref = std::make_shared(ngraph::NodeVector{sslice}, ngraph::ParameterVector{input}); - } -} - - TEST_F(TransformationTestsF, ConvertStridedSliceToCropNoneZeroBeginValuesWithMask) { // when begin_mask/end_mask are present begin/end values should not affect output shape { diff --git a/src/tests/functional/plugin/gna/shared_tests_instances/subgraph_tests/crop4d.cpp b/src/tests/functional/plugin/gna/shared_tests_instances/subgraph_tests/strided_slice.cpp similarity index 76% rename from src/tests/functional/plugin/gna/shared_tests_instances/subgraph_tests/crop4d.cpp rename to src/tests/functional/plugin/gna/shared_tests_instances/subgraph_tests/strided_slice.cpp index 96cf98c105e..a81d2c44fb3 100644 --- a/src/tests/functional/plugin/gna/shared_tests_instances/subgraph_tests/crop4d.cpp +++ b/src/tests/functional/plugin/gna/shared_tests_instances/subgraph_tests/strided_slice.cpp @@ -4,7 +4,7 @@ #include -#include "subgraph_tests/crop4d.hpp" +#include "subgraph_tests/strided_slice.hpp" #include "common_test_utils/test_constants.hpp" using namespace SubgraphTestsDefinitions; @@ -16,6 +16,10 @@ std::vector ss_only_test_cases = { { 0, 0, 0, 0 }, { 1, 1, 1, 1 }, { 1, 1, 1, 1 }, { 1, 1, 1, 1 }, { 1, 0, 1, 1 }, { 0, 0, 0, 0 }, { 1, 0, 0, 0 }, { 0, 0, 0, 0 } }, + StridedSliceSpecificParams{ { 1, 2, 100 }, + { 0, 0, 0 }, + { 1, 1, 1 }, { 1, 1, 1 }, + { 1, 1, 1 }, { 1, 0, 1 }, { 0, 0, 0 }, { 1, 0, 0 }, { 0, 0, 0 } }, }; const std::vector netPrecisions = { @@ -31,7 +35,7 @@ const std::vector> configs = { }; INSTANTIATE_TEST_SUITE_P( - smoke_crop4d_gna, Crop4dTest, + smoke_stridedslice_gna, StridedSliceTest, ::testing::Combine( ::testing::ValuesIn(ss_only_test_cases), ::testing::ValuesIn(netPrecisions), @@ -41,6 +45,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(CommonTestUtils::DEVICE_GNA), ::testing::ValuesIn(configs)), - Crop4dTest::getTestCaseName); + StridedSliceTest::getTestCaseName); } // namespace \ No newline at end of file diff --git a/src/tests/functional/plugin/myriad/shared_tests_instances/skip_tests_config.cpp b/src/tests/functional/plugin/myriad/shared_tests_instances/skip_tests_config.cpp index 0a03744271a..fe1719ecf35 100644 --- a/src/tests/functional/plugin/myriad/shared_tests_instances/skip_tests_config.cpp +++ b/src/tests/functional/plugin/myriad/shared_tests_instances/skip_tests_config.cpp @@ -85,5 +85,7 @@ std::vector disabledTestPatterns() { // TODO: Issue 76209 R"(.*MultithreadingTests.*canRun.*RequestsConsistentlyFromThreads.*MYRIAD.*)", + // TODO: CVS-82012 + R"(.*StridedSliceLayerTest\.CompareWithRefs/inShape=\(1\.12\.100\).*)", }; } diff --git a/src/tests/functional/plugin/shared/include/subgraph_tests/crop4d.hpp b/src/tests/functional/plugin/shared/include/subgraph_tests/strided_slice.hpp similarity index 65% rename from src/tests/functional/plugin/shared/include/subgraph_tests/crop4d.hpp rename to src/tests/functional/plugin/shared/include/subgraph_tests/strided_slice.hpp index 302d9ceb337..8a95112b368 100644 --- a/src/tests/functional/plugin/shared/include/subgraph_tests/crop4d.hpp +++ b/src/tests/functional/plugin/shared/include/subgraph_tests/strided_slice.hpp @@ -4,11 +4,11 @@ #pragma once -#include "shared_test_classes/subgraph/crop4d.hpp" +#include "shared_test_classes/subgraph/strided_slice.hpp" namespace SubgraphTestsDefinitions { -TEST_P(Crop4dTest, CompareWithRefs){ +TEST_P(StridedSliceTest, CompareWithRefs){ Run(); }; } // namespace SubgraphTestsDefinitions diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/crop4d.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/strided_slice.hpp similarity index 87% rename from src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/crop4d.hpp rename to src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/strided_slice.hpp index c9a4f8d8e5d..3dd475d2e14 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/crop4d.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/strided_slice.hpp @@ -25,7 +25,7 @@ struct StridedSliceSpecificParams { std::vector ellipsisAxisMask; }; -using Crop4dParams = std::tuple< +using StridedSliceParams = std::tuple< StridedSliceSpecificParams, InferenceEngine::Precision, // Net precision InferenceEngine::Precision, // Input precision @@ -36,10 +36,10 @@ using Crop4dParams = std::tuple< std::map // Additional network configuration >; -class Crop4dTest : public testing::WithParamInterface, +class StridedSliceTest : public testing::WithParamInterface, virtual public LayerTestsUtils::LayerTestsCommon { public: - static std::string getTestCaseName(const testing::TestParamInfo &obj); + static std::string getTestCaseName(const testing::TestParamInfo &obj); protected: void SetUp() override; diff --git a/src/tests/functional/shared_test_classes/src/subgraph/crop4d.cpp b/src/tests/functional/shared_test_classes/src/subgraph/strided_slice.cpp similarity index 93% rename from src/tests/functional/shared_test_classes/src/subgraph/crop4d.cpp rename to src/tests/functional/shared_test_classes/src/subgraph/strided_slice.cpp index 6d2b319ba8e..227811a26aa 100644 --- a/src/tests/functional/shared_test_classes/src/subgraph/crop4d.cpp +++ b/src/tests/functional/shared_test_classes/src/subgraph/strided_slice.cpp @@ -4,11 +4,11 @@ #include "ngraph_functions/builders.hpp" -#include "shared_test_classes/subgraph/crop4d.hpp" +#include "shared_test_classes/subgraph/strided_slice.hpp" namespace SubgraphTestsDefinitions { -std::string Crop4dTest::getTestCaseName(const testing::TestParamInfo &obj) { +std::string StridedSliceTest::getTestCaseName(const testing::TestParamInfo &obj) { StridedSliceSpecificParams params; InferenceEngine::Precision netPrc; InferenceEngine::Precision inPrc, outPrc; @@ -35,7 +35,7 @@ std::string Crop4dTest::getTestCaseName(const testing::TestParamInfo additionalConfig; @@ -50,7 +50,7 @@ void Crop4dTest::SetUp() { auto ss = ngraph::builder::makeStridedSlice(relu, ssParams.begin, ssParams.end, ssParams.strides, ngPrc, ssParams.beginMask, ssParams.endMask, ssParams.newAxisMask, ssParams.shrinkAxisMask, ssParams.ellipsisAxisMask); ngraph::ResultVector results{std::make_shared(ss)}; - function = std::make_shared(results, params, "crop4d"); + function = std::make_shared(results, params, "strided_slice"); } } // namespace SubgraphTestsDefinitions