diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/reduce_ops.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/reduce_ops.cpp index a1f4029280e..cf1466e258b 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/reduce_ops.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/reduce_ops.cpp @@ -63,9 +63,13 @@ const std::vector reductionTypes = { ngraph::helpers::ReductionType::Max, ngraph::helpers::ReductionType::Sum, ngraph::helpers::ReductionType::Prod, + ngraph::helpers::ReductionType::L1, + ngraph::helpers::ReductionType::L2, +}; + +const std::vector reductionLogicalTypes = { ngraph::helpers::ReductionType::LogicalOr, - ngraph::helpers::ReductionType::LogicalXor, - ngraph::helpers::ReductionType::LogicalAnd, + ngraph::helpers::ReductionType::LogicalAnd }; const auto paramsOneAxis = testing::Combine( @@ -81,6 +85,19 @@ const auto paramsOneAxis = testing::Combine( testing::Values(CommonTestUtils::DEVICE_CPU) ); +const auto paramsOneAxisLogical = testing::Combine( + testing::Values(std::vector{0}), + testing::ValuesIn(opTypes), + testing::Values(true, false), + testing::ValuesIn(reductionLogicalTypes), + testing::Values(InferenceEngine::Precision::BOOL), + testing::Values(InferenceEngine::Precision::UNSPECIFIED), + testing::Values(InferenceEngine::Precision::UNSPECIFIED), + testing::Values(InferenceEngine::Layout::ANY), + testing::ValuesIn(inputShapes), + testing::Values(CommonTestUtils::DEVICE_CPU) +); + const auto params_Precisions = testing::Combine( testing::Values(std::vector{1, 3}), testing::Values(opTypes[1]), @@ -139,6 +156,19 @@ const auto params_ReductionTypes = testing::Combine( testing::Values(CommonTestUtils::DEVICE_CPU) ); +const auto params_ReductionTypesLogical = testing::Combine( + testing::Values(std::vector{0, 1, 3}), + testing::Values(opTypes[1]), + testing::ValuesIn(keepDims), + testing::ValuesIn(reductionLogicalTypes), + testing::Values(InferenceEngine::Precision::BOOL), + testing::Values(InferenceEngine::Precision::UNSPECIFIED), + testing::Values(InferenceEngine::Precision::UNSPECIFIED), + testing::Values(InferenceEngine::Layout::ANY), + testing::Values(std::vector{2, 9, 2, 9}), + testing::Values(CommonTestUtils::DEVICE_CPU) +); + INSTANTIATE_TEST_CASE_P( smoke_ReduceOneAxis, ReduceOpsLayerTest, @@ -146,6 +176,13 @@ INSTANTIATE_TEST_CASE_P( ReduceOpsLayerTest::getTestCaseName ); +INSTANTIATE_TEST_CASE_P( + smoke_ReduceLogicalOneAxis, + ReduceOpsLayerTest, + paramsOneAxisLogical, + ReduceOpsLayerTest::getTestCaseName +); + INSTANTIATE_TEST_CASE_P( smoke_Reduce_Precisions, ReduceOpsLayerTest, @@ -174,6 +211,13 @@ INSTANTIATE_TEST_CASE_P( ReduceOpsLayerTest::getTestCaseName ); +INSTANTIATE_TEST_CASE_P( + smoke_ReduceLogical_ReductionTypes, + ReduceOpsLayerTest, + params_ReductionTypesLogical, + ReduceOpsLayerTest::getTestCaseName +); + INSTANTIATE_TEST_CASE_P( smoke_Reduce, ReduceOpsLayerWithSpecificInputTest, diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/skip_tests_config.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/skip_tests_config.cpp index c326efb7358..cb79f7c7f15 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/skip_tests_config.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/skip_tests_config.cpp @@ -25,9 +25,7 @@ std::vector disabledTestPatterns() { // TODO: failed to downgrade to opset v0 in interpreter backend R"(.*Gather.*axis=-1.*)", // TODO: Issue 33151 - R"(.*Reduce.*type=Logical.*)", R"(.*Reduce.*axes=\(1\.-1\).*)", - R"(.*Reduce.*axes=\(0\.3\)_type=Prod.*)", // TODO: Issue: 34518 R"(.*RangeLayerTest.*)", R"(.*(RangeAddSubgraphTest).*Start=1.2.*Stop=(5.2|-5.2).*Step=(0.1|-0.1).*netPRC=FP16.*)", diff --git a/inference-engine/tests/ngraph_functions/include/ngraph_functions/utils/ngraph_helpers.hpp b/inference-engine/tests/ngraph_functions/include/ngraph_functions/utils/ngraph_helpers.hpp index 0be35c01454..0682cc26f7c 100644 --- a/inference-engine/tests/ngraph_functions/include/ngraph_functions/utils/ngraph_helpers.hpp +++ b/inference-engine/tests/ngraph_functions/include/ngraph_functions/utils/ngraph_helpers.hpp @@ -167,7 +167,8 @@ enum ReductionType { Sum, LogicalOr, LogicalAnd, - LogicalXor + L1, + L2 }; enum class InputLayerType { diff --git a/inference-engine/tests/ngraph_functions/src/reduce.cpp b/inference-engine/tests/ngraph_functions/src/reduce.cpp index bd072e50a32..3f8e0f7ddc5 100644 --- a/inference-engine/tests/ngraph_functions/src/reduce.cpp +++ b/inference-engine/tests/ngraph_functions/src/reduce.cpp @@ -15,21 +15,23 @@ std::shared_ptr makeReduce(const ngraph::Output& data, ngraph::helpers::ReductionType reductionType) { switch (reductionType) { case helpers::Mean: - return std::make_shared(data, axes, keepDims); + return std::make_shared(data, axes, keepDims); case helpers::Max: - return std::make_shared(data, axes, keepDims); + return std::make_shared(data, axes, keepDims); case helpers::Min: - return std::make_shared(data, axes, keepDims); + return std::make_shared(data, axes, keepDims); case helpers::Prod: - return std::make_shared(data, axes, keepDims); + return std::make_shared(data, axes, keepDims); case helpers::Sum: - return std::make_shared(data, axes, keepDims); + return std::make_shared(data, axes, keepDims); case helpers::LogicalOr: - return std::make_shared(data, axes); + return std::make_shared(data, axes, keepDims); case helpers::LogicalAnd: - return std::make_shared(data, axes); - case helpers::LogicalXor: - return std::make_shared(data, axes); + return std::make_shared(data, axes, keepDims); + case helpers::L1: + return std::make_shared(data, axes, keepDims); + case helpers::L2: + return std::make_shared(data, axes, keepDims); default: throw std::runtime_error("Can't create layer for this reduction type"); } diff --git a/inference-engine/tests/ngraph_functions/src/utils/ngraph_helpers.cpp b/inference-engine/tests/ngraph_functions/src/utils/ngraph_helpers.cpp index 72df48f161d..4cc9029f0ad 100644 --- a/inference-engine/tests/ngraph_functions/src/utils/ngraph_helpers.cpp +++ b/inference-engine/tests/ngraph_functions/src/utils/ngraph_helpers.cpp @@ -41,8 +41,11 @@ std::ostream &operator<<(std::ostream &os, const ReductionType &m) { case LogicalAnd: os << "LogicalAnd"; break; - case LogicalXor: - os << "LogicalXor"; + case L1: + os << "ReduceL1"; + break; + case L2: + os << "ReduceL2"; break; } return os;