diff --git a/src/bindings/c/tests/test_model_repo.cpp b/src/bindings/c/tests/test_model_repo.cpp index b7af72817d3..4f722b3adeb 100644 --- a/src/bindings/c/tests/test_model_repo.cpp +++ b/src/bindings/c/tests/test_model_repo.cpp @@ -6,6 +6,8 @@ #include +#include "common_test_utils/subgraph_builders/conv_pool_relu_no_reshapes.hpp" + namespace TestDataHelpers { const std::string model_bin_name = "test_model.bin"; @@ -15,7 +17,7 @@ const std::string model_exported_name = "test_exported_model.blob"; void generate_test_model() { ov::pass::Manager manager; manager.register_pass(model_xml_name, model_bin_name); - auto function = ngraph::builder::subgraph::makeConvPoolReluNoReshapes({1, 3, 227, 227}); + auto function = ov::test::utils::make_conv_pool_relu_no_reshapes({1, 3, 227, 227}); manager.run_passes(function); } diff --git a/src/common/transformations/tests/common_optimizations/dimension_tracking.cpp b/src/common/transformations/tests/common_optimizations/dimension_tracking.cpp index 88f6a1c303f..9a60dba64d6 100644 --- a/src/common/transformations/tests/common_optimizations/dimension_tracking.cpp +++ b/src/common/transformations/tests/common_optimizations/dimension_tracking.cpp @@ -11,6 +11,7 @@ #include #include "common_test_utils/ov_test_utils.hpp" +#include "common_test_utils/subgraph_builders/detection_output.hpp" #include "openvino/core/dimension_tracker.hpp" #include "openvino/core/model.hpp" #include "openvino/opsets/opset1.hpp" @@ -19,6 +20,7 @@ #include "transformations/common_optimizations/divide_fusion.hpp" #include "transformations/init_node_info.hpp" #include "transformations/utils/utils.hpp" + using namespace ov; using namespace testing; @@ -307,7 +309,7 @@ TEST(TransformationTests, AutoBatch_FindBatch_NegativeTracking) { } TEST(TransformationTests, AutoBatch_FindBatch_AutoBatch_LabelPropagation_DO_detachment) { - auto f = ngraph::builder::subgraph::makeDetectionOutput(); + auto f = ov::test::utils::make_detection_output(); auto& data = f->get_parameters()[0]; ov::pass::Manager m; diff --git a/src/inference/tests/functional/caching_test.cpp b/src/inference/tests/functional/caching_test.cpp index 06569f7bdfc..8991e2c7b41 100644 --- a/src/inference/tests/functional/caching_test.cpp +++ b/src/inference/tests/functional/caching_test.cpp @@ -14,6 +14,7 @@ #include #include "common_test_utils/file_utils.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" #include "ie_plugin_config.hpp" #include "openvino/core/any.hpp" #include "openvino/core/except.hpp" @@ -32,7 +33,6 @@ #include "openvino/runtime/iplugin.hpp" #include "openvino/runtime/iremote_context.hpp" #include "openvino/runtime/properties.hpp" -#include "ov_models/subgraph_builders.hpp" #include "unit_test_utils/mocks/openvino/runtime/mock_iasync_infer_request.hpp" #include "unit_test_utils/mocks/openvino/runtime/mock_icompiled_model.hpp" #include "unit_test_utils/mocks/openvino/runtime/mock_iplugin.hpp" @@ -220,7 +220,7 @@ public: ov::pass::Manager manager; manager.register_pass(modelName, weightsName); - manager.run_passes(ngraph::builder::subgraph::makeConvPoolRelu({1, 3, 227, 227}, ov::element::Type_t::f32)); + manager.run_passes(ov::test::utils::make_conv_pool_relu({1, 3, 227, 227}, ov::element::Type_t::f32)); } void TearDown() override { diff --git a/src/plugins/auto_batch/tests/functional/behavior/plugin/auto_batching_tests.hpp b/src/plugins/auto_batch/tests/functional/behavior/plugin/auto_batching_tests.hpp index 91635a2c4b7..b054f4a9816 100644 --- a/src/plugins/auto_batch/tests/functional/behavior/plugin/auto_batching_tests.hpp +++ b/src/plugins/auto_batch/tests/functional/behavior/plugin/auto_batching_tests.hpp @@ -12,6 +12,9 @@ #include "common_test_utils/test_common.hpp" #include "functional_test_utils/blob_utils.hpp" #include "ov_models/subgraph_builders.hpp" +#include "common_test_utils/subgraph_builders/single_conv.hpp" +#include "common_test_utils/subgraph_builders/detection_output.hpp" +#include "common_test_utils/subgraph_builders/multi_single_conv.hpp" using namespace ::testing; using namespace InferenceEngine; @@ -29,7 +32,7 @@ class AutoBatching_Test : public BehaviorTestsUtils::IEPluginTestBase, std::tie(target_device, use_get_blob, num_streams, num_requests, num_batch) = this->GetParam(); // Skip test according to plugin specific disabledTestPatterns() (if any) SKIP_IF_CURRENT_TEST_IS_DISABLED() - fn_ptrs = {ngraph::builder::subgraph::makeSingleConv(), ngraph::builder::subgraph::makeMultiSingleConv()}; + fn_ptrs = {ov::test::utils::make_single_conv(), ov::test::utils::make_multi_single_conv()}; }; public: @@ -144,7 +147,7 @@ public: std::tie(target_device, use_get_blob, num_streams, num_requests, num_batch) = this->GetParam(); // Skip test according to plugin specific disabledTestPatterns() (if any) SKIP_IF_CURRENT_TEST_IS_DISABLED() - fn_ptrs = {ngraph::builder::subgraph::makeDetectionOutput(), ngraph::builder::subgraph::makeDetectionOutput()}; + fn_ptrs = {ov::test::utils::make_detection_output(), ov::test::utils::make_detection_output()}; }; static std::string getTestCaseName(const testing::TestParamInfo& obj) { diff --git a/src/plugins/auto_batch/tests/unit/async_infer_request_test.cpp b/src/plugins/auto_batch/tests/unit/async_infer_request_test.cpp index e4d03c4e832..646d7403df4 100644 --- a/src/plugins/auto_batch/tests/unit/async_infer_request_test.cpp +++ b/src/plugins/auto_batch/tests/unit/async_infer_request_test.cpp @@ -13,6 +13,7 @@ #include "openvino/runtime/threading/immediate_executor.hpp" #include "transformations/utils/utils.hpp" #include "unit_test_utils/mocks/openvino/runtime/mock_icore.hpp" +#include "common_test_utils/subgraph_builders/multi_single_conv.hpp" using ::testing::_; using ::testing::AnyNumber; @@ -115,7 +116,7 @@ public: std::tie(m_batch_size, m_element_type, m_infer_interval) = this->GetParam(); m_terminate = false; std::vector inputShape = {1, 3, 24, 24}; - m_model = ngraph::builder::subgraph::makeMultiSingleConv(inputShape, m_element_type); + m_model = ov::test::utils::make_multi_single_conv(inputShape, m_element_type); prepare_input(m_model, m_batch_size); diff --git a/src/plugins/auto_batch/tests/unit/compile_model_create_infer_request_test.cpp b/src/plugins/auto_batch/tests/unit/compile_model_create_infer_request_test.cpp index 30b06945c4d..39094d16139 100644 --- a/src/plugins/auto_batch/tests/unit/compile_model_create_infer_request_test.cpp +++ b/src/plugins/auto_batch/tests/unit/compile_model_create_infer_request_test.cpp @@ -10,6 +10,7 @@ #include "openvino/core/dimension_tracker.hpp" #include "openvino/runtime/threading/immediate_executor.hpp" #include "unit_test_utils/mocks/openvino/runtime/mock_icore.hpp" +#include "common_test_utils/subgraph_builders/multi_single_conv.hpp" using ::testing::_; using ::testing::AnyNumber; @@ -83,7 +84,7 @@ public: void SetUp() override { std::tie(m_batch_size, m_infer_request_num) = this->GetParam(); - m_model = ngraph::builder::subgraph::makeMultiSingleConv(); + m_model = ov::test::utils::make_multi_single_conv(); m_core = std::shared_ptr>(new NiceMock()); m_auto_batch_plugin = diff --git a/src/plugins/auto_batch/tests/unit/compile_model_get_property_test.cpp b/src/plugins/auto_batch/tests/unit/compile_model_get_property_test.cpp index 805e2f5e672..b3fc8497c9f 100644 --- a/src/plugins/auto_batch/tests/unit/compile_model_get_property_test.cpp +++ b/src/plugins/auto_batch/tests/unit/compile_model_get_property_test.cpp @@ -9,6 +9,7 @@ #include "ov_models/subgraph_builders.hpp" #include "openvino/core/dimension_tracker.hpp" #include "unit_test_utils/mocks/openvino/runtime/mock_icore.hpp" +#include "common_test_utils/subgraph_builders/multi_single_conv.hpp" using ::testing::_; using ::testing::AnyNumber; @@ -67,7 +68,7 @@ public: void SetUp() override { std::tie(m_properity_name, m_throw_exception) = this->GetParam(); - m_model = ngraph::builder::subgraph::makeMultiSingleConv(); + m_model = ov::test::utils::make_multi_single_conv(); m_core = std::shared_ptr>(new NiceMock()); m_plugin = std::shared_ptr>(new NiceMock()); diff --git a/src/plugins/auto_batch/tests/unit/compile_model_get_runtime_model_test.cpp b/src/plugins/auto_batch/tests/unit/compile_model_get_runtime_model_test.cpp index bbe0b1fb18a..f338e6dd3e6 100644 --- a/src/plugins/auto_batch/tests/unit/compile_model_get_runtime_model_test.cpp +++ b/src/plugins/auto_batch/tests/unit/compile_model_get_runtime_model_test.cpp @@ -9,6 +9,7 @@ #include "ov_models/subgraph_builders.hpp" #include "openvino/core/dimension_tracker.hpp" #include "unit_test_utils/mocks/openvino/runtime/mock_icore.hpp" +#include "common_test_utils/subgraph_builders/multi_single_conv.hpp" using ::testing::_; using ::testing::AnyNumber; @@ -48,7 +49,7 @@ public: } void SetUp() override { - m_model = ngraph::builder::subgraph::makeMultiSingleConv(); + m_model = ov::test::utils::make_multi_single_conv(); m_core = std::shared_ptr>(new NiceMock()); m_plugin = std::shared_ptr>(new NiceMock()); diff --git a/src/plugins/auto_batch/tests/unit/compile_model_set_property_test.cpp b/src/plugins/auto_batch/tests/unit/compile_model_set_property_test.cpp index a801b619566..ee03043a162 100644 --- a/src/plugins/auto_batch/tests/unit/compile_model_set_property_test.cpp +++ b/src/plugins/auto_batch/tests/unit/compile_model_set_property_test.cpp @@ -9,6 +9,7 @@ #include "ov_models/subgraph_builders.hpp" #include "openvino/core/dimension_tracker.hpp" #include "unit_test_utils/mocks/openvino/runtime/mock_icore.hpp" +#include "common_test_utils/subgraph_builders/multi_single_conv.hpp" using ::testing::_; using ::testing::AnyNumber; @@ -70,7 +71,7 @@ public: void SetUp() override { std::tie(m_properities, m_throw_exception) = this->GetParam(); - m_model = ngraph::builder::subgraph::makeMultiSingleConv(); + m_model = ov::test::utils::make_multi_single_conv(); m_core = std::shared_ptr>(new NiceMock()); m_plugin = std::shared_ptr>(new NiceMock()); diff --git a/src/plugins/auto_batch/tests/unit/plugin_compile_model_test.cpp b/src/plugins/auto_batch/tests/unit/plugin_compile_model_test.cpp index 8f06a44cff0..ebc52426bfe 100644 --- a/src/plugins/auto_batch/tests/unit/plugin_compile_model_test.cpp +++ b/src/plugins/auto_batch/tests/unit/plugin_compile_model_test.cpp @@ -9,6 +9,8 @@ #include "ov_models/subgraph_builders.hpp" #include "openvino/core/dimension_tracker.hpp" #include "unit_test_utils/mocks/openvino/runtime/mock_icore.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu_non_zero.hpp" +#include "common_test_utils/subgraph_builders/multi_single_conv.hpp" using ::testing::_; using ::testing::AnyNumber; @@ -118,17 +120,17 @@ public: }; TEST_P(PluginCompileModelTest, PluginCompileModelTestCase) { - m_model = ngraph::builder::subgraph::makeMultiSingleConv(); + m_model = ov::test::utils::make_multi_single_conv(); ASSERT_NO_THROW(m_plugin->compile_model(m_model, m_plugin_properities)); } TEST_P(PluginCompileModelTest, PluginCompileModelWithRemoteContextTestCase) { - m_model = ngraph::builder::subgraph::makeMultiSingleConv(); + m_model = ov::test::utils::make_multi_single_conv(); ASSERT_NO_THROW(m_plugin->compile_model(m_model, m_plugin_properities, m_remote_context)); } TEST_P(PluginCompileModelTest, PluginCompileModelBatchedModelTestCase) { - m_model = ngraph::builder::subgraph::makeConvPoolReluNonZero({1, 1, 32, 32}); + m_model = ov::test::utils::make_conv_pool_relu_non_zero({1, 1, 32, 32}); auto batch = ov::Dimension(5); ov::DimensionTracker::set_label(batch, 11); auto p_shape = ov::PartialShape{batch, 1, 32, 32}; @@ -137,7 +139,7 @@ TEST_P(PluginCompileModelTest, PluginCompileModelBatchedModelTestCase) { } TEST_P(PluginCompileModelTest, PluginCompileModelBatchedModelWithRemoteContextTestCase) { - m_model = ngraph::builder::subgraph::makeConvPoolReluNonZero({1, 1, 32, 32}); + m_model = ov::test::utils::make_conv_pool_relu_non_zero({1, 1, 32, 32}); auto batch = ov::Dimension(5); ov::DimensionTracker::set_label(batch, 11); auto p_shape = ov::PartialShape{batch, 1, 32, 32}; diff --git a/src/plugins/auto_batch/tests/unit/plugin_query_model_test.cpp b/src/plugins/auto_batch/tests/unit/plugin_query_model_test.cpp index e15ee5121f0..d36945693bd 100644 --- a/src/plugins/auto_batch/tests/unit/plugin_query_model_test.cpp +++ b/src/plugins/auto_batch/tests/unit/plugin_query_model_test.cpp @@ -8,6 +8,7 @@ #include "mock_common.hpp" #include "ov_models/subgraph_builders.hpp" #include "unit_test_utils/mocks/openvino/runtime/mock_icore.hpp" +#include "common_test_utils/subgraph_builders/multi_single_conv.hpp" using ::testing::_; using ::testing::AnyNumber; @@ -60,7 +61,7 @@ public: void SetUp() override { std::tie(m_properties, m_throw_exception) = this->GetParam(); - m_model = ngraph::builder::subgraph::makeMultiSingleConv(); + m_model = ov::test::utils::make_multi_single_conv(); m_core = std::shared_ptr>(new NiceMock()); m_plugin = std::shared_ptr>(new NiceMock()); diff --git a/src/plugins/auto_batch/tests/unit/sync_infer_request_test.cpp b/src/plugins/auto_batch/tests/unit/sync_infer_request_test.cpp index d05cc53ceb0..6d2b0a32a2b 100644 --- a/src/plugins/auto_batch/tests/unit/sync_infer_request_test.cpp +++ b/src/plugins/auto_batch/tests/unit/sync_infer_request_test.cpp @@ -13,6 +13,7 @@ #include "openvino/runtime/threading/immediate_executor.hpp" #include "transformations/utils/utils.hpp" #include "unit_test_utils/mocks/openvino/runtime/mock_icore.hpp" +#include "common_test_utils/subgraph_builders/multi_single_conv.hpp" using ::testing::_; using ::testing::AnyNumber; @@ -97,7 +98,7 @@ public: void SetUp() override { std::tie(m_batch_size, m_element_type) = this->GetParam(); std::vector inputShape = {1, 3, 24, 24}; - m_model = ngraph::builder::subgraph::makeMultiSingleConv(inputShape, m_element_type); + m_model = ov::test::utils::make_multi_single_conv(inputShape, m_element_type); m_core = std::shared_ptr>(new NiceMock()); m_auto_batch_plugin = diff --git a/src/plugins/intel_cpu/tests/functional/test_utils/properties_test.hpp b/src/plugins/intel_cpu/tests/functional/test_utils/properties_test.hpp index e8abbfe879d..b7dd89c763c 100644 --- a/src/plugins/intel_cpu/tests/functional/test_utils/properties_test.hpp +++ b/src/plugins/intel_cpu/tests/functional/test_utils/properties_test.hpp @@ -7,7 +7,7 @@ #include "openvino/runtime/core.hpp" #include "openvino/runtime/compiled_model.hpp" #include "functional_test_utils/skip_tests_config.hpp" -#include "ov_models/subgraph_builders.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" class OVClassConfigTestCPU : public ::testing::Test { public: @@ -16,6 +16,6 @@ public: void SetUp() override { SKIP_IF_CURRENT_TEST_IS_DISABLED(); - model = ngraph::builder::subgraph::makeConvPoolRelu(); + model = ov::test::utils::make_conv_pool_relu(); } }; diff --git a/src/plugins/intel_gna/legacy/tests/keep_constant_inputs_tests.cpp b/src/plugins/intel_gna/legacy/tests/keep_constant_inputs_tests.cpp index 1dcdfd17d32..e8c1852eb0c 100644 --- a/src/plugins/intel_gna/legacy/tests/keep_constant_inputs_tests.cpp +++ b/src/plugins/intel_gna/legacy/tests/keep_constant_inputs_tests.cpp @@ -21,6 +21,8 @@ #include #include +#include "common_test_utils/subgraph_builders/conv_bias.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" #include "ov_models/subgraph_builders.hpp" #include "shared_test_classes/base/low_precision_transformations/layer_transformation.hpp" @@ -60,7 +62,7 @@ void transformNetwork(InferenceEngine::CNNNetwork& clonedNetwork, bool keep_cons TEST(KeepConstantInputsTests, ConvertConvolutionPoolReluNetworkWithTrue) { std::shared_ptr f_ptr; - f_ptr = ngraph::builder::subgraph::makeConvPoolRelu(); + f_ptr = ov::test::utils::make_conv_pool_relu(); InferenceEngine::CNNNetwork network(f_ptr), originalNetwork = network; transformNetwork(originalNetwork, true); ASSERT_EQ(numberOfInputsForLayerInCNNNetwork(originalNetwork, "Convolution"), 2); @@ -68,7 +70,7 @@ TEST(KeepConstantInputsTests, ConvertConvolutionPoolReluNetworkWithTrue) { TEST(KeepConstantInputsTests, ConvertConvolutionPoolReluNetworkWithFalse) { std::shared_ptr f_ptr; - f_ptr = ngraph::builder::subgraph::makeConvPoolRelu(); + f_ptr = ov::test::utils::make_conv_pool_relu(); InferenceEngine::CNNNetwork network(f_ptr), originalNetwork = network; transformNetwork(originalNetwork, false); ASSERT_EQ(numberOfInputsForLayerInCNNNetwork(originalNetwork, "Convolution"), 1); @@ -76,7 +78,7 @@ TEST(KeepConstantInputsTests, ConvertConvolutionPoolReluNetworkWithFalse) { TEST(KeepConstantInputsTests, ConvertConvolutionBiasNetworkWithTrue) { std::shared_ptr f_ptr; - f_ptr = ngraph::builder::subgraph::makeConvBias(); + f_ptr = ov::test::utils::make_conv_bias(); InferenceEngine::CNNNetwork network(f_ptr), originalNetwork = network; transformNetwork(originalNetwork, true); ASSERT_EQ(numberOfInputsForLayerInCNNNetwork(originalNetwork, "Convolution"), 3); @@ -84,7 +86,7 @@ TEST(KeepConstantInputsTests, ConvertConvolutionBiasNetworkWithTrue) { TEST(KeepConstantInputsTests, ConvertConvolutionBiasNetworkWithFalse) { std::shared_ptr f_ptr; - f_ptr = ngraph::builder::subgraph::makeConvBias(); + f_ptr = ov::test::utils::make_conv_bias(); InferenceEngine::CNNNetwork network(f_ptr), originalNetwork = network; transformNetwork(originalNetwork, false); ASSERT_EQ(numberOfInputsForLayerInCNNNetwork(originalNetwork, "Convolution"), 1); diff --git a/src/plugins/intel_gna/tests/functional/shared_tests_instances/behavior/ov_infer_request/infer_request_dynamic.cpp b/src/plugins/intel_gna/tests/functional/shared_tests_instances/behavior/ov_infer_request/infer_request_dynamic.cpp index 6f372a95c75..da69df5a58f 100644 --- a/src/plugins/intel_gna/tests/functional/shared_tests_instances/behavior/ov_infer_request/infer_request_dynamic.cpp +++ b/src/plugins/intel_gna/tests/functional/shared_tests_instances/behavior/ov_infer_request/infer_request_dynamic.cpp @@ -6,6 +6,8 @@ #include +#include "common_test_utils/subgraph_builders/split_conv_concat.hpp" + using namespace ov::test::behavior; namespace { @@ -14,7 +16,7 @@ const std::vector configs = {{}}; INSTANTIATE_TEST_SUITE_P( smoke_BehaviorTests, OVInferRequestDynamicTests, - ::testing::Combine(::testing::Values(ngraph::builder::subgraph::makeSplitConvConcat()), + ::testing::Combine(::testing::Values(ov::test::utils::make_split_conv_concat()), ::testing::Values(std::vector, std::vector>>{ {{1, 4, 20, 20}, {1, 10, 18, 18}}, {{2, 4, 20, 20}, {2, 10, 18, 18}}}), diff --git a/src/plugins/intel_gpu/tests/functional/behavior/infer_request.cpp b/src/plugins/intel_gpu/tests/functional/behavior/infer_request.cpp index 19631c5d1cb..c0fcdfbd2e0 100644 --- a/src/plugins/intel_gpu/tests/functional/behavior/infer_request.cpp +++ b/src/plugins/intel_gpu/tests/functional/behavior/infer_request.cpp @@ -10,6 +10,8 @@ #include "ov_models/subgraph_builders.hpp" #include "transformations/utils/utils.hpp" #include "shared_test_classes/base/ov_subgraph.hpp" +#include "common_test_utils/subgraph_builders/split_multi_conv_concat.hpp" +#include "common_test_utils/subgraph_builders/read_concat_split_assign.hpp" namespace { typedef std::tuple< @@ -88,7 +90,7 @@ INSTANTIATE_TEST_SUITE_P(smoke_GPU_BehaviorTests, InferRequestIOPrecision, TEST(TensorTest, smoke_canSetShapeForPreallocatedTensor) { auto core = ov::Core(); using namespace ov::preprocess; - auto p = PrePostProcessor(ngraph::builder::subgraph::makeSplitMultiConvConcat()); + auto p = PrePostProcessor(ov::test::utils::make_split_multi_conv_concat()); p.input().tensor().set_element_type(ov::element::i8); p.input().preprocess().convert_element_type(ov::element::f32); @@ -135,7 +137,7 @@ TEST(TensorTest, smoke_canSetScalarTensor) { TEST(TensorTest, smoke_canSetTensorForDynamicInput) { auto core = ov::Core(); using namespace ov::preprocess; - auto p = PrePostProcessor(ngraph::builder::subgraph::makeSplitMultiConvConcat()); + auto p = PrePostProcessor(ov::test::utils::make_split_multi_conv_concat()); p.input().tensor().set_element_type(ov::element::i8); p.input().preprocess().convert_element_type(ov::element::f32); @@ -172,7 +174,7 @@ TEST(TensorTest, smoke_canSetTensorForDynamicInput) { TEST(TensorTest, smoke_canReallocateDeviceInputForHostTensor) { auto ov = ov::Core(); using namespace ov::preprocess; - auto p = PrePostProcessor(ngraph::builder::subgraph::makeSplitMultiConvConcat()); + auto p = PrePostProcessor(ov::test::utils::make_split_multi_conv_concat()); p.input().tensor().set_element_type(ov::element::i8); p.input().preprocess().convert_element_type(ov::element::f32); auto function = p.build(); @@ -196,7 +198,7 @@ TEST(VariablesTest, smoke_canSetStateTensor) { const ov::Shape virable_shape = {1, 3, 2, 4}; const ov::Shape input_shape = {1, 3, 2, 4}; const ov::element::Type et = ov::element::f16; - auto model = ngraph::builder::subgraph::makeReadConcatSplitAssign(input_shape, et); + auto model = ov::test::utils::make_read_concat_split_assign(input_shape, et); auto compiled_model = ov.compile_model(model, ov::test::utils::DEVICE_GPU); auto request = compiled_model.create_infer_request(); diff --git a/src/plugins/intel_gpu/tests/functional/behavior/inference_precision.cpp b/src/plugins/intel_gpu/tests/functional/behavior/inference_precision.cpp index 5c7bfd8adb9..3d2882924aa 100644 --- a/src/plugins/intel_gpu/tests/functional/behavior/inference_precision.cpp +++ b/src/plugins/intel_gpu/tests/functional/behavior/inference_precision.cpp @@ -4,6 +4,7 @@ #include "base/ov_behavior_test_utils.hpp" #include "openvino/runtime/core.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" namespace { using params = std::tuple; @@ -54,7 +55,7 @@ TEST(ExecutionModeTest, SetCompileGetInferPrecisionAndExecMode) { ov::Core core; core.set_property(ov::test::utils::DEVICE_GPU, ov::hint::execution_mode(ov::hint::ExecutionMode::PERFORMANCE)); - auto model = ngraph::builder::subgraph::makeConvPoolRelu(); + auto model = ov::test::utils::make_conv_pool_relu(); { auto compiled_model = core.compile_model(model, ov::test::utils::DEVICE_GPU, ov::hint::inference_precision(ov::element::f32)); ASSERT_EQ(ov::hint::ExecutionMode::PERFORMANCE, compiled_model.get_property(ov::hint::execution_mode)); diff --git a/src/plugins/intel_gpu/tests/functional/concurrency/gpu_concurrency_tests.cpp b/src/plugins/intel_gpu/tests/functional/concurrency/gpu_concurrency_tests.cpp index 0e763f41919..ceff31a1219 100644 --- a/src/plugins/intel_gpu/tests/functional/concurrency/gpu_concurrency_tests.cpp +++ b/src/plugins/intel_gpu/tests/functional/concurrency/gpu_concurrency_tests.cpp @@ -17,6 +17,10 @@ #include "openvino/runtime/infer_request.hpp" #include "openvino/runtime/compiled_model.hpp" #include "functional_test_utils/ov_plugin_cache.hpp" +#include "common_test_utils/subgraph_builders/split_multi_conv_concat.hpp" +#include "common_test_utils/subgraph_builders/ti_with_lstm_cell.hpp" +#include "common_test_utils/subgraph_builders/detection_output.hpp" +#include "common_test_utils/subgraph_builders/multi_single_conv.hpp" namespace { using ConcurrencyTestParams = std::tuple { void SetUp() override { std::tie(num_streams, num_requests) = this->GetParam(); - fn_ptrs = {ngraph::builder::subgraph::makeSplitMultiConvConcat(), - ngraph::builder::subgraph::makeMultiSingleConv(), - ngraph::builder::subgraph::makeTIwithLSTMcell()}; + fn_ptrs = {ov::test::utils::make_split_multi_conv_concat(), + ov::test::utils::make_multi_single_conv(), + ov::test::utils::make_ti_with_lstm_cell()}; }; public: static std::string getTestCaseName(const testing::TestParamInfo& obj) { @@ -144,7 +148,7 @@ INSTANTIATE_TEST_SUITE_P(smoke_RemoteTensor, OVConcurrencyTest, TEST(canSwapTensorsBetweenInferRequests, inputs) { std::vector ref; std::vector input_tensors; - auto fn = ngraph::builder::subgraph::makeSplitMultiConvConcat(); + auto fn = ov::test::utils::make_split_multi_conv_concat(); auto core = ov::test::utils::PluginCache::get().core(); auto compiled_model = core->compile_model(fn, ov::test::utils::DEVICE_GPU, ov::hint::inference_precision(ov::element::f32)); @@ -218,7 +222,7 @@ TEST(canSwapTensorsBetweenInferRequests, inputs) { } TEST(smoke_InferRequestDeviceMemoryAllocation, usmHostIsNotChanged) { - auto fn = ngraph::builder::subgraph::makeDetectionOutput(ov::element::f32); + auto fn = ov::test::utils::make_detection_output(ov::element::f32); auto core = ov::test::utils::PluginCache::get().core(); auto compiled_model = core->compile_model(fn, ov::test::utils::DEVICE_GPU, ov::hint::inference_precision(ov::element::f32)); @@ -257,7 +261,7 @@ TEST(smoke_InferRequestDeviceMemoryAllocation, usmHostIsNotChanged) { } TEST(smoke_InferRequestDeviceMemoryAllocation, canSetSystemHostTensor) { - auto fn = ngraph::builder::subgraph::makeDetectionOutput(ov::element::f32); + auto fn = ov::test::utils::make_detection_output(ov::element::f32); auto core = ov::test::utils::PluginCache::get().core(); auto compiled_model = core->compile_model(fn, ov::test::utils::DEVICE_GPU, ov::hint::inference_precision(ov::element::f32)); @@ -283,7 +287,7 @@ TEST(canSwapTensorsBetweenInferRequests, outputs) { std::vector ref; std::vector input_tensors; std::vector output_tensors; - auto fn = ngraph::builder::subgraph::makeSplitMultiConvConcat(); + auto fn = ov::test::utils::make_split_multi_conv_concat(); auto core = ov::test::utils::PluginCache::get().core(); auto compiled_model = core->compile_model(fn, ov::test::utils::DEVICE_GPU, ov::hint::inference_precision(ov::element::f32)); diff --git a/src/plugins/intel_gpu/tests/functional/dynamic_tests/gpu_dyn_batch_shape_tests.cpp b/src/plugins/intel_gpu/tests/functional/dynamic_tests/gpu_dyn_batch_shape_tests.cpp index 880e401bc1a..7e479025dab 100644 --- a/src/plugins/intel_gpu/tests/functional/dynamic_tests/gpu_dyn_batch_shape_tests.cpp +++ b/src/plugins/intel_gpu/tests/functional/dynamic_tests/gpu_dyn_batch_shape_tests.cpp @@ -9,6 +9,7 @@ #include "openvino/runtime/core.hpp" #include "ov_models/subgraph_builders.hpp" #include "shared_test_classes/base/ov_subgraph.hpp" +#include "common_test_utils/subgraph_builders/split_multi_conv_concat.hpp" namespace { using ov::test::InputShape; @@ -69,8 +70,8 @@ protected: init_input_shapes(input_shape); //TODO: think how we can switch between several input topologies in the future - // function = ngraph::builder::subgraph::makeSplitConvConcat(input_shape.front().first.get_min_shape(), model_type); - function = ngraph::builder::subgraph::makeSplitMultiConvConcat(input_shape.front().first.get_min_shape(), model_type); + // function = ov::test::utils::make_split_conv_concat(input_shape.front().first.get_min_shape(), model_type); + function = ov::test::utils::make_split_multi_conv_concat(input_shape.front().first.get_min_shape(), model_type); // make topology dynamic std::map dynShape; diff --git a/src/plugins/intel_gpu/tests/functional/remote_tensor_tests/cldnn_remote_blob_tests.cpp b/src/plugins/intel_gpu/tests/functional/remote_tensor_tests/cldnn_remote_blob_tests.cpp index 3c52a731546..15efd758849 100644 --- a/src/plugins/intel_gpu/tests/functional/remote_tensor_tests/cldnn_remote_blob_tests.cpp +++ b/src/plugins/intel_gpu/tests/functional/remote_tensor_tests/cldnn_remote_blob_tests.cpp @@ -18,6 +18,8 @@ #include "base/ov_behavior_test_utils.hpp" #include "ov_models/subgraph_builders.hpp" #include "functional_test_utils/blob_utils.hpp" +#include "common_test_utils/subgraph_builders/split_multi_conv_concat.hpp" +#include "common_test_utils/subgraph_builders/multi_single_conv.hpp" using namespace ::testing; using namespace InferenceEngine; @@ -578,8 +580,8 @@ class TwoNets_Test : public ov::test::TestsCommon, public testing::WithParamInterface { void SetUp() override { std::tie(num_streams, num_requests) = this->GetParam(); - fn_ptrs = {ngraph::builder::subgraph::makeSplitMultiConvConcat(), - ngraph::builder::subgraph::makeMultiSingleConv()}; + fn_ptrs = {ov::test::utils::make_split_multi_conv_concat(), + ov::test::utils::make_multi_single_conv()}; }; public: static std::string getTestCaseName(const testing::TestParamInfo& obj) { diff --git a/src/plugins/intel_gpu/tests/functional/remote_tensor_tests/dx11_remote_ctx_test.cpp b/src/plugins/intel_gpu/tests/functional/remote_tensor_tests/dx11_remote_ctx_test.cpp index aed706dbf91..eabaf01d861 100644 --- a/src/plugins/intel_gpu/tests/functional/remote_tensor_tests/dx11_remote_ctx_test.cpp +++ b/src/plugins/intel_gpu/tests/functional/remote_tensor_tests/dx11_remote_ctx_test.cpp @@ -14,6 +14,7 @@ #include "common_test_utils/file_utils.hpp" #include "ov_models/subgraph_builders.hpp" #include "openvino/core/preprocess/pre_post_process.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" #ifdef _WIN32 #ifdef ENABLE_DX11 @@ -147,7 +148,7 @@ struct DX11CachedTexture_Test : DX11RemoteCtx_Test { GTEST_SKIP(); #endif // inference using remote blob with batch - auto fn_ptr_remote = ngraph::builder::subgraph::makeConvPoolRelu({1, 3, texture_description.Height, texture_description.Width}); + auto fn_ptr_remote = ov::test::utils::make_conv_pool_relu({1, 3, texture_description.Height, texture_description.Width}); ov::Core core; ov::intel_gpu::ocl::D3DContext context(core, device_ptr); diff --git a/src/plugins/intel_gpu/tests/functional/remote_tensor_tests/gpu_remote_tensor_tests.cpp b/src/plugins/intel_gpu/tests/functional/remote_tensor_tests/gpu_remote_tensor_tests.cpp index d4b5c490a60..ee83114ac07 100644 --- a/src/plugins/intel_gpu/tests/functional/remote_tensor_tests/gpu_remote_tensor_tests.cpp +++ b/src/plugins/intel_gpu/tests/functional/remote_tensor_tests/gpu_remote_tensor_tests.cpp @@ -11,13 +11,16 @@ #include "common_test_utils/ov_tensor_utils.hpp" #include "base/ov_behavior_test_utils.hpp" #include "ov_models/subgraph_builders.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" +#include "common_test_utils/subgraph_builders/split_multi_conv_concat.hpp" +#include "common_test_utils/subgraph_builders/convert_transpose.hpp" class OVRemoteTensor_Test : public ov::test::TestsCommon { protected: std::shared_ptr fn_ptr; void SetUp() override { - fn_ptr = ngraph::builder::subgraph::makeSplitMultiConvConcat(); + fn_ptr = ov::test::utils::make_split_multi_conv_concat(); } }; @@ -739,7 +742,7 @@ protected: public: void SetUp() override { - fn_ptr = ngraph::builder::subgraph::makeSplitMultiConvConcat(); + fn_ptr = ov::test::utils::make_split_multi_conv_concat(); deviceName = ov::test::utils::DEVICE_GPU; auto with_auto_batching = this->GetParam(); if (with_auto_batching) { @@ -1277,7 +1280,7 @@ TEST_F(OVRemoteTensor_Test, NV12toGray) { // ------------------------------------------------------ // inference using remote tensor - auto fn_ptr_remote = ngraph::builder::subgraph::makeConvPoolRelu({1, feature, height, width}); + auto fn_ptr_remote = ov::test::utils::make_conv_pool_relu({1, feature, height, width}); using namespace ov::preprocess; @@ -1325,7 +1328,7 @@ TEST_F(OVRemoteTensor_Test, NV12toGray) { // ------------------------------------------------------ // regular inference - auto fn_ptr_regular = ngraph::builder::subgraph::makeConvPoolRelu({1, feature, height, width}); + auto fn_ptr_regular = ov::test::utils::make_conv_pool_relu({1, feature, height, width}); auto p_reg = PrePostProcessor(fn_ptr_regular); p_reg.input().tensor().set_element_type(ov::element::f32) @@ -1368,7 +1371,7 @@ TEST_F(OVRemoteTensor_Test, NV12toBGR_image_ConvertTranspose) { // ------------------------------------------------------ // inference using remote tensor - auto fn_ptr_remote = ngraph::builder::subgraph::makeConvertTranspose({1, 3, height, width}); + auto fn_ptr_remote = ov::test::utils::make_convert_transpose({1, 3, height, width}); using namespace ov::preprocess; auto p = PrePostProcessor(fn_ptr_remote); @@ -1435,7 +1438,7 @@ TEST_F(OVRemoteTensor_Test, NV12toBGR_image_ConvertTranspose) { // ------------------------------------------------------ // regular inference - auto fn_ptr_regular = ngraph::builder::subgraph::makeConvertTranspose({1, 3, height, width}); + auto fn_ptr_regular = ov::test::utils::make_convert_transpose({1, 3, height, width}); using namespace ov::preprocess; auto p_reg = PrePostProcessor(fn_ptr_regular); @@ -1478,7 +1481,7 @@ TEST_F(OVRemoteTensor_Test, NV12toBGR_image_single_plane) { // ------------------------------------------------------ // inference using remote tensor - auto fn_ptr_remote = ngraph::builder::subgraph::makeConvPoolRelu({1, 3, height, width}); + auto fn_ptr_remote = ov::test::utils::make_conv_pool_relu({1, 3, height, width}); using namespace ov::preprocess; auto p = PrePostProcessor(fn_ptr_remote); @@ -1526,7 +1529,7 @@ TEST_F(OVRemoteTensor_Test, NV12toBGR_image_single_plane) { // ------------------------------------------------------ // regular inference - auto fn_ptr_regular = ngraph::builder::subgraph::makeConvPoolRelu({1, 3, height, width}); + auto fn_ptr_regular = ov::test::utils::make_conv_pool_relu({1, 3, height, width}); using namespace ov::preprocess; auto p_reg = PrePostProcessor(fn_ptr_regular); @@ -1569,7 +1572,7 @@ TEST_F(OVRemoteTensor_Test, NV12toBGR_image_two_planes) { // ------------------------------------------------------ // inference using remote tensor - auto fn_ptr_remote = ngraph::builder::subgraph::makeConvPoolRelu({1, 3, height, width}); + auto fn_ptr_remote = ov::test::utils::make_conv_pool_relu({1, 3, height, width}); using namespace ov::preprocess; auto p = PrePostProcessor(fn_ptr_remote); @@ -1634,7 +1637,7 @@ TEST_F(OVRemoteTensor_Test, NV12toBGR_image_two_planes) { // ------------------------------------------------------ // regular inference - auto fn_ptr_regular = ngraph::builder::subgraph::makeConvPoolRelu({1, 3, height, width}); + auto fn_ptr_regular = ov::test::utils::make_conv_pool_relu({1, 3, height, width}); using namespace ov::preprocess; auto p_reg = PrePostProcessor(fn_ptr_regular); @@ -1676,7 +1679,7 @@ TEST_F(OVRemoteTensor_Test, NV12toBGR_buffer) { auto ie = ov::Core(); - auto fn_ptr_remote = ngraph::builder::subgraph::makeConvPoolRelu({1, 3, height, width}); + auto fn_ptr_remote = ov::test::utils::make_conv_pool_relu({1, 3, height, width}); using namespace ov::preprocess; auto p = PrePostProcessor(fn_ptr_remote); @@ -1781,7 +1784,7 @@ TEST_P(OVRemoteTensorBatched_Test, NV12toBGR_image_single_plane) { // ------------------------------------------------------ // inference using remote tensor - auto fn_ptr_remote = ngraph::builder::subgraph::makeConvPoolRelu({num_batch, 3, height, width}); + auto fn_ptr_remote = ov::test::utils::make_conv_pool_relu({num_batch, 3, height, width}); using namespace ov::preprocess; auto p = PrePostProcessor(fn_ptr_remote); @@ -1839,7 +1842,7 @@ TEST_P(OVRemoteTensorBatched_Test, NV12toBGR_image_single_plane) { // ------------------------------------------------------ // regular inference - auto fn_ptr_regular = ngraph::builder::subgraph::makeConvPoolRelu({1, 3, height, width}); + auto fn_ptr_regular = ov::test::utils::make_conv_pool_relu({1, 3, height, width}); using namespace ov::preprocess; auto p_reg = PrePostProcessor(fn_ptr_regular); @@ -1889,7 +1892,7 @@ TEST_P(OVRemoteTensorBatched_Test, NV12toBGR_image_two_planes) { // ------------------------------------------------------ // inference using remote tensor - auto fn_ptr_remote = ngraph::builder::subgraph::makeConvPoolRelu({num_batch, 3, height, width}); + auto fn_ptr_remote = ov::test::utils::make_conv_pool_relu({num_batch, 3, height, width}); using namespace ov::preprocess; auto p = PrePostProcessor(fn_ptr_remote); @@ -1963,7 +1966,7 @@ TEST_P(OVRemoteTensorBatched_Test, NV12toBGR_image_two_planes) { // ------------------------------------------------------ // regular inference - auto fn_ptr_regular = ngraph::builder::subgraph::makeConvPoolRelu({1, 3, height, width}); + auto fn_ptr_regular = ov::test::utils::make_conv_pool_relu({1, 3, height, width}); using namespace ov::preprocess; auto p_reg = PrePostProcessor(fn_ptr_regular); @@ -2028,7 +2031,7 @@ TEST_P(OVRemoteTensorBatched_Test, NV12toGray) { // ------------------------------------------------------ // inference using remote tensor - auto fn_ptr_remote = ngraph::builder::subgraph::makeConvPoolRelu({num_batch, feature, height, width}); + auto fn_ptr_remote = ov::test::utils::make_conv_pool_relu({num_batch, feature, height, width}); using namespace ov::preprocess; @@ -2086,7 +2089,7 @@ TEST_P(OVRemoteTensorBatched_Test, NV12toGray) { // ------------------------------------------------------ // regular inference - auto fn_ptr_regular = ngraph::builder::subgraph::makeConvPoolRelu({1, 1, height, width}); + auto fn_ptr_regular = ov::test::utils::make_conv_pool_relu({1, 1, height, width}); auto p_reg = PrePostProcessor(fn_ptr_regular); p_reg.input().tensor().set_element_type(ov::element::f32) @@ -2133,7 +2136,7 @@ TEST_P(OVRemoteTensorBatched_Test, NV12toBGR_buffer) { // ------------------------------------------------------ // inference using remote tensor - auto fn_ptr_remote = ngraph::builder::subgraph::makeConvPoolRelu({num_batch, 3, height, width}); + auto fn_ptr_remote = ov::test::utils::make_conv_pool_relu({num_batch, 3, height, width}); using namespace ov::preprocess; auto p = PrePostProcessor(fn_ptr_remote); @@ -2235,7 +2238,7 @@ TEST_P(OVRemoteTensorBatched_Test, NV12toBGR_buffer) { // ------------------------------------------------------ // regular inference - auto fn_ptr_regular = ngraph::builder::subgraph::makeConvPoolRelu({1, 3, height, width}); + auto fn_ptr_regular = ov::test::utils::make_conv_pool_relu({1, 3, height, width}); using namespace ov::preprocess; auto p_reg = PrePostProcessor(fn_ptr_regular); @@ -2369,7 +2372,7 @@ TEST(OVRemoteContextGPU, smoke_RemoteContextCaching) { const auto gpuDeviceFirst = gpuDevices[0]; const auto gpuDeviceSecond = gpuDevices[1]; - auto model = ngraph::builder::subgraph::makeConvertTranspose(); + auto model = ov::test::utils::make_convert_transpose(); auto compiledModelFirst = core.compile_model(model, gpuDeviceFirst); auto compiledModelSecond = core.compile_model(model, gpuDeviceSecond); @@ -2410,7 +2413,7 @@ TEST(OVRemoteContextGPU, smoke_RemoteContextSingleDevice) { check_contexts_are_same(default_ctx, core.get_default_context(ov::test::utils::DEVICE_GPU)); // Ensure compiled model uses default context too - auto model = ngraph::builder::subgraph::makeConvertTranspose(); + auto model = ov::test::utils::make_convert_transpose(); auto compiled_model = core.compile_model(model, ov::test::utils::DEVICE_GPU); check_contexts_are_same(default_ctx, compiled_model.get_context()); ASSERT_EQ(2, compiled_model.get_property(ov::streams::num)); diff --git a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/plugin/core_threading_tests.cpp b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/plugin/core_threading_tests.cpp index a26501d6bad..b5af69fa6d0 100644 --- a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/plugin/core_threading_tests.cpp +++ b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/plugin/core_threading_tests.cpp @@ -3,7 +3,12 @@ // #include -#include +#include "remote_tensor_tests/helpers.hpp" +#include "common_test_utils/subgraph_builders/split_conv_concat.hpp" +#include "common_test_utils/subgraph_builders/split_multi_conv_concat.hpp" +#include "common_test_utils/subgraph_builders/single_conv.hpp" +#include "common_test_utils/subgraph_builders/multi_single_conv.hpp" +#include "common_test_utils/subgraph_builders/2_input_subtract.hpp" using namespace InferenceEngine; using namespace InferenceEngine::gpu; @@ -26,11 +31,11 @@ TEST_P(CoreThreadingTestsWithIterations, smoke_LoadNetwork_RemoteContext) { std::atomic counter{0u}; std::vector networks; - networks.emplace_back(InferenceEngine::CNNNetwork(ngraph::builder::subgraph::make2InputSubtract())); - networks.emplace_back(InferenceEngine::CNNNetwork(ngraph::builder::subgraph::makeMultiSingleConv())); - networks.emplace_back(InferenceEngine::CNNNetwork(ngraph::builder::subgraph::makeSingleConv())); - networks.emplace_back(InferenceEngine::CNNNetwork(ngraph::builder::subgraph::makeSplitConvConcat())); - networks.emplace_back(InferenceEngine::CNNNetwork(ngraph::builder::subgraph::makeSplitMultiConvConcat())); + networks.emplace_back(InferenceEngine::CNNNetwork(ov::test::utils::make_2_input_subtract())); + networks.emplace_back(InferenceEngine::CNNNetwork(ov::test::utils::make_multi_single_conv())); + networks.emplace_back(InferenceEngine::CNNNetwork(ov::test::utils::make_single_conv())); + networks.emplace_back(InferenceEngine::CNNNetwork(ov::test::utils::make_split_conv_concat())); + networks.emplace_back(InferenceEngine::CNNNetwork(ov::test::utils::make_split_multi_conv_concat())); auto ocl_instance = std::make_shared(); ie.SetConfig(config, target_device); diff --git a/src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_infer_request/infer_request_dynamic.cpp b/src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_infer_request/infer_request_dynamic.cpp index 1ae1cb74130..318ca494d1b 100644 --- a/src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_infer_request/infer_request_dynamic.cpp +++ b/src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_infer_request/infer_request_dynamic.cpp @@ -6,6 +6,8 @@ #include +#include "common_test_utils/subgraph_builders/split_conv_concat.hpp" + using namespace ov::test::behavior; namespace { @@ -17,7 +19,7 @@ const std::vector HeteroConfigs = {{ov::device::priorities(ov::test: INSTANTIATE_TEST_SUITE_P( smoke_BehaviorTests, OVInferRequestDynamicTests, - ::testing::Combine(::testing::Values(ngraph::builder::subgraph::makeSplitConvConcat()), + ::testing::Combine(::testing::Values(ov::test::utils::make_split_conv_concat()), ::testing::Values(std::vector, std::vector>>{ {{1, 4, 20, 20}, {1, 10, 18, 18}}, {{2, 4, 20, 20}, {2, 10, 18, 18}}}), @@ -28,7 +30,7 @@ INSTANTIATE_TEST_SUITE_P( INSTANTIATE_TEST_SUITE_P( smoke_Hetero_BehaviorTests, OVInferRequestDynamicTests, - ::testing::Combine(::testing::Values(ngraph::builder::subgraph::makeSplitConvConcat()), + ::testing::Combine(::testing::Values(ov::test::utils::make_split_conv_concat()), ::testing::Values(std::vector, std::vector>>{ {{1, 4, 20, 20}, {1, 10, 18, 18}}, {{2, 4, 20, 20}, {2, 10, 18, 18}}}), diff --git a/src/plugins/template/tests/functional/shared_tests_instances/behavior/plugin/synthetic.cpp b/src/plugins/template/tests/functional/shared_tests_instances/behavior/plugin/synthetic.cpp index c81cdb24b53..73d6c7b286d 100644 --- a/src/plugins/template/tests/functional/shared_tests_instances/behavior/plugin/synthetic.cpp +++ b/src/plugins/template/tests/functional/shared_tests_instances/behavior/plugin/synthetic.cpp @@ -5,8 +5,9 @@ #include #include "behavior/plugin/hetero_synthetic.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu_non_zero.hpp" #include "ov_models/builders.hpp" -#include "ov_models/subgraph_builders.hpp" namespace { using namespace HeteroTests; @@ -21,7 +22,7 @@ INSTANTIATE_TEST_SUITE_P( {"TEMPLATE1", "openvino_template_plugin"}}), ::testing::ValuesIn(HeteroTests::HeteroSyntheticTest::withMajorNodesFunctions( [] { - return ngraph::builder::subgraph::makeConvPool2Relu2(); + return ov::test::utils::make_conv_pool2_relu2(); }, {"Conv_1"}, true))), @@ -45,7 +46,7 @@ INSTANTIATE_TEST_SUITE_P( static std::vector()>> dynamicBuilders = { [] { - return ngraph::builder::subgraph::makeConvPoolReluNonZero(); + return ov::test::utils::make_conv_pool_relu_non_zero(); }, }; diff --git a/src/tests/functional/plugin/shared/include/base/behavior_test_utils.hpp b/src/tests/functional/plugin/shared/include/base/behavior_test_utils.hpp index 6fb1ca5e3d0..95311b492f3 100644 --- a/src/tests/functional/plugin/shared/include/base/behavior_test_utils.hpp +++ b/src/tests/functional/plugin/shared/include/base/behavior_test_utils.hpp @@ -10,6 +10,7 @@ #include "common_test_utils/file_utils.hpp" #include "openvino/util/file_util.hpp" #include "functional_test_utils/summary/api_summary.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" namespace BehaviorTestsUtils { @@ -174,7 +175,7 @@ protected: std::tie(netPrecision, target_device, configuration) = this->GetParam(); SKIP_IF_CURRENT_TEST_IS_DISABLED() APIBaseTest::SetUp(); - function = ngraph::builder::subgraph::makeConvPoolRelu(); + function = ov::test::utils::make_conv_pool_relu(); } void TearDown() override { if (!configuration.empty()) { diff --git a/src/tests/functional/plugin/shared/include/base/multi/multi_helpers.hpp b/src/tests/functional/plugin/shared/include/base/multi/multi_helpers.hpp index 91d9398aa01..5bd3b7ffb7e 100644 --- a/src/tests/functional/plugin/shared/include/base/multi/multi_helpers.hpp +++ b/src/tests/functional/plugin/shared/include/base/multi/multi_helpers.hpp @@ -10,6 +10,7 @@ #include "common_test_utils/test_constants.hpp" #include "ov_models/subgraph_builders.hpp" #include "openvino/util/common_util.hpp" +#include "common_test_utils/subgraph_builders/split_multi_conv_concat.hpp" using namespace ::testing; @@ -31,7 +32,7 @@ class MultiDevice_Test : public ov::test::TestsCommon, public testing::WithParam std::vector deviceNameList; std::tie(deviceNameList, _properties) = this->GetParam(); device_names = getDeviceStringWithMulti(deviceNameList); - fn_ptr = ngraph::builder::subgraph::makeSplitMultiConvConcat(); + fn_ptr = ov::test::utils::make_split_multi_conv_concat(); } public: @@ -61,7 +62,7 @@ class MultiDevice_SupportTest : public ov::test::TestsCommon, public testing::Wi std::vector deviceNameList; std::tie(deviceNameList, expected_status, _properties) = this->GetParam(); device_names = getDeviceStringWithMulti(deviceNameList); - fn_ptr = ngraph::builder::subgraph::makeSplitMultiConvConcat(); + fn_ptr = ov::test::utils::make_split_multi_conv_concat(); } public: diff --git a/src/tests/functional/plugin/shared/include/base/ov_behavior_test_utils.hpp b/src/tests/functional/plugin/shared/include/base/ov_behavior_test_utils.hpp index c2af9af227a..6d311ac379b 100644 --- a/src/tests/functional/plugin/shared/include/base/ov_behavior_test_utils.hpp +++ b/src/tests/functional/plugin/shared/include/base/ov_behavior_test_utils.hpp @@ -27,6 +27,11 @@ #include "functional_test_utils/blob_utils.hpp" #include "functional_test_utils/summary/api_summary.hpp" #include "openvino/util/file_util.hpp" +#include "common_test_utils/subgraph_builders/split_conv_concat.hpp" +#include "common_test_utils/subgraph_builders/kso_func.hpp" +#include "common_test_utils/subgraph_builders/single_concat_with_constant.hpp" +#include "common_test_utils/subgraph_builders/concat_with_params.hpp" +#include "common_test_utils/subgraph_builders/split_concat.hpp" namespace ov { namespace test { @@ -34,7 +39,7 @@ namespace behavior { inline std::shared_ptr getDefaultNGraphFunctionForTheDevice(std::vector inputShape = {1, 2, 32, 32}, ov::element::Type_t ngPrc = ov::element::Type_t::f32) { - return ngraph::builder::subgraph::makeSplitConcat(inputShape, ngPrc); + return ov::test::utils::make_split_concat(inputShape, ngPrc); } inline bool sw_plugin_in_target_device(std::string targetDevice) { @@ -175,13 +180,13 @@ public: void SetUp() { SKIP_IF_CURRENT_TEST_IS_DISABLED(); // Generic network - actualNetwork = ngraph::builder::subgraph::makeSplitConcat(); + actualNetwork = ov::test::utils::make_split_concat(); // Quite simple network - simpleNetwork = ngraph::builder::subgraph::makeSingleConcatWithConstant(); + simpleNetwork = ov::test::utils::make_single_concat_with_constant(); // Multinput to substruct network - multinputNetwork = ngraph::builder::subgraph::makeConcatWithParams(); + multinputNetwork = ov::test::utils::make_concat_with_params(); // Network with KSO - ksoNetwork = ngraph::builder::subgraph::makeKSOFunction(); + ksoNetwork = ov::test::utils::make_kso_function(); } virtual void setHeteroNetworkAffinity(const std::string &targetDevice) { @@ -240,7 +245,7 @@ public: std::tie(target_device, configuration) = GetParam(); SKIP_IF_CURRENT_TEST_IS_DISABLED(); APIBaseTest::SetUp(); - actualNetwork = ngraph::builder::subgraph::makeSplitConvConcat(); + actualNetwork = ov::test::utils::make_split_conv_concat(); } }; diff --git a/src/tests/functional/plugin/shared/include/behavior/compiled_model/compiled_model_base.hpp b/src/tests/functional/plugin/shared/include/behavior/compiled_model/compiled_model_base.hpp index 866b908c673..5ea0f542527 100644 --- a/src/tests/functional/plugin/shared/include/behavior/compiled_model/compiled_model_base.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/compiled_model/compiled_model_base.hpp @@ -14,6 +14,12 @@ #include "functional_test_utils/plugin_cache.hpp" #include "openvino/op/concat.hpp" #include "openvino/runtime/tensor.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" +#include "common_test_utils/subgraph_builders/multiple_input_outpput_double_concat.hpp" +#include "common_test_utils/subgraph_builders/single_concat_with_constant.hpp" +#include "common_test_utils/subgraph_builders/concat_with_params.hpp" +#include "common_test_utils/subgraph_builders/single_split.hpp" +#include "common_test_utils/subgraph_builders/split_concat.hpp" namespace ov { namespace test { @@ -241,7 +247,7 @@ TEST_P(OVCompiledModelBaseTest, canCompileModelwithBrace) { TEST(OVCompiledModelBaseTest, canCompileModelToDefaultDevice) { std::shared_ptr core = utils::PluginCache::get().core(); - std::shared_ptr function = ngraph::builder::subgraph::makeSingleConcatWithConstant(); + std::shared_ptr function = ov::test::utils::make_single_concat_with_constant(); EXPECT_NO_THROW(auto execNet = core->compile_model(function)); } @@ -280,12 +286,12 @@ TEST_P(OVCompiledModelBaseTest, CanCreateTwoCompiledModelsAndCheckRuntimeModel) TEST_P(OVCompiledModelBaseTest, pluginDoesNotChangeOriginalNetwork) { // compare 2 networks - auto referenceNetwork = ngraph::builder::subgraph::makeConvPoolRelu(); + auto referenceNetwork = ov::test::utils::make_conv_pool_relu(); compare_functions(function, referenceNetwork); } TEST_P(OVCompiledModelBaseTest, CanSetInputPrecisionForNetwork) { - std::shared_ptr model = ngraph::builder::subgraph::makeSingleConcatWithConstant(); + std::shared_ptr model = ov::test::utils::make_single_concat_with_constant(); ov::Core core = createCoreWithTemplate(); auto ppp = ov::preprocess::PrePostProcessor(model); ov::preprocess::InputInfo& input = ppp.input(); @@ -296,7 +302,7 @@ TEST_P(OVCompiledModelBaseTest, CanSetInputPrecisionForNetwork) { } TEST_P(OVCompiledModelBaseTest, CanSetOutputPrecisionForNetwork) { - std::shared_ptr model = ngraph::builder::subgraph::makeSingleConcatWithConstant(); + std::shared_ptr model = ov::test::utils::make_single_concat_with_constant(); ov::Core core = createCoreWithTemplate(); auto ppp = ov::preprocess::PrePostProcessor(model); ov::preprocess::OutputInfo& output = ppp.output(); @@ -451,7 +457,7 @@ TEST_P(OVCompiledModelBaseTestOptional, CheckExecGraphInfoAfterExecution) { TEST_P(OVCompiledModelBaseTest, getInputFromFunctionWithSingleInput) { ov::CompiledModel execNet; - function = ngraph::builder::subgraph::makeSplitConcat(); + function = ov::test::utils::make_split_concat(); execNet = core->compile_model(function, target_device, configuration); EXPECT_EQ(function->inputs().size(), 1); @@ -465,7 +471,7 @@ TEST_P(OVCompiledModelBaseTest, getInputFromFunctionWithSingleInput) { TEST_P(OVCompiledModelBaseTest, getOutputFromFunctionWithSingleInput) { ov::CompiledModel execNet; - function = ngraph::builder::subgraph::makeSplitConcat(); + function = ov::test::utils::make_split_concat(); execNet = core->compile_model(function, target_device, configuration); EXPECT_EQ(function->outputs().size(), 1); @@ -479,7 +485,7 @@ TEST_P(OVCompiledModelBaseTest, getOutputFromFunctionWithSingleInput) { TEST_P(OVCompiledModelBaseTest, getInputsFromFunctionWithSeveralInputs) { ov::CompiledModel execNet; - function = ngraph::builder::subgraph::makeConcatWithParams(); + function = ov::test::utils::make_concat_with_params(); execNet = core->compile_model(function, target_device, configuration); EXPECT_EQ(function->inputs().size(), 2); @@ -500,7 +506,7 @@ TEST_P(OVCompiledModelBaseTest, getInputsFromFunctionWithSeveralInputs) { TEST_P(OVCompiledModelBaseTest, getOutputsFromFunctionWithSeveralOutputs) { ov::CompiledModel execNet; - function = ngraph::builder::subgraph::makeMultipleInputOutputDoubleConcat(); + function = ov::test::utils::make_multiple_input_output_double_concat(); execNet = core->compile_model(function, target_device, configuration); EXPECT_EQ(function->outputs().size(), 2); @@ -521,7 +527,7 @@ TEST_P(OVCompiledModelBaseTest, getOutputsFromFunctionWithSeveralOutputs) { TEST_P(OVCompiledModelBaseTest, getOutputsFromSplitFunctionWithSeveralOutputs) { ov::CompiledModel execNet; - function = ngraph::builder::subgraph::makeSingleSplit(); + function = ov::test::utils::make_single_split(); execNet = core->compile_model(function, target_device, configuration); EXPECT_EQ(function->outputs().size(), 2); diff --git a/src/tests/functional/plugin/shared/include/behavior/compiled_model/properties.hpp b/src/tests/functional/plugin/shared/include/behavior/compiled_model/properties.hpp index 7ae07a6ebce..586195cf25a 100644 --- a/src/tests/functional/plugin/shared/include/behavior/compiled_model/properties.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/compiled_model/properties.hpp @@ -11,6 +11,7 @@ #include "common_test_utils/test_assertions.hpp" #include "common_test_utils/file_utils.hpp" #include "common_test_utils/unicode_utils.hpp" +#include "common_test_utils/subgraph_builders/single_conv.hpp" namespace ov { namespace test { @@ -118,7 +119,7 @@ public: std::tie(target_device, configuration) = GetParam(); SKIP_IF_CURRENT_TEST_IS_DISABLED(); APIBaseTest::SetUp(); - simpleNetwork = ngraph::builder::subgraph::makeSingleConv(); + simpleNetwork = ov::test::utils::make_single_conv(); } }; diff --git a/src/tests/functional/plugin/shared/include/behavior/executable_network/exec_network_base.hpp b/src/tests/functional/plugin/shared/include/behavior/executable_network/exec_network_base.hpp index 3f9ff55f8fa..db7b2ba376a 100644 --- a/src/tests/functional/plugin/shared/include/behavior/executable_network/exec_network_base.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/executable_network/exec_network_base.hpp @@ -8,6 +8,7 @@ #include "common_test_utils/file_utils.hpp" #include "openvino/core/model.hpp" #include "openvino/op/relu.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" namespace BehaviorTestsDefinitions { class ExecutableNetworkBaseTest : public BehaviorTestsUtils::IEExecutableNetworkTestBase, @@ -292,7 +293,7 @@ TEST_P(ExecutableNetworkBaseTest, canExport) { TEST_P(ExecutableNetworkBaseTest, pluginDoesNotChangeOriginalNetwork) { // compare 2 networks - auto referenceNetwork = ngraph::builder::subgraph::makeConvPoolRelu(); + auto referenceNetwork = ov::test::utils::make_conv_pool_relu(); compare_functions(cnnNet.getFunction(), referenceNetwork); } @@ -303,7 +304,7 @@ protected: std::tie(netPrecision, target_device, configuration) = this->GetParam(); SKIP_IF_CURRENT_TEST_IS_DISABLED() APIBaseTest::SetUp(); - function = ngraph::builder::subgraph::makeConvPoolRelu(); + function = ov::test::utils::make_conv_pool_relu(); } void TearDown() override { if (!configuration.empty()) { diff --git a/src/tests/functional/plugin/shared/include/behavior/infer_request/io_blob.hpp b/src/tests/functional/plugin/shared/include/behavior/infer_request/io_blob.hpp index 99c30679b3a..6487c8cb6d4 100644 --- a/src/tests/functional/plugin/shared/include/behavior/infer_request/io_blob.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/infer_request/io_blob.hpp @@ -9,6 +9,7 @@ #include "base/behavior_test_utils.hpp" #include "shared_test_classes/subgraph/basic_lstm.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" namespace BehaviorTestsDefinitions { using InferRequestIOBBlobTest = BehaviorTestsUtils::InferRequestTests; @@ -455,7 +456,7 @@ public: void SetUp() override { std::tie(layout, target_device, configuration) = this->GetParam(); SKIP_IF_CURRENT_TEST_IS_DISABLED() - function = ngraph::builder::subgraph::makeConvPoolRelu(); + function = ov::test::utils::make_conv_pool_relu(); cnnNet = InferenceEngine::CNNNetwork(function); execNet = ie->LoadNetwork(cnnNet, target_device, configuration); } diff --git a/src/tests/functional/plugin/shared/include/behavior/infer_request/set_blob_by_type.hpp b/src/tests/functional/plugin/shared/include/behavior/infer_request/set_blob_by_type.hpp index 439f2ee0ecf..92282dc7ecf 100644 --- a/src/tests/functional/plugin/shared/include/behavior/infer_request/set_blob_by_type.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/infer_request/set_blob_by_type.hpp @@ -8,6 +8,7 @@ #include "base/behavior_test_utils.hpp" #include "common_test_utils/common_utils.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" namespace BehaviorTestsDefinitions { @@ -42,8 +43,7 @@ public: // Skip test according to plugin specific disabledTestPatterns() (if any) SKIP_IF_CURRENT_TEST_IS_DISABLED() APIBaseTest::SetUp(); - std::shared_ptr function = ngraph::builder::subgraph::makeConvPoolRelu( - {4, 3, 6, 8}, ngraph::element::Type_t::u8); + std::shared_ptr function = ov::test::utils::make_conv_pool_relu({4, 3, 6, 8}, ov::element::u8); InferenceEngine::CNNNetwork cnnNetwork(function); executableNetwork = ie->LoadNetwork(cnnNetwork, target_device, config); } diff --git a/src/tests/functional/plugin/shared/include/behavior/ov_executable_network/exec_graph_info.hpp b/src/tests/functional/plugin/shared/include/behavior/ov_executable_network/exec_graph_info.hpp index d946a652dbd..010704bedd3 100644 --- a/src/tests/functional/plugin/shared/include/behavior/ov_executable_network/exec_graph_info.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/ov_executable_network/exec_graph_info.hpp @@ -13,6 +13,7 @@ #include "common_test_utils/file_utils.hpp" #include "functional_test_utils/plugin_cache.hpp" +#include "common_test_utils/subgraph_builders/multiple_input_outpput_double_concat.hpp" namespace ov { namespace test { @@ -76,7 +77,7 @@ TEST_P(OVExecGraphImportExportTest, importExportedFunction) { ov::CompiledModel execNet; // Create simple function - function = ngraph::builder::subgraph::makeMultipleInputOutputDoubleConcat({1, 2, 24, 24}, elementType); + function = ov::test::utils::make_multiple_input_output_double_concat({1, 2, 24, 24}, elementType); execNet = core->compile_model(function, target_device, configuration); std::stringstream strm; @@ -337,7 +338,7 @@ TEST_P(OVExecGraphImportExportTest, importExportedIENetwork) { InferenceEngine::ExecutableNetwork execNet; // Create simple function - function = ngraph::builder::subgraph::makeMultipleInputOutputDoubleConcat({1, 2, 24, 24}, elementType); + function = ov::test::utils::make_multiple_input_output_double_concat({1, 2, 24, 24}, elementType); execNet = ie->LoadNetwork(InferenceEngine::CNNNetwork(function), target_device, any_copy(configuration)); @@ -471,7 +472,7 @@ TEST_P(OVExecGraphImportExportTest, ieImportExportedFunction) { ov::CompiledModel execNet; // Create simple function - function = ngraph::builder::subgraph::makeMultipleInputOutputDoubleConcat({1, 2, 24, 24}, elementType); + function = ov::test::utils::make_multiple_input_output_double_concat({1, 2, 24, 24}, elementType); execNet = core->compile_model(function, target_device, configuration); std::stringstream strm; diff --git a/src/tests/functional/plugin/shared/include/behavior/ov_executable_network/exec_network_base.hpp b/src/tests/functional/plugin/shared/include/behavior/ov_executable_network/exec_network_base.hpp index 592b156d3b0..372a62a5045 100644 --- a/src/tests/functional/plugin/shared/include/behavior/ov_executable_network/exec_network_base.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/ov_executable_network/exec_network_base.hpp @@ -12,6 +12,12 @@ #include "functional_test_utils/plugin_cache.hpp" #include "openvino/op/concat.hpp" #include "openvino/runtime/tensor.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" +#include "common_test_utils/subgraph_builders/multiple_input_outpput_double_concat.hpp" +#include "common_test_utils/subgraph_builders/single_concat_with_constant.hpp" +#include "common_test_utils/subgraph_builders/concat_with_params.hpp" +#include "common_test_utils/subgraph_builders/single_split.hpp" +#include "common_test_utils/subgraph_builders/split_concat.hpp" namespace ov { namespace test { @@ -142,7 +148,7 @@ TEST_P(OVExecutableNetworkBaseTest, canLoadNetworkFromMemory) { TEST(OVExecutableNetworkBaseTest, smoke_LoadNetworkToDefaultDeviceNoThrow) { std::shared_ptr core = utils::PluginCache::get().core(); - std::shared_ptr function = ngraph::builder::subgraph::makeSingleConcatWithConstant(); + std::shared_ptr function = ov::test::utils::make_single_concat_with_constant(); EXPECT_NO_THROW(auto execNet = core->compile_model(function)); } @@ -412,14 +418,14 @@ TEST_P(OVExecutableNetworkBaseTest, canExport) { TEST_P(OVExecutableNetworkBaseTest, pluginDoesNotChangeOriginalNetwork) { // compare 2 networks - auto referenceNetwork = ngraph::builder::subgraph::makeConvPoolRelu(); + auto referenceNetwork = ov::test::utils::make_conv_pool_relu(); compare_functions(function, referenceNetwork); } TEST_P(OVExecutableNetworkBaseTest, getInputFromFunctionWithSingleInput) { ov::CompiledModel execNet; - function = ngraph::builder::subgraph::makeSplitConcat(); + function = ov::test::utils::make_split_concat(); execNet = core->compile_model(function, target_device, configuration); EXPECT_EQ(function->inputs().size(), 1); @@ -433,7 +439,7 @@ TEST_P(OVExecutableNetworkBaseTest, getInputFromFunctionWithSingleInput) { TEST_P(OVExecutableNetworkBaseTest, getOutputFromFunctionWithSingleInput) { ov::CompiledModel execNet; - function = ngraph::builder::subgraph::makeSplitConcat(); + function = ov::test::utils::make_split_concat(); execNet = core->compile_model(function, target_device, configuration); EXPECT_EQ(function->outputs().size(), 1); @@ -447,7 +453,7 @@ TEST_P(OVExecutableNetworkBaseTest, getOutputFromFunctionWithSingleInput) { TEST_P(OVExecutableNetworkBaseTest, getInputsFromFunctionWithSeveralInputs) { ov::CompiledModel execNet; - function = ngraph::builder::subgraph::makeConcatWithParams(); + function = ov::test::utils::make_concat_with_params(); execNet = core->compile_model(function, target_device, configuration); EXPECT_EQ(function->inputs().size(), 2); @@ -468,7 +474,7 @@ TEST_P(OVExecutableNetworkBaseTest, getInputsFromFunctionWithSeveralInputs) { TEST_P(OVExecutableNetworkBaseTest, getOutputsFromFunctionWithSeveralOutputs) { ov::CompiledModel execNet; - function = ngraph::builder::subgraph::makeMultipleInputOutputDoubleConcat(); + function = ov::test::utils::make_multiple_input_output_double_concat(); execNet = core->compile_model(function, target_device, configuration); EXPECT_EQ(function->outputs().size(), 2); @@ -489,7 +495,7 @@ TEST_P(OVExecutableNetworkBaseTest, getOutputsFromFunctionWithSeveralOutputs) { TEST_P(OVExecutableNetworkBaseTest, getOutputsFromSplitFunctionWithSeveralOutputs) { ov::CompiledModel execNet; - function = ngraph::builder::subgraph::makeSingleSplit(); + function = ov::test::utils::make_single_split(); execNet = core->compile_model(function, target_device, configuration); EXPECT_EQ(function->outputs().size(), 2); diff --git a/src/tests/functional/plugin/shared/include/behavior/ov_executable_network/get_metric.hpp b/src/tests/functional/plugin/shared/include/behavior/ov_executable_network/get_metric.hpp index 52e949df773..d9a64036e8c 100644 --- a/src/tests/functional/plugin/shared/include/behavior/ov_executable_network/get_metric.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/ov_executable_network/get_metric.hpp @@ -7,6 +7,7 @@ #include #include +#include "common_test_utils/subgraph_builders/single_conv.hpp" #ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT # include @@ -43,7 +44,7 @@ public: std::tie(target_device, configuration) = GetParam(); SKIP_IF_CURRENT_TEST_IS_DISABLED(); APIBaseTest::SetUp(); - simpleNetwork = ngraph::builder::subgraph::makeSingleConv(); + simpleNetwork = ov::test::utils::make_single_conv(); } }; using OVClassExecutableNetworkGetMetricTest_DEVICE_PRIORITY = OVClassExecutableNetworkGetMetricTest_Priority; diff --git a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/core_integration.hpp b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/core_integration.hpp index a6c0f73751b..edb49cbbc7e 100644 --- a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/core_integration.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/core_integration.hpp @@ -21,6 +21,8 @@ #include "openvino/op/result.hpp" #include "openvino/op/shape_of.hpp" #include "openvino/util/file_util.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu_no_reshapes.hpp" +#include "common_test_utils/subgraph_builders/split_conv_concat.hpp" #ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT # include @@ -103,7 +105,7 @@ public: std::tie(target_device, configuration) = GetParam(); SKIP_IF_CURRENT_TEST_IS_DISABLED(); APIBaseTest::SetUp(); - actualNetwork = ngraph::builder::subgraph::makeSplitConvConcat(); + actualNetwork = ov::test::utils::make_split_conv_concat(); } }; @@ -221,7 +223,7 @@ TEST(OVClassBasicTest, smoke_createMockEngineConfigThrows) { inline void generateModelFile() { ov::pass::Manager manager; manager.register_pass("test_model.xml", "test_model.bin"); - auto function = ngraph::builder::subgraph::makeConvPoolReluNoReshapes({1, 3, 227, 227}); + auto function = ov::test::utils::make_conv_pool_relu_no_reshapes({1, 3, 227, 227}); manager.run_passes(function); } diff --git a/src/tests/functional/plugin/shared/include/behavior/plugin/auto_batching_tests.hpp b/src/tests/functional/plugin/shared/include/behavior/plugin/auto_batching_tests.hpp index 8ecb1440571..e2d754cc155 100644 --- a/src/tests/functional/plugin/shared/include/behavior/plugin/auto_batching_tests.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/plugin/auto_batching_tests.hpp @@ -14,6 +14,9 @@ #include "ov_models/subgraph_builders.hpp" #include "functional_test_utils/blob_utils.hpp" #include "base/behavior_test_utils.hpp" +#include "common_test_utils/subgraph_builders/single_conv.hpp" +#include "common_test_utils/subgraph_builders/detection_output.hpp" +#include "common_test_utils/subgraph_builders/multi_single_conv.hpp" using namespace ::testing; using namespace InferenceEngine; @@ -30,8 +33,8 @@ class AutoBatching_Test : public BehaviorTestsUtils::IEPluginTestBase, public testing::WithParamInterface { void SetUp() override { std::tie(target_device, use_get_blob, num_streams, num_requests, num_batch) = this->GetParam(); - fn_ptrs = {ngraph::builder::subgraph::makeSingleConv(), - ngraph::builder::subgraph::makeMultiSingleConv()}; + fn_ptrs = {ov::test::utils::make_single_conv(), + ov::test::utils::make_multi_single_conv()}; }; public: static std::string getTestCaseName(const testing::TestParamInfo &obj) { @@ -148,8 +151,8 @@ class AutoBatching_Test_DetectionOutput : public AutoBatching_Test { public: void SetUp() override { std::tie(target_device, use_get_blob, num_streams, num_requests, num_batch) = this->GetParam(); - fn_ptrs = {ngraph::builder::subgraph::makeDetectionOutput(), - ngraph::builder::subgraph::makeDetectionOutput()}; + fn_ptrs = {ov::test::utils::make_detection_output(), + ov::test::utils::make_detection_output()}; }; static std::string getTestCaseName(const testing::TestParamInfo &obj) { diff --git a/src/tests/functional/plugin/shared/include/behavior/plugin/caching_tests.hpp b/src/tests/functional/plugin/shared/include/behavior/plugin/caching_tests.hpp index 20d92306146..360b676a09c 100644 --- a/src/tests/functional/plugin/shared/include/behavior/plugin/caching_tests.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/plugin/caching_tests.hpp @@ -14,6 +14,7 @@ #include "common_test_utils/unicode_utils.hpp" #include "openvino/util/common_util.hpp" #include "base/behavior_test_utils.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" #include #include @@ -80,7 +81,7 @@ protected: std::tie(targetDevice, userConfig) = GetParam(); target_device = targetDevice; APIBaseTest::SetUp(); - function = ngraph::builder::subgraph::makeConvPoolRelu(); + function = ov::test::utils::make_conv_pool_relu(); configuration = userConfig.first; std::string ext = userConfig.second; std::string::size_type pos = 0; diff --git a/src/tests/functional/plugin/shared/include/behavior/plugin/configuration_tests.hpp b/src/tests/functional/plugin/shared/include/behavior/plugin/configuration_tests.hpp index 1524ab7bc6d..6f52af29956 100644 --- a/src/tests/functional/plugin/shared/include/behavior/plugin/configuration_tests.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/plugin/configuration_tests.hpp @@ -19,6 +19,7 @@ #include "common_test_utils/file_utils.hpp" #include "functional_test_utils/plugin_cache.hpp" #include "base/behavior_test_utils.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" namespace BehaviorTestsDefinitions { @@ -74,7 +75,7 @@ public: target_device = this->GetParam(); SKIP_IF_CURRENT_TEST_IS_DISABLED() APIBaseTest::SetUp(); - function = ngraph::builder::subgraph::makeConvPoolRelu(); + function = ov::test::utils::make_conv_pool_relu(); cnnNet = InferenceEngine::CNNNetwork(function); } }; @@ -139,7 +140,7 @@ public: std::tie(target_device, configuration) = this->GetParam(); SKIP_IF_CURRENT_TEST_IS_DISABLED(); APIBaseTest::SetUp(); - function = ngraph::builder::subgraph::makeConvPoolRelu(); + function = ov::test::utils::make_conv_pool_relu(); cnnNet = InferenceEngine::CNNNetwork(function); } @@ -164,7 +165,7 @@ public: std::tuple entry; std::tie(target_device, entry) = this->GetParam(); std::tie(key, value, reference) = entry; - function = ngraph::builder::subgraph::makeConvPoolRelu(); + function = ov::test::utils::make_conv_pool_relu(); cnnNet = InferenceEngine::CNNNetwork(function); } @@ -185,7 +186,7 @@ public: std::tie(target_device, key) = this->GetParam(); SKIP_IF_CURRENT_TEST_IS_DISABLED(); APIBaseTest::SetUp(); - function = ngraph::builder::subgraph::makeConvPoolRelu(); + function = ov::test::utils::make_conv_pool_relu(); cnnNet = InferenceEngine::CNNNetwork(function); } @@ -231,7 +232,7 @@ public: std::tie(target_device, configuration, loadNetWorkConfig) = this->GetParam(); SKIP_IF_CURRENT_TEST_IS_DISABLED(); APIBaseTest::SetUp(); - function = ngraph::builder::subgraph::makeConvPoolRelu(); + function = ov::test::utils::make_conv_pool_relu(); cnnNet = InferenceEngine::CNNNetwork(function); } diff --git a/src/tests/functional/plugin/shared/include/behavior/plugin/core_integration.hpp b/src/tests/functional/plugin/shared/include/behavior/plugin/core_integration.hpp index d49e0dfd17c..66aa7ea0078 100644 --- a/src/tests/functional/plugin/shared/include/behavior/plugin/core_integration.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/plugin/core_integration.hpp @@ -13,6 +13,7 @@ #include "common_test_utils/file_utils.hpp" #include "common_test_utils/unicode_utils.hpp" #include "openvino/util/file_util.hpp" +#include "common_test_utils/subgraph_builders/split_conv_concat.hpp" #ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT #include @@ -907,7 +908,7 @@ TEST_P(IEClassQueryNetworkTest, QueryNetworkHETEROWithBigDeviceIDThrows) { TEST(IEClassBasicTest, smoke_LoadNetworkToDefaultDeviceNoThrow) { SKIP_IF_CURRENT_TEST_IS_DISABLED() InferenceEngine::CNNNetwork actualCnnNetwork; - std::shared_ptr actualNetwork = ngraph::builder::subgraph::makeSplitConvConcat(); + std::shared_ptr actualNetwork = ov::test::utils::make_split_conv_concat(); ASSERT_NO_THROW(actualCnnNetwork = InferenceEngine::CNNNetwork(actualNetwork)); InferenceEngine::Core ie = BehaviorTestsUtils::createIECoreWithTemplate(); ASSERT_NO_THROW(ie.LoadNetwork(actualCnnNetwork)); diff --git a/src/tests/functional/plugin/shared/include/behavior/plugin/core_threading.hpp b/src/tests/functional/plugin/shared/include/behavior/plugin/core_threading.hpp index 34bc6b593e3..d4dee3c250a 100644 --- a/src/tests/functional/plugin/shared/include/behavior/plugin/core_threading.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/plugin/core_threading.hpp @@ -16,6 +16,7 @@ #include #include #include "base/behavior_test_utils.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" #include #include @@ -25,6 +26,11 @@ #include #include #include "base/ov_behavior_test_utils.hpp" +#include "common_test_utils/subgraph_builders/split_conv_concat.hpp" +#include "common_test_utils/subgraph_builders/split_multi_conv_concat.hpp" +#include "common_test_utils/subgraph_builders/single_conv.hpp" +#include "common_test_utils/subgraph_builders/multi_single_conv.hpp" +#include "common_test_utils/subgraph_builders/2_input_subtract.hpp" using Device = std::string; using Config = std::map; @@ -150,7 +156,7 @@ TEST_P(CoreThreadingTests, smoke_GetMetric) { // tested function: QueryNetwork TEST_P(CoreThreadingTests, smoke_QueryNetwork) { InferenceEngine::Core ie; - InferenceEngine::CNNNetwork network(ngraph::builder::subgraph::make2InputSubtract()); + InferenceEngine::CNNNetwork network(ov::test::utils::make_2_input_subtract()); ie.SetConfig(config, target_device); InferenceEngine::QueryNetworkResult refResult = ie.QueryNetwork(network, target_device); @@ -225,14 +231,14 @@ protected: void SetupNetworks() { if (modelClass == ModelClass::ConvPoolRelu) { for (unsigned i = 0; i < numThreads; i++) { - networks.emplace_back(InferenceEngine::CNNNetwork(ngraph::builder::subgraph::makeConvPoolRelu())); + networks.emplace_back(InferenceEngine::CNNNetwork(ov::test::utils::make_conv_pool_relu())); } } else { - networks.emplace_back(InferenceEngine::CNNNetwork(ngraph::builder::subgraph::make2InputSubtract())); - networks.emplace_back(InferenceEngine::CNNNetwork(ngraph::builder::subgraph::makeMultiSingleConv())); - networks.emplace_back(InferenceEngine::CNNNetwork(ngraph::builder::subgraph::makeSingleConv())); - networks.emplace_back(InferenceEngine::CNNNetwork(ngraph::builder::subgraph::makeSplitConvConcat())); - networks.emplace_back(InferenceEngine::CNNNetwork(ngraph::builder::subgraph::makeSplitMultiConvConcat())); + networks.emplace_back(InferenceEngine::CNNNetwork(ov::test::utils::make_2_input_subtract())); + networks.emplace_back(InferenceEngine::CNNNetwork(ov::test::utils::make_multi_single_conv())); + networks.emplace_back(InferenceEngine::CNNNetwork(ov::test::utils::make_single_conv())); + networks.emplace_back(InferenceEngine::CNNNetwork(ov::test::utils::make_split_conv_concat())); + networks.emplace_back(InferenceEngine::CNNNetwork(ov::test::utils::make_split_multi_conv_concat())); } } }; diff --git a/src/tests/functional/plugin/shared/src/behavior/compiled_model/properties.cpp b/src/tests/functional/plugin/shared/src/behavior/compiled_model/properties.cpp index 6fed553fef2..eaac5f85f31 100644 --- a/src/tests/functional/plugin/shared/src/behavior/compiled_model/properties.cpp +++ b/src/tests/functional/plugin/shared/src/behavior/compiled_model/properties.cpp @@ -7,6 +7,7 @@ #include #include "openvino/runtime/properties.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" #include @@ -74,7 +75,7 @@ void OVCompileModelGetExecutionDeviceTests::SetUp() { std::tie(target_device, userConfig) = GetParam(); compileModelProperties = userConfig.first; expectedDeviceName = userConfig.second; - model = ngraph::builder::subgraph::makeConvPoolRelu(); + model = ov::test::utils::make_conv_pool_relu(); } TEST_P(OVClassCompiledModelPropertiesTests, CanUseCache) { diff --git a/src/tests/functional/plugin/shared/src/behavior/ov_infer_request/io_tensor.cpp b/src/tests/functional/plugin/shared/src/behavior/ov_infer_request/io_tensor.cpp index c205ec0c1f4..c1bfefc2eb2 100644 --- a/src/tests/functional/plugin/shared/src/behavior/ov_infer_request/io_tensor.cpp +++ b/src/tests/functional/plugin/shared/src/behavior/ov_infer_request/io_tensor.cpp @@ -11,6 +11,9 @@ #include "openvino/op/parameter.hpp" #include "openvino/op/concat.hpp" #include "openvino/op/result.hpp" +#include "common_test_utils/subgraph_builders/multiple_input_outpput_double_concat.hpp" +#include "common_test_utils/subgraph_builders/single_split.hpp" +#include "common_test_utils/subgraph_builders/split_concat.hpp" namespace ov { namespace test { @@ -282,7 +285,7 @@ void OVInferRequestIOTensorSetPrecisionTest::SetUp() { std::tie(element_type, target_device, config) = this->GetParam(); SKIP_IF_CURRENT_TEST_IS_DISABLED() APIBaseTest::SetUp(); - function = ngraph::builder::subgraph::makeSplitConcat(); + function = ov::test::utils::make_split_concat(); execNet = core->compile_model(function, target_device, config); req = execNet.create_infer_request(); } @@ -384,7 +387,7 @@ void OVInferRequestCheckTensorPrecision::TearDown() { } TEST_P(OVInferRequestCheckTensorPrecision, getInputFromFunctionWithSingleInput) { - model = ngraph::builder::subgraph::makeSplitConcat({1, 4, 24, 24}, element_type); + model = ov::test::utils::make_split_concat({1, 4, 24, 24}, element_type); createInferRequest(); ov::Tensor tensor1, tensor2; @@ -400,7 +403,7 @@ TEST_P(OVInferRequestCheckTensorPrecision, getInputFromFunctionWithSingleInput) } TEST_P(OVInferRequestCheckTensorPrecision, getOutputFromFunctionWithSingleInput) { - model = ngraph::builder::subgraph::makeSplitConcat({1, 4, 24, 24}, element_type); + model = ov::test::utils::make_split_concat({1, 4, 24, 24}, element_type); createInferRequest(); ov::Tensor tensor1, tensor2; @@ -416,7 +419,7 @@ TEST_P(OVInferRequestCheckTensorPrecision, getOutputFromFunctionWithSingleInput) } TEST_P(OVInferRequestCheckTensorPrecision, getInputsFromFunctionWithSeveralInputs) { - model = ngraph::builder::subgraph::makeMultipleInputOutputDoubleConcat({1, 1, 32, 32}, element_type); + model = ov::test::utils::make_multiple_input_output_double_concat({1, 1, 32, 32}, element_type); createInferRequest(); ov::Tensor tensor1, tensor2; @@ -447,7 +450,7 @@ TEST_P(OVInferRequestCheckTensorPrecision, getInputsFromFunctionWithSeveralInput } TEST_P(OVInferRequestCheckTensorPrecision, getOutputsFromFunctionWithSeveralOutputs) { - model = ngraph::builder::subgraph::makeMultipleInputOutputDoubleConcat({1, 1, 32, 32}, element_type); + model = ov::test::utils::make_multiple_input_output_double_concat({1, 1, 32, 32}, element_type); createInferRequest(); ov::Tensor tensor1, tensor2; @@ -478,7 +481,7 @@ TEST_P(OVInferRequestCheckTensorPrecision, getOutputsFromFunctionWithSeveralOutp } TEST_P(OVInferRequestCheckTensorPrecision, getOutputsFromSplitFunctionWithSeveralOutputs) { - model = ngraph::builder::subgraph::makeSingleSplit({1, 4, 24, 24}, element_type); + model = ov::test::utils::make_single_split({1, 4, 24, 24}, element_type); createInferRequest(); ov::Tensor tensor1, tensor2; diff --git a/src/tests/functional/plugin/shared/src/behavior/ov_infer_request/perf_counters.cpp b/src/tests/functional/plugin/shared/src/behavior/ov_infer_request/perf_counters.cpp index e5023c6e2f5..d32c0667cfd 100644 --- a/src/tests/functional/plugin/shared/src/behavior/ov_infer_request/perf_counters.cpp +++ b/src/tests/functional/plugin/shared/src/behavior/ov_infer_request/perf_counters.cpp @@ -5,6 +5,7 @@ #include "behavior/ov_infer_request/perf_counters.hpp" #include "openvino/runtime/profiling_info.hpp" +#include "common_test_utils/subgraph_builders/concat_with_params.hpp" namespace ov { namespace test { @@ -13,7 +14,7 @@ void OVInferRequestPerfCountersTest::SetUp() { std::tie(target_device, configuration) = this->GetParam(); SKIP_IF_CURRENT_TEST_IS_DISABLED() APIBaseTest::SetUp(); - function = ngraph::builder::subgraph::makeConcatWithParams(); + function = ov::test::utils::make_concat_with_params(); configuration.insert(ov::enable_profiling(true)); execNet = core->compile_model(function, target_device, configuration); req = execNet.create_infer_request(); diff --git a/src/tests/functional/plugin/shared/src/behavior/ov_plugin/caching_tests.cpp b/src/tests/functional/plugin/shared/src/behavior/ov_plugin/caching_tests.cpp index ab8b5602224..7496cc9d5fd 100644 --- a/src/tests/functional/plugin/shared/src/behavior/ov_plugin/caching_tests.cpp +++ b/src/tests/functional/plugin/shared/src/behavior/ov_plugin/caching_tests.cpp @@ -13,12 +13,22 @@ #include "common_test_utils/file_utils.hpp" #include "functional_test_utils/skip_tests_config.hpp" #include "functional_test_utils/summary/api_summary.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" #include "ov_models/builders.hpp" #include "ov_models/subgraph_builders.hpp" #include "cpp_interfaces/interface/ie_internal_plugin_config.hpp" #include "openvino/core/node_vector.hpp" #include "openvino/op/parameter.hpp" +#include "common_test_utils/subgraph_builders/split_conv_concat.hpp" +#include "common_test_utils/subgraph_builders/kso_func.hpp" +#include "common_test_utils/subgraph_builders/ti_with_lstm_cell.hpp" +#include "common_test_utils/subgraph_builders/single_conv.hpp" +#include "common_test_utils/subgraph_builders/2_input_subtract.hpp" +#include "common_test_utils/subgraph_builders/nested_split_conv_concat.hpp" +#include "common_test_utils/subgraph_builders/conv_bias.hpp" +#include "common_test_utils/subgraph_builders/read_concat_split_assign.hpp" +#include "common_test_utils/subgraph_builders/matmul_bias.hpp" #define GTEST_COUT std::cout << "[ ] [ INFO ] " @@ -77,37 +87,37 @@ std::vector CompileModelCacheTestBase::getNumericTypeOnlyFuncti res.push_back(ovModelWithName { simple_function_multiply, "SimpleFunctionMultiply"}); res.push_back(ovModelWithName { simple_function_relu, "SimpleFunctionRelu"}); res.push_back(ovModelWithName { - inputShapeWrapper(ngraph::builder::subgraph::makeConvPoolRelu, {1, 1, 32, 32}), + inputShapeWrapper(ov::test::utils::make_conv_pool_relu, {1, 1, 32, 32}), "ConvPoolRelu"}); res.push_back(ovModelWithName { - inputShapeWrapper(ngraph::builder::subgraph::makeSplitConvConcat, {1, 4, 20, 20}), + inputShapeWrapper(ov::test::utils::make_split_conv_concat, {1, 4, 20, 20}), "SplitConvConcat"}); res.push_back(ovModelWithName { - inputShapeWrapper(ngraph::builder::subgraph::makeKSOFunction, {1, 4, 20, 20}), + inputShapeWrapper(ov::test::utils::make_kso_function, {1, 4, 20, 20}), "KSOFunction"}); res.push_back(ovModelWithName { - inputShapeWrapper(ngraph::builder::subgraph::makeSingleConv, {1, 3, 24, 24}), + inputShapeWrapper(ov::test::utils::make_single_conv, {1, 3, 24, 24}), "SingleConv"}); res.push_back(ovModelWithName { - inputShapeWrapper(ngraph::builder::subgraph::make2InputSubtract, {1, 3, 24, 24}), + inputShapeWrapper(ov::test::utils::make_2_input_subtract, {1, 3, 24, 24}), "2InputSubtract"}); res.push_back(ovModelWithName { - inputShapeWrapper(ngraph::builder::subgraph::makeNestedSplitConvConcat, {1, 4, 20, 20}), + inputShapeWrapper(ov::test::utils::make_nested_split_conv_concat, {1, 4, 20, 20}), "NestedSplitConvConcat"}); res.push_back(ovModelWithName { - inputShapeWrapper(ngraph::builder::subgraph::makeSplitConvConcatInputInBranch, {1, 4, 20, 20}), + inputShapeWrapper(ov::test::utils::make_cplit_conv_concat_input_in_branch, {1, 4, 20, 20}), "SplitConvConcatInputInBranch"}); res.push_back(ovModelWithName { - inputShapeWrapper(ngraph::builder::subgraph::makeSplitConvConcatNestedInBranch, {1, 4, 20, 20}), + inputShapeWrapper(ov::test::utils::make_cplit_conv_concat_nested_in_branch, {1, 4, 20, 20}), "SplitConvConcatNestedInBranch"}); res.push_back(ovModelWithName { - inputShapeWrapper(ngraph::builder::subgraph::makeSplitConvConcatNestedInBranchNestedOut, {1, 4, 20, 20}), + inputShapeWrapper(ov::test::utils::make_cplit_conv_concat_nested_in_branch_nested_out, {1, 4, 20, 20}), "SplitConvConcatNestedInBranchNestedOut"}); res.push_back(ovModelWithName { - inputShapeWrapper(ngraph::builder::subgraph::makeConvBias, {1, 3, 24, 24}), + inputShapeWrapper(ov::test::utils::make_conv_bias, {1, 3, 24, 24}), "ConvBias"}); res.push_back(ovModelWithName{ - inputShapeWrapper(ngraph::builder::subgraph::makeMatMulBias, {1, 3, 24, 24}), + inputShapeWrapper(ov::test::utils::make_matmul_bias, {1, 3, 24, 24}), "MatMulBias" }); return res; } @@ -115,7 +125,7 @@ std::vector CompileModelCacheTestBase::getNumericTypeOnlyFuncti std::vector CompileModelCacheTestBase::getAnyTypeOnlyFunctions() { std::vector res; res.push_back(ovModelWithName { - inputShapeWrapper(ngraph::builder::subgraph::makeReadConcatSplitAssign, {1, 1, 2, 4}), + inputShapeWrapper(ov::test::utils::make_read_concat_split_assign, {1, 1, 2, 4}), "ReadConcatSplitAssign"}); return res; } @@ -123,7 +133,7 @@ std::vector CompileModelCacheTestBase::getAnyTypeOnlyFunctions( std::vector CompileModelCacheTestBase::getFloatingPointOnlyFunctions() { std::vector res; res.push_back(ovModelWithName { [](ngraph::element::Type type, size_t batchSize) { - return ngraph::builder::subgraph::makeTIwithLSTMcell(type, batchSize); + return ov::test::utils::make_ti_with_lstm_cell(type, batchSize); }, "TIwithLSTMcell1"}); return res; } @@ -293,8 +303,7 @@ void CompileModelLoadFromFileTestBase::SetUp() { core->set_property(ov::cache_dir()); ov::pass::Manager manager; manager.register_pass(m_modelName, m_weightsName); - manager.run_passes(ngraph::builder::subgraph::makeConvPoolRelu( - {1, 3, 227, 227}, InferenceEngine::details::convertPrecision(InferenceEngine::Precision::FP32))); + manager.run_passes(ov::test::utils::make_conv_pool_relu({1, 3, 227, 227}, ov::element::f32)); } void CompileModelLoadFromFileTestBase::TearDown() { @@ -376,9 +385,7 @@ void CompileModelLoadFromMemoryTestBase::SetUp() { core->set_property(ov::cache_dir()); ov::pass::Manager manager; manager.register_pass(m_modelName, m_weightsName); - manager.run_passes(ngraph::builder::subgraph::makeConvPoolRelu( - {1, 3, 227, 227}, - InferenceEngine::details::convertPrecision(InferenceEngine::Precision::FP32))); + manager.run_passes(ov::test::utils::make_conv_pool_relu({1, 3, 227, 227}, ov::element::f32)); try { std::ifstream model_file(m_modelName, std::ios::binary); @@ -500,7 +507,7 @@ std::string CompiledKernelsCacheTest::getTestCaseName(testing::TestParamInfo userConfig; std::tie(targetDevice, userConfig) = GetParam(); target_device = targetDevice; diff --git a/src/tests/functional/plugin/shared/src/behavior/ov_plugin/life_time.cpp b/src/tests/functional/plugin/shared/src/behavior/ov_plugin/life_time.cpp index 9e2c472e30a..690acee8afd 100644 --- a/src/tests/functional/plugin/shared/src/behavior/ov_plugin/life_time.cpp +++ b/src/tests/functional/plugin/shared/src/behavior/ov_plugin/life_time.cpp @@ -6,6 +6,7 @@ #include #include "behavior/ov_plugin/life_time.hpp" +#include "common_test_utils/subgraph_builders/split_concat.hpp" namespace ov { namespace test { @@ -24,7 +25,7 @@ void OVHoldersTest::SetUp() { if (deathTestStyle == "fast") { ::testing::GTEST_FLAG(death_test_style) = "threadsafe"; } - function = ngraph::builder::subgraph::makeSplitConcat(); + function = ov::test::utils::make_split_concat(); } void OVHoldersTest::TearDown() { @@ -139,7 +140,7 @@ void OVHoldersTestOnImportedNetwork::SetUp() { if (deathTestStyle == "fast") { ::testing::GTEST_FLAG(death_test_style) = "threadsafe"; } - function = ngraph::builder::subgraph::makeSplitConcat(); + function = ov::test::utils::make_split_concat(); } void OVHoldersTestOnImportedNetwork::TearDown() { diff --git a/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp b/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp index b320b821675..cf1566dc5e4 100644 --- a/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp +++ b/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp @@ -2,9 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // +#include + #include "behavior/ov_plugin/properties_tests.hpp" #include "openvino/runtime/properties.hpp" -#include +#include "common_test_utils/subgraph_builders/split_concat.hpp" namespace ov { namespace test { @@ -27,7 +29,7 @@ void OVPropertiesTests::SetUp() { std::tie(target_device, properties) = this->GetParam(); APIBaseTest::SetUp(); SKIP_IF_CURRENT_TEST_IS_DISABLED(); - model = ngraph::builder::subgraph::makeSplitConcat(); + model = ov::test::utils::make_split_concat(); } void OVPropertiesTests::TearDown() { @@ -57,7 +59,7 @@ std::string OVSetPropComplieModleGetPropTests::getTestCaseName(testing::TestPara void OVSetPropComplieModleGetPropTests::SetUp() { SKIP_IF_CURRENT_TEST_IS_DISABLED(); std::tie(target_device, properties, compileModelProperties) = this->GetParam(); - model = ngraph::builder::subgraph::makeSplitConcat(); + model = ov::test::utils::make_split_concat(); } std::string OVPropertiesTestsWithCompileModelProps::getTestCaseName(testing::TestParamInfo obj) { @@ -96,7 +98,7 @@ void OVPropertiesTestsWithCompileModelProps::SetUp() { compileModelProperties = {{ CONFIG_KEY(AUTO_BATCH_DEVICE_CONFIG) , hw_device}}; } - model = ngraph::builder::subgraph::makeSplitConcat(); + model = ov::test::utils::make_split_concat(); APIBaseTest::SetUp(); } diff --git a/src/tests/functional/plugin/shared/src/behavior/ov_plugin/remote.cpp b/src/tests/functional/plugin/shared/src/behavior/ov_plugin/remote.cpp index 932a8163e82..48abe578a6d 100644 --- a/src/tests/functional/plugin/shared/src/behavior/ov_plugin/remote.cpp +++ b/src/tests/functional/plugin/shared/src/behavior/ov_plugin/remote.cpp @@ -5,7 +5,7 @@ #include "behavior/ov_plugin/remote.hpp" #include "transformations/utils/utils.hpp" #include "functional_test_utils/skip_tests_config.hpp" -#include "ov_models/subgraph_builders.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" namespace ov { namespace test { @@ -45,7 +45,7 @@ void OVRemoteTest::SetUp() { std::pair param_pair; std::tie(element_type, target_device, config, param_pair) = GetParam(); std::tie(context_parameters, tensor_parameters) = param_pair; - function = ngraph::builder::subgraph::makeConvPoolRelu({1, 1, 32, 32}, element_type); + function = ov::test::utils::make_conv_pool_relu({1, 1, 32, 32}, element_type); exec_network = core.compile_model(function, target_device, config); infer_request = exec_network.create_infer_request(); input = function->get_parameters().front(); diff --git a/src/tests/functional/plugin/shared/src/behavior/plugin/caching_tests.cpp b/src/tests/functional/plugin/shared/src/behavior/plugin/caching_tests.cpp index 3ca54eb5c80..ad67be003a9 100644 --- a/src/tests/functional/plugin/shared/src/behavior/plugin/caching_tests.cpp +++ b/src/tests/functional/plugin/shared/src/behavior/plugin/caching_tests.cpp @@ -10,6 +10,14 @@ #include "common_test_utils/file_utils.hpp" #include "ov_models/builders.hpp" #include "ov_models/subgraph_builders.hpp" +#include "common_test_utils/subgraph_builders/split_conv_concat.hpp" +#include "common_test_utils/subgraph_builders/kso_func.hpp" +#include "common_test_utils/subgraph_builders/ti_with_lstm_cell.hpp" +#include "common_test_utils/subgraph_builders/single_conv.hpp" +#include "common_test_utils/subgraph_builders/2_input_subtract.hpp" +#include "common_test_utils/subgraph_builders/nested_split_conv_concat.hpp" +#include "common_test_utils/subgraph_builders/conv_bias.hpp" +#include "common_test_utils/subgraph_builders/matmul_bias.hpp" using namespace InferenceEngine::details; using namespace InferenceEngine; @@ -72,34 +80,34 @@ std::vector LoadNetworkCacheTestBase::getNumericTypeOnly inputShapeWrapper(ngraph::builder::subgraph::makeConvPoolRelu, {1, 1, 32, 32}), "ConvPoolRelu"}); res.push_back(nGraphFunctionWithName { - inputShapeWrapper(ngraph::builder::subgraph::makeSplitConvConcat, {1, 4, 20, 20}), + inputShapeWrapper(ov::test::utils::make_split_conv_concat, {1, 4, 20, 20}), "SplitConvConcat"}); res.push_back(nGraphFunctionWithName { - inputShapeWrapper(ngraph::builder::subgraph::makeKSOFunction, {1, 4, 20, 20}), + inputShapeWrapper(ov::test::utils::make_kso_function, {1, 4, 20, 20}), "KSOFunction"}); res.push_back(nGraphFunctionWithName { - inputShapeWrapper(ngraph::builder::subgraph::makeSingleConv, {1, 3, 24, 24}), + inputShapeWrapper(ov::test::utils::make_single_conv, {1, 3, 24, 24}), "SingleConv"}); res.push_back(nGraphFunctionWithName { - inputShapeWrapper(ngraph::builder::subgraph::make2InputSubtract, {1, 3, 24, 24}), + inputShapeWrapper(ov::test::utils::make_2_input_subtract, {1, 3, 24, 24}), "2InputSubtract"}); res.push_back(nGraphFunctionWithName { - inputShapeWrapper(ngraph::builder::subgraph::makeNestedSplitConvConcat, {1, 4, 20, 20}), + inputShapeWrapper(ov::test::utils::make_nested_split_conv_concat, {1, 4, 20, 20}), "NestedSplitConvConcat"}); res.push_back(nGraphFunctionWithName { - inputShapeWrapper(ngraph::builder::subgraph::makeSplitConvConcatInputInBranch, {1, 4, 20, 20}), + inputShapeWrapper(ov::test::utils::make_cplit_conv_concat_input_in_branch, {1, 4, 20, 20}), "SplitConvConcatInputInBranch"}); res.push_back(nGraphFunctionWithName { - inputShapeWrapper(ngraph::builder::subgraph::makeSplitConvConcatNestedInBranch, {1, 4, 20, 20}), + inputShapeWrapper(ov::test::utils::make_cplit_conv_concat_nested_in_branch, {1, 4, 20, 20}), "SplitConvConcatNestedInBranch"}); res.push_back(nGraphFunctionWithName { - inputShapeWrapper(ngraph::builder::subgraph::makeSplitConvConcatNestedInBranchNestedOut, {1, 4, 20, 20}), + inputShapeWrapper(ov::test::utils::make_cplit_conv_concat_nested_in_branch_nested_out, {1, 4, 20, 20}), "SplitConvConcatNestedInBranchNestedOut"}); res.push_back(nGraphFunctionWithName { - inputShapeWrapper(ngraph::builder::subgraph::makeConvBias, {1, 3, 24, 24}), + inputShapeWrapper(ov::test::utils::make_conv_bias, {1, 3, 24, 24}), "ConvBias"}); res.push_back(nGraphFunctionWithName{ - inputShapeWrapper(ngraph::builder::subgraph::makeMatMulBias, {1, 3, 24, 24}), + inputShapeWrapper(ov::test::utils::make_matmul_bias, {1, 3, 24, 24}), "MatMulBias" }); return res; } @@ -113,7 +121,7 @@ std::vector LoadNetworkCacheTestBase::getAnyTypeOnlyFunc std::vector LoadNetworkCacheTestBase::getFloatingPointOnlyFunctions() { std::vector res; res.push_back(nGraphFunctionWithName { [](ngraph::element::Type type, size_t batchSize) { - return ngraph::builder::subgraph::makeTIwithLSTMcell(type, batchSize); + return ov::test::utils::make_ti_with_lstm_cell(type, batchSize); }, "TIwithLSTMcell1"}); return res; } diff --git a/src/tests/functional/plugin/shared/src/behavior/plugin/hetero_synthetic.cpp b/src/tests/functional/plugin/shared/src/behavior/plugin/hetero_synthetic.cpp index bd165465edc..5e257bee490 100644 --- a/src/tests/functional/plugin/shared/src/behavior/plugin/hetero_synthetic.cpp +++ b/src/tests/functional/plugin/shared/src/behavior/plugin/hetero_synthetic.cpp @@ -10,15 +10,19 @@ #include "openvino/util/file_util.hpp" #include #include "ie_algorithm.hpp" +#include "common_test_utils/subgraph_builders/split_conv_concat.hpp" +#include "common_test_utils/subgraph_builders/split_multi_conv_concat.hpp" +#include "common_test_utils/subgraph_builders/nested_branch_conv_concat.hpp" +#include "common_test_utils/subgraph_builders/nested_split_conv_concat.hpp" namespace HeteroTests { static std::vector()>> builders = { - [] {return ngraph::builder::subgraph::makeSplitMultiConvConcat();}, - [] {return ngraph::builder::subgraph::makeNestedSplitConvConcat();}, - [] {return ngraph::builder::subgraph::makeSplitConvConcatNestedInBranch();}, - [] {return ngraph::builder::subgraph::makeSplitConvConcatNestedInBranchNestedOut();}, - [] {return ngraph::builder::subgraph::makeNestedBranchConvConcat();}, + [] {return ov::test::utils::make_split_multi_conv_concat();}, + [] {return ov::test::utils::make_nested_split_conv_concat();}, + [] {return ov::test::utils::make_cplit_conv_concat_nested_in_branch();}, + [] {return ov::test::utils::make_cplit_conv_concat_nested_in_branch_nested_out();}, + [] {return ov::test::utils::make_nested_branch_conv_concat();}, }; std::vector HeteroSyntheticTest::withMajorNodesFunctions( diff --git a/src/tests/functional/plugin/shared/src/behavior/plugin/life_time.cpp b/src/tests/functional/plugin/shared/src/behavior/plugin/life_time.cpp index af13b3bfe51..646ee9598e2 100644 --- a/src/tests/functional/plugin/shared/src/behavior/plugin/life_time.cpp +++ b/src/tests/functional/plugin/shared/src/behavior/plugin/life_time.cpp @@ -4,7 +4,7 @@ #include -#include +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" #include #include "behavior/plugin/life_time.hpp" @@ -31,7 +31,7 @@ namespace BehaviorTestsDefinitions { std::tie(target_device, order) = this->GetParam(); APIBaseTest::SetUp(); SKIP_IF_CURRENT_TEST_IS_DISABLED(); - function = ngraph::builder::subgraph::makeConvPoolRelu(); + function = ov::test::utils::make_conv_pool_relu(); } void release_order_test(std::vector order, const std::string &target_device, @@ -109,7 +109,7 @@ namespace BehaviorTestsDefinitions { void HoldersTestOnImportedNetwork::SetUp() { target_device = this->GetParam(); APIBaseTest::SetUp(); - function = ngraph::builder::subgraph::makeConvPoolRelu(); + function = ov::test::utils::make_conv_pool_relu(); SKIP_IF_CURRENT_TEST_IS_DISABLED(); } diff --git a/src/tests/functional/plugin/shared/src/behavior/plugin/stress_tests.cpp b/src/tests/functional/plugin/shared/src/behavior/plugin/stress_tests.cpp index 94a017ae58e..3be75d71952 100644 --- a/src/tests/functional/plugin/shared/src/behavior/plugin/stress_tests.cpp +++ b/src/tests/functional/plugin/shared/src/behavior/plugin/stress_tests.cpp @@ -4,6 +4,7 @@ #include "behavior/plugin/stress_tests.hpp" #include "ov_models/subgraph_builders.hpp" +#include "common_test_utils/subgraph_builders/split_conv_concat.hpp" namespace LayerTestsDefinitions { @@ -21,7 +22,7 @@ std::string MultipleAllocations::getTestCaseName(const testing::TestParamInfoGetParam(); - function = ngraph::builder::subgraph::makeSplitConvConcat(); + function = ov::test::utils::make_split_conv_concat(); } TEST_P(MultipleAllocations, InferWorksCorrectAfterAllocations) { diff --git a/src/tests/ov_helpers/ov_models/include/ov_models/subgraph_builders.hpp b/src/tests/ov_helpers/ov_models/include/ov_models/subgraph_builders.hpp index 65e424a77fc..fe1c8d53950 100644 --- a/src/tests/ov_helpers/ov_models/include/ov_models/subgraph_builders.hpp +++ b/src/tests/ov_helpers/ov_models/include/ov_models/subgraph_builders.hpp @@ -16,9 +16,6 @@ namespace subgraph { std::shared_ptr makeConvPoolRelu(std::vector inputShape = {1, 1, 32, 32}, ov::element::Type_t ngPrc = ov::element::Type_t::f32); -std::shared_ptr makeConvPoolReluNoReshapes(std::vector inputShape = {1, 1, 32, 32}, - ov::element::Type_t ngPrc = ov::element::Type_t::f32); - std::shared_ptr makeConvPool2Relu2(std::vector inputShape = {1, 1, 32, 32}, ov::element::Type_t ngPrc = ov::element::Type_t::f32); @@ -31,73 +28,11 @@ std::shared_ptr makeSplitConvConcat(std::vector inputShape = std::shared_ptr makeKSOFunction(std::vector inputShape = {1, 4, 20, 20}, ov::element::Type_t ngPrc = ov::element::Type_t::f32); -std::shared_ptr makeSplitMultiConvConcat(std::vector inputShape = {1, 4, 20, 20}, - ov::element::Type_t ngPrc = ov::element::Type_t::f32); - -std::shared_ptr makeTIwithLSTMcell(ov::element::Type_t ngPRC = ov::element::Type_t::f32, - size_t N = 32, // Batch size - size_t L = 10, // Sequence length - size_t I = 8, // Input size - size_t H = 32); // Hidden size - -std::shared_ptr makeSingleConv(std::vector inputShape = {1, 3, 24, 24}, - ov::element::Type_t type = ov::element::Type_t::f32); - -std::shared_ptr makeDetectionOutput(ov::element::Type_t type = ov::element::Type_t::f32); - -std::shared_ptr makeMultiSingleConv(std::vector inputShape = {1, 3, 24, 24}, - ov::element::Type type = ov::element::Type_t::f32); - -std::shared_ptr make2InputSubtract(std::vector inputShape = {1, 3, 24, 24}, - ov::element::Type_t type = ov::element::Type_t::f32); - -std::shared_ptr makeNestedBranchConvConcat(std::vector inputShape = {1, 4, 20, 20}, - ov::element::Type ngPrc = ov::element::Type_t::f32); - -std::shared_ptr makeNestedSplitConvConcat(std::vector inputShape = {1, 4, 20, 20}, - ov::element::Type ngPrc = ov::element::Type_t::f32); - -std::shared_ptr makeSplitConvConcatInputInBranch(std::vector inputShape = {1, 4, 20, 20}, - ov::element::Type ngPrc = ov::element::Type_t::f32); - -std::shared_ptr makeSplitConvConcatNestedInBranch(std::vector inputShape = {1, 4, 20, 20}, - ov::element::Type ngPrc = ov::element::Type_t::f32); - -std::shared_ptr makeSplitConvConcatNestedInBranchNestedOut( - std::vector inputShape = {1, 4, 20, 20}, - ov::element::Type ngPrc = ov::element::Type_t::f32); - -std::shared_ptr makeConvBias(std::vector inputShape = {1, 3, 24, 24}, - ov::element::Type type = ov::element::Type_t::f32); - -std::shared_ptr makeReadConcatSplitAssign(std::vector inputShape = {1, 1, 2, 4}, - ov::element::Type type = ov::element::Type_t::f32); - -std::shared_ptr makeMatMulBias(std::vector inputShape = {1, 3, 24, 24}, - ov::element::Type type = ov::element::Type_t::f32); - -std::shared_ptr makeConvertTranspose(std::vector inputShape = {1, 3, 24, 24}, - std::vector inputOrder = {0, 1, 2, 3}, - ov::element::Type type = ov::element::Type_t::f32); - -std::shared_ptr makeMultipleInputOutputReLU(std::vector inputShape = {1, 1, 32, 32}, - ov::element::Type_t type = ov::element::Type_t::f32); - -std::shared_ptr makeMultipleInputOutputDoubleConcat(std::vector inputShape = {1, 1, 32, 32}, - ov::element::Type_t type = ov::element::Type_t::f32); - std::shared_ptr makeSingleConcatWithConstant(std::vector inputShape = {1, 1, 2, 4}, ov::element::Type type = ov::element::Type_t::f32); std::shared_ptr makeConcatWithParams(std::vector inputShape = {1, 1, 32, 32}, ov::element::Type_t type = ov::element::Type_t::f32); - -std::shared_ptr makeSingleSplit(std::vector inputShape = {1, 4, 32, 32}, - ov::element::Type_t type = ov::element::Type_t::f32); - -std::shared_ptr makeSplitConcat(std::vector inputShape = {1, 4, 24, 24}, - ov::element::Type_t type = ov::element::Type_t::f32); - } // namespace subgraph } // namespace builder } // namespace ngraph diff --git a/src/tests/ov_helpers/ov_models/src/subgraph_builders.cpp b/src/tests/ov_helpers/ov_models/src/subgraph_builders.cpp index bde40117899..f8cd46cdffe 100644 --- a/src/tests/ov_helpers/ov_models/src/subgraph_builders.cpp +++ b/src/tests/ov_helpers/ov_models/src/subgraph_builders.cpp @@ -78,40 +78,6 @@ std::shared_ptr makeConvPoolRelu(std::vector inputShape, ov:: return fnPtr; } -std::shared_ptr makeConvPoolReluNoReshapes(std::vector inputShape, ov::element::Type_t ngPrc) { - ov::ParameterVector params{std::make_shared(ngPrc, ov::Shape(inputShape))}; - params.front()->set_friendly_name("Param_1"); - params.front()->output(0).get_tensor().set_names({"data"}); - auto conv1 = ngraph::builder::makeConvolution(params.front(), - ngPrc, - {1, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 4); - conv1->set_friendly_name("Conv_1"); - conv1->output(0).get_tensor().set_names({"conv"}); - std::vector stride{1, 1}, padB{0, 0}, padE = padB, kernel{1, 2}; - auto pool1 = std::make_shared(conv1, - stride, - padB, - padE, - kernel, - ov::op::RoundingType::FLOOR, - ov::op::PadType::EXPLICIT); - pool1->output(0).get_tensor().set_names({"pool"}); - pool1->set_friendly_name("Pool_1"); - auto relu1 = std::make_shared(pool1); - relu1->set_friendly_name("Relu_1"); - relu1->output(0).get_tensor().set_names({"relu"}); - ov::Shape reluShape = relu1->outputs()[0].get_tensor().get_shape(); - ov::ResultVector results{std::make_shared(relu1)}; - std::shared_ptr fnPtr = std::make_shared(results, params); - return fnPtr; -} - std::shared_ptr makeConvPool2Relu2(std::vector inputShape, ov::element::Type_t ngPrc) { ov::ParameterVector params{std::make_shared(ngPrc, ov::Shape(inputShape))}; params.front()->set_friendly_name("Param_1"); @@ -297,1058 +263,6 @@ std::shared_ptr makeKSOFunction(std::vector inputShape, ov::e return fnPtr; } -std::shared_ptr makeSplitMultiConvConcat(std::vector inputShape, ov::element::Type_t ngPrc) { - ov::ParameterVector params{std::make_shared(ngPrc, ov::Shape(inputShape))}; - params.front()->set_friendly_name("Param_1"); - params.front()->get_output_tensor(0).set_names({"input_tensor"}); - auto split_axis_op = - std::make_shared(ov::element::Type_t::i64, ov::Shape{}, std::vector{1}); - auto split = std::make_shared(params[0], split_axis_op, 2); - - auto conv1_0 = ngraph::builder::makeConvolution(split->output(0), - ngPrc, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto relu1_0 = std::make_shared(conv1_0); - auto conv1_1 = ngraph::builder::makeConvolution(relu1_0, - ngPrc, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto relu1_1 = std::make_shared(conv1_1); - auto conv1_2 = ngraph::builder::makeConvolution(relu1_1, - ngPrc, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto relu1_2 = std::make_shared(conv1_2); - auto conv1_3 = ngraph::builder::makeConvolution(relu1_2, - ngPrc, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto relu1_3 = std::make_shared(conv1_3); - auto conv1_4 = ngraph::builder::makeConvolution(relu1_2, - ngPrc, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto relu1_4 = std::make_shared(conv1_4); - - auto conv2_0 = ngraph::builder::makeConvolution(split->output(1), - ngPrc, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto relu2_0 = std::make_shared(conv2_0); - auto conv2_1 = ngraph::builder::makeConvolution(relu2_0, - ngPrc, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto relu2_1 = std::make_shared(conv2_1); - auto conv2_2 = ngraph::builder::makeConvolution(relu2_1, - ngPrc, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto relu2_2 = std::make_shared(conv2_2); - auto conv2_3 = ngraph::builder::makeConvolution(relu2_2, - ngPrc, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto relu2_3 = std::make_shared(conv2_3); - auto conv2_4 = ngraph::builder::makeConvolution(relu2_2, - ngPrc, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto relu2_4 = std::make_shared(conv2_4); - - auto concat = std::make_shared(ov::OutputVector{relu1_4->output(0), relu2_4->output(0)}, 1); - ov::ResultVector results{std::make_shared(concat)}; - std::shared_ptr fnPtr = std::make_shared(results, params); - fnPtr->set_friendly_name("SplitMultiConvConcat"); - return fnPtr; -} - -std::shared_ptr makeTIwithLSTMcell(ov::element::Type_t ngPRC, size_t N, size_t L, size_t I, size_t H) { - auto SENT = std::make_shared(ngPRC, ov::Shape{N, L, I}); - - auto H_init = std::make_shared(ngPRC, ov::Shape{N, 1, H}); - auto C_init = std::make_shared(ngPRC, ov::Shape{N, 1, H}); - - auto H_t = std::make_shared(ngPRC, ov::Shape{N, 1, H}); - auto C_t = std::make_shared(ngPRC, ov::Shape{N, 1, H}); - - // Body - auto X = std::make_shared(ngPRC, ov::Shape{N, 1, I}); - std::vector dataW(4 * H * I, 0); - auto W_body = std::make_shared(ngPRC, ov::Shape{4 * H, I}, dataW); - std::vector dataR(4 * H * H, 0); - auto R_body = std::make_shared(ngPRC, ov::Shape{4 * H, H}, dataR); - std::vector inShape = {N, H}; - auto constantH = std::make_shared(ov::element::i64, ov::Shape{2}, inShape); - inShape = {N, I}; - auto constantX = std::make_shared(ov::element::i64, ov::Shape{2}, inShape); - auto LSTM_cell = - std::make_shared(std::make_shared(X, constantX, false), - std::make_shared(H_t, constantH, false), - std::make_shared(C_t, constantH, false), - W_body, - R_body, - H); - inShape = {N, 1, H}; - auto constantHo = std::make_shared(ov::element::i64, ov::Shape{3}, inShape); - auto H_o = std::make_shared(LSTM_cell->output(0), constantHo, false); - auto C_o = std::make_shared(LSTM_cell->output(1), constantHo, false); - auto body = std::make_shared(ov::OutputVector{H_o, C_o}, ov::ParameterVector{X, H_t, C_t}); - - auto tensor_iterator = std::make_shared(); - tensor_iterator->set_body(body); - // start=0, stride=1, part_size=1, end=39, axis=1 - tensor_iterator->set_sliced_input(X, SENT, 0, 1, 1, -1, 1); - // H_t is Hinit on the first iteration, Ho after that - tensor_iterator->set_merged_input(H_t, H_init, H_o); - tensor_iterator->set_merged_input(C_t, C_init, C_o); - - // Output 0 is last Ho, result 0 of body - auto out0 = tensor_iterator->get_iter_value(H_o, -1); - // Output 1 is last Co, result 1 of body - auto out1 = tensor_iterator->get_iter_value(C_o, -1); - - auto results = - ov::ResultVector{std::make_shared(out0), std::make_shared(out1)}; - auto fn_ptr = std::make_shared(results, ov::ParameterVector{SENT, H_init, C_init}); - fn_ptr->set_friendly_name("TIwithLSTMcell"); - return fn_ptr; -} - -std::shared_ptr makeSingleConv(std::vector inputShape, ov::element::Type_t type) { - auto param0 = std::make_shared(type, ov::Shape(inputShape)); - - auto conv1 = ngraph::builder::makeConvolution(param0, - type, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 4); - auto result = std::make_shared(conv1); - auto fn_ptr = std::make_shared(ov::ResultVector{result}, ov::ParameterVector{param0}); - fn_ptr->set_friendly_name("SingleConv"); - return fn_ptr; -} - -std::shared_ptr makeDetectionOutput(ov::element::Type_t type) { - const auto& data = std::make_shared(type, ov::Shape{1, 4, 10, 10}); - - const auto& constant_0 = std::make_shared(type, ov::Shape{1, 1, 1, 1}); - const auto& mul_0 = std::make_shared(data, constant_0); - - const auto& filters = std::make_shared(type, ov::Shape{1, 4, 1, 1}); - const auto& conv = std::make_shared(mul_0, - filters, - ov::Strides{1, 1}, - ov::CoordinateDiff{0, 0}, - ov::CoordinateDiff{0, 0}, - ov::Strides{1, 1}); - - const auto& box_logits_reshape = - std::make_shared(ov::element::i64, ov::Shape{2}, std::vector{0, -1}); - const auto& box_logits = std::make_shared(conv, box_logits_reshape, true); - - const auto& four_times = std::make_shared( - box_logits, - std::make_shared(ov::element::i64, ov::Shape{2}, std::vector{1, 4})); - - const auto& third_input_reshape = - std::make_shared(ov::element::i64, ov::Shape{3}, std::vector{0, 1, -1}); - const auto& third_input = std::make_shared(four_times, third_input_reshape, true); - - ov::op::v0::DetectionOutput::Attributes attr; - attr.num_classes = 4; - attr.background_label_id = 0; - attr.top_k = 75; - attr.variance_encoded_in_target = true; - attr.keep_top_k = {50}; - attr.code_type = std::string{"caffe.PriorBoxParameter.CORNER"}; - attr.share_location = true; - attr.nms_threshold = 0.5f; - attr.confidence_threshold = 0.5f; - attr.clip_after_nms = false; - attr.clip_before_nms = false; - attr.decrease_label_id = false; - attr.normalized = true; - attr.input_height = 1; - attr.input_width = 1; - attr.objectness_score = 0.4f; - const auto& detection = std::make_shared(four_times, four_times, third_input, attr); - const auto& convert = std::make_shared(detection, type); - - return std::make_shared(ov::NodeVector{convert}, ov::ParameterVector{data}, "SplitableDetectionOutput"); -} - -std::shared_ptr makeMultiSingleConv(std::vector inputShape, ov::element::Type type) { - auto param0 = std::make_shared(type, ov::Shape(inputShape)); - auto conv1 = ngraph::builder::makeConvolution(param0, - type, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto conv2 = ngraph::builder::makeConvolution(conv1, - type, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto conv3 = ngraph::builder::makeConvolution(conv2, - type, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto conv4 = ngraph::builder::makeConvolution(conv3, - type, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto conv5 = ngraph::builder::makeConvolution(conv4, - type, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto conv6 = ngraph::builder::makeConvolution(conv5, - type, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto conv7 = ngraph::builder::makeConvolution(conv6, - type, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto conv8 = ngraph::builder::makeConvolution(conv7, - type, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto conv9 = ngraph::builder::makeConvolution(conv8, - type, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto conv10 = ngraph::builder::makeConvolution(conv9, - type, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto result = std::make_shared(conv10); - auto fn_ptr = std::make_shared(ov::ResultVector{result}, ov::ParameterVector{param0}); - fn_ptr->set_friendly_name("MultiSingleConv"); - return fn_ptr; -} - -std::shared_ptr make2InputSubtract(std::vector inputShape, ov::element::Type_t type) { - auto param0 = std::make_shared(type, ov::Shape(inputShape)); - auto param1 = std::make_shared(type, ov::Shape(inputShape)); - auto subtract = std::make_shared(param0, param1); - auto result = std::make_shared(subtract); - auto fn_ptr = std::make_shared(ov::ResultVector{result}, ov::ParameterVector{param0, param1}); - fn_ptr->set_friendly_name("TwoInputSubtract"); - return fn_ptr; -} - -std::shared_ptr makeNestedBranchConvConcat(std::vector inputShape, ov::element::Type ngPrc) { - ov::ParameterVector params{std::make_shared(ngPrc, ov::Shape(inputShape))}; - auto relu0 = std::make_shared(params[0]); - - auto conv1 = ngraph::builder::makeConvolution(relu0, - ngPrc, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto relu1 = std::make_shared(conv1); - - auto conv2 = ngraph::builder::makeConvolution(relu0, - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 10); - auto relu2 = std::make_shared(conv2); - - auto conv3 = ngraph::builder::makeConvolution(relu2, - ngPrc, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto relu3 = std::make_shared(conv3); - - auto conv4 = ngraph::builder::makeConvolution(relu2, - ngPrc, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto relu4 = std::make_shared(conv4); - - auto concat = std::make_shared(ov::OutputVector{relu3->output(0), relu4->output(0)}, 1); - - auto concat1 = std::make_shared(ov::OutputVector{relu1->output(0), concat}, 1); - ov::ResultVector results{std::make_shared(concat1)}; - std::shared_ptr fnPtr = std::make_shared(results, params); - fnPtr->set_friendly_name("NestedBranchConvConcat"); - return fnPtr; -} - -std::shared_ptr makeNestedSplitConvConcat(std::vector inputShape, ov::element::Type ngPrc) { - ov::ParameterVector params{std::make_shared(ngPrc, ov::Shape(inputShape))}; - auto split_axis_op = - std::make_shared(ov::element::Type_t::i64, ov::Shape{}, std::vector{1}); - auto split = std::make_shared(params[0], split_axis_op, 2); - - auto conv1 = ngraph::builder::makeConvolution(split->output(0), - ngPrc, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto relu1 = std::make_shared(conv1); - - auto conv2 = ngraph::builder::makeConvolution(split->output(1), - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 10); - auto relu2 = std::make_shared(conv2); - - auto split2_axis_op = - std::make_shared(ov::element::Type_t::i64, ov::Shape{}, std::vector{1}); - auto split2 = std::make_shared(relu2, split2_axis_op, 2); - - auto conv3 = ngraph::builder::makeConvolution(split2->output(0), - ngPrc, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto relu3 = std::make_shared(conv3); - - auto conv4 = ngraph::builder::makeConvolution(split2->output(1), - ngPrc, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto relu4 = std::make_shared(conv4); - - auto concat = std::make_shared(ov::OutputVector{relu3->output(0), relu4->output(0)}, 1); - - auto concat1 = std::make_shared(ov::OutputVector{relu1->output(0), concat}, 1); - ov::ResultVector results{std::make_shared(concat1)}; - std::shared_ptr fnPtr = std::make_shared(results, params); - fnPtr->set_friendly_name("NestedSplitConvConcat"); - return fnPtr; -} - -std::shared_ptr makeSplitConvConcatInputInBranch(std::vector inputShape, ov::element::Type ngPrc) { - ov::ParameterVector params{std::make_shared(ngPrc, ov::Shape(inputShape)), - std::make_shared(ngPrc, ov::Shape(inputShape))}; - auto split_axis_op = - std::make_shared(ov::element::Type_t::i64, ov::Shape{}, std::vector{1}); - auto split = std::make_shared(params[0], split_axis_op, 2); - - auto conv1 = ngraph::builder::makeConvolution(split->output(0), - ngPrc, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto relu1 = std::make_shared(conv1); - - auto conv2 = ngraph::builder::makeConvolution(split->output(1), - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto relu2 = std::make_shared(conv2); - - auto conv4 = ngraph::builder::makeConvolution(params[1]->output(0), - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto relu4 = std::make_shared(conv4); - - auto concat = std::make_shared(ov::OutputVector{relu4->output(0), relu2->output(0)}, 1); - - auto conv3 = ngraph::builder::makeConvolution(concat, - ngPrc, - {3, 3}, - {1, 1}, - {0, 0}, - {0, 0}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - auto relu3 = std::make_shared(conv3); - - auto concat1 = std::make_shared(ov::OutputVector{relu1->output(0), relu3->output(0)}, 1); - ov::ResultVector results{std::make_shared(concat1)}; - std::shared_ptr fnPtr = std::make_shared(results, params); - fnPtr->set_friendly_name("SplitConvConcatInputInBranch"); - return fnPtr; -} - -std::shared_ptr makeSplitConvConcatNestedInBranch(std::vector inputShape, ov::element::Type ngPrc) { - ov::ParameterVector params{std::make_shared(ngPrc, ov::Shape(inputShape)), - std::make_shared(ngPrc, ov::Shape(inputShape))}; - int localId = 0; -#define SET_NAME(node) node->set_friendly_name(#node + std::to_string(localId++)); - auto split_axis_op = - std::make_shared(ov::element::Type_t::i64, ov::Shape{}, std::vector{1}); - auto split = std::make_shared(params[0], split_axis_op, 2); - - SET_NAME(split); - - auto conv1 = ngraph::builder::makeConvolution(split->output(0), - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - SET_NAME(conv1); - auto relu1 = std::make_shared(conv1); - SET_NAME(relu1); - - auto conv2 = ngraph::builder::makeConvolution(split->output(1), - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - SET_NAME(conv2); - auto relu2 = std::make_shared(conv2); - SET_NAME(relu2); - - auto nestedSubgraph = [&] { - auto split_axis_op = - std::make_shared(ov::element::Type_t::i64, ov::Shape{}, std::vector{1}); - auto split = std::make_shared(params[1], split_axis_op, 2); - - SET_NAME(split); - - auto conv1 = ngraph::builder::makeConvolution(split->output(0), - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - SET_NAME(conv1); - auto relu1 = std::make_shared(conv1); - SET_NAME(relu1); - - auto conv2 = ngraph::builder::makeConvolution(split->output(1), - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 10); - SET_NAME(conv2); - auto relu2 = std::make_shared(conv2); - SET_NAME(relu2); - - auto split2_axis_op = - std::make_shared(ov::element::Type_t::i64, ov::Shape{}, std::vector{1}); - auto split2 = std::make_shared(relu2, split2_axis_op, 2); - - SET_NAME(split2); - - auto conv3 = ngraph::builder::makeConvolution(split2->output(0), - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - SET_NAME(conv3); - auto relu3 = std::make_shared(conv3); - SET_NAME(relu3); - - auto conv4 = ngraph::builder::makeConvolution(split2->output(1), - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - SET_NAME(conv4); - auto relu4 = std::make_shared(conv4); - SET_NAME(relu4); - - auto concat = std::make_shared(ov::OutputVector{relu3->output(0), relu4->output(0)}, 1); - SET_NAME(concat); - - auto concat1 = std::make_shared(ov::OutputVector{relu1->output(0), concat}, 1); - SET_NAME(concat1); - - auto conv5 = ngraph::builder::makeConvolution(concat1, - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - SET_NAME(conv5); - auto relu5 = std::make_shared(conv5); - SET_NAME(relu5); - - return relu5; - }(); - auto concat = - std::make_shared(ov::OutputVector{nestedSubgraph->output(0), relu2->output(0)}, 1); - SET_NAME(concat); - - auto conv3 = ngraph::builder::makeConvolution(concat, - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - SET_NAME(conv3); - auto relu3 = std::make_shared(conv3); - SET_NAME(relu3); - - auto concat1 = std::make_shared(ov::OutputVector{relu1->output(0), relu3->output(0)}, 1); - SET_NAME(concat1); - ov::ResultVector results{std::make_shared(concat1)}; - std::shared_ptr fnPtr = std::make_shared(results, params); - fnPtr->set_friendly_name("SplitConvConcatNestedInBranch"); - return fnPtr; -} - -std::shared_ptr makeSplitConvConcatNestedInBranchNestedOut(std::vector inputShape, - ov::element::Type ngPrc) { - ov::ParameterVector params{std::make_shared(ngPrc, ov::Shape(inputShape)), - std::make_shared(ngPrc, ov::Shape(inputShape))}; - int localId = 0; -#define SET_NAME(node) node->set_friendly_name(#node + std::to_string(localId++)); - auto split_axis_op = - std::make_shared(ov::element::Type_t::i64, ov::Shape{}, std::vector{1}); - auto split = std::make_shared(params[0], split_axis_op, 2); - - SET_NAME(split); - - auto conv1 = ngraph::builder::makeConvolution(split->output(0), - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - SET_NAME(conv1); - auto relu1 = std::make_shared(conv1); - SET_NAME(relu1); - - auto conv2 = ngraph::builder::makeConvolution(split->output(1), - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 10); - SET_NAME(conv2); - auto relu2 = std::make_shared(conv2); - SET_NAME(relu2); - - auto split3_axis_op = - std::make_shared(ov::element::Type_t::i64, ov::Shape{}, std::vector{1}); - auto split3 = std::make_shared(relu2, split3_axis_op, 2); - SET_NAME(split3); - - auto conv32 = ngraph::builder::makeConvolution(split3->output(1), - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 10); - SET_NAME(conv32); - auto relu32 = std::make_shared(conv32); - SET_NAME(relu32); - - auto nestedSubgraph = [&] { - auto split_axis_op = - std::make_shared(ov::element::Type_t::i64, ov::Shape{}, std::vector{1}); - auto split = std::make_shared(params[1], split_axis_op, 2); - SET_NAME(split); - - auto conv1 = ngraph::builder::makeConvolution(split->output(0), - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - SET_NAME(conv1); - auto relu1 = std::make_shared(conv1); - SET_NAME(relu1); - - auto conv2 = ngraph::builder::makeConvolution(split->output(1), - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 10); - SET_NAME(conv2); - auto relu2 = std::make_shared(conv2); - SET_NAME(relu2); - - auto split2_axis_op = - std::make_shared(ov::element::Type_t::i64, ov::Shape{}, std::vector{1}); - auto split2 = std::make_shared(relu2, split2_axis_op, 2); - SET_NAME(split2); - - auto conv3 = ngraph::builder::makeConvolution(split2->output(0), - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - SET_NAME(conv3); - auto relu3 = std::make_shared(conv3); - SET_NAME(relu3); - - auto conv4 = ngraph::builder::makeConvolution(split2->output(1), - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - SET_NAME(conv4); - auto relu4 = std::make_shared(conv4); - SET_NAME(relu4); - - auto concat = std::make_shared(ov::OutputVector{relu3->output(0), relu4->output(0)}, 1); - SET_NAME(concat); - - auto concat1 = std::make_shared(ov::OutputVector{relu1->output(0), concat}, 1); - SET_NAME(concat1); - - auto conv5 = ngraph::builder::makeConvolution(concat1, - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - SET_NAME(conv5); - auto relu5 = std::make_shared(conv5); - SET_NAME(relu5); - - return relu5; - }(); - - auto nestedSubgraph1 = [&] { - auto split_axis_op = - std::make_shared(ov::element::Type_t::i64, ov::Shape{}, std::vector{1}); - auto split = std::make_shared(relu32, split_axis_op, 2); - SET_NAME(split); - - auto conv1 = ngraph::builder::makeConvolution(split->output(0), - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - SET_NAME(conv1); - auto relu1 = std::make_shared(conv1); - SET_NAME(relu1); - - auto conv2 = ngraph::builder::makeConvolution(split->output(1), - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 10); - SET_NAME(conv2); - auto relu2 = std::make_shared(conv2); - SET_NAME(relu2); - - auto split2_axis_op = - std::make_shared(ov::element::Type_t::i64, ov::Shape{}, std::vector{1}); - auto split2 = std::make_shared(relu2, split2_axis_op, 2); - SET_NAME(split2); - - auto conv3 = ngraph::builder::makeConvolution(split2->output(0), - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - SET_NAME(conv3); - auto relu3 = std::make_shared(conv3); - SET_NAME(relu3); - - auto conv4 = ngraph::builder::makeConvolution(split2->output(1), - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - SET_NAME(conv4); - auto relu4 = std::make_shared(conv4); - SET_NAME(relu4); - - auto concat = std::make_shared(ov::OutputVector{relu3->output(0), relu4->output(0)}, 1); - SET_NAME(concat); - - auto concat1 = std::make_shared(ov::OutputVector{relu1->output(0), concat}, 1); - SET_NAME(concat1); - - auto conv5 = ngraph::builder::makeConvolution(concat1, - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - SET_NAME(conv5); - auto relu5 = std::make_shared(conv5); - SET_NAME(relu5); - - return relu5; - }(); - - auto concat = - std::make_shared(ov::OutputVector{nestedSubgraph->output(0), split3->output(0)}, 1); - SET_NAME(concat); - - auto conv3 = ngraph::builder::makeConvolution(concat, - ngPrc, - {3, 3}, - {1, 1}, - {1, 1}, - {1, 1}, - {1, 1}, - ov::op::PadType::EXPLICIT, - 5); - SET_NAME(conv3); - auto relu3 = std::make_shared(conv3); - SET_NAME(relu3); - - auto concat1 = std::make_shared(ov::OutputVector{relu1->output(0), relu3->output(0)}, 1); - SET_NAME(concat1); - ov::ResultVector results{std::make_shared(concat1), - std::make_shared(nestedSubgraph1)}; - std::shared_ptr fnPtr = std::make_shared(results, params); - fnPtr->set_friendly_name("SplitConvConcatNestedInBranchNestedOut"); - return fnPtr; -} - -std::shared_ptr makeConvBias(std::vector inputShape, ov::element::Type type) { - ov::ParameterVector parameter{std::make_shared(type, ov::Shape(inputShape))}; - parameter[0]->set_friendly_name("parameter"); - auto weights = ov::op::v0::Constant::create(type, ov::Shape{6, 3, 1, 1}, {1}); - auto biases = ov::op::v0::Constant::create(type, ov::Shape{6, 1, 1}, {1}); - auto conv = std::make_shared(parameter[0], - weights, - ov::Strides{1, 1}, - ov::CoordinateDiff{0, 0}, - ov::CoordinateDiff{0, 0}, - ov::Strides{1, 1}); - conv->set_friendly_name("conv"); - auto add = std::make_shared(conv, biases); - add->set_friendly_name("add"); - auto result = std::make_shared(add); - result->set_friendly_name("result"); - std::shared_ptr fn_ptr = - std::make_shared(ov::ResultVector{result}, ov::ParameterVector{parameter}); - fn_ptr->set_friendly_name("ConvBias"); - return fn_ptr; -} - -std::shared_ptr makeReadConcatSplitAssign(std::vector inputShape, ov::element::Type type) { - ov::ParameterVector parameter{std::make_shared(type, ov::Shape(inputShape))}; - parameter[0]->set_friendly_name("parameter"); - auto init_const = ov::op::v0::Constant::create(type, inputShape, {0}); - auto read = std::make_shared(init_const, "v0"); - read->set_friendly_name("read"); - std::vector> args = {parameter[0], read}; - auto conc = std::make_shared(args, 3); - conc->set_friendly_name("concat"); - auto res = std::make_shared(conc); - res->set_friendly_name("result"); - const auto axis = ov::op::v0::Constant::create(element::i64, Shape{}, {3}); - axis->set_friendly_name("axis"); - auto crop = std::make_shared(conc, axis, 2); - crop->set_friendly_name("split"); - auto assign = std::make_shared(crop, "v0"); - assign->set_friendly_name("assign"); - std::shared_ptr fn_ptr = - std::make_shared(ov::ResultVector({res}), ov::SinkVector({assign}), ov::ParameterVector{parameter}); - fn_ptr->set_friendly_name("ReadConcatSplitAssign"); - return fn_ptr; -} - -std::shared_ptr makeMatMulBias(std::vector inputShape, ov::element::Type type) { - ov::ParameterVector parameter{std::make_shared(type, ov::Shape(inputShape))}; - parameter[0]->set_friendly_name("parameter"); - auto weights = ov::op::v0::Constant::create(type, ov::Shape{24, 24}, {1}); - auto biases = ov::op::v0::Constant::create(type, ov::Shape{1, 24}, {1}); - auto matmul = std::make_shared(parameter[0], weights); - matmul->set_friendly_name("matmul"); - auto add = std::make_shared(matmul, biases); - add->set_friendly_name("add"); - auto result = std::make_shared(add); - result->set_friendly_name("result"); - std::shared_ptr fn_ptr = - std::make_shared(ov::ResultVector{result}, ov::ParameterVector{parameter}); - fn_ptr->set_friendly_name("MatMulBias"); - return fn_ptr; -} - -std::shared_ptr makeConvertTranspose(std::vector inputShape, - std::vector inputOrder, - ov::element::Type type) { - ov::ParameterVector params{std::make_shared(type, ov::Shape(inputShape))}; - params.front()->set_friendly_name("Param_1"); - params.front()->output(0).get_tensor().set_names({"data"}); - const auto order = ov::op::v0::Constant::create(element::i32, {inputOrder.size()}, inputOrder); - - auto convert = std::make_shared(params.front(), type); - convert->set_friendly_name("convert"); - auto transpose = std::make_shared(convert, order); - transpose->set_friendly_name("transpose"); - auto result = std::make_shared(transpose); - result->set_friendly_name("result"); - - std::shared_ptr fn_ptr = - std::make_shared(ov::ResultVector{result}, ov::ParameterVector{params}); - fn_ptr->set_friendly_name("ConvertTranspose"); - return fn_ptr; -} - -std::shared_ptr makeMultipleInputOutputReLU(std::vector inputShape, ov::element::Type_t type) { - auto param1 = std::make_shared(type, ov::Shape(inputShape)); - param1->set_friendly_name("param1"); - param1->output(0).get_tensor().set_names({"data1"}); - auto param2 = std::make_shared(type, ov::Shape(inputShape)); - param2->set_friendly_name("param2"); - param2->output(0).get_tensor().set_names({"data2"}); - auto relu = std::make_shared(param1); - relu->set_friendly_name("relu_op"); - relu->output(0).get_tensor().set_names({"relu"}); - auto result1 = std::make_shared(relu); - result1->set_friendly_name("result1"); - auto concat = std::make_shared(OutputVector{relu, param2}, 1); - concat->set_friendly_name("concat_op"); - concat->output(0).get_tensor().set_names({"concat"}); - auto result2 = std::make_shared(concat); - result2->set_friendly_name("result2"); - auto fn_ptr = std::make_shared(ov::ResultVector{result1, result2}, ov::ParameterVector{param1, param2}); - fn_ptr->set_friendly_name("MultipleInputOutputReLU"); - return fn_ptr; -} - -std::shared_ptr makeMultipleInputOutputDoubleConcat(std::vector inputShape, - ov::element::Type_t type) { - auto param1 = std::make_shared(type, ov::Shape{inputShape}); - param1->set_friendly_name("param1"); - param1->output(0).get_tensor().set_names({"data1"}); - auto param2 = std::make_shared(type, ov::Shape(inputShape)); - param2->set_friendly_name("param2"); - param2->output(0).get_tensor().set_names({"data2"}); - auto concat1 = std::make_shared(OutputVector{param1, param2}, 1); - concat1->set_friendly_name("concat_op1"); - concat1->output(0).get_tensor().set_names({"concat1"}); - auto result1 = std::make_shared(concat1); - result1->set_friendly_name("result1"); - auto concat2 = std::make_shared(OutputVector{concat1, param2}, 1); - concat2->set_friendly_name("concat_op2"); - concat2->output(0).get_tensor().set_names({"concat2"}); - auto result2 = std::make_shared(concat2); - result2->set_friendly_name("result2"); - auto fn_ptr = std::make_shared(ov::ResultVector{result1, result2}, ov::ParameterVector{param1, param2}); - fn_ptr->set_friendly_name("makeMultipleInputOutputDoubleConcat"); - return fn_ptr; -} - std::shared_ptr makeSingleConcatWithConstant(std::vector inputShape, ov::element::Type type) { ov::ParameterVector parameter{std::make_shared(type, ov::Shape(inputShape))}; parameter[0]->set_friendly_name("Param_1"); @@ -1383,45 +297,6 @@ std::shared_ptr makeConcatWithParams(std::vector inputShape, fn_ptr->set_friendly_name("SingleConcatWithParams"); return fn_ptr; } - -std::shared_ptr makeSingleSplit(std::vector inputShape, ov::element::Type_t type) { - auto param1 = std::make_shared(type, ov::Shape{inputShape}); - param1->set_friendly_name("param1"); - param1->output(0).get_tensor().set_names({"data1"}); - auto axis_node = ov::op::v0::Constant::create(element::i64, Shape{}, {1}); - auto split = std::make_shared(param1, axis_node, 2); - split->set_friendly_name("split"); - split->output(0).get_tensor().set_names({"tensor_split_1"}); - split->output(1).get_tensor().set_names({"tensor_split_2"}); - auto result1 = std::make_shared(split->output(0)); - result1->set_friendly_name("result1"); - auto result2 = std::make_shared(split->output(1)); - result2->set_friendly_name("result2"); - auto fn_ptr = std::make_shared(ov::ResultVector{result1, result2}, ov::ParameterVector{param1}); - fn_ptr->set_friendly_name("SingleSplit"); - return fn_ptr; -} - -std::shared_ptr makeSplitConcat(std::vector inputShape, ov::element::Type_t type) { - auto param1 = std::make_shared(type, ov::Shape{inputShape}); - param1->set_friendly_name("Param1"); - param1->output(0).get_tensor().set_names({"data1"}); - auto axis_node = ov::op::v0::Constant::create(element::i64, Shape{}, {1}); - auto split = std::make_shared(param1, axis_node, 2); - split->set_friendly_name("Split"); - split->output(0).get_tensor().set_names({"tensor_split_1"}); - split->output(1).get_tensor().set_names({"tensor_split_2"}); - - auto concat = std::make_shared(OutputVector{split->output(0), split->output(1)}, 1); - concat->set_friendly_name("Concat_op"); - concat->output(0).get_tensor().set_names({"Concat"}); - auto result = std::make_shared(concat); - result->set_friendly_name("Result"); - auto fn_ptr = std::make_shared(ov::ResultVector{result}, ov::ParameterVector{param1}); - fn_ptr->set_friendly_name("SplitConcat"); - return fn_ptr; -} - } // namespace subgraph } // namespace builder } // namespace ngraph diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/activation.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/activation.hpp index 5a6b13d422b..61d5c586a55 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/activation.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/activation.hpp @@ -1,6 +1,7 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once #pragma once diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/augru_cell.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/augru_cell.hpp index 4c35345db51..a200cb22752 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/augru_cell.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/augru_cell.hpp @@ -1,6 +1,7 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once #pragma once diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/binary_convolution.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/binary_convolution.hpp index 9cb3f8d5671..82bb0e640db 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/binary_convolution.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/binary_convolution.hpp @@ -1,6 +1,7 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once #pragma once diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/comparison.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/comparison.hpp index 24e6abffae1..da722586d77 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/comparison.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/comparison.hpp @@ -1,6 +1,7 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once #pragma once diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/convolution.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/convolution.hpp index 34d29174bcc..1ca630c77a7 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/convolution.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/convolution.hpp @@ -1,6 +1,7 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once #pragma once diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/convolution_backprop_data.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/convolution_backprop_data.hpp index 4362ea90720..c3e63ac29c0 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/convolution_backprop_data.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/convolution_backprop_data.hpp @@ -1,6 +1,7 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once #pragma once diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/dft.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/dft.hpp index c90259bbe2f..71e5f341da7 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/dft.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/dft.hpp @@ -1,6 +1,7 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once #pragma once diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/eltwise.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/eltwise.hpp index 8e491be7144..658c62bea4a 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/eltwise.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/eltwise.hpp @@ -1,6 +1,7 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once #pragma once diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/embedding_bag_offsets_sum.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/embedding_bag_offsets_sum.hpp index 281022fd74f..a86c3482575 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/embedding_bag_offsets_sum.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/embedding_bag_offsets_sum.hpp @@ -1,6 +1,7 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once #pragma once diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/embedding_bag_packed_sum.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/embedding_bag_packed_sum.hpp index 05ecb45b95a..bf95e26ecd9 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/embedding_bag_packed_sum.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/embedding_bag_packed_sum.hpp @@ -1,6 +1,7 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once #pragma once diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/embedding_segments_sum.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/embedding_segments_sum.hpp index ad36485b0b3..b91643c9f2a 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/embedding_segments_sum.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/embedding_segments_sum.hpp @@ -1,6 +1,7 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once #pragma once diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/fully_connected.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/fully_connected.hpp index 59449b6a6d5..e6d2c3aed3a 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/fully_connected.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/fully_connected.hpp @@ -1,6 +1,7 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once #pragma once diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/gather_nd.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/gather_nd.hpp index ee4041eac62..e24de6bdcea 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/gather_nd.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/gather_nd.hpp @@ -1,6 +1,7 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once #pragma once diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/group_convolution.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/group_convolution.hpp index 5790a7769d7..8b2aeb09d10 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/group_convolution.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/group_convolution.hpp @@ -1,6 +1,7 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once #pragma once diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/group_convolution_backprop_data.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/group_convolution_backprop_data.hpp index 190e367b6f2..cf71c157ca7 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/group_convolution_backprop_data.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/group_convolution_backprop_data.hpp @@ -1,6 +1,7 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once #pragma once diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/gru_cell.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/gru_cell.hpp index 3e2a06e6e47..b781c2eb3d1 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/gru_cell.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/gru_cell.hpp @@ -1,6 +1,7 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once #pragma once diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/logical.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/logical.hpp index eb5d6684cb3..443266e0a86 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/logical.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/logical.hpp @@ -1,6 +1,7 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once #pragma once diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/lstm_cell.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/lstm_cell.hpp index 058b92388b5..23658f510de 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/lstm_cell.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/lstm_cell.hpp @@ -1,6 +1,7 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once #pragma once diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/rdft.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/rdft.hpp index 425b6cb30ba..80ad0332ab3 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/rdft.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/rdft.hpp @@ -1,6 +1,7 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once #pragma once diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/reduce.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/reduce.hpp index 06c062460c3..8472410b9cf 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/reduce.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/reduce.hpp @@ -1,6 +1,7 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once #pragma once diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/rnn_cell.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/rnn_cell.hpp index 463a4930f5c..65e304a8ee9 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/rnn_cell.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/node_builders/rnn_cell.hpp @@ -1,6 +1,7 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once #pragma once diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/2_input_subtract.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/2_input_subtract.hpp new file mode 100644 index 00000000000..46001065f26 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/2_input_subtract.hpp @@ -0,0 +1,15 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_2_input_subtract(ov::Shape input_shape = {1, 3, 24, 24}, + ov::element::Type type = ov::element::f32); +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/concat_with_params.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/concat_with_params.hpp new file mode 100644 index 00000000000..6daf65331e5 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/concat_with_params.hpp @@ -0,0 +1,15 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_concat_with_params(ov::Shape input_shape = {1, 1, 32, 32}, + ov::element::Type type = ov::element::f32); +} // namespace utils +} // namespace test +} // namespace ov diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/conv_bias.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/conv_bias.hpp new file mode 100644 index 00000000000..03d244fc189 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/conv_bias.hpp @@ -0,0 +1,15 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_conv_bias(ov::Shape input_shape = {1, 3, 24, 24}, + ov::element::Type type = ov::element::f32); +} // namespace utils +} // namespace test +} // namespace ov diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/conv_pool_relu.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/conv_pool_relu.hpp new file mode 100644 index 00000000000..c869671e20c --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/conv_pool_relu.hpp @@ -0,0 +1,18 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_conv_pool_relu(ov::Shape input_shape = {1, 1, 32, 32}, + ov::element::Type type = ov::element::f32); + +std::shared_ptr make_conv_pool2_relu2(ov::Shape input_shape = {1, 1, 32, 32}, + ov::element::Type type = ov::element::f32); +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/conv_pool_relu_no_reshapes.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/conv_pool_relu_no_reshapes.hpp new file mode 100644 index 00000000000..4f4d54d2e93 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/conv_pool_relu_no_reshapes.hpp @@ -0,0 +1,15 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_conv_pool_relu_no_reshapes(ov::Shape input_shape = {1, 1, 32, 32}, + ov::element::Type type = ov::element::f32); +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/conv_pool_relu_non_zero.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/conv_pool_relu_non_zero.hpp new file mode 100644 index 00000000000..24f8a72525a --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/conv_pool_relu_non_zero.hpp @@ -0,0 +1,16 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_conv_pool_relu_non_zero(ov::Shape input_shape = {1, 1, 32, 32}, + ov::element::Type type = ov::element::f32); + +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/convert_transpose.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/convert_transpose.hpp new file mode 100644 index 00000000000..92fdebe5f3e --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/convert_transpose.hpp @@ -0,0 +1,16 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_convert_transpose(ov::Shape input_shape = {1, 3, 24, 24}, + std::vector input_order = {0, 1, 2, 3}, + ov::element::Type type = ov::element::f32); +} // namespace utils +} // namespace test +} // namespace ov diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/detection_output.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/detection_output.hpp new file mode 100644 index 00000000000..562c49180cb --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/detection_output.hpp @@ -0,0 +1,14 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_detection_output(ov::element::Type type = ov::element::f32); +} // namespace utils +} // namespace test +} // namespace ov diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/kso_func.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/kso_func.hpp new file mode 100644 index 00000000000..adf4cf47992 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/kso_func.hpp @@ -0,0 +1,15 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_kso_function(ov::Shape input_shape = {1, 4, 20, 20}, + ov::element::Type type = ov::element::f32); +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/matmul_bias.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/matmul_bias.hpp new file mode 100644 index 00000000000..3844abf9f98 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/matmul_bias.hpp @@ -0,0 +1,15 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_matmul_bias(ov::Shape input_shape = {1, 3, 24, 24}, + ov::element::Type type = ov::element::f32); +} // namespace utils +} // namespace test +} // namespace ov diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/multi_single_conv.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/multi_single_conv.hpp new file mode 100644 index 00000000000..cd399b1e92c --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/multi_single_conv.hpp @@ -0,0 +1,15 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_multi_single_conv(ov::Shape input_shape = {1, 3, 24, 24}, + ov::element::Type type = ov::element::f32); +} // namespace utils +} // namespace test +} // namespace ov diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/multiple_input_outpput_double_concat.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/multiple_input_outpput_double_concat.hpp new file mode 100644 index 00000000000..35f15f0a62b --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/multiple_input_outpput_double_concat.hpp @@ -0,0 +1,15 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_multiple_input_output_double_concat(ov::Shape input_shape = {1, 1, 32, 32}, + ov::element::Type type = ov::element::f32); +} // namespace utils +} // namespace test +} // namespace ov diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/nested_branch_conv_concat.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/nested_branch_conv_concat.hpp new file mode 100644 index 00000000000..1472007771a --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/nested_branch_conv_concat.hpp @@ -0,0 +1,15 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_nested_branch_conv_concat(ov::Shape input_shape = {1, 4, 20, 20}, + ov::element::Type type = ov::element::f32); +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/nested_split_conv_concat.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/nested_split_conv_concat.hpp new file mode 100644 index 00000000000..ac02ce41d24 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/nested_split_conv_concat.hpp @@ -0,0 +1,15 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_nested_split_conv_concat(ov::Shape input_shape = {1, 4, 20, 20}, + ov::element::Type type = ov::element::f32); +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/read_concat_split_assign.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/read_concat_split_assign.hpp new file mode 100644 index 00000000000..4c193e36513 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/read_concat_split_assign.hpp @@ -0,0 +1,15 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_read_concat_split_assign(ov::Shape input_shape = {1, 1, 2, 4}, + ov::element::Type type = ov::element::f32); +} // namespace utils +} // namespace test +} // namespace ov diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/single_concat_with_constant.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/single_concat_with_constant.hpp new file mode 100644 index 00000000000..959c2bb3490 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/single_concat_with_constant.hpp @@ -0,0 +1,15 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_single_concat_with_constant(ov::Shape input_shape = {1, 1, 2, 4}, + ov::element::Type type = ov::element::f32); +} // namespace utils +} // namespace test +} // namespace ov diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/single_conv.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/single_conv.hpp new file mode 100644 index 00000000000..0fd9472404d --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/single_conv.hpp @@ -0,0 +1,15 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_single_conv(ov::Shape input_shape = {1, 3, 24, 24}, + ov::element::Type type = ov::element::f32); +} // namespace utils +} // namespace test +} // namespace ov diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/single_split.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/single_split.hpp new file mode 100644 index 00000000000..461620c4eb1 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/single_split.hpp @@ -0,0 +1,15 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_single_split(ov::Shape input_shape = {1, 4, 32, 32}, + ov::element::Type type = ov::element::f32); +} // namespace utils +} // namespace test +} // namespace ov diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/split_concat.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/split_concat.hpp new file mode 100644 index 00000000000..cbd3ff84bbd --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/split_concat.hpp @@ -0,0 +1,15 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_split_concat(ov::Shape input_shape = {1, 4, 24, 24}, + ov::element::Type type = ov::element::f32); +} // namespace utils +} // namespace test +} // namespace ov diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/split_conv_concat.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/split_conv_concat.hpp new file mode 100644 index 00000000000..ba2c28a4c94 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/split_conv_concat.hpp @@ -0,0 +1,25 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_split_conv_concat(ov::Shape input_shape = {1, 4, 20, 20}, + ov::element::Type type = ov::element::f32); + +std::shared_ptr make_cplit_conv_concat_input_in_branch(ov::Shape input_shape = {1, 4, 20, 20}, + ov::element::Type type = ov::element::f32); + +std::shared_ptr make_cplit_conv_concat_nested_in_branch(ov::Shape input_shape = {1, 4, 20, 20}, + ov::element::Type type = ov::element::f32); + +std::shared_ptr make_cplit_conv_concat_nested_in_branch_nested_out( + ov::Shape input_shape = {1, 4, 20, 20}, + ov::element::Type type = ov::element::f32); +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/split_multi_conv_concat.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/split_multi_conv_concat.hpp new file mode 100644 index 00000000000..31446b3cf64 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/split_multi_conv_concat.hpp @@ -0,0 +1,15 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_split_multi_conv_concat(ov::Shape input_shape = {1, 4, 20, 20}, + ov::element::Type type = ov::element::f32); +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/ti_with_lstm_cell.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/ti_with_lstm_cell.hpp new file mode 100644 index 00000000000..43d9806fccd --- /dev/null +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/subgraph_builders/ti_with_lstm_cell.hpp @@ -0,0 +1,18 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "openvino/core/model.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_ti_with_lstm_cell(ov::element::Type type = ov::element::f32, + size_t N = 32, // Batch size + size_t L = 10, // Sequence length + size_t I = 8, // Input size + size_t H = 32); // Hidden size +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/node_builders/convolution.cpp b/src/tests/test_utils/common_test_utils/src/node_builders/convolution.cpp index 29592d1e053..e760bef588b 100644 --- a/src/tests/test_utils/common_test_utils/src/node_builders/convolution.cpp +++ b/src/tests/test_utils/common_test_utils/src/node_builders/convolution.cpp @@ -32,7 +32,7 @@ std::shared_ptr make_convolution(const ov::Output& in, if (!filter_weights.empty()) { filter_weights_node = std::make_shared(type, filter_weights_shape, filter_weights); } else { - auto tensor = create_and_fill_tensor(type, filter_weights_shape); + auto tensor = create_and_fill_tensor(type, filter_weights_shape, 9, 1); filter_weights_node = std::make_shared(tensor); } @@ -49,7 +49,7 @@ std::shared_ptr make_convolution(const ov::Output& in, biases_weights_node = std::make_shared(type, ov::Shape{1, num_out_channels, 1, 1}, biases_weights); } else { - auto tensor = create_and_fill_tensor(type, ov::Shape{1, num_out_channels, 1, 1}); + auto tensor = create_and_fill_tensor(type, ov::Shape{1, num_out_channels, 1, 1}, 9, 1); biases_weights_node = std::make_shared(tensor); } @@ -86,7 +86,7 @@ std::shared_ptr make_convolution(const ov::Output& in_data, biases_weights_node = std::make_shared(type, ov::Shape{1, num_out_channels, 1, 1}, biases_weights); } else { - auto tensor = create_and_fill_tensor(type, ov::Shape{1, num_out_channels, 1, 1}); + auto tensor = create_and_fill_tensor(type, ov::Shape{1, num_out_channels, 1, 1}, 9, 1); biases_weights_node = std::make_shared(tensor); } diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/2_input_subtract.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/2_input_subtract.cpp new file mode 100644 index 00000000000..cec78a6fa65 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/2_input_subtract.cpp @@ -0,0 +1,27 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/subgraph_builders/2_input_subtract.hpp" + +#include "common_test_utils/node_builders/convolution.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/result.hpp" +#include "openvino/op/subtract.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_2_input_subtract(ov::Shape input_shape, ov::element::Type type) { + auto param0 = std::make_shared(type, input_shape); + auto param1 = std::make_shared(type, input_shape); + auto subtract = std::make_shared(param0, param1); + auto result = std::make_shared(subtract); + + auto model = std::make_shared(ov::ResultVector{result}, ov::ParameterVector{param0, param1}); + model->set_friendly_name("TwoInputSubtract"); + return model; +} +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/concat_with_params.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/concat_with_params.cpp new file mode 100644 index 00000000000..914fd06e2c6 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/concat_with_params.cpp @@ -0,0 +1,38 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/subgraph_builders/concat_with_params.hpp" + +#include "common_test_utils/node_builders/convolution.hpp" +#include "openvino/op/concat.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/result.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_concat_with_params(ov::Shape input_shape, ov::element::Type type) { + auto parameter1 = std::make_shared(type, input_shape); + parameter1->set_friendly_name("param1"); + parameter1->output(0).get_tensor().set_names({"data1"}); + + auto parameter2 = std::make_shared(type, input_shape); + parameter2->set_friendly_name("param2"); + parameter2->output(0).get_tensor().set_names({"data2"}); + + auto concat = std::make_shared(OutputVector{parameter1, parameter2}, 1); + concat->set_friendly_name("concat_op"); + concat->output(0).get_tensor().set_names({"concat"}); + + auto result = std::make_shared(concat); + result->set_friendly_name("result"); + + auto model = std::make_shared(ov::ResultVector{result}, ov::ParameterVector{parameter1, parameter2}); + model->set_friendly_name("SingleConcatWithParams"); + return model; +} +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/conv_bias.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/conv_bias.cpp new file mode 100644 index 00000000000..079f91d8768 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/conv_bias.cpp @@ -0,0 +1,43 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/subgraph_builders/conv_bias.hpp" + +#include "openvino/op/add.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/convolution.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/result.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_conv_bias(ov::Shape input_shape, ov::element::Type type) { + ov::ParameterVector parameter{std::make_shared(type, input_shape)}; + parameter[0]->set_friendly_name("parameter"); + + auto weights = ov::op::v0::Constant::create(type, ov::Shape{6, 3, 1, 1}, {1}); + auto biases = ov::op::v0::Constant::create(type, ov::Shape{6, 1, 1}, {1}); + auto conv = std::make_shared(parameter[0], + weights, + ov::Strides{1, 1}, + ov::CoordinateDiff{0, 0}, + ov::CoordinateDiff{0, 0}, + ov::Strides{1, 1}); + conv->set_friendly_name("conv"); + + auto add = std::make_shared(conv, biases); + add->set_friendly_name("add"); + + auto result = std::make_shared(add); + result->set_friendly_name("result"); + + std::shared_ptr model = + std::make_shared(ov::ResultVector{result}, ov::ParameterVector{parameter}); + model->set_friendly_name("ConvBias"); + return model; +} +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/conv_pool_relu.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/conv_pool_relu.cpp new file mode 100644 index 00000000000..d5f3f18f792 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/conv_pool_relu.cpp @@ -0,0 +1,161 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" + +#include "common_test_utils/node_builders/convolution.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/max_pool.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/relu.hpp" +#include "openvino/op/reshape.hpp" +#include "openvino/op/result.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_conv_pool_relu(ov::Shape input_shape, ov::element::Type type) { + ov::ParameterVector params{std::make_shared(type, input_shape)}; + params.front()->set_friendly_name("Param_1"); + params.front()->output(0).get_tensor().set_names({"data"}); + + ov::Shape const_shape = {input_shape[0], input_shape[2], input_shape[1], input_shape[3]}; + auto const1 = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{4}, const_shape); + const1->set_friendly_name("Const_1"); + const1->output(0).get_tensor().set_names({"const1"}); + + auto reshape1 = std::make_shared(params.front(), const1, false); + reshape1->set_friendly_name("Reshape_1"); + reshape1->output(0).get_tensor().set_names({"reshape1"}); + + auto conv1 = ov::test::utils::make_convolution(reshape1, + type, + {1, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 4); + conv1->set_friendly_name("Conv_1"); + conv1->output(0).get_tensor().set_names({"conv"}); + + std::vector stride{1, 1}, padB{0, 0}, padE = padB, kernel{1, 2}; + auto pool1 = std::make_shared(conv1, + stride, + padB, + padE, + kernel, + ov::op::RoundingType::FLOOR, + ov::op::PadType::EXPLICIT); + pool1->output(0).get_tensor().set_names({"pool"}); + pool1->set_friendly_name("Pool_1"); + + auto relu1 = std::make_shared(pool1); + relu1->set_friendly_name("Relu_1"); + relu1->output(0).get_tensor().set_names({"relu"}); + + ov::Shape reluShape = relu1->outputs()[0].get_tensor().get_shape(); + std::vector constShape2 = {1, ov::shape_size(reluShape)}; + auto const2 = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{2}, constShape2); + const2->output(0).get_tensor().set_names({"const2"}); + const2->set_friendly_name("Const_2"); + + auto reshape2 = std::make_shared(relu1, const2, false); + reshape2->output(0).get_tensor().set_names({"reshape2"}); + reshape2->set_friendly_name("Reshape_2"); + + ov::ResultVector results{std::make_shared(reshape2)}; + std::shared_ptr model = std::make_shared(results, params); + return model; +} + +std::shared_ptr make_conv_pool2_relu2(ov::Shape input_shape, ov::element::Type type) { + ov::ParameterVector params{std::make_shared(type, input_shape)}; + params.front()->set_friendly_name("Param_1"); + params.front()->output(0).get_tensor().set_names({"data"}); + + std::vector constShape = {input_shape[0], input_shape[2], input_shape[1], input_shape[3]}; + auto const1 = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{4}, constShape); + const1->set_friendly_name("Const_1"); + const1->output(0).get_tensor().set_names({"const1"}); + + auto reshape1 = std::make_shared(params.front(), const1, false); + reshape1->set_friendly_name("Reshape_1"); + reshape1->output(0).get_tensor().set_names({"reshape1"}); + + auto conv1 = ov::test::utils::make_convolution(reshape1, + type, + {1, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 4); + conv1->set_friendly_name("Conv_1"); + conv1->output(0).get_tensor().set_names({"conv"}); + std::vector stride{1, 1}, padB{0, 0}, padE = padB, kernel{1, 2}; + + ov::ResultVector results; + { + auto pool1 = std::make_shared(conv1, + stride, + padB, + padE, + kernel, + ov::op::RoundingType::FLOOR, + ov::op::PadType::EXPLICIT); + pool1->output(0).get_tensor().set_names({"pool_0"}); + pool1->set_friendly_name("Pool_1_0"); + + auto relu1 = std::make_shared(pool1); + relu1->set_friendly_name("Relu_1_0"); + relu1->output(0).get_tensor().set_names({"relu_0"}); + + ov::Shape reluShape = relu1->outputs()[0].get_tensor().get_shape(); + std::vector constShape2 = {1, ov::shape_size(reluShape)}; + auto const2 = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{2}, constShape2); + const2->output(0).get_tensor().set_names({"const2_0"}); + const2->set_friendly_name("Const_2_0"); + + auto reshape2 = std::make_shared(relu1, const2, false); + reshape2->output(0).get_tensor().set_names({"reshape2_0"}); + reshape2->set_friendly_name("Reshape_2_0"); + + results.push_back(std::make_shared(reshape2)); + } + { + auto pool1 = std::make_shared(conv1, + stride, + padB, + padE, + kernel, + ov::op::RoundingType::FLOOR, + ov::op::PadType::EXPLICIT); + pool1->output(0).get_tensor().set_names({"pool_1"}); + pool1->set_friendly_name("Pool_1_1"); + + auto relu1 = std::make_shared(pool1); + relu1->set_friendly_name("Relu_1_1"); + relu1->output(0).get_tensor().set_names({"relu_1"}); + + ov::Shape reluShape = relu1->outputs()[0].get_tensor().get_shape(); + std::vector constShape2 = {1, ov::shape_size(reluShape)}; + auto const2 = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{2}, constShape2); + const2->output(0).get_tensor().set_names({"const2_1"}); + const2->set_friendly_name("Const_2_1"); + + auto reshape2 = std::make_shared(relu1, const2, false); + reshape2->output(0).get_tensor().set_names({"reshape2_1"}); + reshape2->set_friendly_name("Reshape_2_1"); + + results.push_back(std::make_shared(reshape2)); + } + std::shared_ptr model = std::make_shared(results, params); + return model; +} +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/conv_pool_relu_no_reshapes.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/conv_pool_relu_no_reshapes.cpp new file mode 100644 index 00000000000..e3b8d56de66 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/conv_pool_relu_no_reshapes.cpp @@ -0,0 +1,56 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/node_builders/convolution.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/max_pool.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/relu.hpp" +#include "openvino/op/result.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_conv_pool_relu_no_reshapes(ov::Shape input_shape, ov::element::Type type) { + ov::ParameterVector params{std::make_shared(type, ov::Shape(input_shape))}; + params.front()->set_friendly_name("Param_1"); + params.front()->output(0).get_tensor().set_names({"data"}); + + auto conv1 = ov::test::utils::make_convolution(params.front(), + type, + {1, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 4); + conv1->set_friendly_name("Conv_1"); + conv1->output(0).get_tensor().set_names({"conv"}); + + std::vector stride{1, 1}, padB{0, 0}, padE = padB, kernel{1, 2}; + auto pool1 = std::make_shared(conv1, + stride, + padB, + padE, + kernel, + ov::op::RoundingType::FLOOR, + ov::op::PadType::EXPLICIT); + pool1->output(0).get_tensor().set_names({"pool"}); + pool1->set_friendly_name("Pool_1"); + + auto relu1 = std::make_shared(pool1); + relu1->set_friendly_name("Relu_1"); + relu1->output(0).get_tensor().set_names({"relu"}); + + ov::Shape reluShape = relu1->outputs()[0].get_tensor().get_shape(); + ov::ResultVector results{std::make_shared(relu1)}; + std::shared_ptr fnPtr = std::make_shared(results, params); + return fnPtr; +} + +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/conv_pool_relu_non_zero.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/conv_pool_relu_non_zero.cpp new file mode 100644 index 00000000000..097486723f3 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/conv_pool_relu_non_zero.cpp @@ -0,0 +1,73 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/node_builders/convolution.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/gather.hpp" +#include "openvino/op/max_pool.hpp" +#include "openvino/op/non_zero.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/relu.hpp" +#include "openvino/op/result.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_conv_pool_relu_non_zero(ov::Shape input_shape, ov::element::Type type) { + ov::ParameterVector params{std::make_shared(type, input_shape)}; + params.front()->set_friendly_name("Param_1"); + params.front()->output(0).get_tensor().set_names({"data"}); + + auto conv1 = ov::test::utils::make_convolution(params.front(), + type, + {1, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 4); + conv1->set_friendly_name("Conv_1"); + conv1->output(0).get_tensor().set_names({"conv"}); + + std::vector stride{1, 1}, padB{0, 0}, padE = padB, kernel{1, 2}; + auto pool1 = std::make_shared(conv1, + stride, + padB, + padE, + kernel, + ov::op::RoundingType::FLOOR, + ov::op::PadType::EXPLICIT); + pool1->output(0).get_tensor().set_names({"pool"}); + pool1->set_friendly_name("Pool_1"); + + auto relu1 = std::make_shared(pool1); + relu1->set_friendly_name("Relu_1"); + relu1->output(0).get_tensor().set_names({"relu"}); + + auto non_zero = std::make_shared(relu1); + non_zero->set_friendly_name("nonZero_1"); + non_zero->output(0).get_tensor().set_names({"nonZero"}); + + auto gather_indices = + std::make_shared(ov::element::i64, ov::Shape{1}, std::vector{0}); + gather_indices->set_friendly_name("gather_indices_1"); + gather_indices->output(0).get_tensor().set_names({"gather_indices"}); + + auto gather_axis = std::make_shared(ov::element::i64, ov::Shape{1}, std::vector{1}); + gather_axis->set_friendly_name("gather_axis_1"); + gather_axis->output(0).get_tensor().set_names({"gather_axis"}); + + auto gather = std::make_shared(non_zero->output(0), gather_indices, gather_axis); + gather->set_friendly_name("gather_1"); + gather->output(0).get_tensor().set_names({"gather"}); + + ov::ResultVector results{std::make_shared(gather)}; + std::shared_ptr model = std::make_shared(results, params); + return model; +} +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/convert_transpose.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/convert_transpose.cpp new file mode 100644 index 00000000000..56b70c71679 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/convert_transpose.cpp @@ -0,0 +1,42 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/subgraph_builders/convert_transpose.hpp" + +#include "common_test_utils/node_builders/convolution.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/convert.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/result.hpp" +#include "openvino/op/transpose.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_convert_transpose(ov::Shape input_shape, + std::vector input_order, + ov::element::Type type) { + ov::ParameterVector params{std::make_shared(type, input_shape)}; + params.front()->set_friendly_name("Param_1"); + params.front()->output(0).get_tensor().set_names({"data"}); + + const auto order = ov::op::v0::Constant::create(element::i32, {input_order.size()}, input_order); + + auto convert = std::make_shared(params.front(), type); + convert->set_friendly_name("convert"); + + auto transpose = std::make_shared(convert, order); + transpose->set_friendly_name("transpose"); + + auto result = std::make_shared(transpose); + result->set_friendly_name("result"); + + std::shared_ptr model = + std::make_shared(ov::ResultVector{result}, ov::ParameterVector{params}); + model->set_friendly_name("ConvertTranspose"); + return model; +} +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/detection_output.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/detection_output.cpp new file mode 100644 index 00000000000..754bbad3cc1 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/detection_output.cpp @@ -0,0 +1,71 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/subgraph_builders/detection_output.hpp" + +#include "common_test_utils/node_builders/convolution.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/convert.hpp" +#include "openvino/op/convolution.hpp" +#include "openvino/op/detection_output.hpp" +#include "openvino/op/multiply.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/reshape.hpp" +#include "openvino/op/result.hpp" +#include "openvino/op/tile.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_detection_output(ov::element::Type type) { + const auto& data = std::make_shared(type, ov::Shape{1, 4, 10, 10}); + + const auto& constant_0 = std::make_shared(type, ov::Shape{1, 1, 1, 1}); + const auto& mul_0 = std::make_shared(data, constant_0); + + const auto& filters = std::make_shared(type, ov::Shape{1, 4, 1, 1}); + const auto& conv = std::make_shared(mul_0, + filters, + ov::Strides{1, 1}, + ov::CoordinateDiff{0, 0}, + ov::CoordinateDiff{0, 0}, + ov::Strides{1, 1}); + + const auto& box_logits_reshape = + std::make_shared(ov::element::i64, ov::Shape{2}, std::vector{0, -1}); + const auto& box_logits = std::make_shared(conv, box_logits_reshape, true); + + const auto& four_times = std::make_shared( + box_logits, + std::make_shared(ov::element::i64, ov::Shape{2}, std::vector{1, 4})); + + const auto& third_input_reshape = + std::make_shared(ov::element::i64, ov::Shape{3}, std::vector{0, 1, -1}); + const auto& third_input = std::make_shared(four_times, third_input_reshape, true); + + ov::op::v0::DetectionOutput::Attributes attr; + attr.num_classes = 4; + attr.background_label_id = 0; + attr.top_k = 75; + attr.variance_encoded_in_target = true; + attr.keep_top_k = {50}; + attr.code_type = std::string{"caffe.PriorBoxParameter.CORNER"}; + attr.share_location = true; + attr.nms_threshold = 0.5f; + attr.confidence_threshold = 0.5f; + attr.clip_after_nms = false; + attr.clip_before_nms = false; + attr.decrease_label_id = false; + attr.normalized = true; + attr.input_height = 1; + attr.input_width = 1; + attr.objectness_score = 0.4f; + const auto& detection = std::make_shared(four_times, four_times, third_input, attr); + const auto& convert = std::make_shared(detection, type); + + return std::make_shared(ov::NodeVector{convert}, ov::ParameterVector{data}, "SplitableDetectionOutput"); +} +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/kso_func.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/kso_func.cpp new file mode 100644 index 00000000000..001ad9e90e9 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/kso_func.cpp @@ -0,0 +1,51 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/subgraph_builders/kso_func.hpp" + +#include "common_test_utils/node_builders/convolution.hpp" +#include "openvino/op/add.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/convert.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/relu.hpp" +#include "openvino/op/reshape.hpp" +#include "openvino/op/result.hpp" +#include "openvino/op/shape_of.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_kso_function(ov::Shape input_shape, ov::element::Type type) { + ov::ParameterVector params{std::make_shared(type, input_shape), + std::make_shared(type, input_shape)}; + + auto shape_of = std::make_shared(params[0]); + auto convert = std::make_shared(shape_of, type); + auto new_shape = + std::make_shared(ov::element::i64, ov::Shape{4}, std::vector{1, 4, 1, 1}); + auto reshape = std::make_shared(convert, new_shape, false); + + auto conv1 = ov::test::utils::make_convolution(params[1], + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 4); + + auto relu1 = std::make_shared(conv1); + auto add = std::make_shared(relu1, reshape); + + ov::ResultVector results{std::make_shared(add)}; + + std::shared_ptr model = std::make_shared(results, params); + model->set_friendly_name("KSOFunction"); + return model; +} +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/matmul_bias.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/matmul_bias.cpp new file mode 100644 index 00000000000..9446695ce73 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/matmul_bias.cpp @@ -0,0 +1,40 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/subgraph_builders/matmul_bias.hpp" + +#include "common_test_utils/node_builders/convolution.hpp" +#include "openvino/op/add.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/matmul.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/result.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_matmul_bias(ov::Shape input_shape, ov::element::Type type) { + ov::ParameterVector parameter{std::make_shared(type, input_shape)}; + parameter[0]->set_friendly_name("parameter"); + + auto weights = ov::op::v0::Constant::create(type, ov::Shape{24, 24}, {1}); + auto biases = ov::op::v0::Constant::create(type, ov::Shape{1, 24}, {1}); + + auto matmul = std::make_shared(parameter[0], weights); + matmul->set_friendly_name("matmul"); + + auto add = std::make_shared(matmul, biases); + add->set_friendly_name("add"); + + auto result = std::make_shared(add); + result->set_friendly_name("result"); + + std::shared_ptr model = + std::make_shared(ov::ResultVector{result}, ov::ParameterVector{parameter}); + model->set_friendly_name("MatMulBias"); + return model; +} +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/multi_single_conv.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/multi_single_conv.cpp new file mode 100644 index 00000000000..43168103abe --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/multi_single_conv.cpp @@ -0,0 +1,113 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/subgraph_builders/multi_single_conv.hpp" + +#include "common_test_utils/node_builders/convolution.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/result.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_multi_single_conv(ov::Shape input_shape, ov::element::Type type) { + auto param0 = std::make_shared(type, input_shape); + auto conv1 = ov::test::utils::make_convolution(param0, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto conv2 = ov::test::utils::make_convolution(conv1, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto conv3 = ov::test::utils::make_convolution(conv2, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto conv4 = ov::test::utils::make_convolution(conv3, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto conv5 = ov::test::utils::make_convolution(conv4, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto conv6 = ov::test::utils::make_convolution(conv5, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto conv7 = ov::test::utils::make_convolution(conv6, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto conv8 = ov::test::utils::make_convolution(conv7, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto conv9 = ov::test::utils::make_convolution(conv8, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto conv10 = ov::test::utils::make_convolution(conv9, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto result = std::make_shared(conv10); + auto model = std::make_shared(ov::ResultVector{result}, ov::ParameterVector{param0}); + model->set_friendly_name("MultiSingleConv"); + return model; +} +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/multiple_input_output_double_concat.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/multiple_input_output_double_concat.cpp new file mode 100644 index 00000000000..f1aad099681 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/multiple_input_output_double_concat.cpp @@ -0,0 +1,43 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/node_builders/convolution.hpp" +#include "common_test_utils/subgraph_builders/multiple_input_outpput_double_concat.hpp" +#include "openvino/op/concat.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/result.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_multiple_input_output_double_concat(ov::Shape input_shape, ov::element::Type type) { + auto param1 = std::make_shared(type, input_shape); + param1->set_friendly_name("param1"); + param1->output(0).get_tensor().set_names({"data1"}); + + auto param2 = std::make_shared(type, input_shape); + param2->set_friendly_name("param2"); + param2->output(0).get_tensor().set_names({"data2"}); + + auto concat1 = std::make_shared(OutputVector{param1, param2}, 1); + concat1->set_friendly_name("concat_op1"); + concat1->output(0).get_tensor().set_names({"concat1"}); + + auto result1 = std::make_shared(concat1); + result1->set_friendly_name("result1"); + + auto concat2 = std::make_shared(OutputVector{concat1, param2}, 1); + concat2->set_friendly_name("concat_op2"); + concat2->output(0).get_tensor().set_names({"concat2"}); + + auto result2 = std::make_shared(concat2); + result2->set_friendly_name("result2"); + + auto model = std::make_shared(ov::ResultVector{result1, result2}, ov::ParameterVector{param1, param2}); + model->set_friendly_name("makeMultipleInputOutputDoubleConcat"); + return model; +} +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/nested_branch_conv_concat.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/nested_branch_conv_concat.cpp new file mode 100644 index 00000000000..4d206df3ba3 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/nested_branch_conv_concat.cpp @@ -0,0 +1,76 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/subgraph_builders/nested_branch_conv_concat.hpp" + +#include "common_test_utils/node_builders/convolution.hpp" +#include "openvino/op/concat.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/relu.hpp" +#include "openvino/op/result.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_nested_branch_conv_concat(ov::Shape input_shape, ov::element::Type type) { + ov::ParameterVector params{std::make_shared(type, input_shape)}; + auto relu0 = std::make_shared(params[0]); + + auto conv1 = ov::test::utils::make_convolution(relu0, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto relu1 = std::make_shared(conv1); + + auto conv2 = ov::test::utils::make_convolution(relu0, + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 10); + auto relu2 = std::make_shared(conv2); + + auto conv3 = ov::test::utils::make_convolution(relu2, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto relu3 = std::make_shared(conv3); + + auto conv4 = ov::test::utils::make_convolution(relu2, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto relu4 = std::make_shared(conv4); + + auto concat = std::make_shared(ov::OutputVector{relu3->output(0), relu4->output(0)}, 1); + + auto concat1 = std::make_shared(ov::OutputVector{relu1->output(0), concat}, 1); + ov::ResultVector results{std::make_shared(concat1)}; + + std::shared_ptr model = std::make_shared(results, params); + model->set_friendly_name("NestedBranchConvConcat"); + return model; +} + +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/nested_split_conv_concat.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/nested_split_conv_concat.cpp new file mode 100644 index 00000000000..924ce6a1576 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/nested_split_conv_concat.cpp @@ -0,0 +1,83 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/subgraph_builders/nested_split_conv_concat.hpp" + +#include "common_test_utils/node_builders/convolution.hpp" +#include "openvino/op/concat.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/relu.hpp" +#include "openvino/op/result.hpp" +#include "openvino/op/split.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_nested_split_conv_concat(ov::Shape input_shape, ov::element::Type type) { + ov::ParameterVector params{std::make_shared(type, input_shape)}; + auto split_axis_op = + std::make_shared(ov::element::Type_t::i64, ov::Shape{}, std::vector{1}); + auto split = std::make_shared(params[0], split_axis_op, 2); + + auto conv1 = ov::test::utils::make_convolution(split->output(0), + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto relu1 = std::make_shared(conv1); + + auto conv2 = ov::test::utils::make_convolution(split->output(1), + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 10); + auto relu2 = std::make_shared(conv2); + + auto split2_axis_op = + std::make_shared(ov::element::Type_t::i64, ov::Shape{}, std::vector{1}); + auto split2 = std::make_shared(relu2, split2_axis_op, 2); + + auto conv3 = ov::test::utils::make_convolution(split2->output(0), + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto relu3 = std::make_shared(conv3); + + auto conv4 = ov::test::utils::make_convolution(split2->output(1), + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto relu4 = std::make_shared(conv4); + + auto concat = std::make_shared(ov::OutputVector{relu3->output(0), relu4->output(0)}, 1); + + auto concat1 = std::make_shared(ov::OutputVector{relu1->output(0), concat}, 1); + ov::ResultVector results{std::make_shared(concat1)}; + + std::shared_ptr model = std::make_shared(results, params); + model->set_friendly_name("NestedSplitConvConcat"); + return model; +} +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/read_concat_split_assign.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/read_concat_split_assign.cpp new file mode 100644 index 00000000000..8d06410814a --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/read_concat_split_assign.cpp @@ -0,0 +1,47 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/subgraph_builders/read_concat_split_assign.hpp" + +#include "openvino/op/concat.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/result.hpp" +#include "openvino/op/split.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_read_concat_split_assign(ov::Shape input_shape, ov::element::Type type) { + ov::ParameterVector parameter{std::make_shared(type, input_shape)}; + parameter[0]->set_friendly_name("parameter"); + + auto init_const = ov::op::v0::Constant::create(type, input_shape, {0}); + auto read = std::make_shared(init_const, "v0"); + read->set_friendly_name("read"); + + std::vector> args = {parameter[0], read}; + auto conc = std::make_shared(args, 3); + conc->set_friendly_name("concat"); + + auto res = std::make_shared(conc); + res->set_friendly_name("result"); + + const auto axis = ov::op::v0::Constant::create(element::i64, Shape{}, {3}); + axis->set_friendly_name("axis"); + + auto crop = std::make_shared(conc, axis, 2); + crop->set_friendly_name("split"); + + auto assign = std::make_shared(crop, "v0"); + assign->set_friendly_name("assign"); + + std::shared_ptr model = + std::make_shared(ov::ResultVector({res}), ov::SinkVector({assign}), ov::ParameterVector{parameter}); + model->set_friendly_name("ReadConcatSplitAssign"); + return model; +} +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/single_concat_with_constant.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/single_concat_with_constant.cpp new file mode 100644 index 00000000000..90d703c0cd0 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/single_concat_with_constant.cpp @@ -0,0 +1,37 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/subgraph_builders/single_concat_with_constant.hpp" + +#include "common_test_utils/node_builders/convolution.hpp" +#include "openvino/op/concat.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/result.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_single_concat_with_constant(ov::Shape input_shape, ov::element::Type type) { + ov::ParameterVector parameter{std::make_shared(type, input_shape)}; + parameter[0]->set_friendly_name("Param_1"); + parameter[0]->output(0).get_tensor().set_names({"data"}); + + auto init_const = ov::op::v0::Constant::create(type, input_shape, {0}); + + std::vector> args = {parameter[0], init_const}; + auto conc = std::make_shared(args, 3); + conc->set_friendly_name("concat"); + + auto res = std::make_shared(conc); + res->set_friendly_name("result"); + + std::shared_ptr model = + std::make_shared(ov::ResultVector({res}), ov::ParameterVector{parameter}); + model->set_friendly_name("SingleConcatWithConstant"); + return model; +} +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/single_conv.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/single_conv.cpp new file mode 100644 index 00000000000..8f570eb725f --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/single_conv.cpp @@ -0,0 +1,33 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/node_builders/convolution.hpp" +#include "common_test_utils/subgraph_builders/ti_with_lstm_cell.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/result.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_single_conv(ov::Shape input_shape, ov::element::Type type) { + auto param0 = std::make_shared(type, ov::Shape(input_shape)); + + auto conv1 = ov::test::utils::make_convolution(param0, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 4); + auto result = std::make_shared(conv1); + + auto model = std::make_shared(ov::ResultVector{result}, ov::ParameterVector{param0}); + model->set_friendly_name("SingleConv"); + return model; +} +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/single_split.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/single_split.cpp new file mode 100644 index 00000000000..79c2993dc7a --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/single_split.cpp @@ -0,0 +1,38 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/subgraph_builders/single_split.hpp" + +#include "openvino/op/constant.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/result.hpp" +#include "openvino/op/split.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_single_split(ov::Shape input_shape, ov::element::Type type) { + auto param1 = std::make_shared(type, input_shape); + param1->set_friendly_name("param1"); + param1->output(0).get_tensor().set_names({"data1"}); + + auto axis_node = ov::op::v0::Constant::create(element::i64, Shape{}, {1}); + auto split = std::make_shared(param1, axis_node, 2); + split->set_friendly_name("split"); + split->output(0).get_tensor().set_names({"tensor_split_1"}); + split->output(1).get_tensor().set_names({"tensor_split_2"}); + + auto result1 = std::make_shared(split->output(0)); + result1->set_friendly_name("result1"); + + auto result2 = std::make_shared(split->output(1)); + result2->set_friendly_name("result2"); + + auto model = std::make_shared(ov::ResultVector{result1, result2}, ov::ParameterVector{param1}); + model->set_friendly_name("SingleSplit"); + return model; +} +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/split_concat.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/split_concat.cpp new file mode 100644 index 00000000000..639c7cd04bc --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/split_concat.cpp @@ -0,0 +1,40 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/subgraph_builders/split_concat.hpp" + +#include "openvino/op/concat.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/result.hpp" +#include "openvino/op/split.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_split_concat(ov::Shape input_shape, ov::element::Type type) { + auto param1 = std::make_shared(type, input_shape); + param1->set_friendly_name("Param1"); + param1->output(0).get_tensor().set_names({"data1"}); + + auto axis_node = ov::op::v0::Constant::create(element::i64, Shape{}, {1}); + auto split = std::make_shared(param1, axis_node, 2); + split->set_friendly_name("Split"); + split->output(0).get_tensor().set_names({"tensor_split_1"}); + split->output(1).get_tensor().set_names({"tensor_split_2"}); + + auto concat = std::make_shared(OutputVector{split->output(0), split->output(1)}, 1); + concat->set_friendly_name("Concat_op"); + concat->output(0).get_tensor().set_names({"Concat"}); + + auto result = std::make_shared(concat); + result->set_friendly_name("Result"); + + auto model = std::make_shared(ov::ResultVector{result}, ov::ParameterVector{param1}); + model->set_friendly_name("SplitConcat"); + return model; +} +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/split_conv_concat.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/split_conv_concat.cpp new file mode 100644 index 00000000000..3b9912b22d6 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/split_conv_concat.cpp @@ -0,0 +1,544 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/subgraph_builders/split_conv_concat.hpp" + +#include "common_test_utils/node_builders/convolution.hpp" +#include "openvino/op/concat.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/relu.hpp" +#include "openvino/op/result.hpp" +#include "openvino/op/split.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_split_conv_concat(ov::Shape input_shape, ov::element::Type type) { + ov::ParameterVector params{std::make_shared(type, input_shape)}; + params.front()->set_friendly_name("Param_1"); + params.front()->get_output_tensor(0).set_names({"input_tensor"}); + + auto split_axis_op = std::make_shared(ov::element::i64, ov::Shape{}, std::vector{1}); + auto split = std::make_shared(params[0], split_axis_op, 2); + + auto conv1 = ov::test::utils::make_convolution(split->output(0), + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto relu1 = std::make_shared(conv1); + + auto conv2 = ov::test::utils::make_convolution(split->output(1), + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + + auto relu2 = std::make_shared(conv2); + + auto concat = std::make_shared(ov::OutputVector{relu1->output(0), relu2->output(0)}, 1); + concat->get_output_tensor(0).set_names({"concat_tensor"}); + + ov::ResultVector results{std::make_shared(concat)}; + + std::shared_ptr model = std::make_shared(results, params); + model->set_friendly_name("SplitConvConcat"); + return model; +} + +std::shared_ptr make_cplit_conv_concat_input_in_branch(ov::Shape input_shape, ov::element::Type type) { + ov::ParameterVector params{std::make_shared(type, input_shape), + std::make_shared(type, input_shape)}; + auto split_axis_op = std::make_shared(ov::element::i64, ov::Shape{}, std::vector{1}); + auto split = std::make_shared(params[0], split_axis_op, 2); + + auto conv1 = ov::test::utils::make_convolution(split->output(0), + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto relu1 = std::make_shared(conv1); + + auto conv2 = ov::test::utils::make_convolution(split->output(1), + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto relu2 = std::make_shared(conv2); + + auto conv4 = ov::test::utils::make_convolution(params[1]->output(0), + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto relu4 = std::make_shared(conv4); + + auto concat = std::make_shared(ov::OutputVector{relu4->output(0), relu2->output(0)}, 1); + + auto conv3 = ov::test::utils::make_convolution(concat, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto relu3 = std::make_shared(conv3); + + auto concat1 = std::make_shared(ov::OutputVector{relu1->output(0), relu3->output(0)}, 1); + ov::ResultVector results{std::make_shared(concat1)}; + + std::shared_ptr model = std::make_shared(results, params); + model->set_friendly_name("SplitConvConcatInputInBranch"); + return model; +} + +std::shared_ptr make_cplit_conv_concat_nested_in_branch(ov::Shape input_shape, ov::element::Type type) { + ov::ParameterVector params{std::make_shared(type, input_shape), + std::make_shared(type, input_shape)}; + + int localId = 0; +#define SET_NAME(node) node->set_friendly_name(#node + std::to_string(localId++)); + + auto split_axis_op = std::make_shared(ov::element::i64, ov::Shape{}, std::vector{1}); + + auto split = std::make_shared(params[0], split_axis_op, 2); + SET_NAME(split); + + auto conv1 = ov::test::utils::make_convolution(split->output(0), + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + SET_NAME(conv1); + + auto relu1 = std::make_shared(conv1); + SET_NAME(relu1); + + auto conv2 = ov::test::utils::make_convolution(split->output(1), + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + SET_NAME(conv2); + + auto relu2 = std::make_shared(conv2); + SET_NAME(relu2); + + auto nested_subgraph = [&] { + auto split_axis_op = + std::make_shared(ov::element::i64, ov::Shape{}, std::vector{1}); + auto split = std::make_shared(params[1], split_axis_op, 2); + SET_NAME(split); + + auto conv1 = ov::test::utils::make_convolution(split->output(0), + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + SET_NAME(conv1); + + auto relu1 = std::make_shared(conv1); + SET_NAME(relu1); + + auto conv2 = ov::test::utils::make_convolution(split->output(1), + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 10); + SET_NAME(conv2); + + auto relu2 = std::make_shared(conv2); + SET_NAME(relu2); + + auto split2_axis_op = + std::make_shared(ov::element::i64, ov::Shape{}, std::vector{1}); + auto split2 = std::make_shared(relu2, split2_axis_op, 2); + SET_NAME(split2); + + auto conv3 = ov::test::utils::make_convolution(split2->output(0), + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + SET_NAME(conv3); + + auto relu3 = std::make_shared(conv3); + SET_NAME(relu3); + + auto conv4 = ov::test::utils::make_convolution(split2->output(1), + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + SET_NAME(conv4); + + auto relu4 = std::make_shared(conv4); + SET_NAME(relu4); + + auto concat = std::make_shared(ov::OutputVector{relu3->output(0), relu4->output(0)}, 1); + SET_NAME(concat); + + auto concat1 = std::make_shared(ov::OutputVector{relu1->output(0), concat}, 1); + SET_NAME(concat1); + + auto conv5 = ov::test::utils::make_convolution(concat1, + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + SET_NAME(conv5); + + auto relu5 = std::make_shared(conv5); + SET_NAME(relu5); + + return relu5; + }(); + + auto concat = + std::make_shared(ov::OutputVector{nested_subgraph->output(0), relu2->output(0)}, 1); + SET_NAME(concat); + + auto conv3 = ov::test::utils::make_convolution(concat, + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + SET_NAME(conv3); + + auto relu3 = std::make_shared(conv3); + SET_NAME(relu3); + + auto concat1 = std::make_shared(ov::OutputVector{relu1->output(0), relu3->output(0)}, 1); + SET_NAME(concat1); + + ov::ResultVector results{std::make_shared(concat1)}; + + std::shared_ptr model = std::make_shared(results, params); + model->set_friendly_name("SplitConvConcatNestedInBranch"); + return model; +} + +std::shared_ptr make_cplit_conv_concat_nested_in_branch_nested_out(ov::Shape input_shape, + ov::element::Type type) { + ov::ParameterVector params{std::make_shared(type, input_shape), + std::make_shared(type, input_shape)}; + + int localId = 0; +#define SET_NAME(node) node->set_friendly_name(#node + std::to_string(localId++)); + + auto split_axis_op = std::make_shared(ov::element::i64, ov::Shape{}, std::vector{1}); + auto split = std::make_shared(params[0], split_axis_op, 2); + SET_NAME(split); + + auto conv1 = ov::test::utils::make_convolution(split->output(0), + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + SET_NAME(conv1); + + auto relu1 = std::make_shared(conv1); + SET_NAME(relu1); + + auto conv2 = ov::test::utils::make_convolution(split->output(1), + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 10); + SET_NAME(conv2); + + auto relu2 = std::make_shared(conv2); + SET_NAME(relu2); + + auto split3_axis_op = + std::make_shared(ov::element::i64, ov::Shape{}, std::vector{1}); + auto split3 = std::make_shared(relu2, split3_axis_op, 2); + SET_NAME(split3); + + auto conv32 = ov::test::utils::make_convolution(split3->output(1), + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 10); + SET_NAME(conv32); + + auto relu32 = std::make_shared(conv32); + SET_NAME(relu32); + + auto nested_subgraph = [&] { + auto split_axis_op = + std::make_shared(ov::element::i64, ov::Shape{}, std::vector{1}); + auto split = std::make_shared(params[1], split_axis_op, 2); + SET_NAME(split); + + auto conv1 = ov::test::utils::make_convolution(split->output(0), + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + SET_NAME(conv1); + + auto relu1 = std::make_shared(conv1); + SET_NAME(relu1); + + auto conv2 = ov::test::utils::make_convolution(split->output(1), + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 10); + SET_NAME(conv2); + + auto relu2 = std::make_shared(conv2); + SET_NAME(relu2); + + auto split2_axis_op = + std::make_shared(ov::element::i64, ov::Shape{}, std::vector{1}); + auto split2 = std::make_shared(relu2, split2_axis_op, 2); + SET_NAME(split2); + + auto conv3 = ov::test::utils::make_convolution(split2->output(0), + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + SET_NAME(conv3); + + auto relu3 = std::make_shared(conv3); + SET_NAME(relu3); + + auto conv4 = ov::test::utils::make_convolution(split2->output(1), + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + SET_NAME(conv4); + + auto relu4 = std::make_shared(conv4); + SET_NAME(relu4); + + auto concat = std::make_shared(ov::OutputVector{relu3->output(0), relu4->output(0)}, 1); + SET_NAME(concat); + + auto concat1 = std::make_shared(ov::OutputVector{relu1->output(0), concat}, 1); + SET_NAME(concat1); + + auto conv5 = ov::test::utils::make_convolution(concat1, + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + SET_NAME(conv5); + + auto relu5 = std::make_shared(conv5); + SET_NAME(relu5); + return relu5; + }(); + + auto nested_subgraph1 = [&] { + auto split_axis_op = + std::make_shared(ov::element::i64, ov::Shape{}, std::vector{1}); + auto split = std::make_shared(relu32, split_axis_op, 2); + SET_NAME(split); + + auto conv1 = ov::test::utils::make_convolution(split->output(0), + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + SET_NAME(conv1); + + auto relu1 = std::make_shared(conv1); + SET_NAME(relu1); + + auto conv2 = ov::test::utils::make_convolution(split->output(1), + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 10); + SET_NAME(conv2); + + auto relu2 = std::make_shared(conv2); + SET_NAME(relu2); + + auto split2_axis_op = + std::make_shared(ov::element::i64, ov::Shape{}, std::vector{1}); + auto split2 = std::make_shared(relu2, split2_axis_op, 2); + SET_NAME(split2); + + auto conv3 = ov::test::utils::make_convolution(split2->output(0), + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + SET_NAME(conv3); + + auto relu3 = std::make_shared(conv3); + SET_NAME(relu3); + + auto conv4 = ov::test::utils::make_convolution(split2->output(1), + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + SET_NAME(conv4); + + auto relu4 = std::make_shared(conv4); + SET_NAME(relu4); + + auto concat = std::make_shared(ov::OutputVector{relu3->output(0), relu4->output(0)}, 1); + SET_NAME(concat); + + auto concat1 = std::make_shared(ov::OutputVector{relu1->output(0), concat}, 1); + SET_NAME(concat1); + + auto conv5 = ov::test::utils::make_convolution(concat1, + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + SET_NAME(conv5); + + auto relu5 = std::make_shared(conv5); + SET_NAME(relu5); + return relu5; + }(); + + auto concat = + std::make_shared(ov::OutputVector{nested_subgraph->output(0), split3->output(0)}, 1); + SET_NAME(concat); + + auto conv3 = ov::test::utils::make_convolution(concat, + type, + {3, 3}, + {1, 1}, + {1, 1}, + {1, 1}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + SET_NAME(conv3); + + auto relu3 = std::make_shared(conv3); + SET_NAME(relu3); + + auto concat1 = std::make_shared(ov::OutputVector{relu1->output(0), relu3->output(0)}, 1); + SET_NAME(concat1); + + ov::ResultVector results{std::make_shared(concat1), + std::make_shared(nested_subgraph1)}; + + std::shared_ptr model = std::make_shared(results, params); + model->set_friendly_name("SplitConvConcatNestedInBranchNestedOut"); + return model; +} +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/split_multi_conv_concat.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/split_multi_conv_concat.cpp new file mode 100644 index 00000000000..98d2f2791b1 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/split_multi_conv_concat.cpp @@ -0,0 +1,146 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/subgraph_builders/split_multi_conv_concat.hpp" + +#include "common_test_utils/node_builders/convolution.hpp" +#include "openvino/op/concat.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/relu.hpp" +#include "openvino/op/result.hpp" +#include "openvino/op/split.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_split_multi_conv_concat(ov::Shape input_shape, ov::element::Type type) { + ov::ParameterVector params{std::make_shared(type, input_shape)}; + params.front()->set_friendly_name("Param_1"); + params.front()->get_output_tensor(0).set_names({"input_tensor"}); + + auto split_axis_op = + std::make_shared(ov::element::Type_t::i64, ov::Shape{}, std::vector{1}); + auto split = std::make_shared(params[0], split_axis_op, 2); + + auto conv1_0 = ov::test::utils::make_convolution(split->output(0), + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto relu1_0 = std::make_shared(conv1_0); + + auto conv1_1 = ov::test::utils::make_convolution(relu1_0, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto relu1_1 = std::make_shared(conv1_1); + + auto conv1_2 = ov::test::utils::make_convolution(relu1_1, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto relu1_2 = std::make_shared(conv1_2); + + auto conv1_3 = ov::test::utils::make_convolution(relu1_2, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto relu1_3 = std::make_shared(conv1_3); + + auto conv1_4 = ov::test::utils::make_convolution(relu1_2, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto relu1_4 = std::make_shared(conv1_4); + + auto conv2_0 = ov::test::utils::make_convolution(split->output(1), + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto relu2_0 = std::make_shared(conv2_0); + + auto conv2_1 = ov::test::utils::make_convolution(relu2_0, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto relu2_1 = std::make_shared(conv2_1); + + auto conv2_2 = ov::test::utils::make_convolution(relu2_1, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto relu2_2 = std::make_shared(conv2_2); + + auto conv2_3 = ov::test::utils::make_convolution(relu2_2, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto relu2_3 = std::make_shared(conv2_3); + + auto conv2_4 = ov::test::utils::make_convolution(relu2_2, + type, + {3, 3}, + {1, 1}, + {0, 0}, + {0, 0}, + {1, 1}, + ov::op::PadType::EXPLICIT, + 5); + auto relu2_4 = std::make_shared(conv2_4); + + auto concat = std::make_shared(ov::OutputVector{relu1_4->output(0), relu2_4->output(0)}, 1); + ov::ResultVector results{std::make_shared(concat)}; + + std::shared_ptr model = std::make_shared(results, params); + model->set_friendly_name("SplitMultiConvConcat"); + return model; +} +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/common_test_utils/src/subgraph_builders/ti_with_lstm_cell.cpp b/src/tests/test_utils/common_test_utils/src/subgraph_builders/ti_with_lstm_cell.cpp new file mode 100644 index 00000000000..00d9a492482 --- /dev/null +++ b/src/tests/test_utils/common_test_utils/src/subgraph_builders/ti_with_lstm_cell.cpp @@ -0,0 +1,72 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/subgraph_builders/ti_with_lstm_cell.hpp" + +#include "openvino/op/constant.hpp" +#include "openvino/op/lstm_cell.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/reshape.hpp" +#include "openvino/op/result.hpp" +#include "openvino/op/tensor_iterator.hpp" + +namespace ov { +namespace test { +namespace utils { +std::shared_ptr make_ti_with_lstm_cell(ov::element::Type type, size_t N, size_t L, size_t I, size_t H) { + auto SENT = std::make_shared(type, ov::Shape{N, L, I}); + + auto H_init = std::make_shared(type, ov::Shape{N, 1, H}); + auto C_init = std::make_shared(type, ov::Shape{N, 1, H}); + + auto H_t = std::make_shared(type, ov::Shape{N, 1, H}); + auto C_t = std::make_shared(type, ov::Shape{N, 1, H}); + + // Body + auto X = std::make_shared(type, ov::Shape{N, 1, I}); + std::vector dataW(4 * H * I, 0); + auto W_body = std::make_shared(type, ov::Shape{4 * H, I}, dataW); + std::vector dataR(4 * H * H, 0); + auto R_body = std::make_shared(type, ov::Shape{4 * H, H}, dataR); + std::vector inShape = {N, H}; + auto constantH = std::make_shared(ov::element::i64, ov::Shape{2}, inShape); + inShape = {N, I}; + auto constantX = std::make_shared(ov::element::i64, ov::Shape{2}, inShape); + auto LSTM_cell = + std::make_shared(std::make_shared(X, constantX, false), + std::make_shared(H_t, constantH, false), + std::make_shared(C_t, constantH, false), + W_body, + R_body, + H); + inShape = {N, 1, H}; + auto constantHo = std::make_shared(ov::element::i64, ov::Shape{3}, inShape); + auto H_o = std::make_shared(LSTM_cell->output(0), constantHo, false); + auto C_o = std::make_shared(LSTM_cell->output(1), constantHo, false); + auto body = std::make_shared(ov::OutputVector{H_o, C_o}, ov::ParameterVector{X, H_t, C_t}); + + auto tensor_iterator = std::make_shared(); + tensor_iterator->set_body(body); + // start=0, stride=1, part_size=1, end=39, axis=1 + tensor_iterator->set_sliced_input(X, SENT, 0, 1, 1, -1, 1); + // H_t is Hinit on the first iteration, Ho after that + tensor_iterator->set_merged_input(H_t, H_init, H_o); + tensor_iterator->set_merged_input(C_t, C_init, C_o); + + // Output 0 is last Ho, result 0 of body + auto out0 = tensor_iterator->get_iter_value(H_o, -1); + // Output 1 is last Co, result 1 of body + auto out1 = tensor_iterator->get_iter_value(C_o, -1); + + auto results = + ov::ResultVector{std::make_shared(out0), std::make_shared(out1)}; + + auto model = std::make_shared(results, ov::ParameterVector{SENT, H_init, C_init}); + model->set_friendly_name("TIwithLSTMcell"); + return model; +} + +} // namespace utils +} // namespace test +} // namespace ov \ No newline at end of file diff --git a/src/tests/test_utils/functional_test_utils/src/test_model/test_model.cpp b/src/tests/test_utils/functional_test_utils/src/test_model/test_model.cpp index b5d63dfd6ef..a2ef41f1f9a 100644 --- a/src/tests/test_utils/functional_test_utils/src/test_model/test_model.cpp +++ b/src/tests/test_utils/functional_test_utils/src/test_model/test_model.cpp @@ -4,10 +4,10 @@ #include "functional_test_utils/test_model/test_model.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" #include "openvino/core/partial_shape.hpp" #include "openvino/pass/manager.hpp" #include "openvino/pass/serialize.hpp" -#include "ov_models/subgraph_builders.hpp" namespace ov { namespace test { @@ -19,7 +19,7 @@ void generate_test_model(const std::string& model_path, const ov::PartialShape& input_shape) { ov::pass::Manager manager; manager.register_pass(model_path, weights_path); - manager.run_passes(ngraph::builder::subgraph::makeConvPoolRelu(input_shape.to_shape(), input_type)); + manager.run_passes(ov::test::utils::make_conv_pool_relu(input_shape.to_shape(), input_type)); } } // namespace utils