diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/nonzero.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/nonzero.cpp index bbbb7f888dcd2f..629392a5d99829 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/nonzero.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/nonzero.cpp @@ -2,35 +2,34 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "single_layer_tests/nonzero.hpp" +#include "single_op_tests/nonzero.hpp" #include "common_test_utils/test_constants.hpp" #include -using namespace ngraph::helpers; -using namespace LayerTestsDefinitions; - namespace { - std::vector> inShapes = { - {1000}, - {4, 1000}, - {2, 4, 1000}, - {2, 4, 4, 1000}, - {2, 4, 4, 2, 1000}, - }; +using ov::test::NonZeroLayerTest; + +std::vector> input_shapes_static = { + {{1000}}, + {{4, 1000}}, + {{2, 4, 1000}}, + {{2, 4, 4, 1000}}, + {{2, 4, 4, 2, 1000}}, +}; - const std::vector inputPrecisions = { - InferenceEngine::Precision::I32, - InferenceEngine::Precision::FP16, - InferenceEngine::Precision::U8, - }; +const std::vector model_types = { + ov::element::i32, + ov::element::f16, + ov::element::u8, +}; - ConfigMap config; +std::map config = {}; - INSTANTIATE_TEST_SUITE_P(smoke_nonzero, NonZeroLayerTest, - ::testing::Combine( - ::testing::ValuesIn(inShapes), - ::testing::ValuesIn(inputPrecisions), - ::testing::Values(ov::test::utils::DEVICE_CPU), - ::testing::Values(config)), - NonZeroLayerTest::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(smoke_nonzero, NonZeroLayerTest, + ::testing::Combine( + ::testing::ValuesIn(ov::test::static_shapes_to_test_representation(input_shapes_static)), + ::testing::ValuesIn(model_types), + ::testing::Values(ov::test::utils::DEVICE_CPU), + ::testing::Values(config)), + NonZeroLayerTest::getTestCaseName); } // namespace diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/normalize_l2.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/normalize_l2.cpp index 6941437751d567..7fbf1207bc4e29 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/normalize_l2.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/normalize_l2.cpp @@ -4,36 +4,38 @@ #include -#include "single_layer_tests/normalize_l2.hpp" - -using namespace LayerTestsDefinitions; +#include "single_op_tests/normalize_l2.hpp" namespace { -const std::vector netPrecisions = { - InferenceEngine::Precision::FP32, - InferenceEngine::Precision::FP16 +using ov::test::NormalizeL2LayerTest; + +const std::vector model_types = { + ov::element::f32, + ov::element::f16 }; const std::vector eps = {1e-12f, 1e-6f, 1e-3f, 0.1f, 100}; -const std::vector epsMode = { - ngraph::op::EpsMode::ADD, - ngraph::op::EpsMode::MAX, +const std::vector eps_modes = { + ov::op::EpsMode::ADD, + ov::op::EpsMode::MAX, }; /* ============= 1D ============= */ // [SKIPPED][CPU] Unsupported rank, Issue: 35627 -const std::vector> axes_1D = { +const std::vector> axes_1d = { {}, {0} }; +std::vector input_shape_1d_static = {{5}}; + const auto normL2params_1D = testing::Combine( - testing::ValuesIn(axes_1D), + testing::ValuesIn(axes_1d), testing::ValuesIn(eps), - testing::ValuesIn(epsMode), - testing::ValuesIn(std::vector>({{5}})), - testing::ValuesIn(netPrecisions), + testing::ValuesIn(eps_modes), + testing::Values(ov::test::static_shapes_to_test_representation(input_shape_1d_static)), + testing::ValuesIn(model_types), testing::Values(ov::test::utils::DEVICE_CPU) ); @@ -54,12 +56,14 @@ const std::vector> axes_2D = { // {0, 1}, }; +std::vector input_shape_2d_static = {{5, 3}}; + const auto normL2params_2D = testing::Combine( testing::ValuesIn(axes_2D), testing::ValuesIn(eps), - testing::ValuesIn(epsMode), - testing::ValuesIn(std::vector>({{5, 3}})), - testing::ValuesIn(netPrecisions), + testing::ValuesIn(eps_modes), + testing::Values(ov::test::static_shapes_to_test_representation(input_shape_2d_static)), + testing::ValuesIn(model_types), testing::Values(ov::test::utils::DEVICE_CPU) ); @@ -84,12 +88,14 @@ const std::vector> axes_3D = { // {0, 1, 2} }; +std::vector input_shape_3d_static = {{2, 5, 3}}; + const auto normL2params_3D = testing::Combine( testing::ValuesIn(axes_3D), testing::ValuesIn(eps), - testing::ValuesIn(epsMode), - testing::ValuesIn(std::vector>({{2, 5, 3}})), - testing::ValuesIn(netPrecisions), + testing::ValuesIn(eps_modes), + testing::Values(ov::test::static_shapes_to_test_representation(input_shape_3d_static)), + testing::ValuesIn(model_types), testing::Values(ov::test::utils::DEVICE_CPU) ); @@ -117,12 +123,14 @@ const std::vector> axes_4D = { // {0, 1, 2, 3} }; +std::vector input_shape_4d_static = {{2, 3, 10, 5}}; + const auto normL2params_4D = testing::Combine( testing::ValuesIn(axes_4D), testing::ValuesIn(eps), - testing::ValuesIn(epsMode), - testing::ValuesIn(std::vector>({{2, 3, 10, 5}})), - testing::ValuesIn(netPrecisions), + testing::ValuesIn(eps_modes), + testing::Values(ov::test::static_shapes_to_test_representation(input_shape_4d_static)), + testing::ValuesIn(model_types), testing::Values(ov::test::utils::DEVICE_CPU) ); @@ -153,12 +161,14 @@ const std::vector> axes_5D = { {0, 1, 2, 3} }; +std::vector input_shape_5d_static = {{2, 2, 3, 10, 5}}; + const auto normL2params_5D = testing::Combine( testing::ValuesIn(axes_5D), testing::ValuesIn(eps), - testing::ValuesIn(epsMode), - testing::ValuesIn(std::vector>({{2, 2, 3, 10, 5}})), - testing::ValuesIn(netPrecisions), + testing::ValuesIn(eps_modes), + testing::Values(ov::test::static_shapes_to_test_representation(input_shape_5d_static)), + testing::ValuesIn(model_types), testing::Values(ov::test::utils::DEVICE_CPU) ); diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/one_hot.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/one_hot.cpp index 4432eb7b7b2ea3..92272ba76b5bb9 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/one_hot.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/one_hot.cpp @@ -3,96 +3,97 @@ // #include -#include "single_layer_tests/one_hot.hpp" -using namespace LayerTestsDefinitions; +#include "single_op_tests/one_hot.hpp" namespace { -const std::vector netPrecisions = { - InferenceEngine::Precision::I32, +using ov::test::OneHotLayerTest; + +const std::vector model_types = { + ov::element::i32, }; -const std::vector argDepthType_IC = { ngraph::element::i32 }; -const std::vector argDepth_IC = { 1, 5, 1017 }; -const std::vector argSetType_IC = { ngraph::element::i32 }; -const std::vector argOnValue_IC = { 0, 1, -29 }; -const std::vector argOffValue_IC = { 0, 1, -127 }; -const std::vector argAxis_IC = {0}; -const std::vector> inputShapes_IC = {{4, 5}, {3, 7}}; +const std::vector arg_depth_type_ic = { ov::element::i32 }; +const std::vector arg_depth_ic = { 1, 5, 1017 }; +const std::vector arg_set_type_ic = { ov::element::i32 }; +const std::vector arg_on_value_ic = { 0, 1, -29 }; +const std::vector arg_off_value_ic = { 0, 1, -127 }; +const std::vector arg_axis_ic = {0}; +const std::vector> input_shapes_ic = {{{4, 5}}, {{3, 7}}}; -const auto oneHotParams_IC = testing::Combine( - testing::ValuesIn(argDepthType_IC), - testing::ValuesIn(argDepth_IC), - testing::ValuesIn(argSetType_IC), - testing::ValuesIn(argOnValue_IC), - testing::ValuesIn(argOffValue_IC), - testing::ValuesIn(argAxis_IC), - testing::ValuesIn(netPrecisions), - testing::ValuesIn(inputShapes_IC), +const auto oneHotParams_ic = testing::Combine( + testing::ValuesIn(arg_depth_type_ic), + testing::ValuesIn(arg_depth_ic), + testing::ValuesIn(arg_set_type_ic), + testing::ValuesIn(arg_on_value_ic), + testing::ValuesIn(arg_off_value_ic), + testing::ValuesIn(arg_axis_ic), + testing::ValuesIn(model_types), + testing::ValuesIn(ov::test::static_shapes_to_test_representation(input_shapes_ic)), testing::Values(ov::test::utils::DEVICE_CPU) ); INSTANTIATE_TEST_SUITE_P( smoke_OneHotIntConst, OneHotLayerTest, - oneHotParams_IC, + oneHotParams_ic, OneHotLayerTest::getTestCaseName ); -const std::vector argDepthType_Ax = { ngraph::element::i32 }; -const std::vector argDepth_Ax = { 3 }; -const std::vector argSetType_Ax = { ngraph::element::i32, ngraph::element::f32 }; -const std::vector argOnValue_Ax = { 17 }; -const std::vector argOffValue_Ax = { -3 }; -const std::vector argAxis_Ax = {0, 1, 3, 5, -4, -5}; -const std::vector> inputShapes_Ax = {{4, 8, 5, 3, 2, 9}}; +const std::vector arg_depth_type_ax = { ov::element::i32 }; +const std::vector arg_depth_ax = { 3 }; +const std::vector arg_set_type_ax = { ov::element::i32, ov::element::f32 }; +const std::vector arg_on_value_ax = { 17 }; +const std::vector arg_off_value_ax = { -3 }; +const std::vector arg_axis_ax = {0, 1, 3, 5, -4, -5}; +const std::vector> input_shapes_ax = {{{4, 8, 5, 3, 2, 9}}}; -const auto oneHotParams_Ax = testing::Combine( - testing::ValuesIn(argDepthType_Ax), - testing::ValuesIn(argDepth_Ax), - testing::ValuesIn(argSetType_Ax), - testing::ValuesIn(argOnValue_Ax), - testing::ValuesIn(argOffValue_Ax), - testing::ValuesIn(argAxis_Ax), - testing::ValuesIn(netPrecisions), - testing::ValuesIn(inputShapes_Ax), +const auto oneHotParams_ax = testing::Combine( + testing::ValuesIn(arg_depth_type_ax), + testing::ValuesIn(arg_depth_ax), + testing::ValuesIn(arg_set_type_ax), + testing::ValuesIn(arg_on_value_ax), + testing::ValuesIn(arg_off_value_ax), + testing::ValuesIn(arg_axis_ax), + testing::ValuesIn(model_types), + testing::ValuesIn(ov::test::static_shapes_to_test_representation(input_shapes_ax)), testing::Values(ov::test::utils::DEVICE_CPU) ); INSTANTIATE_TEST_SUITE_P( smoke_OneHotAxrng, OneHotLayerTest, - oneHotParams_Ax, + oneHotParams_ax, OneHotLayerTest::getTestCaseName ); -const std::vector argDepthType_T = { ngraph::element::i8, ngraph::element::u8 }; -const std::vector argDepth_T = { 1 }; -const std::vector argSetType_T = { ngraph::element::i8, ngraph::element::u8, - ngraph::element::bf16, ngraph::element::f32 }; -const std::vector argOnValue_T = { 1 }; -const std::vector argOffValue_T = { 1 }; -const std::vector argAxis_T = {-1}; -const std::vector> inputShapes_T = {{2, 2}}; +const std::vector arg_depth_type_t = { ov::element::i8, ov::element::u8 }; +const std::vector arg_depth_t = { 1 }; +const std::vector arg_set_type_t = { ov::element::i8, ov::element::u8, + ov::element::bf16, ov::element::f32 }; +const std::vector arg_on_value_t = { 1 }; +const std::vector arg_off_value_t = { 1 }; +const std::vector arg_axis_t = {-1}; +const std::vector> input_shapes_t = {{{2, 2}}}; -const auto oneHotParams_T = testing::Combine( - testing::ValuesIn(argDepthType_T), - testing::ValuesIn(argDepth_T), - testing::ValuesIn(argSetType_T), - testing::ValuesIn(argOnValue_T), - testing::ValuesIn(argOffValue_T), - testing::ValuesIn(argAxis_T), - testing::ValuesIn(netPrecisions), - testing::ValuesIn(inputShapes_T), +const auto oneHotParams_t = testing::Combine( + testing::ValuesIn(arg_depth_type_t), + testing::ValuesIn(arg_depth_t), + testing::ValuesIn(arg_set_type_t), + testing::ValuesIn(arg_on_value_t), + testing::ValuesIn(arg_off_value_t), + testing::ValuesIn(arg_axis_t), + testing::ValuesIn(model_types), + testing::ValuesIn(ov::test::static_shapes_to_test_representation(input_shapes_t)), testing::Values(ov::test::utils::DEVICE_CPU) ); INSTANTIATE_TEST_SUITE_P( smoke_OneHotArgType, OneHotLayerTest, - oneHotParams_T, + oneHotParams_t, OneHotLayerTest::getTestCaseName ); } // namespace diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/pad.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/pad.cpp index 4d73dbf3aa070f..0dc19a7d79044f 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/pad.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/pad.cpp @@ -4,42 +4,45 @@ #include -#include "single_layer_tests/pad.hpp" - -using namespace LayerTestsDefinitions; +#include "single_op_tests/pad.hpp" namespace { -const std::vector netPrecisions = { - InferenceEngine::Precision::FP32, - InferenceEngine::Precision::I32, - InferenceEngine::Precision::FP16, - InferenceEngine::Precision::I16, - InferenceEngine::Precision::U16, - InferenceEngine::Precision::I8, - InferenceEngine::Precision::U8, +using ov::test::PadLayerTest; +using ov::op::PadMode; + +const std::vector model_types = { + ov::element::f32, + ov::element::i32, + ov::element::f16, + ov::element::i16, + ov::element::u16, + ov::element::i8, + ov::element::u8, }; -const std::vector argPadValue = {0.f, 1.f, -1.f, 2.5f}; +const std::vector arg_pad_values = {0.f, 1.f, -1.f, 2.5f}; -const std::vector padMode = { - ngraph::helpers::PadMode::EDGE, - ngraph::helpers::PadMode::REFLECT, - ngraph::helpers::PadMode::SYMMETRIC +const std::vector pad_modes = { + PadMode::EDGE, + PadMode::REFLECT, + PadMode::SYMMETRIC }; -const std::vector> padsBegin1D = {{0}, {1}, {2}, {-2}}; -const std::vector> padsEnd1D = {{0}, {1}, {2}, {-2}}; + +// 1D + +const std::vector> pads_begin_1d = {{0}, {1}, {2}, {-2}}; +const std::vector> pads_end_1d = {{0}, {1}, {2}, {-2}}; + +const std::vector input_shape_1d_static = {{5}}; const auto pad1DConstparams = testing::Combine( - testing::ValuesIn(padsBegin1D), - testing::ValuesIn(padsEnd1D), - testing::ValuesIn(argPadValue), - testing::Values(ngraph::helpers::PadMode::CONSTANT), - testing::ValuesIn(netPrecisions), - testing::Values(InferenceEngine::Precision::UNSPECIFIED), - testing::Values(InferenceEngine::Precision::UNSPECIFIED), - testing::Values(InferenceEngine::Layout::ANY), - testing::Values(std::vector{5}), + testing::ValuesIn(pads_begin_1d), + testing::ValuesIn(pads_end_1d), + testing::ValuesIn(arg_pad_values), + testing::Values(PadMode::CONSTANT), + testing::ValuesIn(model_types), + testing::Values(ov::test::static_shapes_to_test_representation(input_shape_1d_static)), testing::Values(ov::test::utils::DEVICE_CPU) ); @@ -51,15 +54,12 @@ INSTANTIATE_TEST_SUITE_P( ); const auto pad1Dparams = testing::Combine( - testing::ValuesIn(padsBegin1D), - testing::ValuesIn(padsEnd1D), + testing::ValuesIn(pads_begin_1d), + testing::ValuesIn(pads_end_1d), testing::Values(0), - testing::ValuesIn(padMode), - testing::ValuesIn(netPrecisions), - testing::Values(InferenceEngine::Precision::UNSPECIFIED), - testing::Values(InferenceEngine::Precision::UNSPECIFIED), - testing::Values(InferenceEngine::Layout::ANY), - testing::Values(std::vector{5}), + testing::ValuesIn(pad_modes), + testing::ValuesIn(model_types), + testing::Values(ov::test::static_shapes_to_test_representation(input_shape_1d_static)), testing::Values(ov::test::utils::DEVICE_CPU) ); @@ -70,19 +70,21 @@ INSTANTIATE_TEST_SUITE_P( PadLayerTest::getTestCaseName ); -const std::vector> padsBegin2D = {{0, 0}, {1, 1}, {-2, 0}, {0, 3}}; -const std::vector> padsEnd2D = {{0, 0}, {1, 1}, {0, 1}, {-3, -2}}; + +// 2D + +const std::vector> pads_begin_2d = {{0, 0}, {1, 1}, {-2, 0}, {0, 3}}; +const std::vector> pads_end_2d = {{0, 0}, {1, 1}, {0, 1}, {-3, -2}}; + +const std::vector input_shape_2d_static = {{13, 5}}; const auto pad2DConstparams = testing::Combine( - testing::ValuesIn(padsBegin2D), - testing::ValuesIn(padsEnd2D), - testing::ValuesIn(argPadValue), - testing::Values(ngraph::helpers::PadMode::CONSTANT), - testing::ValuesIn(netPrecisions), - testing::Values(InferenceEngine::Precision::UNSPECIFIED), - testing::Values(InferenceEngine::Precision::UNSPECIFIED), - testing::Values(InferenceEngine::Layout::ANY), - testing::Values(std::vector{13, 5}), + testing::ValuesIn(pads_begin_2d), + testing::ValuesIn(pads_end_2d), + testing::ValuesIn(arg_pad_values), + testing::Values(PadMode::CONSTANT), + testing::ValuesIn(model_types), + testing::Values(ov::test::static_shapes_to_test_representation(input_shape_2d_static)), testing::Values(ov::test::utils::DEVICE_CPU) ); @@ -94,15 +96,12 @@ INSTANTIATE_TEST_SUITE_P( ); const auto pad2Dparams = testing::Combine( - testing::ValuesIn(padsBegin2D), - testing::ValuesIn(padsEnd2D), + testing::ValuesIn(pads_begin_2d), + testing::ValuesIn(pads_end_2d), testing::Values(0), - testing::ValuesIn(padMode), - testing::ValuesIn(netPrecisions), - testing::Values(InferenceEngine::Precision::UNSPECIFIED), - testing::Values(InferenceEngine::Precision::UNSPECIFIED), - testing::Values(InferenceEngine::Layout::ANY), - testing::Values(std::vector{13, 5}), + testing::ValuesIn(pad_modes), + testing::ValuesIn(model_types), + testing::Values(ov::test::static_shapes_to_test_representation(input_shape_2d_static)), testing::Values(ov::test::utils::DEVICE_CPU) ); @@ -113,19 +112,21 @@ INSTANTIATE_TEST_SUITE_P( PadLayerTest::getTestCaseName ); -const std::vector> padsBegin4D = {{0, 0, 0, 0}, {0, 3, 0, 0}, {0, 0, 0, 1}, {0, 0, -1, 1}, {2, 0, 0, 0}, {0, 3, 0, -1}}; -const std::vector> padsEnd4D = {{0, 0, 0, 0}, {0, 3, 0, 0}, {1, 0, 0, 0}, {0, 0, 0, 2}, {1, -3, 0, 0}, {0, 3, 0, -1}}; + +// 4D + +const std::vector> pads_begin_4d = {{0, 0, 0, 0}, {0, 3, 0, 0}, {0, 0, 0, 1}, {0, 0, -1, 1}, {2, 0, 0, 0}, {0, 3, 0, -1}}; +const std::vector> pads_end_4d = {{0, 0, 0, 0}, {0, 3, 0, 0}, {1, 0, 0, 0}, {0, 0, 0, 2}, {1, -3, 0, 0}, {0, 3, 0, -1}}; + +const std::vector input_shape_4d_static = {{3, 5, 10, 11}}; const auto pad4DConstparams = testing::Combine( - testing::ValuesIn(padsBegin4D), - testing::ValuesIn(padsEnd4D), - testing::ValuesIn(argPadValue), - testing::Values(ngraph::helpers::PadMode::CONSTANT), - testing::ValuesIn(netPrecisions), - testing::Values(InferenceEngine::Precision::UNSPECIFIED), - testing::Values(InferenceEngine::Precision::UNSPECIFIED), - testing::Values(InferenceEngine::Layout::ANY), - testing::Values(std::vector{3, 5, 10, 11}), + testing::ValuesIn(pads_begin_4d), + testing::ValuesIn(pads_end_4d), + testing::ValuesIn(arg_pad_values), + testing::Values(PadMode::CONSTANT), + testing::ValuesIn(model_types), + testing::Values(ov::test::static_shapes_to_test_representation(input_shape_4d_static)), testing::Values(ov::test::utils::DEVICE_CPU) ); @@ -137,15 +138,12 @@ INSTANTIATE_TEST_SUITE_P( ); const auto pad4Dparams = testing::Combine( - testing::ValuesIn(padsBegin4D), - testing::ValuesIn(padsEnd4D), + testing::ValuesIn(pads_begin_4d), + testing::ValuesIn(pads_end_4d), testing::Values(0), - testing::ValuesIn(padMode), - testing::ValuesIn(netPrecisions), - testing::Values(InferenceEngine::Precision::UNSPECIFIED), - testing::Values(InferenceEngine::Precision::UNSPECIFIED), - testing::Values(InferenceEngine::Layout::ANY), - testing::Values(std::vector{3, 5, 10, 11}), + testing::ValuesIn(pad_modes), + testing::ValuesIn(model_types), + testing::Values(ov::test::static_shapes_to_test_representation(input_shape_4d_static)), testing::Values(ov::test::utils::DEVICE_CPU) ); @@ -155,5 +153,4 @@ INSTANTIATE_TEST_SUITE_P( pad4Dparams, PadLayerTest::getTestCaseName ); - } // namespace diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/skip_tests_config.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/skip_tests_config.cpp index 3cf22ebff921a3..e629a715b69890 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/skip_tests_config.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/skip_tests_config.cpp @@ -64,8 +64,6 @@ std::vector disabledTestPatterns() { R"(.*BF16NetworkRestore1.*)", R"(.*MobileNet_ssd_with_branching.*)", - // TODO: 57562 No dynamic output shape support - R"(.*NonZeroLayerTest.*)", // Not expected behavior R"(.*Behavior.*InferRequestSetBlobByType.*Batched.*)", R"(.*OVCompiledModelBaseTest.*(CanGetInputsInfoAndCheck|canSetConfigToCompiledModel).*)", diff --git a/src/tests/functional/plugin/shared/include/single_op_tests/nonzero.hpp b/src/tests/functional/plugin/shared/include/single_op_tests/nonzero.hpp new file mode 100644 index 00000000000000..7afb5a97579bee --- /dev/null +++ b/src/tests/functional/plugin/shared/include/single_op_tests/nonzero.hpp @@ -0,0 +1,15 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "shared_test_classes/single_op/nonzero.hpp" + +namespace ov { +namespace test { +TEST_P(NonZeroLayerTest, Inference) { + run(); +} +} // namespace test +} // namespace ov diff --git a/src/tests/functional/plugin/shared/include/single_op_tests/normalize_l2.hpp b/src/tests/functional/plugin/shared/include/single_op_tests/normalize_l2.hpp new file mode 100644 index 00000000000000..aabe69a20654b1 --- /dev/null +++ b/src/tests/functional/plugin/shared/include/single_op_tests/normalize_l2.hpp @@ -0,0 +1,15 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "shared_test_classes/single_op/normalize_l2.hpp" + +namespace ov { +namespace test { +TEST_P(NormalizeL2LayerTest, Inference) { + run(); +} +} // namespace test +} // namespace ov diff --git a/src/tests/functional/plugin/shared/include/single_op_tests/one_hot.hpp b/src/tests/functional/plugin/shared/include/single_op_tests/one_hot.hpp new file mode 100644 index 00000000000000..91242249e8794b --- /dev/null +++ b/src/tests/functional/plugin/shared/include/single_op_tests/one_hot.hpp @@ -0,0 +1,15 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "shared_test_classes/single_op/one_hot.hpp" + +namespace ov { +namespace test { +TEST_P(OneHotLayerTest, Inference) { + run(); +} +} // namespace test +} // namespace ov diff --git a/src/tests/functional/plugin/shared/include/single_op_tests/pad.hpp b/src/tests/functional/plugin/shared/include/single_op_tests/pad.hpp new file mode 100644 index 00000000000000..a1bc55e5208eb7 --- /dev/null +++ b/src/tests/functional/plugin/shared/include/single_op_tests/pad.hpp @@ -0,0 +1,19 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "shared_test_classes/single_op/pad.hpp" + +namespace ov { +namespace test { +TEST_P(PadLayerTest, Inference) { + run(); +} + +TEST_P(Pad12LayerTest, Inference) { + run(); +} +} // namespace test +} // namespace ov diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/single_op/nonzero.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/single_op/nonzero.hpp new file mode 100644 index 00000000000000..740259846b8150 --- /dev/null +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/single_op/nonzero.hpp @@ -0,0 +1,31 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include +#include +#include + +#include "shared_test_classes/base/ov_subgraph.hpp" + +namespace ov { +namespace test { +using NonZeroLayerTestParamsSet = typename std::tuple< + std::vector, // Input shapes + ov::element::Type, // Model shape + std::string, // Device name + std::map>; // Additional network configuration + +class NonZeroLayerTest : public testing::WithParamInterface, + virtual public ov::test::SubgraphBaseTest { +public: + static std::string getTestCaseName(const testing::TestParamInfo& obj); + +protected: + void SetUp() override; +}; + +} // namespace test +} // namespace ov diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/single_op/normalize_l2.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/single_op/normalize_l2.hpp new file mode 100644 index 00000000000000..160bfc89035258 --- /dev/null +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/single_op/normalize_l2.hpp @@ -0,0 +1,33 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include +#include +#include + +#include "shared_test_classes/base/ov_subgraph.hpp" + +namespace ov { +namespace test { +using NormalizeL2LayerTestParams = std::tuple< + std::vector, // axes + float, // eps + ov::op::EpsMode, // eps mode + std::vector, // input shape + ov::element::Type, // model type + std::string // target device +>; + +class NormalizeL2LayerTest : public testing::WithParamInterface, + virtual public ov::test::SubgraphBaseTest { +public: + static std::string getTestCaseName(const testing::TestParamInfo& obj); + +protected: + void SetUp() override; +}; +} // namespace test +} // namespace ov diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/single_op/one_hot.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/single_op/one_hot.hpp new file mode 100644 index 00000000000000..4714c8441603cc --- /dev/null +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/single_op/one_hot.hpp @@ -0,0 +1,37 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include +#include +#include + +#include "shared_test_classes/base/ov_subgraph.hpp" + +namespace ov { +namespace test { +typedef std::tuple< + ov::element::Type, // depth type (any integer type) + int64_t, // depth value + ov::element::Type, // On & Off values type (any supported type) + float, // OnValue + float, // OffValue + int64_t, // axis + ov::element::Type, // Model type + std::vector, // Input shapes + std::string // Target device name +> oneHotLayerTestParamsSet; + +class OneHotLayerTest : public testing::WithParamInterface, + virtual public ov::test::SubgraphBaseTest { +public: + static std::string getTestCaseName(const testing::TestParamInfo& obj); + +protected: + void SetUp() override; +}; + +} // namespace test +} // namespace ov diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/single_op/pad.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/single_op/pad.hpp new file mode 100644 index 00000000000000..1e8e2b7a50a144 --- /dev/null +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/single_op/pad.hpp @@ -0,0 +1,48 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include +#include +#include + +#include "shared_test_classes/base/ov_subgraph.hpp" +#include "openvino/op/util/attr_types.hpp" + +namespace ov { +namespace test { +typedef std::tuple< + std::vector, // padsBegin + std::vector, // padsEnd + float, // argPadValue + ov::op::PadMode, // padMode + ov::element::Type, // Net precision + std::vector, // Input shapes + std::string // Target device name +> padLayerTestParamsSet; + +class PadLayerTest : public testing::WithParamInterface, + virtual public ov::test::SubgraphBaseTest { +public: + static std::string getTestCaseName(const testing::TestParamInfo& obj); + +protected: + void SetUp() override; + virtual std::shared_ptr create_pad_op(const std::shared_ptr&, + const std::shared_ptr&, + const std::shared_ptr&, + const std::shared_ptr&, + ov::op::PadMode) const; +}; + +class Pad12LayerTest : public PadLayerTest { + std::shared_ptr create_pad_op(const std::shared_ptr&, + const std::shared_ptr&, + const std::shared_ptr&, + const std::shared_ptr&, + ov::op::PadMode) const override; +}; +} // namespace test +} // namespace ov diff --git a/src/tests/functional/shared_test_classes/src/base/utils/generate_inputs.cpp b/src/tests/functional/shared_test_classes/src/base/utils/generate_inputs.cpp index b654b41feeb66b..e738e73d879d6e 100644 --- a/src/tests/functional/shared_test_classes/src/base/utils/generate_inputs.cpp +++ b/src/tests/functional/shared_test_classes/src/base/utils/generate_inputs.cpp @@ -1184,6 +1184,18 @@ ov::runtime::Tensor generate(const return tensor; } +ov::runtime::Tensor generate(const + std::shared_ptr& node, + size_t port, + const ov::element::Type& elemType, + const ov::Shape& targetShape) { + if (port == 0) { + InputGenerateData inGenData(-5, 10, 7, 222); + return ov::test::utils::create_and_fill_tensor(elemType, targetShape, inGenData.range, inGenData.start_from, inGenData.resolution, inGenData.seed); + } + return generate(std::dynamic_pointer_cast(node), port, elemType, targetShape); +} + template ov::runtime::Tensor generateInput(const std::shared_ptr& node, size_t port, diff --git a/src/tests/functional/shared_test_classes/src/single_op/nonzero.cpp b/src/tests/functional/shared_test_classes/src/single_op/nonzero.cpp new file mode 100644 index 00000000000000..610148b9127960 --- /dev/null +++ b/src/tests/functional/shared_test_classes/src/single_op/nonzero.cpp @@ -0,0 +1,57 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "shared_test_classes/single_op/nonzero.hpp" + +#include "openvino/op/parameter.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/result.hpp" +#include "openvino/op/non_zero.hpp" + +namespace ov { +namespace test { + +std::string NonZeroLayerTest::getTestCaseName(const testing::TestParamInfo& obj) { + std::vector shapes; + ov::element::Type model_type; + std::string target_device; + std::map additional_config; + std::tie(shapes, model_type, target_device, additional_config) = obj.param; + + std::ostringstream result; + result << "IS=("; + for (size_t i = 0lu; i < shapes.size(); i++) { + result << ov::test::utils::partialShape2str({shapes[i].first}) << (i < shapes.size() - 1lu ? "_" : ""); + } + result << ")_TS="; + for (size_t i = 0lu; i < shapes.front().second.size(); i++) { + result << "{"; + for (size_t j = 0lu; j < shapes.size(); j++) { + result << ov::test::utils::vec2str(shapes[j].second[i]) << (j < shapes.size() - 1lu ? "_" : ""); + } + result << "}_"; + } + result << "inPRC=" << model_type.get_type_name() << "_"; + result << "targetDevice=" << target_device; + return result.str(); +} + +void NonZeroLayerTest::SetUp() { + std::vector shapes; + ov::element::Type model_type; + std::map additional_config; + std::tie(shapes, model_type, targetDevice, additional_config) = GetParam(); + configuration.insert(additional_config.cbegin(), additional_config.cend()); + init_input_shapes(shapes); + + auto param = std::make_shared(model_type, inputDynamicShapes.front()); + + auto non_zero = std::make_shared(param); + + auto result = std::make_shared(non_zero); + + function = std::make_shared(result, ov::ParameterVector{param}, "non_zero"); +} +} // namespace test +} // namespace ov diff --git a/src/tests/functional/shared_test_classes/src/single_op/normalize_l2.cpp b/src/tests/functional/shared_test_classes/src/single_op/normalize_l2.cpp new file mode 100644 index 00000000000000..b3db915a59a035 --- /dev/null +++ b/src/tests/functional/shared_test_classes/src/single_op/normalize_l2.cpp @@ -0,0 +1,62 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "shared_test_classes/single_op/normalize_l2.hpp" + +#include "openvino/op/parameter.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/result.hpp" +#include "openvino/op/normalize_l2.hpp" + +namespace ov { +namespace test { +std::string NormalizeL2LayerTest::getTestCaseName(const testing::TestParamInfo& obj) { + std::vector axes; + float eps; + ngraph::op::EpsMode eps_mode; + std::vector shapes; + ov::element::Type model_type; + std::string targetDevice; + std::tie(axes, eps, eps_mode, shapes, model_type, targetDevice) = obj.param; + + std::ostringstream result; + result << "IS=("; + for (size_t i = 0lu; i < shapes.size(); i++) { + result << ov::test::utils::partialShape2str({shapes[i].first}) << (i < shapes.size() - 1lu ? "_" : ""); + } + result << ")_TS="; + for (size_t i = 0lu; i < shapes.front().second.size(); i++) { + result << "{"; + for (size_t j = 0lu; j < shapes.size(); j++) { + result << ov::test::utils::vec2str(shapes[j].second[i]) << (j < shapes.size() - 1lu ? "_" : ""); + } + result << "}_"; + } + result << "axes=" << ov::test::utils::vec2str(axes) << "_"; + result << "eps=" << eps << "_"; + result << "eps_mode=" << eps_mode << "_"; + result << "netPRC=" << model_type.get_type_name() << "_"; + result << "targetDevice=" << targetDevice; + return result.str(); +} + +void NormalizeL2LayerTest::SetUp() { + std::vector shapes; + std::vector axes; + float eps; + ngraph::op::EpsMode eps_mode; + ov::element::Type model_type; + std::tie(axes, eps, eps_mode, shapes, model_type, targetDevice) = this->GetParam(); + init_input_shapes(shapes); + + auto param = std::make_shared(model_type, inputDynamicShapes.front()); + + auto norm_axes = std::make_shared(ov::element::i64, ov::Shape{axes.size()}, axes); + auto norm = std::make_shared(param, norm_axes, eps, eps_mode); + + auto result = std::make_shared(norm); + function = std::make_shared(result, ov::ParameterVector{param}, "NormalizeL2"); +} +} // namespace test +} // namespace ov diff --git a/src/tests/functional/shared_test_classes/src/single_op/one_hot.cpp b/src/tests/functional/shared_test_classes/src/single_op/one_hot.cpp new file mode 100644 index 00000000000000..273c51c00cef9c --- /dev/null +++ b/src/tests/functional/shared_test_classes/src/single_op/one_hot.cpp @@ -0,0 +1,71 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "shared_test_classes/single_op/one_hot.hpp" + +#include "openvino/op/parameter.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/result.hpp" +#include "openvino/op/one_hot.hpp" + +namespace ov { +namespace test { +std::string OneHotLayerTest::getTestCaseName(const testing::TestParamInfo& obj) { + int64_t axis; + ov::element::Type depth_type, set_type; + int64_t depth_val; + float on_val, off_val; + ov::element::Type model_type; + std::vector shapes; + std::string targetDevice; + + std::tie(depth_type, depth_val, set_type, on_val, off_val, axis, model_type, shapes, targetDevice) = obj.param; + + std::ostringstream result; + result << "IS=("; + for (size_t i = 0lu; i < shapes.size(); i++) { + result << ov::test::utils::partialShape2str({shapes[i].first}) << (i < shapes.size() - 1lu ? "_" : ""); + } + result << ")_TS="; + for (size_t i = 0lu; i < shapes.front().second.size(); i++) { + result << "{"; + for (size_t j = 0lu; j < shapes.size(); j++) { + result << ov::test::utils::vec2str(shapes[j].second[i]) << (j < shapes.size() - 1lu ? "_" : ""); + } + result << "}_"; + } + result << "depthType=" << depth_type << "_"; + result << "depth=" << depth_val << "_"; + result << "SetValueType=" << set_type << "_"; + result << "onValue=" << on_val << "_"; + result << "offValue=" << off_val << "_"; + result << "axis=" << axis << "_"; + + result << "netPRC=" << model_type.get_type_name() << "_"; + result << "trgDev=" << targetDevice; + return result.str(); +} + +void OneHotLayerTest::SetUp() { + int64_t axis; + ov::element::Type depth_type, set_type; + int64_t depth_val; + float on_val, off_val; + ov::element::Type model_type; + std::vector shapes; + std::tie(depth_type, depth_val, set_type, on_val, off_val, axis, model_type, shapes, targetDevice) = this->GetParam(); + init_input_shapes(shapes); + + auto param = std::make_shared(model_type, inputDynamicShapes.front()); + + auto depth_const = std::make_shared(depth_type, ov::Shape{}, depth_val); + auto on_value_const = std::make_shared(set_type, ov::Shape{}, on_val); + auto off_value_const = std::make_shared(set_type, ov::Shape{}, off_val); + auto onehot = std::make_shared(param, depth_const, on_value_const, off_value_const, axis); + + auto result = std::make_shared(onehot); + function = std::make_shared(result, ov::ParameterVector{param}, "OneHot"); +} +} // namespace test +} // namespace ov diff --git a/src/tests/functional/shared_test_classes/src/single_op/pad.cpp b/src/tests/functional/shared_test_classes/src/single_op/pad.cpp new file mode 100644 index 00000000000000..a62b33ec21263c --- /dev/null +++ b/src/tests/functional/shared_test_classes/src/single_op/pad.cpp @@ -0,0 +1,85 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "shared_test_classes/single_op/pad.hpp" + +#include "openvino/op/parameter.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/result.hpp" +#include "openvino/op/pad.hpp" + +namespace ov { +namespace test { +std::string PadLayerTest::getTestCaseName(const testing::TestParamInfo& obj) { + ov::element::Type model_type; + std::vector shapes; + std::vector pads_begin, pads_end; + ov::op::PadMode pad_mode; + float arg_pad_value; + std::string target_device; + std::tie(pads_begin, pads_end, arg_pad_value, pad_mode, model_type, shapes, target_device) = obj.param; + + std::ostringstream result; + result << "IS=("; + for (size_t i = 0lu; i < shapes.size(); i++) { + result << ov::test::utils::partialShape2str({shapes[i].first}) << (i < shapes.size() - 1lu ? "_" : ""); + } + result << ")_TS="; + for (size_t i = 0lu; i < shapes.front().second.size(); i++) { + result << "{"; + for (size_t j = 0lu; j < shapes.size(); j++) { + result << ov::test::utils::vec2str(shapes[j].second[i]) << (j < shapes.size() - 1lu ? "_" : ""); + } + result << "}_"; + } + result << "PadsBegin=" << ov::test::utils::vec2str(pads_begin) << "_"; + result << "PadsEnd=" << ov::test::utils::vec2str(pads_end) << "_"; + if (pad_mode == ov::op::PadMode::CONSTANT) { + result << "Value=" << arg_pad_value << "_"; + } + result << "PadMode=" << pad_mode << "_"; + result << "ModelType=" << model_type.get_type_name() << "_"; + result << "TrgDev=" << target_device; + return result.str(); +} + +void PadLayerTest::SetUp() { + ov::element::Type model_type; + std::vector shapes; + std::vector pads_begin, pads_end; + ov::op::PadMode pad_mode; + float arg_pad_value; + std::tie(pads_begin, pads_end, arg_pad_value, pad_mode, model_type, shapes, targetDevice) = this->GetParam(); + init_input_shapes(shapes); + + auto param = std::make_shared(model_type, inputDynamicShapes.front()); + + auto pads_begin_const = std::make_shared(ov::element::i64, ov::Shape{pads_begin.size()}, pads_begin.data()); + auto pads_end_const = std::make_shared(ov::element::i64, ov::Shape{pads_end.size()}, pads_end.data()); + auto arg_pad_value_const = std::make_shared(model_type, ov::Shape{}, &arg_pad_value); + + auto pad = create_pad_op(param, pads_begin_const, pads_end_const, arg_pad_value_const, pad_mode); + + auto result = std::make_shared(pad); + + function = std::make_shared(result, ov::ParameterVector{param}, "pad"); +} + +std::shared_ptr PadLayerTest::create_pad_op(const std::shared_ptr& data, + const std::shared_ptr& pads_begin, + const std::shared_ptr& pads_end, + const std::shared_ptr& arg_pad_value, + ov::op::PadMode pad_mode) const { + return std::make_shared(data, pads_begin, pads_end, arg_pad_value, pad_mode); +} + +std::shared_ptr Pad12LayerTest::create_pad_op(const std::shared_ptr& data, + const std::shared_ptr& pads_begin, + const std::shared_ptr& pads_end, + const std::shared_ptr& arg_pad_value, + ov::op::PadMode pad_mode) const { + return std::make_shared(data, pads_begin, pads_end, arg_pad_value, pad_mode); +} +} // namespace test +} // namespace ov