diff --git a/docs/template_plugin/tests/functional/shared_tests_instances/single_layer_tests/convolution.cpp b/docs/template_plugin/tests/functional/shared_tests_instances/single_layer_tests/convolution.cpp index 9259ee356b7..dbdb145c43b 100644 --- a/docs/template_plugin/tests/functional/shared_tests_instances/single_layer_tests/convolution.cpp +++ b/docs/template_plugin/tests/functional/shared_tests_instances/single_layer_tests/convolution.cpp @@ -80,8 +80,9 @@ INSTANTIATE_TEST_SUITE_P(Convolution2D_ExplicitPadding, ConvolutionLayerTest, ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector>({{1, 10}, {3, 30}, {30, 300}, {30, 300}})), -// ::testing::Values(std::vector>({{1, 3, 30, 30}, {2, 4, 31, 31}})), - ::testing::Values(std::vector>({{2, 4, 31, 31}})), + ::testing::Values(std::vector>({{1, 3, 30, 30}}), + std::vector>({{2, 4, 31, 31}}), + std::vector>({{1, 3, 30, 30}, {2, 4, 31, 31}})), ::testing::Values(CommonTestUtils::DEVICE_TEMPLATE)), ConvolutionLayerTest::getTestCaseName); // ! [test_convolution:instantiate] diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/convolution.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/convolution.cpp index fbaba32e8d8..35c8e001df8 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/convolution.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/convolution.cpp @@ -43,7 +43,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(InferenceEngine::Layout::ANY), - ::testing::Values(std::vector({1, 3, 30})), + ::testing::Values(std::vector>(NULL_RANGE)), + ::testing::Values(std::vector>({{1, 3, 30}})), ::testing::Values(CommonTestUtils::DEVICE_CPU)), ConvolutionLayerTest::getTestCaseName); @@ -55,7 +56,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(InferenceEngine::Layout::ANY), - ::testing::Values(std::vector({1, 3, 30})), + ::testing::Values(std::vector>(NULL_RANGE)), + ::testing::Values(std::vector>({{1, 3, 30}})), ::testing::Values(CommonTestUtils::DEVICE_CPU)), ConvolutionLayerTest::getTestCaseName); @@ -87,7 +89,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(InferenceEngine::Layout::ANY), - ::testing::Values(std::vector({1, 3, 30, 30})), + ::testing::Values(std::vector>(NULL_RANGE)), + ::testing::Values(std::vector>({{1, 3, 30, 30}})), ::testing::Values(CommonTestUtils::DEVICE_CPU)), ConvolutionLayerTest::getTestCaseName); @@ -99,7 +102,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(InferenceEngine::Layout::ANY), - ::testing::Values(std::vector({1, 3, 30, 30})), + ::testing::Values(std::vector>(NULL_RANGE)), + ::testing::Values(std::vector>({{1, 3, 30, 30}})), ::testing::Values(CommonTestUtils::DEVICE_CPU)), ConvolutionLayerTest::getTestCaseName); @@ -127,7 +131,8 @@ namespace specificWeightLayout { ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(InferenceEngine::Layout::ANY), - ::testing::Values(std::vector({1, 1, 50, 75})), + ::testing::Values(std::vector>(NULL_RANGE)), + ::testing::Values(std::vector>({{1, 1, 50, 75}})), ::testing::Values(CommonTestUtils::DEVICE_CPU)), ConvolutionLayerTest::getTestCaseName); } // namespace specificWeightLayout @@ -159,7 +164,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(InferenceEngine::Layout::ANY), - ::testing::Values(std::vector({1, 3, 10, 10, 10})), + ::testing::Values(std::vector>(NULL_RANGE)), + ::testing::Values(std::vector>({{1, 3, 10, 10, 10}})), ::testing::Values(CommonTestUtils::DEVICE_CPU)), ConvolutionLayerTest::getTestCaseName); @@ -171,7 +177,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(InferenceEngine::Layout::ANY), - ::testing::Values(std::vector({1, 3, 10, 10, 10})), + ::testing::Values(std::vector>(NULL_RANGE)), + ::testing::Values(std::vector>({{1, 3, 10, 10, 10}})), ::testing::Values(CommonTestUtils::DEVICE_CPU)), ConvolutionLayerTest::getTestCaseName); diff --git a/inference-engine/tests/functional/plugin/shared/include/behavior/preprocessing/preprocessing.hpp b/inference-engine/tests/functional/plugin/shared/include/behavior/preprocessing/preprocessing.hpp index 557a36803b3..9abc1a78dd2 100644 --- a/inference-engine/tests/functional/plugin/shared/include/behavior/preprocessing/preprocessing.hpp +++ b/inference-engine/tests/functional/plugin/shared/include/behavior/preprocessing/preprocessing.hpp @@ -113,7 +113,7 @@ public: // w/a: copy of original function is required to provide correct op coverage report (overflow of convert counter issue) auto copyOriginalFunction = function; //force the reference implementation to use graph with extra Convert operation - function = reference_function; + functionRefs = reference_function; LayerTestsUtils::LayerTestsCommon::Validate(); function = copyOriginalFunction; } diff --git a/inference-engine/tests/functional/plugin/shared/src/hetero/synthetic.cpp b/inference-engine/tests/functional/plugin/shared/src/hetero/synthetic.cpp index b134d27a811..f0cc2f9e807 100644 --- a/inference-engine/tests/functional/plugin/shared/src/hetero/synthetic.cpp +++ b/inference-engine/tests/functional/plugin/shared/src/hetero/synthetic.cpp @@ -106,6 +106,7 @@ void HeteroSyntheticTest::SetUp() { --num; } function = std::get(param)._function; + functionRefs = function; } void HeteroSyntheticTest::TearDown() { diff --git a/inference-engine/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/convolution.hpp b/inference-engine/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/convolution.hpp index a7287a637b8..2a71a03cf9d 100644 --- a/inference-engine/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/convolution.hpp +++ b/inference-engine/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/convolution.hpp @@ -45,7 +45,6 @@ public: protected: void SetUp() override; std::shared_ptr makeConvolution(const std::string& name = ""); - void Run() override; private: InferenceEngine::Precision::ePrecision netPrecision = InferenceEngine::Precision::UNSPECIFIED; diff --git a/inference-engine/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/softmax.hpp b/inference-engine/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/softmax.hpp index a7c17866e68..9641125813f 100644 --- a/inference-engine/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/softmax.hpp +++ b/inference-engine/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/softmax.hpp @@ -36,7 +36,7 @@ public: protected: void SetUp() override; - void makeSoftMax(); + std::shared_ptr makeSoftMax(const std::string& name = ""); private: InferenceEngine::Precision netPrecision; diff --git a/inference-engine/tests/functional/shared_test_classes/src/base/layer_test_utils.cpp b/inference-engine/tests/functional/shared_test_classes/src/base/layer_test_utils.cpp index 59fe17b0175..21ca42a3b65 100644 --- a/inference-engine/tests/functional/shared_test_classes/src/base/layer_test_utils.cpp +++ b/inference-engine/tests/functional/shared_test_classes/src/base/layer_test_utils.cpp @@ -39,10 +39,10 @@ void LayerTestsCommon::Run() { s.setDeviceName(targetDevice); if (FuncTestUtils::SkipTestsConfig::currentTestIsDisabled()) { - s.updateOPsStats(function, PassRate::Statuses::SKIPPED); + s.updateOPsStats(functionRefs, PassRate::Statuses::SKIPPED); GTEST_SKIP() << "Disabled test due to configuration" << std::endl; } else { - s.updateOPsStats(function, PassRate::Statuses::CRASHED); + s.updateOPsStats(functionRefs, PassRate::Statuses::CRASHED); } try { @@ -52,17 +52,17 @@ void LayerTestsCommon::Run() { GenerateInputs(); Infer(); Validate(); - s.updateOPsStats(function, PassRate::Statuses::PASSED); + s.updateOPsStats(functionRefs, PassRate::Statuses::PASSED); } } catch (const std::runtime_error &re) { - s.updateOPsStats(function, PassRate::Statuses::FAILED); + s.updateOPsStats(functionRefs, PassRate::Statuses::FAILED); GTEST_FATAL_FAILURE_(re.what()); } catch (const std::exception &ex) { - s.updateOPsStats(function, PassRate::Statuses::FAILED); + s.updateOPsStats(functionRefs, PassRate::Statuses::FAILED); GTEST_FATAL_FAILURE_(ex.what()); } catch (...) { - s.updateOPsStats(function, PassRate::Statuses::FAILED); + s.updateOPsStats(functionRefs, PassRate::Statuses::FAILED); GTEST_FATAL_FAILURE_("Unknown failure occurred."); } } @@ -95,8 +95,10 @@ void LayerTestsCommon::Serialize() { InferenceEngine::Blob::Ptr LayerTestsCommon::GenerateInput(const InferenceEngine::InputInfo& info) const { return FuncTestUtils::createAndFillBlob( - InferenceEngine::TensorDesc(info.getPrecision(), targetStaticShape, - const_cast(info).getLayout())); + targetStaticShape.empty() ? info.getTensorDesc() + : InferenceEngine::TensorDesc(info.getPrecision(), + targetStaticShape, + const_cast(info).getLayout())); } void LayerTestsCommon::Compare(const std::vector>> &expectedOutputs, @@ -317,12 +319,14 @@ void LayerTestsCommon::ConfigureNetwork() { } } - std::map inputShapes; - auto inputsDataMap = cnnNetwork.getInputsInfo(); - for (auto&& inputDataMap : inputsDataMap) { - inputShapes[inputDataMap.first] = std::vector(inputDynamicShape); + if (inputDynamicShape.is_dynamic()) { + std::map inputShapes; + auto inputsDataMap = cnnNetwork.getInputsInfo(); + for (auto&& inputDataMap : inputsDataMap) { + inputShapes[inputDataMap.first] = std::vector(inputDynamicShape); + } + cnnNetwork.reshape(inputShapes); } - cnnNetwork.reshape(inputShapes); } void LayerTestsCommon::LoadNetwork() { diff --git a/inference-engine/tests/functional/shared_test_classes/src/single_layer/convolution.cpp b/inference-engine/tests/functional/shared_test_classes/src/single_layer/convolution.cpp index 3a2421eb7e0..cf53e8138c2 100644 --- a/inference-engine/tests/functional/shared_test_classes/src/single_layer/convolution.cpp +++ b/inference-engine/tests/functional/shared_test_classes/src/single_layer/convolution.cpp @@ -58,7 +58,8 @@ void ConvolutionLayerTest::SetUp() { setTargetStaticShape(targetStaticShapes[0]); function = makeConvolution("convolution"); - functionRefs = makeConvolution("convolutionRefs"); + functionRefs = ngraph::clone_function(*function); + functionRefs->set_friendly_name("convolutionRefs"); } std::shared_ptr ConvolutionLayerTest::makeConvolution(const std::string& name) { @@ -79,45 +80,4 @@ std::shared_ptr ConvolutionLayerTest::makeConvolution(const st return std::make_shared(results, params, name); } -void ConvolutionLayerTest::Run() { - auto crashHandler = [](int errCode) { - auto &s = LayerTestsUtils::Summary::getInstance(); - s.saveReport(); - std::cout << "Unexpected application crash!" << std::endl; - std::abort(); - }; - signal(SIGSEGV, crashHandler); - - auto &s = LayerTestsUtils::Summary::getInstance(); - s.setDeviceName(targetDevice); - - if (FuncTestUtils::SkipTestsConfig::currentTestIsDisabled()) { - s.updateOPsStats(function, LayerTestsUtils::PassRate::Statuses::SKIPPED); - GTEST_SKIP() << "Disabled test due to configuration" << std::endl; - } else { - s.updateOPsStats(function, LayerTestsUtils::PassRate::Statuses::CRASHED); - } - - try { - LoadNetwork(); - for (auto&& tss : targetStaticShapes) { - setTargetStaticShape(tss); - GenerateInputs(); - Infer(); - Validate(); - s.updateOPsStats(function, LayerTestsUtils::PassRate::Statuses::PASSED); - } - } - catch (const std::runtime_error &re) { - s.updateOPsStats(function, LayerTestsUtils::PassRate::Statuses::FAILED); - GTEST_FATAL_FAILURE_(re.what()); - } catch (const std::exception &ex) { - s.updateOPsStats(function, LayerTestsUtils::PassRate::Statuses::FAILED); - GTEST_FATAL_FAILURE_(ex.what()); - } catch (...) { - s.updateOPsStats(function, LayerTestsUtils::PassRate::Statuses::FAILED); - GTEST_FATAL_FAILURE_("Unknown failure occurred."); - } -} - } // namespace LayerTestsDefinitions diff --git a/inference-engine/tests/functional/shared_test_classes/src/single_layer/reshape.cpp b/inference-engine/tests/functional/shared_test_classes/src/single_layer/reshape.cpp index 478f2ce0e27..ef37a106286 100644 --- a/inference-engine/tests/functional/shared_test_classes/src/single_layer/reshape.cpp +++ b/inference-engine/tests/functional/shared_test_classes/src/single_layer/reshape.cpp @@ -45,6 +45,8 @@ void ReshapeLayerTest::SetUp() { std::make_shared(paramIn[0], constNode, specialZero)); ngraph::ResultVector results{std::make_shared(reshape)}; function = std::make_shared(results, paramsIn, "Reshape"); + functionRefs = ngraph::clone_function(*function); + functionRefs->set_friendly_name("ReshapeRefs"); } } // namespace LayerTestsDefinitions diff --git a/inference-engine/tests/functional/shared_test_classes/src/single_layer/softmax.cpp b/inference-engine/tests/functional/shared_test_classes/src/single_layer/softmax.cpp index 4c2145a98e4..d5414f453b9 100644 --- a/inference-engine/tests/functional/shared_test_classes/src/single_layer/softmax.cpp +++ b/inference-engine/tests/functional/shared_test_classes/src/single_layer/softmax.cpp @@ -45,10 +45,13 @@ void SoftMaxLayerTest::SetUp() { inputDynamicShape = FuncTestUtils::PartialShapeUtils::vec2partialshape(inputShape, targetStaticShapes[0]); - makeSoftMax(); + setTargetStaticShape(targetStaticShapes[0]); + function = makeSoftMax("softMax"); + functionRefs = ngraph::clone_function(*function); + functionRefs->set_friendly_name("softMaxRefs"); } -void SoftMaxLayerTest::makeSoftMax() { +std::shared_ptr SoftMaxLayerTest::makeSoftMax(const std::string& name) { const auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(netPrecision); const auto params = ngraph::builder::makeParams(ngPrc, {targetStaticShape}); const auto paramOuts = @@ -56,7 +59,7 @@ void SoftMaxLayerTest::makeSoftMax() { const auto softMax = std::make_shared(paramOuts.at(0), axis); const ngraph::ResultVector results {std::make_shared(softMax)}; - function = std::make_shared(results, params, "softMax"); + return std::make_shared(results, params, name); } } // namespace LayerTestsDefinitions diff --git a/inference-engine/tests/functional/shared_test_classes/src/single_layer/split.cpp b/inference-engine/tests/functional/shared_test_classes/src/single_layer/split.cpp index 446533dd3de..7dd9574e507 100644 --- a/inference-engine/tests/functional/shared_test_classes/src/single_layer/split.cpp +++ b/inference-engine/tests/functional/shared_test_classes/src/single_layer/split.cpp @@ -53,5 +53,7 @@ void SplitLayerTest::SetUp() { results.push_back(std::make_shared(split->output(outIndices[i]))); } function = std::make_shared(results, params, "split"); + functionRefs = ngraph::clone_function(*function); + functionRefs->set_friendly_name("splitRefs"); } } // namespace LayerTestsDefinitions