From 0069bfe6fc0a71a9abb48bab60a03fabea95c8ae Mon Sep 17 00:00:00 2001 From: DariaMityagina Date: Fri, 7 May 2021 05:04:59 +0300 Subject: [PATCH] Revert "changes in tests, so not to break other plugins" This reverts commit f6a537d2236f0b64f0ff028627af9e0e388a2d23. --- .../single_layer_tests/interpolate.cpp | 14 +++- .../cpu/single_layer_tests/interpolate.cpp | 22 +++-- .../single_layer_tests/interpolate.cpp | 8 +- .../single_layer_tests/interpolate.cpp | 16 ++-- .../single_layer_tests/interpolate.hpp | 4 - .../single_layer/interpolate.hpp | 23 +---- .../src/single_layer/interpolate.cpp | 83 +------------------ 7 files changed, 41 insertions(+), 129 deletions(-) diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/interpolate.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/interpolate.cpp index d5a9c8364e7cd2..08c529379767a7 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/interpolate.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/interpolate.cpp @@ -82,6 +82,8 @@ const std::vector> defaultScales = { {1.f, 1.f, 1.333333f, 1.333333f} }; +std::map additional_config = {}; + const auto interpolateCasesWithoutNearest = ::testing::Combine( ::testing::ValuesIn(modesWithoutNearest), ::testing::ValuesIn(shapeCalculationMode), @@ -115,7 +117,8 @@ INSTANTIATE_TEST_CASE_P(smoke_Interpolate_Basic, InterpolateLayerTest, ::testing ::testing::Values(InferenceEngine::Layout::ANY), ::testing::ValuesIn(inShapes), ::testing::ValuesIn(targetShapes), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), + ::testing::Values(CommonTestUtils::DEVICE_CPU), + ::testing::Values(additional_config)), InterpolateLayerTest::getTestCaseName); INSTANTIATE_TEST_CASE_P(smoke_Interpolate_Nearest, InterpolateLayerTest, ::testing::Combine( @@ -127,7 +130,8 @@ INSTANTIATE_TEST_CASE_P(smoke_Interpolate_Nearest, InterpolateLayerTest, ::testi ::testing::Values(InferenceEngine::Layout::ANY), ::testing::ValuesIn(inShapes), ::testing::ValuesIn(targetShapes), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), + ::testing::Values(CommonTestUtils::DEVICE_CPU), + ::testing::Values(additional_config)), InterpolateLayerTest::getTestCaseName); const std::vector> targetShapesTailTest = { @@ -171,7 +175,8 @@ INSTANTIATE_TEST_CASE_P(smoke_Interpolate_Basic_Down_Sample_Tail, InterpolateLay ::testing::Values(InferenceEngine::Layout::ANY), ::testing::ValuesIn(inShapes), ::testing::ValuesIn(targetShapesTailTest), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), + ::testing::Values(CommonTestUtils::DEVICE_CPU), + ::testing::Values(additional_config)), InterpolateLayerTest::getTestCaseName); INSTANTIATE_TEST_CASE_P(smoke_Interpolate_Nearest_Down_Sample_Tail, InterpolateLayerTest, ::testing::Combine( @@ -183,7 +188,8 @@ INSTANTIATE_TEST_CASE_P(smoke_Interpolate_Nearest_Down_Sample_Tail, InterpolateL ::testing::Values(InferenceEngine::Layout::ANY), ::testing::ValuesIn(inShapes), ::testing::ValuesIn(targetShapesTailTest), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), + ::testing::Values(CommonTestUtils::DEVICE_CPU), + ::testing::Values(additional_config)), InterpolateLayerTest::getTestCaseName); } // namespace diff --git a/inference-engine/tests/functional/plugin/cpu/single_layer_tests/interpolate.cpp b/inference-engine/tests/functional/plugin/cpu/single_layer_tests/interpolate.cpp index 424fae341ec040..55863095e75acb 100644 --- a/inference-engine/tests/functional/plugin/cpu/single_layer_tests/interpolate.cpp +++ b/inference-engine/tests/functional/plugin/cpu/single_layer_tests/interpolate.cpp @@ -60,7 +60,9 @@ class InterpolateLayerCPUTest : public testing::WithParamInterface inputShape; std::vector targetShape; Precision netPrecision; - std::tie(interpolateParams, netPrecision, inPrc, outPrc, inLayout, outLayout, inputShape, targetShape, targetDevice) = basicParamsSet; + std::map additional_config; + std::tie(interpolateParams, netPrecision, inPrc, outPrc, inLayout, outLayout, inputShape, + targetShape, targetDevice, additional_config) = basicParamsSet; ngraph::op::v4::Interpolate::InterpolateMode mode; ngraph::op::v4::Interpolate::ShapeCalcMode shapeCalcMode; @@ -269,7 +271,8 @@ INSTANTIATE_TEST_CASE_P(smoke_InterpolateNN_Layout_Test, InterpolateLayerCPUTest ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({1, 21, 4, 4})), ::testing::Values(std::vector({1, 21, 5, 6})), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), + ::testing::Values(CommonTestUtils::DEVICE_CPU), + ::testing::Values(additional_config)), ::testing::ValuesIn(filterCPUInfoForDevice()), ::testing::ValuesIn(interpolateFusingParamsSet), ::testing::ValuesIn(filterAdditionalConfig())), @@ -286,7 +289,8 @@ INSTANTIATE_TEST_CASE_P(smoke_InterpolateLinearOnnx_Layout_Test, InterpolateLaye ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({1, 21, 4, 4})), ::testing::Values(std::vector({1, 21, 5, 6})), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), + ::testing::Values(CommonTestUtils::DEVICE_CPU), + ::testing::Values(additional_config)), ::testing::ValuesIn(filterCPUInfoForDevice()), ::testing::ValuesIn(interpolateFusingParamsSet), ::testing::ValuesIn(filterAdditionalConfig())), @@ -303,7 +307,8 @@ INSTANTIATE_TEST_CASE_P(smoke_InterpolateLinear_Layout_Test, InterpolateLayerCPU ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({1, 21, 4, 4})), ::testing::Values(std::vector({1, 21, 5, 6})), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), + ::testing::Values(CommonTestUtils::DEVICE_CPU), + ::testing::Values(additional_config)), ::testing::ValuesIn(filterCPUInfoForDevice()), ::testing::ValuesIn(interpolateFusingParamsSet), ::testing::ValuesIn(filterAdditionalConfig())), @@ -320,7 +325,8 @@ INSTANTIATE_TEST_CASE_P(smoke_InterpolateCubic_Layout_Test, InterpolateLayerCPUT ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({1, 21, 4, 4})), ::testing::Values(std::vector({1, 21, 5, 6})), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), + ::testing::Values(CommonTestUtils::DEVICE_CPU), + ::testing::Values(additional_config)), ::testing::ValuesIn(filterCPUInfoForDevice()), ::testing::ValuesIn(interpolateFusingParamsSet), ::testing::ValuesIn(filterAdditionalConfig())), @@ -392,7 +398,8 @@ INSTANTIATE_TEST_CASE_P(smoke_InterpolateLinearOnnx5D_Layout_Test, InterpolateLa ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({1, 21, 4, 4, 4})), ::testing::Values(std::vector({1, 21, 5, 6, 2})), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), + ::testing::Values(CommonTestUtils::DEVICE_CPU), + ::testing::Values(additional_config)), ::testing::ValuesIn(filterCPUInfoForDevice5D()), ::testing::ValuesIn(interpolateFusingParamsSet), ::testing::ValuesIn(filterAdditionalConfig())), @@ -409,7 +416,8 @@ INSTANTIATE_TEST_CASE_P(smoke_InterpolateNN5D_Layout_Test, InterpolateLayerCPUTe ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({1, 21, 4, 4, 4})), ::testing::Values(std::vector({1, 21, 5, 6, 2})), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), + ::testing::Values(CommonTestUtils::DEVICE_CPU), + ::testing::Values(additional_config)), ::testing::ValuesIn(filterCPUInfoForDevice5D()), ::testing::ValuesIn(interpolateFusingParamsSet), ::testing::ValuesIn(filterAdditionalConfig())), diff --git a/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/single_layer_tests/interpolate.cpp b/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/single_layer_tests/interpolate.cpp index fbbb30c1e2c6fe..0b210ebef2e4db 100644 --- a/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/single_layer_tests/interpolate.cpp +++ b/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/single_layer_tests/interpolate.cpp @@ -82,6 +82,8 @@ const std::vector> defaultScales = { {1.f, 1.f, 2.f, 2.f} }; +std::map additional_config = {}; + const auto interpolateCasesWithoutNearest = ::testing::Combine( ::testing::ValuesIn(modesWithoutNearest), ::testing::ValuesIn(shapeCalculationMode), @@ -115,7 +117,8 @@ INSTANTIATE_TEST_CASE_P(smoke_Interpolate_Basic, InterpolateLayerTest, ::testing ::testing::Values(InferenceEngine::Layout::ANY), ::testing::ValuesIn(inShapes), ::testing::ValuesIn(targetShapes), - ::testing::Values(CommonTestUtils::DEVICE_GPU)), + ::testing::Values(CommonTestUtils::DEVICE_GPU), + ::testing::Values(additional_config)), InterpolateLayerTest::getTestCaseName); INSTANTIATE_TEST_CASE_P(smoke_Interpolate_Nearest, InterpolateLayerTest, ::testing::Combine( @@ -127,7 +130,8 @@ INSTANTIATE_TEST_CASE_P(smoke_Interpolate_Nearest, InterpolateLayerTest, ::testi ::testing::Values(InferenceEngine::Layout::ANY), ::testing::ValuesIn(inShapes), ::testing::ValuesIn(targetShapes), - ::testing::Values(CommonTestUtils::DEVICE_GPU)), + ::testing::Values(CommonTestUtils::DEVICE_GPU), + ::testing::Values(additional_config)), InterpolateLayerTest::getTestCaseName); } // namespace diff --git a/inference-engine/tests/functional/plugin/myriad/shared_tests_instances/single_layer_tests/interpolate.cpp b/inference-engine/tests/functional/plugin/myriad/shared_tests_instances/single_layer_tests/interpolate.cpp index 868c17a533e3f4..b7234a93c4c76a 100644 --- a/inference-engine/tests/functional/plugin/myriad/shared_tests_instances/single_layer_tests/interpolate.cpp +++ b/inference-engine/tests/functional/plugin/myriad/shared_tests_instances/single_layer_tests/interpolate.cpp @@ -172,7 +172,7 @@ const auto interpolateCasesWithoutNearestMode = ::testing::Combine( ::testing::ValuesIn(defaultAxes), ::testing::ValuesIn(defaultScales)); -INSTANTIATE_TEST_CASE_P(smoke_Interpolate_nearest_mode_2x, InterpolateLayerTestWithConfig, ::testing::Combine( +INSTANTIATE_TEST_CASE_P(smoke_Interpolate_nearest_mode_2x, InterpolateLayerTest, ::testing::Combine( interpolateCasesNearestMode2x, ::testing::ValuesIn(netPrecisions), ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), @@ -183,9 +183,9 @@ INSTANTIATE_TEST_CASE_P(smoke_Interpolate_nearest_mode_2x, InterpolateLayerTestW ::testing::ValuesIn(targetShapes2x), ::testing::Values(CommonTestUtils::DEVICE_MYRIAD), ::testing::Values(Config{{InferenceEngine::MYRIAD_DETECT_NETWORK_BATCH, CONFIG_VALUE(NO)}})), - InterpolateLayerTestWithConfig::getTestCaseName); + InterpolateLayerTest::getTestCaseName); -INSTANTIATE_TEST_CASE_P(smoke_Interpolate_nearest_mode, InterpolateLayerTestWithConfig, ::testing::Combine( +INSTANTIATE_TEST_CASE_P(smoke_Interpolate_nearest_mode, InterpolateLayerTest, ::testing::Combine( interpolateCasesNearestMode, ::testing::ValuesIn(netPrecisions), ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), @@ -196,9 +196,9 @@ INSTANTIATE_TEST_CASE_P(smoke_Interpolate_nearest_mode, InterpolateLayerTestWith ::testing::ValuesIn(targetShapes), ::testing::Values(CommonTestUtils::DEVICE_MYRIAD), ::testing::Values(Config{{InferenceEngine::MYRIAD_DETECT_NETWORK_BATCH, CONFIG_VALUE(NO)}})), - InterpolateLayerTestWithConfig::getTestCaseName); + InterpolateLayerTest::getTestCaseName); -INSTANTIATE_TEST_CASE_P(smoke_Interpolate_nearest_mode_more, InterpolateLayerTestWithConfig, ::testing::Combine( +INSTANTIATE_TEST_CASE_P(smoke_Interpolate_nearest_mode_more, InterpolateLayerTest, ::testing::Combine( interpolateCasesNearestModeMore, ::testing::ValuesIn(netPrecisions), ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), @@ -209,9 +209,9 @@ INSTANTIATE_TEST_CASE_P(smoke_Interpolate_nearest_mode_more, InterpolateLayerTes ::testing::ValuesIn(targetShapes), ::testing::Values(CommonTestUtils::DEVICE_MYRIAD), ::testing::Values(Config{{InferenceEngine::MYRIAD_DETECT_NETWORK_BATCH, CONFIG_VALUE(NO)}})), - InterpolateLayerTestWithConfig::getTestCaseName); + InterpolateLayerTest::getTestCaseName); -INSTANTIATE_TEST_CASE_P(smoke_Interpolate_without_nearest, InterpolateLayerTestWithConfig, ::testing::Combine( +INSTANTIATE_TEST_CASE_P(smoke_Interpolate_without_nearest, InterpolateLayerTest, ::testing::Combine( interpolateCasesWithoutNearestMode, ::testing::ValuesIn(netPrecisions), ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), @@ -222,6 +222,6 @@ INSTANTIATE_TEST_CASE_P(smoke_Interpolate_without_nearest, InterpolateLayerTestW ::testing::ValuesIn(targetShapes), ::testing::Values(CommonTestUtils::DEVICE_MYRIAD), ::testing::Values(Config{{InferenceEngine::MYRIAD_DETECT_NETWORK_BATCH, CONFIG_VALUE(NO)}})), - InterpolateLayerTestWithConfig::getTestCaseName); + InterpolateLayerTest::getTestCaseName); } // namespace diff --git a/inference-engine/tests/functional/plugin/shared/include/single_layer_tests/interpolate.hpp b/inference-engine/tests/functional/plugin/shared/include/single_layer_tests/interpolate.hpp index 588d2143375bd3..476bd2a8ae2d0c 100644 --- a/inference-engine/tests/functional/plugin/shared/include/single_layer_tests/interpolate.hpp +++ b/inference-engine/tests/functional/plugin/shared/include/single_layer_tests/interpolate.hpp @@ -12,8 +12,4 @@ TEST_P(InterpolateLayerTest, CompareWithRefs) { Run(); } -TEST_P(InterpolateLayerTestWithConfig, CompareWithRefs) { - Run(); -} - } // namespace LayerTestsDefinitions diff --git a/inference-engine/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/interpolate.hpp b/inference-engine/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/interpolate.hpp index 2855c213a7bd3a..07e86512ee0ea9 100644 --- a/inference-engine/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/interpolate.hpp +++ b/inference-engine/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/interpolate.hpp @@ -29,18 +29,6 @@ typedef std::tuple< std::vector // Scales > InterpolateSpecificParams; -typedef std::tuple< - InterpolateSpecificParams, - InferenceEngine::Precision, // Net precision - InferenceEngine::Precision, // Input precision - InferenceEngine::Precision, // Output precision - InferenceEngine::Layout, // Input layout - InferenceEngine::Layout, // Output layout - InferenceEngine::SizeVector, // Input shapes - InferenceEngine::SizeVector, // Target shapes - LayerTestsUtils::TargetDevice // Device name -> InterpolateLayerTestParams; - typedef std::tuple< InterpolateSpecificParams, InferenceEngine::Precision, // Net precision @@ -52,7 +40,7 @@ typedef std::tuple< InferenceEngine::SizeVector, // Target shapes LayerTestsUtils::TargetDevice, // Device name std::map // Additional network configuration -> InterpolateLayerTestParamsWithConfig; +> InterpolateLayerTestParams; class InterpolateLayerTest : public testing::WithParamInterface, virtual public LayerTestsUtils::LayerTestsCommon { @@ -63,13 +51,4 @@ class InterpolateLayerTest : public testing::WithParamInterface, - virtual public LayerTestsUtils::LayerTestsCommon { -public: - static std::string getTestCaseName(testing::TestParamInfo obj); - -protected: - void SetUp() override; -}; - } // namespace LayerTestsDefinitions diff --git a/inference-engine/tests/functional/shared_test_classes/src/single_layer/interpolate.cpp b/inference-engine/tests/functional/shared_test_classes/src/single_layer/interpolate.cpp index 4e3b901341f465..37db7bdeeab173 100644 --- a/inference-engine/tests/functional/shared_test_classes/src/single_layer/interpolate.cpp +++ b/inference-engine/tests/functional/shared_test_classes/src/single_layer/interpolate.cpp @@ -12,86 +12,6 @@ using ngraph::helpers::operator<<; namespace LayerTestsDefinitions { std::string InterpolateLayerTest::getTestCaseName(testing::TestParamInfo obj) { - InterpolateSpecificParams interpolateParams; - InferenceEngine::Precision netPrecision; - InferenceEngine::Precision inPrc, outPrc; - InferenceEngine::Layout inLayout, outLayout; - InferenceEngine::SizeVector inputShapes, targetShapes; - std::string targetDevice; - std::tie(interpolateParams, netPrecision, inPrc, outPrc, inLayout, outLayout, inputShapes, targetShapes, targetDevice) = obj.param; - std::vector padBegin, padEnd; - std::vector axes; - std::vector scales; - bool antialias; - ngraph::op::v4::Interpolate::InterpolateMode mode; - ngraph::op::v4::Interpolate::ShapeCalcMode shapeCalcMode; - ngraph::op::v4::Interpolate::CoordinateTransformMode coordinateTransformMode; - ngraph::op::v4::Interpolate::NearestMode nearestMode; - double cubeCoef; - std::tie(mode, shapeCalcMode, coordinateTransformMode, nearestMode, antialias, padBegin, padEnd, cubeCoef, axes, scales) = interpolateParams; - std::ostringstream result; - result << "IS=" << CommonTestUtils::vec2str(inputShapes) << "_"; - result << "TS=" << CommonTestUtils::vec2str(targetShapes) << "_"; - result << "InterpolateMode=" << mode << "_"; - result << "ShapeCalcMode=" << shapeCalcMode << "_"; - result << "CoordinateTransformMode=" << coordinateTransformMode << "_"; - result << "NearestMode=" << nearestMode << "_"; - result << "CubeCoef=" << cubeCoef << "_"; - result << "Antialias=" << antialias << "_"; - result << "PB=" << CommonTestUtils::vec2str(padBegin) << "_"; - result << "PE=" << CommonTestUtils::vec2str(padEnd) << "_"; - result << "Axes=" << CommonTestUtils::vec2str(axes) << "_"; - result << "Scales=" << CommonTestUtils::vec2str(scales) << "_"; - result << "netPRC=" << netPrecision.name() << "_"; - result << "inPRC=" << inPrc.name() << "_"; - result << "outPRC=" << outPrc.name() << "_"; - result << "inL=" << inLayout << "_"; - result << "outL=" << outLayout << "_"; - result << "trgDev=" << targetDevice; - return result.str(); -} - -void InterpolateLayerTest::SetUp() { - InterpolateSpecificParams interpolateParams; - std::vector inputShape, targetShape; - auto netPrecision = InferenceEngine::Precision::UNSPECIFIED; - std::tie(interpolateParams, netPrecision, inPrc, outPrc, inLayout, outLayout, inputShape, targetShape, targetDevice) = this->GetParam(); - std::vector padBegin, padEnd; - std::vector axes; - std::vector scales; - bool antialias; - ngraph::op::v4::Interpolate::InterpolateMode mode; - ngraph::op::v4::Interpolate::ShapeCalcMode shapeCalcMode; - ngraph::op::v4::Interpolate::CoordinateTransformMode coordinateTransformMode; - ngraph::op::v4::Interpolate::NearestMode nearestMode; - - double cubeCoef; - std::tie(mode, shapeCalcMode, coordinateTransformMode, nearestMode, antialias, padBegin, padEnd, cubeCoef, axes, scales) = interpolateParams; - - auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(netPrecision); - auto params = ngraph::builder::makeParams(ngPrc, {inputShape}); - - auto sizesConst = ngraph::opset3::Constant(ngraph::element::Type_t::i64, {targetShape.size()}, targetShape); - auto sizesInput = std::make_shared(sizesConst); - - auto scales_const = ngraph::opset3::Constant(ngraph::element::Type_t::f32, {scales.size()}, scales); - auto scalesInput = std::make_shared(scales_const); - - auto axesConst = ngraph::opset3::Constant(ngraph::element::Type_t::i64, {axes.size()}, axes); - auto axesInput = std::make_shared(axesConst); - - ngraph::op::v4::Interpolate::InterpolateAttrs interpolateAttributes{mode, shapeCalcMode, padBegin, - padEnd, coordinateTransformMode, nearestMode, antialias, cubeCoef}; - auto interpolate = std::make_shared(params[0], - sizesInput, - scalesInput, - axesInput, - interpolateAttributes); - const ngraph::ResultVector results{std::make_shared(interpolate)}; - function = std::make_shared(results, params, "interpolate"); -} - -std::string InterpolateLayerTestWithConfig::getTestCaseName(testing::TestParamInfo obj) { InterpolateSpecificParams interpolateParams; InferenceEngine::Precision netPrecision; InferenceEngine::Precision inPrc, outPrc; @@ -132,7 +52,7 @@ std::string InterpolateLayerTestWithConfig::getTestCaseName(testing::TestParamIn return result.str(); } -void InterpolateLayerTestWithConfig::SetUp() { +void InterpolateLayerTest::SetUp() { InterpolateSpecificParams interpolateParams; std::vector inputShape, targetShape; auto netPrecision = InferenceEngine::Precision::UNSPECIFIED; @@ -174,5 +94,4 @@ void InterpolateLayerTestWithConfig::SetUp() { const ngraph::ResultVector results{std::make_shared(interpolate)}; function = std::make_shared(results, params, "interpolate"); } - } // namespace LayerTestsDefinitions