From 5ce622f4f49bba26813e81333aa6239ce8102105 Mon Sep 17 00:00:00 2001 From: Nikita Kudriavtsev Date: Mon, 12 Oct 2020 16:37:31 +0300 Subject: [PATCH] [IE Myriad] Fix layer tests for logical_and (#2622) --- .../single_layer_tests/logical.cpp | 16 +++++----------- .../shared/include/single_layer_tests/logical.hpp | 8 ++++++++ .../plugin/shared/src/single_layer_tests/logical.cpp | 18 ++++++++---------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/inference-engine/tests/functional/plugin/myriad/shared_tests_instances/single_layer_tests/logical.cpp b/inference-engine/tests/functional/plugin/myriad/shared_tests_instances/single_layer_tests/logical.cpp index adcf5f5..1598011 100644 --- a/inference-engine/tests/functional/plugin/myriad/shared_tests_instances/single_layer_tests/logical.cpp +++ b/inference-engine/tests/functional/plugin/myriad/shared_tests_instances/single_layer_tests/logical.cpp @@ -22,15 +22,9 @@ typedef std::map Config; class LogicalLayerTestVPU : public LogicalLayerTest { protected: void SetUp() override { - const auto& inputShapes = std::get<0>(GetParam()); - const auto& ngInputsPrecision = std::get<4>(GetParam()); - const auto& logicalOpType = std::get<1>(GetParam()); - targetDevice = std::get<5>(GetParam()); - const auto& additionalConfig = std::get<9>(GetParam()); - configuration.insert(additionalConfig.begin(), additionalConfig.end()); - outPrc = ngInputsPrecision; - - auto ngInputsPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(ngInputsPrecision); + SetupParams(); + + auto ngInputsPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(inPrc); auto inputs = ngraph::builder::makeParams(ngInputsPrc, {inputShapes.first, logicalOpType != ngraph::helpers::LogicalTypes::LOGICAL_NOT ? inputShapes.second : ngraph::Shape()}); ngraph::NodeVector convertedInputs; @@ -80,7 +74,7 @@ INSTANTIATE_TEST_CASE_P(smoke_EltwiseLogicalInt, ::testing::Values(ngraph::helpers::InputLayerType::PARAMETER), ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), ::testing::Values(InferenceEngine::Precision::I32), - ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), + ::testing::Values(InferenceEngine::Precision::I32), ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(CommonTestUtils::DEVICE_MYRIAD), @@ -95,7 +89,7 @@ INSTANTIATE_TEST_CASE_P(smoke_EltwiseLogicalNotInt, ::testing::Values(ngraph::helpers::InputLayerType::CONSTANT), ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), ::testing::Values(InferenceEngine::Precision::I32), - ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), + ::testing::Values(InferenceEngine::Precision::I32), ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(CommonTestUtils::DEVICE_MYRIAD), diff --git a/inference-engine/tests/functional/plugin/shared/include/single_layer_tests/logical.hpp b/inference-engine/tests/functional/plugin/shared/include/single_layer_tests/logical.hpp index d41deec..a2807b4 100644 --- a/inference-engine/tests/functional/plugin/shared/include/single_layer_tests/logical.hpp +++ b/inference-engine/tests/functional/plugin/shared/include/single_layer_tests/logical.hpp @@ -34,10 +34,18 @@ class LogicalLayerTest : public testing::WithParamInterface, virtual public LayerTestsUtils::LayerTestsCommon { protected: InferenceEngine::Blob::Ptr GenerateInput(const InferenceEngine::InputInfo &info) const override; + void SetupParams(); void SetUp() override; public: static std::string getTestCaseName(testing::TestParamInfo obj); static std::vector combineShapes(const std::map, std::vector>>& inputShapes); + +protected: + LogicalParams::InputShapesTuple inputShapes; + ngraph::helpers::LogicalTypes logicalOpType; + ngraph::helpers::InputLayerType secondInputType; + InferenceEngine::Precision netPrecision; + std::map additional_config; }; } // namespace LayerTestsDefinitions diff --git a/inference-engine/tests/functional/plugin/shared/src/single_layer_tests/logical.cpp b/inference-engine/tests/functional/plugin/shared/src/single_layer_tests/logical.cpp index 3b0871f..14429e9 100644 --- a/inference-engine/tests/functional/plugin/shared/src/single_layer_tests/logical.cpp +++ b/inference-engine/tests/functional/plugin/shared/src/single_layer_tests/logical.cpp @@ -60,20 +60,18 @@ InferenceEngine::Blob::Ptr LogicalLayerTest::GenerateInput(const InferenceEngine return FuncTestUtils::createAndFillBlob(info.getTensorDesc(), 2, 0); } -void LogicalLayerTest::SetUp() { - InputShapesTuple inputShapes; - InferenceEngine::Precision inputsPrecision; - ngraph::helpers::LogicalTypes logicalOpType; - ngraph::helpers::InputLayerType secondInputType; - InferenceEngine::Precision netPrecision; - std::string targetName; - std::map additional_config; - std::tie(inputShapes, logicalOpType, secondInputType, netPrecision, inPrc, outPrc, inLayout, outLayout, targetDevice, additional_config) = +void LogicalLayerTest::SetupParams() { + std::tie(inputShapes, logicalOpType, secondInputType, netPrecision, + inPrc, outPrc, inLayout, outLayout, targetDevice, additional_config) = this->GetParam(); - auto ngInputsPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(inPrc); configuration.insert(additional_config.begin(), additional_config.end()); +} +void LogicalLayerTest::SetUp() { + SetupParams(); + + auto ngInputsPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(inPrc); auto inputs = ngraph::builder::makeParams(ngInputsPrc, {inputShapes.first}); std::shared_ptr logicalNode; -- 2.7.4