From 48b47e754fdc600cc89e13e6ee945badc63b9c57 Mon Sep 17 00:00:00 2001 From: Oleg Pipikin Date: Fri, 23 Jun 2023 09:51:47 +0200 Subject: [PATCH] Rename ngraph with ov in common_test_utils (#17905) * Rename ngraph with ov in common_test_utils * Fix comments * Delete opset includes from commonTestUtils * Fix CI and code style * Apply comments * Fix CI and apply comments --- .../tests/add_transformation.cpp | 2 +- ...quantization_parameters_transformation.cpp | 17 +- .../assign_and_read_value_transformation.cpp | 2 +- .../tests/avg_pool_transformation.cpp | 4 +- .../avg_pool_with_child_transformation.cpp | 4 +- .../tests/clamp_transformation.cpp | 2 +- .../compose_fake_quantize_transformation.cpp | 2 +- ...ction_with_intermediate_transformation.cpp | 8 +- .../tests/concat_transformation.cpp | 2 +- ...t_with_different_precision_on_children.cpp | 8 +- .../tests/concat_with_fq_tranformation.cpp | 14 +- ...ate_precision_selection_transformation.cpp | 12 +- ...th_intermediate_reshape_transformation.cpp | 6 +- ...oncat_with_intermediate_transformation.cpp | 8 +- ...ermediate_with_constant_transformation.cpp | 10 +- .../concat_with_neighbors_transformation.cpp | 10 +- ...ghbors_transformation_with_convolution.cpp | 6 +- ...th_not_quantized_parent_transformation.cpp | 10 +- ...with_reshape_at_the_end_transformation.cpp | 8 +- .../concat_with_split_transformation.cpp | 10 +- ...ncat_with_strided_slice_transformation.cpp | 12 +- ...nvolution_backprop_data_transformation.cpp | 24 +- .../tests/convolution_qdq_transformation.cpp | 2 +- .../tests/convolution_transformation.cpp | 6 +- .../convolution_with_incorrect_weights.cpp | 5 +- ...i_parent_dequantization_transformation.cpp | 2 +- ...eliminate_fake_quantize_transformation.cpp | 11 +- ...d_two_output_branches_with_convolution.cpp | 4 +- ...tize_on_weights_with_unsupported_child.cpp | 6 +- ...ize_precision_selection_transformation.cpp | 10 +- .../tests/fake_quantize_transformation.cpp | 9 +- ...ize_with_dq_not_optimal_transformation.cpp | 8 +- ..._with_dynamic_intervals_transformation.cpp | 40 +- .../tests/fold_convert_transformation.cpp | 6 +- .../fold_fake_quantize_in_transformations.cpp | 16 +- .../tests/fuse_convert_transformation.cpp | 2 +- ...antize_to_fake_quantize_transformation.cpp | 7 +- ...ntize_with_multi_inputs_transformation.cpp | 2 +- ...ltiply_to_fake_quantize_transformation.cpp | 2 +- ...btract_to_fake_quantize_transformation.cpp | 2 +- .../tests/gather_transformation.cpp | 2 +- .../group_convolution_transformation.cpp | 4 +- .../tests/interpolate_transformation.cpp | 2 +- ...s_asymmetric_on_weights_dequantization.cpp | 2 +- .../tests/is_asymmetric_on_weights_fq.cpp | 2 +- .../tests/is_constant_path_transformation.cpp | 32 +- .../is_function_quantized_transformation.cpp | 4 +- .../low_precision_transformations_test.cpp | 4 +- .../lpt_avoid_shapeof_propagation_test.cpp | 535 ++++++------ .../tests/lpt_public_methods_test.cpp | 8 +- ...kup_avg_pool_precisions_transformation.cpp | 4 +- .../tests/markup_bias_transformation.cpp | 2 +- .../tests/max_pool_transformation.cpp | 2 +- .../move_fake_quantize_transformation.cpp | 12 +- ...ly_to_group_convolution_transformation.cpp | 36 +- .../tests/multiply_transformation.cpp | 2 +- .../tests/mvn_transformation.cpp | 2 +- .../tests/normalize_l2_transformation.cpp | 2 +- .../tests/pad_transformation.cpp | 2 +- .../tests/prelu_transformation.cpp | 2 +- .../tests/reduce_max_transformation.cpp | 4 +- .../tests/reduce_mean_transformation.cpp | 4 +- .../tests/reduce_min_transformation.cpp | 4 +- .../tests/reduce_sum_transformation.cpp | 4 +- .../tests/relu_transformation.cpp | 2 +- .../tests/reshape_transformation.cpp | 2 +- ...te_in_standalone_branch_transformation.cpp | 32 +- .../tests/shuffle_channels_transformation.cpp | 2 +- .../tests/split_transformation.cpp | 2 +- .../tests/squeeze_transformation.cpp | 2 +- .../tests/strided_slice_transformation.cpp | 2 +- ...fq_decomposition_with_shared_constants.cpp | 28 +- ...sformations_after_split_transformation.cpp | 44 +- .../tests/transpose_transformation.cpp | 3 +- .../tests/unit/get_data_precision.cpp | 64 +- .../tests/unsqueeze_transformation.cpp | 2 +- .../tests/variadic_split_transformation.cpp | 2 +- .../common_optimizations/clamp_fusion.cpp | 8 +- .../compress_float_constants_test.cpp | 16 +- .../concat_reduce_fusion.cpp | 230 +++--- ...nvert_nms_gather_path_to_unsigned_test.cpp | 2 +- .../fq_mul_fusion_test.cpp | 6 +- .../fq_reshape_fusion.cpp | 6 +- .../common_optimizations/gelu_fusion.cpp | 16 +- .../hsigmoid_fusion_test.cpp | 13 +- .../leaky_relu_fusion.cpp | 6 +- .../low_latency_v2_test.cpp | 2 +- .../ngraph_fq_transpose_test.cpp | 51 +- .../common_optimizations/nop_elimination.cpp | 101 ++- .../preprocessing_fusion_tests.cpp | 30 +- .../shuffle_channels_fusion_test.cpp | 6 +- .../simplify_second_input_of_reshape_test.cpp | 2 +- .../common_optimizations/softmax_fusion.cpp | 18 +- .../strides_optimization.cpp | 766 +++++++++--------- ...anspose_reshape_elimination_for_matmul.cpp | 126 +-- .../transpose_sinking_test.cpp | 12 +- .../transpose_to_reshape_test.cpp | 14 +- .../weights_dequantize_to_fake_quantize.cpp | 6 +- .../tests/control_flow/unroll_if_test.cpp | 146 ++-- .../convert_nms9_to_nms_ie_internal_test.cpp | 60 +- .../convert_reduce_to_pooling_test.cpp | 6 +- ...nvert_scatter_elements_to_scatter_test.cpp | 8 +- .../ngraph_depth_to_space_transform_test.cpp | 24 +- .../ngraph_mode_decomposition_test.cpp | 6 +- .../tests/smart_reshape/sr_mimicking_sbs.cpp | 6 +- .../smart_reshape/sr_proposal_scales.cpp | 8 +- .../tests/smart_reshape/sr_reshape_1d.cpp | 4 +- .../sr_strided_slice_squeeze.cpp | 16 +- .../tests/smart_reshape/sr_sub_graph_ops.cpp | 12 +- .../tests/utils/compare_functions_test.cpp | 2 +- .../tests/pass/serialization/custom_ops.cpp | 42 +- .../pass/serialization/deterministicity.cpp | 6 +- .../tests/pass/serialization/from_model.cpp | 19 +- .../ir/tests/rt_info_deserialization.cpp | 54 +- .../tests/onnx_editor_topological_sort.cpp | 31 +- .../onnx/tests/onnx_ops_registration.cpp | 7 +- src/frontends/onnx/tests/op_extension.cpp | 5 + .../frontend/shared/src/library_extension.cpp | 8 +- src/inference/tests/functional/CMakeLists.txt | 1 + .../functional/legacy/ov_extension_test.cpp | 64 ++ .../tests/functional/ov_extension_test.cpp | 213 +---- .../tests/functional/ov_extension_test.hpp | 157 ++++ .../tests/unit/add_preprocessing.cpp | 1 + .../tests/unit/ie_extension_test.cpp | 4 + .../src/fuse_non0_output_port.cpp | 12 +- .../src/fuse_transpose_reorder.cpp | 12 +- .../subgraph_tests/src/interaction.cpp | 2 +- .../subgraph_tests/src/reshape_inplace.cpp | 6 +- .../src/subgraph_with_blocked_format.cpp | 4 +- .../x64/convert_to_interaction.cpp | 12 +- .../fake_quantize_tokenization_test.cpp | 5 +- .../legacy/tests/conv_fusion_test.cpp | 6 +- .../legacy/tests/convert_nms5_test.cpp | 2 +- .../legacy/tests/convert_topk_test.cpp | 2 +- .../legacy/tests/fc_bias_fusion_test.cpp | 6 +- .../legacy/tests/mul_add_conversion_test.cpp | 16 +- .../legacy/tests/reshape_fc_fusion_test.cpp | 24 +- .../deprecated/helpers/tests_file_utils.cpp | 4 +- .../cnn_ngraph_impl_tests.cpp | 45 +- .../subgraph_reference/preprocess.cpp | 10 +- .../src/matchers/convolutions.cpp | 3 + .../src/matchers/single_op.cpp | 2 +- .../tests/matchers/convolutions_matcher.cpp | 32 +- .../tests/matchers/generic_single_op.cpp | 42 +- .../compiled_model/compiled_model_base.hpp | 16 +- .../behavior/compiled_model/import_export.hpp | 52 +- .../executable_network/exec_network_base.hpp | 12 +- .../ov_executable_network/exec_graph_info.hpp | 16 +- .../exec_network_base.hpp | 16 +- .../ov_infer_request/infer_correctness.cpp | 10 +- .../shared/src/snippets/check_broadcast.cpp | 8 +- .../src/single_layer/random_uniform.cpp | 2 +- .../common_test_utils/common_utils.cpp | 3 +- .../common_test_utils/common_utils.hpp | 9 +- .../common_test_utils/data_utils.cpp | 5 + .../common_test_utils/data_utils.hpp | 3 + .../common_test_utils/graph_comparator.cpp | 361 +++++---- .../common_test_utils/graph_comparator.hpp | 198 ++--- .../common_test_utils/ngraph_test_utils.cpp | 33 +- .../common_test_utils/ngraph_test_utils.hpp | 44 +- .../common_test_utils/ov_tensor_utils.cpp | 1 - .../tests/graph_comparator_tests.cpp | 397 ++++----- ...weights_and_unsupported_child_function.hpp | 2 +- .../lpt_ngraph_functions/reduce_function.hpp | 20 +- .../src/subgraph_simple.cpp | 10 +- 165 files changed, 2530 insertions(+), 2467 deletions(-) create mode 100644 src/inference/tests/functional/legacy/ov_extension_test.cpp create mode 100644 src/inference/tests/functional/ov_extension_test.hpp diff --git a/src/common/low_precision_transformations/tests/add_transformation.cpp b/src/common/low_precision_transformations/tests/add_transformation.cpp index ca3e743b3b8..f8ad91f6857 100644 --- a/src/common/low_precision_transformations/tests/add_transformation.cpp +++ b/src/common/low_precision_transformations/tests/add_transformation.cpp @@ -99,7 +99,7 @@ public: testValues.postops_configuration); SimpleLowPrecisionTransformer transform; - transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); auto inputShape1Ref = inputShapes.first; diff --git a/src/common/low_precision_transformations/tests/align_concat_quantization_parameters_transformation.cpp b/src/common/low_precision_transformations/tests/align_concat_quantization_parameters_transformation.cpp index 2efbe05fae8..b21224a2953 100644 --- a/src/common/low_precision_transformations/tests/align_concat_quantization_parameters_transformation.cpp +++ b/src/common/low_precision_transformations/tests/align_concat_quantization_parameters_transformation.cpp @@ -72,22 +72,21 @@ public: testValues.actual.dequantization); auto supportedPrecisions = std::vector( - {ngraph::pass::low_precision::PrecisionsRestriction::create( + {ngraph::pass::low_precision::PrecisionsRestriction::create( {{{0}, {ngraph::element::u8}}, {{1}, {ngraph::element::i8}}})}); auto perTensorQuantization = std::vector({ - ngraph::pass::low_precision::QuantizationGranularityRestriction::create({0}), + ngraph::pass::low_precision::QuantizationGranularityRestriction::create({0}), }); SimpleLowPrecisionTransformer transform(supportedPrecisions, perTensorQuantization); - transform.add(testValues.params); - transform.add(testValues.params); - transform.add( + transform.add(testValues.params); + transform.add(testValues.params); + transform.add( testValues.params); - transform - .add( - testValues.params); - transform.add(testValues.params); + transform.add( + testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::AlignConcatQuantizationParametersFunction::getReference( diff --git a/src/common/low_precision_transformations/tests/assign_and_read_value_transformation.cpp b/src/common/low_precision_transformations/tests/assign_and_read_value_transformation.cpp index 0de217a8e95..4d25723744f 100644 --- a/src/common/low_precision_transformations/tests/assign_and_read_value_transformation.cpp +++ b/src/common/low_precision_transformations/tests/assign_and_read_value_transformation.cpp @@ -74,7 +74,7 @@ public: testValues.actual.dequantization); SimpleLowPrecisionTransformer transformer({}, {}, { ngraph::element::f32, defaultPrecisions }); - transformer.add(actualFunction, params); + transformer.add(actualFunction, params); transformer.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::AssignAndReadValueFunction::getReference( diff --git a/src/common/low_precision_transformations/tests/avg_pool_transformation.cpp b/src/common/low_precision_transformations/tests/avg_pool_transformation.cpp index 391f2e4fa9a..1d3a0b1ce35 100644 --- a/src/common/low_precision_transformations/tests/avg_pool_transformation.cpp +++ b/src/common/low_precision_transformations/tests/avg_pool_transformation.cpp @@ -67,8 +67,8 @@ public: testValues.actual.dequantization); SimpleLowPrecisionTransformer transform; - transform.add(testValues.params); - transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); referenceFunction = diff --git a/src/common/low_precision_transformations/tests/avg_pool_with_child_transformation.cpp b/src/common/low_precision_transformations/tests/avg_pool_with_child_transformation.cpp index a90f42629ee..e68a467b1b2 100644 --- a/src/common/low_precision_transformations/tests/avg_pool_with_child_transformation.cpp +++ b/src/common/low_precision_transformations/tests/avg_pool_with_child_transformation.cpp @@ -63,8 +63,8 @@ public: testValues.actual.dequantization); SimpleLowPrecisionTransformer transform; - transform.add(testValues.params); - transform.add( + transform.add(testValues.params); + transform.add( testValues.params); transform.transform(actualFunction); diff --git a/src/common/low_precision_transformations/tests/clamp_transformation.cpp b/src/common/low_precision_transformations/tests/clamp_transformation.cpp index c89a3c589ed..14315c9c420 100644 --- a/src/common/low_precision_transformations/tests/clamp_transformation.cpp +++ b/src/common/low_precision_transformations/tests/clamp_transformation.cpp @@ -60,7 +60,7 @@ public: testValues.actual.dequantization); SimpleLowPrecisionTransformer transformer; - transformer.add(testValues.params); + transformer.add(testValues.params); transformer.transform(actualFunction); referenceFunction = testValues.nonDequantizationMultiply diff --git a/src/common/low_precision_transformations/tests/compose_fake_quantize_transformation.cpp b/src/common/low_precision_transformations/tests/compose_fake_quantize_transformation.cpp index f33fa8c9d91..8815171e26c 100644 --- a/src/common/low_precision_transformations/tests/compose_fake_quantize_transformation.cpp +++ b/src/common/low_precision_transformations/tests/compose_fake_quantize_transformation.cpp @@ -58,7 +58,7 @@ public: const auto input = actualFunction->get_parameters()[0]; const auto fakeQuantizes = input->output(0).get_target_inputs(); const auto it = fakeQuantizes.begin(); - const auto fakeQuantize = ngraph::as_type_ptr(it->get_node()->shared_from_this()); + const auto fakeQuantize = ngraph::as_type_ptr(it->get_node()->shared_from_this()); low_precision::NetworkHelper::composeFakeQuantize(fakeQuantize); referenceFunction = ngraph::builder::subgraph::ComposeFakeQuantizeFunction::get( diff --git a/src/common/low_precision_transformations/tests/concat_selection_with_intermediate_transformation.cpp b/src/common/low_precision_transformations/tests/concat_selection_with_intermediate_transformation.cpp index 4eb9d062368..bcf3aa481d2 100644 --- a/src/common/low_precision_transformations/tests/concat_selection_with_intermediate_transformation.cpp +++ b/src/common/low_precision_transformations/tests/concat_selection_with_intermediate_transformation.cpp @@ -86,15 +86,15 @@ public: testValues.actual.fakeQuantize2); auto supportedPrecisions = std::vector({ - ngraph::pass::low_precision::PrecisionsRestriction::create({ + ngraph::pass::low_precision::PrecisionsRestriction::create({ {{0}, {ngraph::element::u8}} }) }); SimpleLowPrecisionTransformer transform(supportedPrecisions); - transform.add(testValues.params); - transform.add(testValues.params); - transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::ConcatFunction::getReferenceSelectionWithIntermediate( diff --git a/src/common/low_precision_transformations/tests/concat_transformation.cpp b/src/common/low_precision_transformations/tests/concat_transformation.cpp index fc689225fde..f2a425529b3 100644 --- a/src/common/low_precision_transformations/tests/concat_transformation.cpp +++ b/src/common/low_precision_transformations/tests/concat_transformation.cpp @@ -65,7 +65,7 @@ public: testValues.concatAxis); SimpleLowPrecisionTransformer transformer; - transformer.add(testValues.params); + transformer.add(testValues.params); transformer.transform(actualFunction); referenceFunction = ConcatFunction::get( diff --git a/src/common/low_precision_transformations/tests/concat_with_different_precision_on_children.cpp b/src/common/low_precision_transformations/tests/concat_with_different_precision_on_children.cpp index 1426185697f..93416e392bc 100644 --- a/src/common/low_precision_transformations/tests/concat_with_different_precision_on_children.cpp +++ b/src/common/low_precision_transformations/tests/concat_with_different_precision_on_children.cpp @@ -94,13 +94,13 @@ public: auto quantizationRestrictions = testValues.multiChannels ? std::vector() : std::vector({ - ngraph::pass::low_precision::QuantizationGranularityRestriction::create() + ngraph::pass::low_precision::QuantizationGranularityRestriction::create() }); SimpleLowPrecisionTransformer transform({}, quantizationRestrictions); - transform.add(testValues.params); - transform.add(testValues.params); - transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::ConcatFunction::getReferenceWithDifferentPrecisionOnChildren( diff --git a/src/common/low_precision_transformations/tests/concat_with_fq_tranformation.cpp b/src/common/low_precision_transformations/tests/concat_with_fq_tranformation.cpp index cd4ce107e23..ce349da5e4a 100644 --- a/src/common/low_precision_transformations/tests/concat_with_fq_tranformation.cpp +++ b/src/common/low_precision_transformations/tests/concat_with_fq_tranformation.cpp @@ -131,14 +131,14 @@ public: testValues.axis, testValues.addNotPrecisionPreservedOperation); auto supportedPrecisionsOnActivation = std::vector( - {ngraph::pass::low_precision::PrecisionsRestriction::create( + {ngraph::pass::low_precision::PrecisionsRestriction::create( {{{0}, testValues.params.precisionsOnActivations}})}); auto quantizationRestrictions = - testValues.multiChannels ? std::vector() - : std::vector( - {ngraph::pass::low_precision::QuantizationGranularityRestriction::create< - ngraph::opset1::AvgPool>()}); + testValues.multiChannels + ? std::vector() + : std::vector( + {ngraph::pass::low_precision::QuantizationGranularityRestriction::create()}); const auto params = TestTransformationParams::toParams(testValues.params); SimpleLowPrecisionTransformer transformer(supportedPrecisionsOnActivation, quantizationRestrictions); @@ -213,13 +213,13 @@ TEST_P(ConcatWithFQTransformation, CompareFunctions) { ASSERT_TRUE(LayerTransformation::allNamesAreUnique(actualFunction)) << "Not all names are unique"; ConcatTransformationTestValues testValues = std::get<2>(GetParam()); - const auto actualFakeQuantizes = LayerTransformation::get(actualFunction); + const auto actualFakeQuantizes = LayerTransformation::get(actualFunction); if (testValues.axis == 1) { ASSERT_TRUE(checkIfOutputAttributesSharedValuesAreTheSame(actualFakeQuantizes)) << "PrecisionsAttribute are not the same"; if (testValues.checkIntervalsAlignmentAttributes) { - auto operations = LayerTransformation::get(actualFunction); + auto operations = LayerTransformation::get(actualFunction); operations.insert(operations.end(), actualFakeQuantizes.begin(), actualFakeQuantizes.end()); ASSERT_TRUE(checkIfAttributesSharedValuesAreTheSame(operations)) << "IntervalsAlignmentAttribute are not the same"; diff --git a/src/common/low_precision_transformations/tests/concat_with_intermediate_precision_selection_transformation.cpp b/src/common/low_precision_transformations/tests/concat_with_intermediate_precision_selection_transformation.cpp index b632a6296c1..b14a1dc1f3c 100644 --- a/src/common/low_precision_transformations/tests/concat_with_intermediate_precision_selection_transformation.cpp +++ b/src/common/low_precision_transformations/tests/concat_with_intermediate_precision_selection_transformation.cpp @@ -90,20 +90,20 @@ public: testValues.actual.fakeQuantize2); auto supportedPrecisionsOnActivation = std::vector({ - ngraph::pass::low_precision::PrecisionsRestriction::create({{{0}, testValues.params.precisionsOnActivations}}) + ngraph::pass::low_precision::PrecisionsRestriction::create({{{0}, testValues.params.precisionsOnActivations}}) }); auto quantizationRestrictions = testValues.multiChannels ? std::vector() : std::vector({ - ngraph::pass::low_precision::QuantizationGranularityRestriction::create() + ngraph::pass::low_precision::QuantizationGranularityRestriction::create() }); SimpleLowPrecisionTransformer transform(supportedPrecisionsOnActivation, quantizationRestrictions); - transform.add(testValues.params); - transform.add(testValues.params); - transform.add(testValues.params); - transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::ConcatFunction::getReferenceWithIntermediateAvgPool( diff --git a/src/common/low_precision_transformations/tests/concat_with_intermediate_reshape_transformation.cpp b/src/common/low_precision_transformations/tests/concat_with_intermediate_reshape_transformation.cpp index 6bf76597292..5f09b176932 100644 --- a/src/common/low_precision_transformations/tests/concat_with_intermediate_reshape_transformation.cpp +++ b/src/common/low_precision_transformations/tests/concat_with_intermediate_reshape_transformation.cpp @@ -78,9 +78,9 @@ public: testValues.actual.fakeQuantize2); SimpleLowPrecisionTransformer transform; - transform.add(testValues.params); - transform.add(testValues.params); - transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::ConcatFunction::getReferenceWithIntermediateReshape( diff --git a/src/common/low_precision_transformations/tests/concat_with_intermediate_transformation.cpp b/src/common/low_precision_transformations/tests/concat_with_intermediate_transformation.cpp index aa6bc797095..2308ed31390 100644 --- a/src/common/low_precision_transformations/tests/concat_with_intermediate_transformation.cpp +++ b/src/common/low_precision_transformations/tests/concat_with_intermediate_transformation.cpp @@ -93,13 +93,13 @@ public: auto quantizationRestrictions = testValues.multiChannels ? std::vector() : std::vector({ - ngraph::pass::low_precision::QuantizationGranularityRestriction::create() + ngraph::pass::low_precision::QuantizationGranularityRestriction::create() }); SimpleLowPrecisionTransformer transform({}, quantizationRestrictions); - transform.add(testValues.params); - transform.add(testValues.params); - transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::ConcatFunction::getReferenceWithIntermediate( diff --git a/src/common/low_precision_transformations/tests/concat_with_intermediate_with_constant_transformation.cpp b/src/common/low_precision_transformations/tests/concat_with_intermediate_with_constant_transformation.cpp index 52aaf71a606..4d2e28e10aa 100644 --- a/src/common/low_precision_transformations/tests/concat_with_intermediate_with_constant_transformation.cpp +++ b/src/common/low_precision_transformations/tests/concat_with_intermediate_with_constant_transformation.cpp @@ -94,14 +94,14 @@ public: auto quantizationRestrictions = testValues.multiChannels ? std::vector() : std::vector({ - ngraph::pass::low_precision::QuantizationGranularityRestriction::create() + ngraph::pass::low_precision::QuantizationGranularityRestriction::create() }); SimpleLowPrecisionTransformer transform({}, quantizationRestrictions); - transform.add(testValues.params); - transform.add(testValues.params); - transform.add(testValues.params); - transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::ConcatFunction::getReferenceWithIntermediateWithConstant( diff --git a/src/common/low_precision_transformations/tests/concat_with_neighbors_transformation.cpp b/src/common/low_precision_transformations/tests/concat_with_neighbors_transformation.cpp index 9a2f1e89734..22d7ed81f28 100644 --- a/src/common/low_precision_transformations/tests/concat_with_neighbors_transformation.cpp +++ b/src/common/low_precision_transformations/tests/concat_with_neighbors_transformation.cpp @@ -103,7 +103,7 @@ public: testValues.additionalLayer); auto supportedPrecisionsOnActivation = std::vector({ - ngraph::pass::low_precision::PrecisionsRestriction::create({ + ngraph::pass::low_precision::PrecisionsRestriction::create({ {{0}, testValues.params.precisionsOnActivations}, {{1}, testValues.params.precisionsOnWeights} }) @@ -112,13 +112,13 @@ public: auto quantizationRestrictions = testValues.multiChannels ? std::vector() : std::vector({ - ngraph::pass::low_precision::QuantizationGranularityRestriction::create() + ngraph::pass::low_precision::QuantizationGranularityRestriction::create() }); SimpleLowPrecisionTransformer transform(supportedPrecisionsOnActivation, quantizationRestrictions); - transform.add(testValues.params); - transform.add(testValues.params); - transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::ConcatFunction::getReferenceWithNeighbors( diff --git a/src/common/low_precision_transformations/tests/concat_with_neighbors_transformation_with_convolution.cpp b/src/common/low_precision_transformations/tests/concat_with_neighbors_transformation_with_convolution.cpp index e905a7d6608..9378d1f2e4d 100644 --- a/src/common/low_precision_transformations/tests/concat_with_neighbors_transformation_with_convolution.cpp +++ b/src/common/low_precision_transformations/tests/concat_with_neighbors_transformation_with_convolution.cpp @@ -120,8 +120,8 @@ public: SimpleLowPrecisionTransformer transform(supportedPrecisionsOnActivation, quantizationRestrictions); transform.add(testValues.params); transform.add(testValues.params); - transform.add(testValues.params); - transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::PrecisionPropagationFunction::getReferenceWithNeighbors( @@ -157,7 +157,7 @@ TEST_P(ConcatWithNeighborsWithConvolutionTransformation, CompareFunctions) { //auto res = compare_functions(actualFunction, referenceFunction, true, false, false); //ASSERT_TRUE(res.first) << res.second; - auto actualFakeQuantizes = LayerTransformation::get(actualFunction); + auto actualFakeQuantizes = LayerTransformation::get(actualFunction); ASSERT_EQ(3ul, actualFakeQuantizes.size()) << "unexpected FakeQuantize operations count " << actualFakeQuantizes.size(); ASSERT_TRUE(checkIfOutputAttributesSharedValuesAreTheSame(actualFakeQuantizes)) << diff --git a/src/common/low_precision_transformations/tests/concat_with_not_quantized_parent_transformation.cpp b/src/common/low_precision_transformations/tests/concat_with_not_quantized_parent_transformation.cpp index e528acf2bbd..6783d097ed8 100644 --- a/src/common/low_precision_transformations/tests/concat_with_not_quantized_parent_transformation.cpp +++ b/src/common/low_precision_transformations/tests/concat_with_not_quantized_parent_transformation.cpp @@ -156,15 +156,15 @@ public: testValues.addNotPrecisionPreservedOperation); auto precisionsRestrictions = std::vector({ - ngraph::pass::low_precision::PrecisionsRestriction::create({ + ngraph::pass::low_precision::PrecisionsRestriction::create({ {{0}, {ngraph::element::u8}}, {{1}, {ngraph::element::i8}} }), - ngraph::pass::low_precision::PrecisionsRestriction::create({{{0}, testValues.params.precisionsOnActivations}}) + ngraph::pass::low_precision::PrecisionsRestriction::create({{{0}, testValues.params.precisionsOnActivations}}) }); auto quantizationRestrictions = std::vector({ - ngraph::pass::low_precision::QuantizationGranularityRestriction::create({0}) + ngraph::pass::low_precision::QuantizationGranularityRestriction::create({0}) }); const auto params = TestTransformationParams(testValues.params.updatePrecisions); @@ -250,7 +250,7 @@ TEST_P(ConcatWithNotQuantizedParentTransformation, CompareFunctions) { auto res = compare_functions(actualFunction, referenceFunction, true, true, false, true, false); ASSERT_TRUE(res.first) << res.second; - auto actualFakeQuantizes = LayerTransformation::get(actualFunction); + auto actualFakeQuantizes = LayerTransformation::get(actualFunction); for (auto it = actualFakeQuantizes.begin(); it != actualFakeQuantizes.end(); it++) { const auto actualFakeQuantize = *it; if (actualFakeQuantize->output(0).get_target_inputs().begin()->get_index() == 1ul) { @@ -263,7 +263,7 @@ TEST_P(ConcatWithNotQuantizedParentTransformation, CompareFunctions) { ConcatWithNotQuantizedParentTransformationTestValues testValues = std::get<2>(GetParam()); if (testValues.checkIntervalsAlignmentAttributes) { - auto operations = LayerTransformation::get(actualFunction); + auto operations = LayerTransformation::get(actualFunction); operations.insert(operations.end(), actualFakeQuantizes.begin(), actualFakeQuantizes.end()); ASSERT_TRUE(checkIfAttributesSharedValuesAreTheSame(operations)) << "IntervalsAlignmentAttribute are not the same"; diff --git a/src/common/low_precision_transformations/tests/concat_with_reshape_at_the_end_transformation.cpp b/src/common/low_precision_transformations/tests/concat_with_reshape_at_the_end_transformation.cpp index 04edfb9b126..d8b9ed48486 100644 --- a/src/common/low_precision_transformations/tests/concat_with_reshape_at_the_end_transformation.cpp +++ b/src/common/low_precision_transformations/tests/concat_with_reshape_at_the_end_transformation.cpp @@ -85,10 +85,10 @@ public: testValues.actual.fakeQuantize3); SimpleLowPrecisionTransformer transform; - transform.add(testValues.params); - transform.add(testValues.params); - transform.add(testValues.params); - transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::ConcatFunction::getReferenceWithReshapeAtTheEndTransformation( diff --git a/src/common/low_precision_transformations/tests/concat_with_split_transformation.cpp b/src/common/low_precision_transformations/tests/concat_with_split_transformation.cpp index 7c63ef04b24..c8bedd52a7f 100644 --- a/src/common/low_precision_transformations/tests/concat_with_split_transformation.cpp +++ b/src/common/low_precision_transformations/tests/concat_with_split_transformation.cpp @@ -100,7 +100,7 @@ public: addConvolution); auto supportedPrecisions = std::vector({ - ngraph::pass::low_precision::PrecisionsRestriction::create({ + ngraph::pass::low_precision::PrecisionsRestriction::create({ {{0}, testValues.params.precisionsOnActivations}, {{1}, testValues.params.precisionsOnWeights}, }) @@ -109,13 +109,13 @@ public: auto quantizationRestrictions = testValues.multiChannels ? std::vector() : std::vector({ - ngraph::pass::low_precision::QuantizationGranularityRestriction::create() + ngraph::pass::low_precision::QuantizationGranularityRestriction::create() }); SimpleLowPrecisionTransformer transform(supportedPrecisions, quantizationRestrictions); - transform.add(testValues.params); - transform.add(testValues.params); - transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::ConcatFunction::getReferenceWithSplitedIntermediate( diff --git a/src/common/low_precision_transformations/tests/concat_with_strided_slice_transformation.cpp b/src/common/low_precision_transformations/tests/concat_with_strided_slice_transformation.cpp index 144d437656a..2aef5697095 100644 --- a/src/common/low_precision_transformations/tests/concat_with_strided_slice_transformation.cpp +++ b/src/common/low_precision_transformations/tests/concat_with_strided_slice_transformation.cpp @@ -93,7 +93,7 @@ public: testValues.ssAfterConcat); auto supportedPrecisions = std::vector({ - ngraph::pass::low_precision::PrecisionsRestriction::create({ + ngraph::pass::low_precision::PrecisionsRestriction::create({ {{0}, testValues.params.precisionsOnActivations}, {{1}, testValues.params.precisionsOnWeights}, }) @@ -102,14 +102,14 @@ public: auto quantizationRestrictions = testValues.multiChannels ? std::vector() : std::vector({ - ngraph::pass::low_precision::QuantizationGranularityRestriction::create() + ngraph::pass::low_precision::QuantizationGranularityRestriction::create() }); SimpleLowPrecisionTransformer transform(supportedPrecisions, quantizationRestrictions); - transform.add(testValues.params); - transform.add(testValues.params); - transform.add(testValues.params); - transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::ConcatFunction::getReferenceWithStridedSlice( diff --git a/src/common/low_precision_transformations/tests/convolution_backprop_data_transformation.cpp b/src/common/low_precision_transformations/tests/convolution_backprop_data_transformation.cpp index c84f0dbfdcd..9269a4e88e3 100644 --- a/src/common/low_precision_transformations/tests/convolution_backprop_data_transformation.cpp +++ b/src/common/low_precision_transformations/tests/convolution_backprop_data_transformation.cpp @@ -40,7 +40,7 @@ public: ngraph::builder::subgraph::DequantizationOperations dequantizationOnActivations; builder::subgraph::FakeQuantizeOnWeights fakeQuantizeOnWeights; builder::subgraph::DequantizationOperations dequantizationOnWeights; - std::shared_ptr weights; + std::shared_ptr weights; callback_function_type callback; Actual() = default; @@ -49,7 +49,7 @@ public: const DequantizationOperations& dequantizationOnActivations, const FakeQuantizeOnWeights& fakeQuantizeOnWeights, const DequantizationOperations& dequantizationOnWeights, - const std::shared_ptr& weights, + const std::shared_ptr& weights, const callback_function_type& callback = empty_callback) : precisionBeforeDequantization(precisionBeforeDequantization), dequantizationOnActivations(dequantizationOnActivations), @@ -61,7 +61,7 @@ public: const ngraph::element::Type& precisionBeforeDequantization, const ngraph::builder::subgraph::DequantizationOperations& dequantizationOnActivations, const builder::subgraph::FakeQuantizeOnWeights& fakeQuantizeOnWeights, - const std::shared_ptr& weights, + const std::shared_ptr& weights, const callback_function_type& callback = empty_callback) : precisionBeforeDequantization(precisionBeforeDequantization), dequantizationOnActivations(dequantizationOnActivations), @@ -72,7 +72,7 @@ public: const ngraph::element::Type& precisionBeforeDequantization, const ngraph::builder::subgraph::DequantizationOperations& dequantizationOnActivations, const builder::subgraph::DequantizationOperations& dequantizationOnWeights, - const std::shared_ptr& weights, + const std::shared_ptr& weights, const callback_function_type& callback = empty_callback) : precisionBeforeDequantization(precisionBeforeDequantization), dequantizationOnActivations(dequantizationOnActivations), @@ -87,7 +87,7 @@ public: ngraph::builder::subgraph::DequantizationOperations dequantizationOnActivations; builder::subgraph::DequantizationOperations dequantizationOnWeights; ngraph::builder::subgraph::DequantizationOperations dequantizationAfter; - std::shared_ptr weights; + std::shared_ptr weights; bool transformed; }; @@ -123,7 +123,7 @@ public: std::shared_ptr actualWeights = pass::low_precision::fold( testValues.actual.weights, - opset1::Constant::create( + ov::op::v0::Constant::create( element::i64, Shape{ outputShape.size() }, Shape{ inputChannels, outputShape[1], 1, 1 })); @@ -133,19 +133,19 @@ public: netPrecision, testValues.actual.fakeQuantizeOnWeights, testValues.actual.dequantizationOnWeights, - ov::as_type_ptr(actualWeights)); + ov::as_type_ptr(actualWeights)); } else if (!testValues.actual.fakeQuantizeOnWeights.empty()) { actualWeights = ngraph::builder::subgraph::ConvolutionBackpropDataFunction::getWeights( outputShape, netPrecision, testValues.actual.fakeQuantizeOnWeights, - ov::as_type_ptr(actualWeights)); + ov::as_type_ptr(actualWeights)); } else { actualWeights = ngraph::builder::subgraph::ConvolutionBackpropDataFunction::getWeights( outputShape, netPrecision, testValues.actual.dequantizationOnWeights, - ov::as_type_ptr(actualWeights)); + ov::as_type_ptr(actualWeights)); } actualFunction = ngraph::builder::subgraph::ConvolutionBackpropDataFunction::getOriginal( @@ -163,7 +163,7 @@ public: std::shared_ptr refWeights = low_precision::fold( testValues.expected.weights, - opset1::Constant::create( + ov::op::v0::Constant::create( element::i64, Shape{ outputShape.size() }, Shape{ inputChannels, outputShape[1], 1, 1 })); @@ -174,13 +174,13 @@ public: netPrecision, testValues.actual.fakeQuantizeOnWeights, testValues.actual.dequantizationOnWeights, - ov::as_type_ptr(refWeights)); + ov::as_type_ptr(refWeights)); } else { refWeights = ngraph::builder::subgraph::ConvolutionBackpropDataFunction::getWeights( outputShape, netPrecision, testValues.expected.dequantizationOnWeights, - ov::as_type_ptr(refWeights)); + ov::as_type_ptr(refWeights)); } referenceFunction = ngraph::builder::subgraph::ConvolutionBackpropDataFunction::getReference( diff --git a/src/common/low_precision_transformations/tests/convolution_qdq_transformation.cpp b/src/common/low_precision_transformations/tests/convolution_qdq_transformation.cpp index 1efd30323a8..7a783106878 100644 --- a/src/common/low_precision_transformations/tests/convolution_qdq_transformation.cpp +++ b/src/common/low_precision_transformations/tests/convolution_qdq_transformation.cpp @@ -63,7 +63,7 @@ public: testValues.actual.dequantizationAfter); SimpleLowPrecisionTransformer transform; - transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::FakeQuantizeAndConvolutionFunction::get( diff --git a/src/common/low_precision_transformations/tests/convolution_transformation.cpp b/src/common/low_precision_transformations/tests/convolution_transformation.cpp index 00cdb0ee78a..b883e204736 100644 --- a/src/common/low_precision_transformations/tests/convolution_transformation.cpp +++ b/src/common/low_precision_transformations/tests/convolution_transformation.cpp @@ -28,7 +28,7 @@ public: public: ngraph::element::Type precisionBeforeDequantization; ngraph::builder::subgraph::DequantizationOperations dequantizationOnActivations; - std::shared_ptr weights; + std::shared_ptr weights; builder::subgraph::FakeQuantizeOnWeights fakeQuantizeOnWeights; }; @@ -36,7 +36,7 @@ public: public: ngraph::element::Type precisionBeforeDequantization; ngraph::builder::subgraph::DequantizationOperations dequantizationBefore; - std::shared_ptr weights; + std::shared_ptr weights; builder::subgraph::FakeQuantizeOnWeights fakeQuantizeOnWeights; ngraph::element::Type precisionAfterOperation; ngraph::builder::subgraph::DequantizationOperations dequantizationAfter; @@ -83,7 +83,7 @@ public: OutputVector convertedOutput(1); convertOnWeights->constant_fold(convertedOutput, convertOnWeights->input_values()); const auto convertedWeights = convertedOutput[0].get_node_shared_ptr(); - testValues.expected.weights = ov::as_type_ptr(convertedWeights); + testValues.expected.weights = ov::as_type_ptr(convertedWeights); } referenceFunction = ngraph::builder::subgraph::ConvolutionFunction::getReference( diff --git a/src/common/low_precision_transformations/tests/convolution_with_incorrect_weights.cpp b/src/common/low_precision_transformations/tests/convolution_with_incorrect_weights.cpp index 3d07741df40..62a9c3588d5 100644 --- a/src/common/low_precision_transformations/tests/convolution_with_incorrect_weights.cpp +++ b/src/common/low_precision_transformations/tests/convolution_with_incorrect_weights.cpp @@ -62,9 +62,8 @@ public: SimpleLowPrecisionTransformer transform; transform.add( testValues.params); - transform - .add( - testValues.params); + transform.add( + testValues.params); transform.transform(actualFunction); ngraph::pass::Manager cleanupManager; diff --git a/src/common/low_precision_transformations/tests/elementwise_with_multi_parent_dequantization_transformation.cpp b/src/common/low_precision_transformations/tests/elementwise_with_multi_parent_dequantization_transformation.cpp index 2decca2e023..7a525d4bb09 100644 --- a/src/common/low_precision_transformations/tests/elementwise_with_multi_parent_dequantization_transformation.cpp +++ b/src/common/low_precision_transformations/tests/elementwise_with_multi_parent_dequantization_transformation.cpp @@ -67,7 +67,7 @@ public: testValues.actual.dequantization2); SimpleLowPrecisionTransformer transform; - transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); referenceFunction = ElementwiseWithMultiParentDequantizationFunction::get( diff --git a/src/common/low_precision_transformations/tests/eliminate_fake_quantize_transformation.cpp b/src/common/low_precision_transformations/tests/eliminate_fake_quantize_transformation.cpp index 2cc4dcbd306..f29fe7c5419 100644 --- a/src/common/low_precision_transformations/tests/eliminate_fake_quantize_transformation.cpp +++ b/src/common/low_precision_transformations/tests/eliminate_fake_quantize_transformation.cpp @@ -56,13 +56,12 @@ public: testValues.actual.fakeQuantizeOnData2, {}); SimpleLowPrecisionTransformer transformer; - transformer - .add( - testValues.params); - transformer.add(testValues.params); - transformer.add( + transformer.add( testValues.params); - transformer.add( + transformer.add(testValues.params); + transformer.add( + testValues.params); + transformer.add( testValues.params); transformer.transform(actualFunction); diff --git a/src/common/low_precision_transformations/tests/fake_quantize_and_two_output_branches_with_convolution.cpp b/src/common/low_precision_transformations/tests/fake_quantize_and_two_output_branches_with_convolution.cpp index 313ed3f861a..97c0cd71d9e 100644 --- a/src/common/low_precision_transformations/tests/fake_quantize_and_two_output_branches_with_convolution.cpp +++ b/src/common/low_precision_transformations/tests/fake_quantize_and_two_output_branches_with_convolution.cpp @@ -75,8 +75,8 @@ public: testValues.actual.fqOnWeights2); SimpleLowPrecisionTransformer transform; - transform.add(testValues.params); - transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::FakeQuantizeAndTwoOutputBranchesWithConvolutionFunction::getReference( diff --git a/src/common/low_precision_transformations/tests/fake_quantize_on_weights_with_unsupported_child.cpp b/src/common/low_precision_transformations/tests/fake_quantize_on_weights_with_unsupported_child.cpp index 731a60c0fd9..6b4b5ba2d75 100644 --- a/src/common/low_precision_transformations/tests/fake_quantize_on_weights_with_unsupported_child.cpp +++ b/src/common/low_precision_transformations/tests/fake_quantize_on_weights_with_unsupported_child.cpp @@ -27,13 +27,13 @@ class FakeQuantizeOnWeightsWithUnsupportedChildTestValues { public: class Actual { public: - std::shared_ptr weights; + std::shared_ptr weights; builder::subgraph::FakeQuantizeOnWeights fakeQuantizeOnWeights; }; class Expected { public: - std::shared_ptr weights; + std::shared_ptr weights; builder::subgraph::FakeQuantizeOnWeights fakeQuantizeOnWeights; }; @@ -62,7 +62,7 @@ public: testValues.actual.fakeQuantizeOnWeights); SimpleLowPrecisionTransformer transform; - transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); ngraph::pass::Manager cleanupManager; diff --git a/src/common/low_precision_transformations/tests/fake_quantize_precision_selection_transformation.cpp b/src/common/low_precision_transformations/tests/fake_quantize_precision_selection_transformation.cpp index 44cba277c14..64381e325f7 100644 --- a/src/common/low_precision_transformations/tests/fake_quantize_precision_selection_transformation.cpp +++ b/src/common/low_precision_transformations/tests/fake_quantize_precision_selection_transformation.cpp @@ -90,17 +90,17 @@ public: }); auto supportedPrecisions = std::vector({ - ngraph::pass::low_precision::PrecisionsRestriction::create({ + ngraph::pass::low_precision::PrecisionsRestriction::create({ {{0}, testValues.precisionsOnActivationForLimitedOperation}, {{1}, { element::i8 }} }) }); SimpleLowPrecisionTransformer transform(supportedPrecisions); - transform.add(params); - transform.add(precisionLimitedOperationParams); - transform.add(params); - transform.add(params); + transform.add(params); + transform.add(precisionLimitedOperationParams); + transform.add(params); + transform.add(params); transform.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::FakeQuantizePrecisionSelectionFunction::getReference( diff --git a/src/common/low_precision_transformations/tests/fake_quantize_transformation.cpp b/src/common/low_precision_transformations/tests/fake_quantize_transformation.cpp index f55ac25589a..cbf99163887 100644 --- a/src/common/low_precision_transformations/tests/fake_quantize_transformation.cpp +++ b/src/common/low_precision_transformations/tests/fake_quantize_transformation.cpp @@ -84,14 +84,13 @@ public: fakeQuantizeOnData.addNotPrecisionPreservedOperation); auto supportedPrecisions = std::vector( - {ngraph::pass::low_precision::PrecisionsRestriction::create( + {ngraph::pass::low_precision::PrecisionsRestriction::create( {{{0}, params.precisionsOnActivations}})}); SimpleLowPrecisionTransformer transform(supportedPrecisions, {}, {ngraph::element::f32, defaultPrecisions}); - transform - .add( - params); - transform.add(params); + transform.add( + params); + transform.add(params); transform.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::FakeQuantizeFunction::getReference( diff --git a/src/common/low_precision_transformations/tests/fake_quantize_with_dq_not_optimal_transformation.cpp b/src/common/low_precision_transformations/tests/fake_quantize_with_dq_not_optimal_transformation.cpp index 317eefea69b..5aee28047ae 100644 --- a/src/common/low_precision_transformations/tests/fake_quantize_with_dq_not_optimal_transformation.cpp +++ b/src/common/low_precision_transformations/tests/fake_quantize_with_dq_not_optimal_transformation.cpp @@ -81,20 +81,20 @@ public: testValues.actual.dequantizationAfter); auto precisionsRestrictions = std::vector({ - ngraph::pass::low_precision::PrecisionsRestriction::create({ + ngraph::pass::low_precision::PrecisionsRestriction::create({ {{0}, {ngraph::element::u8}}, {{1}, {ngraph::element::i8}} }) }); auto quantizationRestrictions = std::vector({ - ngraph::pass::low_precision::QuantizationGranularityRestriction::create() + ngraph::pass::low_precision::QuantizationGranularityRestriction::create() }); SimpleLowPrecisionTransformer transformer(precisionsRestrictions, quantizationRestrictions); - transformer.add( + transformer.add( TestTransformationParams(params).setPrecisionsOnActivations({ element::u8 })); - transformer.add(params); + transformer.add(params); transformer.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::FakeQuantizeAndConvolutionFunction::get( diff --git a/src/common/low_precision_transformations/tests/fake_quantize_with_dynamic_intervals_transformation.cpp b/src/common/low_precision_transformations/tests/fake_quantize_with_dynamic_intervals_transformation.cpp index 500d690a671..49dd804c2d5 100644 --- a/src/common/low_precision_transformations/tests/fake_quantize_with_dynamic_intervals_transformation.cpp +++ b/src/common/low_precision_transformations/tests/fake_quantize_with_dynamic_intervals_transformation.cpp @@ -63,7 +63,7 @@ public: actualFunction = get(precision, shape, testValues.inputLowConst, testValues.inpuHighConst, testValues.outputLowConst, testValues.outputHighConst); SimpleLowPrecisionTransformer transform; - transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); referenceFunction = get(precision, shape, testValues.inputLowConst, testValues.inpuHighConst, testValues.outputLowConst, testValues.outputHighConst); @@ -88,7 +88,7 @@ private: const bool inpuHighConst, const bool outputLowConst, const bool outputHighConst) { - const auto input = std::make_shared(precision, inputShape); + const auto input = std::make_shared(precision, inputShape); input->set_friendly_name("input"); const auto constantPresition = element::f32; @@ -97,40 +97,40 @@ private: const std::vector high = { 1.f }; const auto inputLow = inputLowConst ? - std::dynamic_pointer_cast(std::make_shared(constantPresition, constantShape, low)) : - std::make_shared(constantPresition, constantShape); + std::dynamic_pointer_cast(std::make_shared(constantPresition, constantShape, low)) : + std::make_shared(constantPresition, constantShape); const auto inputHigh = inputLowConst ? - std::dynamic_pointer_cast(std::make_shared(constantPresition, constantShape, high)) : - std::make_shared(constantPresition, constantShape); + std::dynamic_pointer_cast(std::make_shared(constantPresition, constantShape, high)) : + std::make_shared(constantPresition, constantShape); const auto outputLow = outputLowConst ? - std::dynamic_pointer_cast(std::make_shared(constantPresition, constantShape, low)) : - std::make_shared(constantPresition, constantShape); + std::dynamic_pointer_cast(std::make_shared(constantPresition, constantShape, low)) : + std::make_shared(constantPresition, constantShape); const auto outputHigh = outputHighConst ? - std::dynamic_pointer_cast(std::make_shared(constantPresition, constantShape, high)) : - std::make_shared(constantPresition, constantShape); + std::dynamic_pointer_cast(std::make_shared(constantPresition, constantShape, high)) : + std::make_shared(constantPresition, constantShape); const auto levels = 256ul; - auto fakeQuantize = std::make_shared(input, inputLow, inputHigh, outputLow, outputHigh, levels); + auto fakeQuantize = std::make_shared(input, inputLow, inputHigh, outputLow, outputHigh, levels); fakeQuantize->set_friendly_name("fakeQuantize"); - ngraph::ResultVector results{ std::make_shared(fakeQuantize) }; + ngraph::ResultVector results{ std::make_shared(fakeQuantize) }; ngraph::ParameterVector inputs{ input }; - if (as_type_ptr(inputLow)) { - inputs.push_back(as_type_ptr(inputLow)); + if (as_type_ptr(inputLow)) { + inputs.push_back(as_type_ptr(inputLow)); } - if (as_type_ptr(inputHigh)) { - inputs.push_back(as_type_ptr(inputHigh)); + if (as_type_ptr(inputHigh)) { + inputs.push_back(as_type_ptr(inputHigh)); } - if (as_type_ptr(outputLow)) { - inputs.push_back(as_type_ptr(outputLow)); + if (as_type_ptr(outputLow)) { + inputs.push_back(as_type_ptr(outputLow)); } - if (as_type_ptr(outputHigh)) { - inputs.push_back(as_type_ptr(outputHigh)); + if (as_type_ptr(outputHigh)) { + inputs.push_back(as_type_ptr(outputHigh)); } return std::make_shared(results, inputs, "FakeQuantizeWithDynamicIntervalsTransformation"); diff --git a/src/common/low_precision_transformations/tests/fold_convert_transformation.cpp b/src/common/low_precision_transformations/tests/fold_convert_transformation.cpp index f8115b709c3..1807d894ee3 100644 --- a/src/common/low_precision_transformations/tests/fold_convert_transformation.cpp +++ b/src/common/low_precision_transformations/tests/fold_convert_transformation.cpp @@ -49,19 +49,19 @@ public: const ngraph::element::Type precision, const ngraph::PartialShape& inputShape, const ngraph::builder::subgraph::DequantizationOperations& dequantization) -> std::shared_ptr { - auto input = std::make_shared(precision, inputShape); + auto input = std::make_shared(precision, inputShape); std::shared_ptr output = makeDequantization(input, dequantization); output->set_friendly_name("output"); return std::make_shared( - ngraph::ResultVector{ std::make_shared(output) }, + ngraph::ResultVector{ std::make_shared(output) }, ngraph::ParameterVector{ input }, "FoldConvertTransformation"); }; actualFunction = createFunction(testValues.precision, inputShape, testValues.dequantizationActual); SimpleLowPrecisionTransformer transform; - transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); referenceFunction = createFunction(testValues.precision, inputShape, testValues.dequantizationExpected); diff --git a/src/common/low_precision_transformations/tests/fold_fake_quantize_in_transformations.cpp b/src/common/low_precision_transformations/tests/fold_fake_quantize_in_transformations.cpp index 659dcc1cb03..d069d62e9b1 100644 --- a/src/common/low_precision_transformations/tests/fold_fake_quantize_in_transformations.cpp +++ b/src/common/low_precision_transformations/tests/fold_fake_quantize_in_transformations.cpp @@ -68,29 +68,29 @@ public: const auto params = TestTransformationParams(testValues.params).setUpdatePrecisions(testValues.updatePrecision); std::shared_ptr dataSource; - std::shared_ptr parameter; + std::shared_ptr parameter; bool useParameterAsDataSource = (testValues.actual.constValues.size() == 0); if (useParameterAsDataSource) { // for data-independent const folding parameter = - std::make_shared(testValues.actual.constPrecision, testValues.constShape); + std::make_shared(testValues.actual.constPrecision, testValues.constShape); dataSource = parameter; } else { - dataSource = std::make_shared(testValues.actual.constPrecision, - testValues.constShape, - testValues.actual.constValues); + dataSource = std::make_shared(testValues.actual.constPrecision, + testValues.constShape, + testValues.actual.constValues); } std::shared_ptr fq = ngraph::builder::subgraph::makeFakeQuantizeTypeRelaxed(dataSource, element::f32, testValues.actual.fakeQuantize); - ngraph::pass::low_precision::NetworkHelper::setOutDataPrecision(as_type_ptr(fq), + ngraph::pass::low_precision::NetworkHelper::setOutDataPrecision(as_type_ptr(fq), testValues.actual.fqOutPrecision); - fq = ngraph::pass::low_precision::NetworkHelper::fold_fake_quantize(as_type_ptr(fq), + fq = ngraph::pass::low_precision::NetworkHelper::fold_fake_quantize(as_type_ptr(fq), testValues.roundValues); - ngraph::ResultVector results{std::make_shared(fq)}; + ngraph::ResultVector results{std::make_shared(fq)}; actualFunction = std::make_shared( results, parameter ? ngraph::ParameterVector{parameter} : ngraph::ParameterVector{}, diff --git a/src/common/low_precision_transformations/tests/fuse_convert_transformation.cpp b/src/common/low_precision_transformations/tests/fuse_convert_transformation.cpp index 96f6ae1edec..fd30225d6d0 100644 --- a/src/common/low_precision_transformations/tests/fuse_convert_transformation.cpp +++ b/src/common/low_precision_transformations/tests/fuse_convert_transformation.cpp @@ -64,7 +64,7 @@ public: testValues.constInput); SimpleLowPrecisionTransformer transformer; - transformer.add(testValues.params); + transformer.add(testValues.params); transformer.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::FuseConvertFunction::get( diff --git a/src/common/low_precision_transformations/tests/fuse_dequantize_to_fake_quantize_transformation.cpp b/src/common/low_precision_transformations/tests/fuse_dequantize_to_fake_quantize_transformation.cpp index 8370560c947..7320baf9a30 100644 --- a/src/common/low_precision_transformations/tests/fuse_dequantize_to_fake_quantize_transformation.cpp +++ b/src/common/low_precision_transformations/tests/fuse_dequantize_to_fake_quantize_transformation.cpp @@ -73,12 +73,11 @@ public: testValues.actual.fakeQuantizeOnData); SimpleLowPrecisionTransformer transformer; - transformer - .add( - testValues.params); + transformer.add( + testValues.params); transformer.transform(actualFunction); - transformer.add( + transformer.add( testValues.params); transformer.transform(actualFunction); diff --git a/src/common/low_precision_transformations/tests/fuse_fake_quantize_with_multi_inputs_transformation.cpp b/src/common/low_precision_transformations/tests/fuse_fake_quantize_with_multi_inputs_transformation.cpp index bb2e5d2f679..3647f007167 100644 --- a/src/common/low_precision_transformations/tests/fuse_fake_quantize_with_multi_inputs_transformation.cpp +++ b/src/common/low_precision_transformations/tests/fuse_fake_quantize_with_multi_inputs_transformation.cpp @@ -62,7 +62,7 @@ public: testValues.actual.fakeQuantizeOnData); SimpleLowPrecisionTransformer transformer; - transformer.add(testValues.params); + transformer.add(testValues.params); transformer.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::FuseFakeQuantizeFunction::get( diff --git a/src/common/low_precision_transformations/tests/fuse_multiply_to_fake_quantize_transformation.cpp b/src/common/low_precision_transformations/tests/fuse_multiply_to_fake_quantize_transformation.cpp index 1db4b6b6602..00ddbc36433 100644 --- a/src/common/low_precision_transformations/tests/fuse_multiply_to_fake_quantize_transformation.cpp +++ b/src/common/low_precision_transformations/tests/fuse_multiply_to_fake_quantize_transformation.cpp @@ -68,7 +68,7 @@ public: testValues.actual.dequantization); SimpleLowPrecisionTransformer transformer; - transformer.add(testValues.params); + transformer.add(testValues.params); transformer.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::FuseMultiplyToFakeQuantizeFunction::get( diff --git a/src/common/low_precision_transformations/tests/fuse_subtract_to_fake_quantize_transformation.cpp b/src/common/low_precision_transformations/tests/fuse_subtract_to_fake_quantize_transformation.cpp index 582b2fc3ff9..6cd4157398e 100644 --- a/src/common/low_precision_transformations/tests/fuse_subtract_to_fake_quantize_transformation.cpp +++ b/src/common/low_precision_transformations/tests/fuse_subtract_to_fake_quantize_transformation.cpp @@ -86,7 +86,7 @@ public: testValues.actual.dequantization2); SimpleLowPrecisionTransformer transformer; - transformer.add(testValues.params); + transformer.add(testValues.params); transformer.transform(actualFunction); referenceFunction = testValues.expected.fakeQuantizeOnData2.empty() ? diff --git a/src/common/low_precision_transformations/tests/gather_transformation.cpp b/src/common/low_precision_transformations/tests/gather_transformation.cpp index 66f6f4bb107..a3b3996eb9e 100644 --- a/src/common/low_precision_transformations/tests/gather_transformation.cpp +++ b/src/common/low_precision_transformations/tests/gather_transformation.cpp @@ -68,7 +68,7 @@ public: opset_version); SimpleLowPrecisionTransformer transformer; - transformer.add(testValues.params); + transformer.add(testValues.params); transformer.transform(actualFunction); referenceFunction = diff --git a/src/common/low_precision_transformations/tests/group_convolution_transformation.cpp b/src/common/low_precision_transformations/tests/group_convolution_transformation.cpp index f3bf2c3f8c6..4371c43d651 100644 --- a/src/common/low_precision_transformations/tests/group_convolution_transformation.cpp +++ b/src/common/low_precision_transformations/tests/group_convolution_transformation.cpp @@ -28,7 +28,7 @@ public: public: ngraph::element::Type precisionBeforeDequantization; ngraph::builder::subgraph::DequantizationOperations dequantization; - std::shared_ptr weights; + std::shared_ptr weights; builder::subgraph::FakeQuantizeOnWeights fakeQuantizeOnWeights; ngraph::builder::subgraph::DequantizationOperations dequantizationOnWeights; }; @@ -37,7 +37,7 @@ public: public: ngraph::element::Type precisionBeforeDequantization; ngraph::builder::subgraph::DequantizationOperations dequantizationBefore; - std::shared_ptr weights; + std::shared_ptr weights; builder::subgraph::FakeQuantizeOnWeights fakeQuantizeOnWeights; ngraph::builder::subgraph::DequantizationOperations dequantizationOnWeights; ngraph::element::Type precisionAfterOperation; diff --git a/src/common/low_precision_transformations/tests/interpolate_transformation.cpp b/src/common/low_precision_transformations/tests/interpolate_transformation.cpp index fd17653f326..9323661a558 100644 --- a/src/common/low_precision_transformations/tests/interpolate_transformation.cpp +++ b/src/common/low_precision_transformations/tests/interpolate_transformation.cpp @@ -112,7 +112,7 @@ public: testValues.actual.dequantization); SimpleLowPrecisionTransformer transformer; - transformer.add(testValues.params); + transformer.add(testValues.params); transformer.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::InterpolateFunction::getReference( diff --git a/src/common/low_precision_transformations/tests/is_asymmetric_on_weights_dequantization.cpp b/src/common/low_precision_transformations/tests/is_asymmetric_on_weights_dequantization.cpp index 0446825d441..68f6a13ec3a 100644 --- a/src/common/low_precision_transformations/tests/is_asymmetric_on_weights_dequantization.cpp +++ b/src/common/low_precision_transformations/tests/is_asymmetric_on_weights_dequantization.cpp @@ -23,7 +23,7 @@ public: TestTransformationParams params; ngraph::element::Type precisionBeforeDequantization; ngraph::builder::subgraph::DequantizationOperations dequantizationOnActivations; - std::shared_ptr weights; + std::shared_ptr weights; builder::subgraph::DequantizationOperations dequantizationOnWeights; bool isAsymmetricOnWeights; }; diff --git a/src/common/low_precision_transformations/tests/is_asymmetric_on_weights_fq.cpp b/src/common/low_precision_transformations/tests/is_asymmetric_on_weights_fq.cpp index dd676e327d1..d37d8ed20ab 100644 --- a/src/common/low_precision_transformations/tests/is_asymmetric_on_weights_fq.cpp +++ b/src/common/low_precision_transformations/tests/is_asymmetric_on_weights_fq.cpp @@ -24,7 +24,7 @@ public: TestTransformationParams params; ngraph::element::Type precisionBeforeDequantization; ngraph::builder::subgraph::DequantizationOperations dequantizationOnActivations; - std::shared_ptr weights; + std::shared_ptr weights; builder::subgraph::FakeQuantizeOnWeights fakeQuantizeOnWeights; }; diff --git a/src/common/low_precision_transformations/tests/is_constant_path_transformation.cpp b/src/common/low_precision_transformations/tests/is_constant_path_transformation.cpp index 0575ac9840a..a71d1f70bae 100644 --- a/src/common/low_precision_transformations/tests/is_constant_path_transformation.cpp +++ b/src/common/low_precision_transformations/tests/is_constant_path_transformation.cpp @@ -18,7 +18,7 @@ using namespace ngraph::pass; using namespace ngraph::builder::subgraph; TEST(LPT, isConstantPathFQAfterInputTransformation) { - const auto input = std::make_shared(ngraph::element::f32, ngraph::Shape{ 1, 3, 16, 16 }); + const auto input = std::make_shared(ngraph::element::f32, ngraph::Shape{ 1, 3, 16, 16 }); const auto fqOnActivations = makeFakeQuantize(input, ngraph::element::f32, FakeQuantizeOnData{ 256ul, {}, {0.f}, {2.55f}, {0.f}, {2.55f} }); @@ -28,7 +28,7 @@ TEST(LPT, isConstantPathFQAfterInputTransformation) { } TEST(LPT, isConstantPathFQAfterWeightsTransformation) { - const auto weights = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{ 3, 1, 1, 1 }, { 1.f }); + const auto weights = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{ 3, 1, 1, 1 }, { 1.f }); const auto fqOnWeights = makeFakeQuantize(weights, ngraph::element::f32, FakeQuantizeOnWeights{ 255ul, {}, {0.f}, {254.f}, {-1.27f}, {1.27f} }); @@ -38,7 +38,7 @@ TEST(LPT, isConstantPathFQAfterWeightsTransformation) { } TEST(LPT, isConstantPathDqAfterInputTransformation) { - const auto input = std::make_shared(ngraph::element::f32, ngraph::Shape{ 1, 3, 16, 16 }); + const auto input = std::make_shared(ngraph::element::f32, ngraph::Shape{ 1, 3, 16, 16 }); const auto dqOnActivations = makeDequantization(input, DequantizationOperations{ ngraph::element::f32, {128.f}, {0.1f} }); const bool result = low_precision::NetworkHelper::isConstantPath(dqOnActivations); @@ -47,7 +47,7 @@ TEST(LPT, isConstantPathDqAfterInputTransformation) { } TEST(LPT, isConstantPathDqAfterWeightsTransformation) { - const auto weights = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{ 3, 1, 1, 1 }, { 1.f }); + const auto weights = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{ 3, 1, 1, 1 }, { 1.f }); const auto dqOnWeights = makeDequantization(weights, DequantizationOperations{ ngraph::element::f32, {128.f}, {0.1f} }); const bool result = low_precision::NetworkHelper::isConstantPath(dqOnWeights); @@ -56,8 +56,8 @@ TEST(LPT, isConstantPathDqAfterWeightsTransformation) { } TEST(LPT, isConstantPathTwoInputsTransformation) { - const auto input1 = std::make_shared(ngraph::element::f32, ngraph::Shape{ 1, 3, 16, 16 }); - const auto input2 = std::make_shared(ngraph::element::f32, ngraph::Shape{ 1, 3, 16, 16 }); + const auto input1 = std::make_shared(ngraph::element::f32, ngraph::Shape{ 1, 3, 16, 16 }); + const auto input2 = std::make_shared(ngraph::element::f32, ngraph::Shape{ 1, 3, 16, 16 }); const auto dq1 = makeDequantization(input1, DequantizationOperations{ ngraph::element::f32, {128.f}, {0.1f} }); const auto dq2 = makeDequantization(input2, DequantizationOperations{ ngraph::element::f32, {128.f}, {0.1f} }); const auto matmul = std::make_shared(dq1, dq2); @@ -68,8 +68,8 @@ TEST(LPT, isConstantPathTwoInputsTransformation) { } TEST(LPT, isConstantPathTwoConsantsTransformation) { - const auto constant1 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{ 3, 1, 1, 1 }, { 1.f }); - const auto constant2 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{ 3, 1, 1, 1 }, { 1.f }); + const auto constant1 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{ 3, 1, 1, 1 }, { 1.f }); + const auto constant2 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{ 3, 1, 1, 1 }, { 1.f }); const auto dq1 = makeDequantization(constant1, DequantizationOperations{ ngraph::element::f32, {128.f}, {0.1f} }); const auto dq2 = makeDequantization(constant2, DequantizationOperations{ ngraph::element::f32, {128.f}, {0.1f} }); const auto eltwise = std::make_shared(dq1, dq2); @@ -80,8 +80,8 @@ TEST(LPT, isConstantPathTwoConsantsTransformation) { } TEST(LPT, isConstantPathMatMulParentFQTransformation) { - const auto input1 = std::make_shared(ngraph::element::f32, ngraph::Shape{ 1, 3, 16, 16 }); - const auto input2 = std::make_shared(ngraph::element::f32, ngraph::Shape{ 1, 3, 16, 16 }); + const auto input1 = std::make_shared(ngraph::element::f32, ngraph::Shape{ 1, 3, 16, 16 }); + const auto input2 = std::make_shared(ngraph::element::f32, ngraph::Shape{ 1, 3, 16, 16 }); const auto dq1 = makeDequantization(input1, DequantizationOperations{ ngraph::element::f32, {128.f}, {0.1f} }); const auto dq2 = makeDequantization(input2, DequantizationOperations{ ngraph::element::f32, {128.f}, {0.1f} }); const auto matmul = std::make_shared(dq1, dq2); @@ -94,8 +94,8 @@ TEST(LPT, isConstantPathMatMulParentFQTransformation) { } TEST(LPT, isConstantPathMatMulParentDqTransformation) { - const auto input1 = std::make_shared(ngraph::element::f32, ngraph::Shape{ 1, 3, 16, 16 }); - const auto input2 = std::make_shared(ngraph::element::f32, ngraph::Shape{ 1, 3, 16, 16 }); + const auto input1 = std::make_shared(ngraph::element::f32, ngraph::Shape{ 1, 3, 16, 16 }); + const auto input2 = std::make_shared(ngraph::element::f32, ngraph::Shape{ 1, 3, 16, 16 }); const auto dq1 = makeDequantization(input1, DequantizationOperations{ ngraph::element::f32, {128.f}, {0.1f} }); const auto dq2 = makeDequantization(input2, DequantizationOperations{ ngraph::element::f32, {128.f}, {0.1f} }); const auto matmul = std::make_shared(dq1, dq2); @@ -107,8 +107,8 @@ TEST(LPT, isConstantPathMatMulParentDqTransformation) { } TEST(LPT, isConstantPathConvParentDqTransformation) { - const auto input = std::make_shared(ngraph::element::f32, ngraph::Shape{ 1, 3, 72, 16 }); - const auto weights = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{ 6, 3, 1, 1 }, { 1.f }); + const auto input = std::make_shared(ngraph::element::f32, ngraph::Shape{ 1, 3, 72, 16 }); + const auto weights = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{ 6, 3, 1, 1 }, { 1.f }); const auto conv = std::make_shared( input, weights, @@ -124,8 +124,8 @@ TEST(LPT, isConstantPathConvParentDqTransformation) { } TEST(LPT, isConstantPathGroupConvParentDqTransformation) { - const auto input = std::make_shared(ngraph::element::f32, ngraph::Shape{ 1, 3, 16, 16 }); - const auto weights = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{ 1, 6, 3, 1, 1 }, { 1.f }); + const auto input = std::make_shared(ngraph::element::f32, ngraph::Shape{ 1, 3, 16, 16 }); + const auto weights = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{ 1, 6, 3, 1, 1 }, { 1.f }); const auto groupConv = std::make_shared( input, weights, diff --git a/src/common/low_precision_transformations/tests/is_function_quantized_transformation.cpp b/src/common/low_precision_transformations/tests/is_function_quantized_transformation.cpp index 05032605fa5..0bdaf2887ef 100644 --- a/src/common/low_precision_transformations/tests/is_function_quantized_transformation.cpp +++ b/src/common/low_precision_transformations/tests/is_function_quantized_transformation.cpp @@ -33,7 +33,7 @@ public: void SetUp() override { const auto testValues = GetParam(); - const auto input = std::make_shared(testValues.precision, ngraph::Shape(testValues.shape)); + const auto input = std::make_shared(testValues.precision, ngraph::Shape(testValues.shape)); const auto fakeQuantize = ngraph::builder::subgraph::makeFakeQuantize( input, testValues.precision, @@ -44,7 +44,7 @@ public: replace_node(fakeQuantize->get_input_node_shared_ptr(3), input); } - ngraph::ResultVector results{ std::make_shared(fakeQuantize) }; + ngraph::ResultVector results{ std::make_shared(fakeQuantize) }; function = std::make_shared(results, ngraph::ParameterVector{ input }, "IsFunctionQuantizedFunction"); function->validate_nodes_and_infer_types(); } diff --git a/src/common/low_precision_transformations/tests/low_precision_transformations_test.cpp b/src/common/low_precision_transformations/tests/low_precision_transformations_test.cpp index 47e0638a17f..3365ea09909 100644 --- a/src/common/low_precision_transformations/tests/low_precision_transformations_test.cpp +++ b/src/common/low_precision_transformations/tests/low_precision_transformations_test.cpp @@ -53,7 +53,7 @@ TEST_F(smoke_LPT_LowPrecisionTransformationsTests, DISABLED_removeAll) { // ASSERT_NE(0, transformation.size()); // const size_t originalSize = transformation.size(); // -// transformations.removeCleanup(); +// transformations.removeCleanup(); // transformation = transformations.find("Multiply"); // ASSERT_EQ(originalSize - 1, transformation.size()); //} @@ -64,7 +64,7 @@ TEST_F(smoke_LPT_LowPrecisionTransformationsTests, DISABLED_removeAll) { // ASSERT_NE(0, transformation.size()); // const size_t originalSize = transformation.size(); // -// transformations.removeStandaloneCleanup(); +// transformations.removeStandaloneCleanup(); // transformation = transformations.find("Multiply"); // ASSERT_EQ(originalSize - 1, transformation.size()); //} diff --git a/src/common/low_precision_transformations/tests/lpt_avoid_shapeof_propagation_test.cpp b/src/common/low_precision_transformations/tests/lpt_avoid_shapeof_propagation_test.cpp index 678bb511ccc..99d3e43ab42 100644 --- a/src/common/low_precision_transformations/tests/lpt_avoid_shapeof_propagation_test.cpp +++ b/src/common/low_precision_transformations/tests/lpt_avoid_shapeof_propagation_test.cpp @@ -48,20 +48,20 @@ using namespace ngraph; using namespace ngraph::pass; TEST(LPT, AvoidDequantizationToShapeOfPropagationAddTransformation) { - auto input1 = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto input2 = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto input1 = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto input2 = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert1 = std::make_shared(input1, element::f32); - auto convert2 = std::make_shared(input2, element::f32); + auto convert1 = std::make_shared(input1, element::f32); + auto convert2 = std::make_shared(input2, element::f32); - auto mul1 = std::make_shared(convert1, opset1::Constant::create(element::f32, {}, {2.f})); - auto mul2 = std::make_shared(convert2, opset1::Constant::create(element::f32, {}, {4.f})); + auto mul1 = std::make_shared(convert1, ov::op::v0::Constant::create(element::f32, {}, {2.f})); + auto mul2 = std::make_shared(convert2, ov::op::v0::Constant::create(element::f32, {}, {4.f})); - auto add = std::make_shared(mul1, mul2); - auto shapeOf = std::make_shared(add); + auto add = std::make_shared(mul1, mul2); + auto shapeOf = std::make_shared(add); - auto result1 = std::make_shared(add); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(add); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input1, input2}); pass::Manager m; @@ -73,15 +73,16 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationAddTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationAvgPoolTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto avgPool = std::make_shared(mul, Strides{1, 1}, Shape{1, 1}, Shape{0, 0}, Shape{2, 2}, true); - auto shapeOf = std::make_shared(avgPool); + auto avgPool = + std::make_shared(mul, Strides{1, 1}, Shape{1, 1}, Shape{0, 0}, Shape{2, 2}, true); + auto shapeOf = std::make_shared(avgPool); - auto result1 = std::make_shared(avgPool); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(avgPool); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -93,15 +94,15 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationAvgPoolTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationClampTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto clamp = std::make_shared(mul, 0.0, 6.0); - auto shapeOf = std::make_shared(clamp); + auto clamp = std::make_shared(mul, 0.0, 6.0); + auto shapeOf = std::make_shared(clamp); - auto result1 = std::make_shared(clamp); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(clamp); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -113,20 +114,20 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationClampTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationConcatTransformation) { - auto input1 = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto input2 = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto input1 = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto input2 = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert1 = std::make_shared(input1, element::f32); - auto convert2 = std::make_shared(input2, element::f32); + auto convert1 = std::make_shared(input1, element::f32); + auto convert2 = std::make_shared(input2, element::f32); - auto mul1 = std::make_shared(convert1, opset1::Constant::create(element::f32, {}, {2.f})); - auto mul2 = std::make_shared(convert2, opset1::Constant::create(element::f32, {}, {4.f})); + auto mul1 = std::make_shared(convert1, ov::op::v0::Constant::create(element::f32, {}, {2.f})); + auto mul2 = std::make_shared(convert2, ov::op::v0::Constant::create(element::f32, {}, {4.f})); - auto concat = std::make_shared(OutputVector{mul1, mul2}, 1); - auto shapeOf = std::make_shared(concat); + auto concat = std::make_shared(OutputVector{mul1, mul2}, 1); + auto shapeOf = std::make_shared(concat); - auto result1 = std::make_shared(concat); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(concat); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input1, input2}); pass::Manager m; @@ -138,26 +139,26 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationConcatTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationConvolutionTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto weights = opset1::Constant::create(element::i8, {6, 3, 1, 1}, {3}); - auto convertOnWeights = std::make_shared(weights, element::f32); + auto weights = ov::op::v0::Constant::create(element::i8, {6, 3, 1, 1}, {3}); + auto convertOnWeights = std::make_shared(weights, element::f32); auto mulOnWeights = - std::make_shared(convertOnWeights, opset1::Constant::create(element::f32, {}, {4.f})); + std::make_shared(convertOnWeights, ov::op::v0::Constant::create(element::f32, {}, {4.f})); - auto convolution = std::make_shared(mul, - mulOnWeights, - ngraph::Strides{1, 1}, - ngraph::CoordinateDiff{0, 0}, - ngraph::CoordinateDiff{0, 0}, - ngraph::Strides{1, 1}); + auto convolution = std::make_shared(mul, + mulOnWeights, + ngraph::Strides{1, 1}, + ngraph::CoordinateDiff{0, 0}, + ngraph::CoordinateDiff{0, 0}, + ngraph::Strides{1, 1}); - auto shapeOf = std::make_shared(convolution); + auto shapeOf = std::make_shared(convolution); - auto result1 = std::make_shared(convolution); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(convolution); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -168,26 +169,26 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationConvolutionTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationConvolutionBackpropDataTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 8, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 8, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto weights = opset1::Constant::create(element::i8, {8, 2, 1, 1}, {3}); - auto convertOnWeights = std::make_shared(weights, element::f32); + auto weights = ov::op::v0::Constant::create(element::i8, {8, 2, 1, 1}, {3}); + auto convertOnWeights = std::make_shared(weights, element::f32); auto mulOnWeights = - std::make_shared(convertOnWeights, opset1::Constant::create(element::f32, {}, {4.f})); + std::make_shared(convertOnWeights, ov::op::v0::Constant::create(element::f32, {}, {4.f})); - auto convolutionBackpropData = std::make_shared(mul, - mulOnWeights, - ngraph::Strides{1, 1}, - ngraph::CoordinateDiff{0, 0}, - ngraph::CoordinateDiff{0, 0}, - ngraph::Strides{1, 1}); + auto convolutionBackpropData = std::make_shared(mul, + mulOnWeights, + ngraph::Strides{1, 1}, + ngraph::CoordinateDiff{0, 0}, + ngraph::CoordinateDiff{0, 0}, + ngraph::Strides{1, 1}); - auto shapeOf = std::make_shared(convolutionBackpropData); + auto shapeOf = std::make_shared(convolutionBackpropData); - auto result1 = std::make_shared(convolutionBackpropData); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(convolutionBackpropData); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -198,15 +199,15 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationConvolutionBackpropDataTransfor } TEST(LPT, AvoidDequantizationToShapeOfPropagationDepthToSpaceTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto d2s = std::make_shared(mul, op::v0::DepthToSpace::DepthToSpaceMode::BLOCKS_FIRST); - auto shapeOf = std::make_shared(d2s); + auto d2s = std::make_shared(mul, op::v0::DepthToSpace::DepthToSpaceMode::BLOCKS_FIRST); + auto shapeOf = std::make_shared(d2s); - auto result1 = std::make_shared(d2s); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(d2s); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -218,18 +219,18 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationDepthToSpaceTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationFakeQuantizeDecompositionTransformation) { - auto input = std::make_shared(element::f32, PartialShape{1, 3, 16, 16}); + auto input = std::make_shared(element::f32, PartialShape{1, 3, 16, 16}); ngraph::builder::subgraph::FakeQuantizeOnData fqValues{256ul, {}, {0.f}, {2.55f}, {0.f}, {2.55f}}; auto fakeQuantize = ngraph::builder::subgraph::makeFakeQuantize(input, element::f32, fqValues); - auto shapeOf = std::make_shared(fakeQuantize); + auto shapeOf = std::make_shared(fakeQuantize); auto& outInfo = fakeQuantize->output(0).get_rt_info(); outInfo.emplace(PrecisionsAttribute::get_type_info_static(), PrecisionsAttribute(element::TypeVector{element::u8, element::i8})); - auto result1 = std::make_shared(fakeQuantize); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(fakeQuantize); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -241,27 +242,27 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationFakeQuantizeDecompositionTransf } TEST(LPT, AvoidDequantizationToShapeOfPropagationGroupConvolutionTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 2 * 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 2 * 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto weights = opset1::Constant::create(element::i8, {6, 3, 7, 7}, {2}); - auto convertOnWeights = std::make_shared(weights, element::f32); + auto weights = ov::op::v0::Constant::create(element::i8, {6, 3, 7, 7}, {2}); + auto convertOnWeights = std::make_shared(weights, element::f32); auto mulOnWeights = - std::make_shared(convertOnWeights, opset1::Constant::create(element::f32, {}, {4.f})); - auto reshapeConst = opset1::Constant::create(element::i32, {5}, {2, 3, 3, 7, 7}); - auto reshapeOnWeights = std::make_shared(mulOnWeights, reshapeConst, true); + std::make_shared(convertOnWeights, ov::op::v0::Constant::create(element::f32, {}, {4.f})); + auto reshapeConst = ov::op::v0::Constant::create(element::i32, {5}, {2, 3, 3, 7, 7}); + auto reshapeOnWeights = std::make_shared(mulOnWeights, reshapeConst, true); - auto groupConvolution = std::make_shared(mul, - reshapeOnWeights, - ngraph::Strides{1, 1}, - ngraph::CoordinateDiff{0, 0}, - ngraph::CoordinateDiff{0, 0}, - ngraph::Strides{1, 1}); - auto shapeOf = std::make_shared(groupConvolution); + auto groupConvolution = std::make_shared(mul, + reshapeOnWeights, + ngraph::Strides{1, 1}, + ngraph::CoordinateDiff{0, 0}, + ngraph::CoordinateDiff{0, 0}, + ngraph::Strides{1, 1}); + auto shapeOf = std::make_shared(groupConvolution); - auto result1 = std::make_shared(groupConvolution); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(groupConvolution); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -272,11 +273,11 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationGroupConvolutionTransformation) } TEST(LPT, AvoidDequantizationToShapeOfPropagationInterpolateTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto outShape = opset1::Constant::create(element::i32, {4}, {1, 3, 18, 18}); + auto outShape = ov::op::v0::Constant::create(element::i32, {4}, {1, 3, 18, 18}); op::v0::InterpolateAttrs attributes; attributes.align_corners = false; attributes.antialias = false; @@ -284,11 +285,11 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationInterpolateTransformation) { attributes.mode = "nearest"; attributes.pads_begin = {0}; attributes.pads_end = {0}; - auto interpolate = std::make_shared(mul, outShape, attributes); - auto shapeOf = std::make_shared(interpolate); + auto interpolate = std::make_shared(mul, outShape, attributes); + auto shapeOf = std::make_shared(interpolate); - auto result1 = std::make_shared(interpolate); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(interpolate); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -300,20 +301,20 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationInterpolateTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationMatMulTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 1024}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 1024}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto weights = opset1::Constant::create(element::i8, {2048, 1024}, {3}); - auto convertOnWeights = std::make_shared(weights, element::f32); + auto weights = ov::op::v0::Constant::create(element::i8, {2048, 1024}, {3}); + auto convertOnWeights = std::make_shared(weights, element::f32); auto mulOnWeights = - std::make_shared(convertOnWeights, opset1::Constant::create(element::f32, {}, {4.f})); + std::make_shared(convertOnWeights, ov::op::v0::Constant::create(element::f32, {}, {4.f})); - auto matmul = std::make_shared(mul, mulOnWeights, false, true); - auto shapeOf = std::make_shared(matmul); + auto matmul = std::make_shared(mul, mulOnWeights, false, true); + auto shapeOf = std::make_shared(matmul); - auto result1 = std::make_shared(matmul); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(matmul); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -324,15 +325,15 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationMatMulTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationMaxPoolTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto maxPool = std::make_shared(mul, Strides{1, 1}, Shape{1, 1}, Shape{0, 0}, Shape{2, 2}); - auto shapeOf = std::make_shared(maxPool); + auto maxPool = std::make_shared(mul, Strides{1, 1}, Shape{1, 1}, Shape{0, 0}, Shape{2, 2}); + auto shapeOf = std::make_shared(maxPool); - auto result1 = std::make_shared(maxPool); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(maxPool); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -343,20 +344,20 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationMaxPoolTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationMultiplyTransformation) { - auto input1 = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto input2 = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto input1 = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto input2 = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert1 = std::make_shared(input1, element::f32); - auto convert2 = std::make_shared(input2, element::f32); + auto convert1 = std::make_shared(input1, element::f32); + auto convert2 = std::make_shared(input2, element::f32); - auto mul1 = std::make_shared(convert1, opset1::Constant::create(element::f32, {}, {2.f})); - auto mul2 = std::make_shared(convert2, opset1::Constant::create(element::f32, {}, {4.f})); + auto mul1 = std::make_shared(convert1, ov::op::v0::Constant::create(element::f32, {}, {2.f})); + auto mul2 = std::make_shared(convert2, ov::op::v0::Constant::create(element::f32, {}, {4.f})); - auto mul = std::make_shared(mul1, mul2); - auto shapeOf = std::make_shared(mul); + auto mul = std::make_shared(mul1, mul2); + auto shapeOf = std::make_shared(mul); - auto result1 = std::make_shared(mul); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(mul); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input1, input2}); pass::Manager m; @@ -368,15 +369,15 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationMultiplyTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationMVNTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); auto MVN = std::make_shared>(mul); - auto shapeOf = std::make_shared(MVN); + auto shapeOf = std::make_shared(MVN); - auto result1 = std::make_shared(MVN); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(MVN); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -388,16 +389,16 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationMVNTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationNormalizeL2Transformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto axes = opset1::Constant::create(element::i32, {2}, {2, 3}); - auto normalize = std::make_shared(mul, axes, 0.01f, ov::op::EpsMode::ADD); - auto shapeOf = std::make_shared(normalize); + auto axes = ov::op::v0::Constant::create(element::i32, {2}, {2, 3}); + auto normalize = std::make_shared(mul, axes, 0.01f, ov::op::EpsMode::ADD); + auto shapeOf = std::make_shared(normalize); - auto result1 = std::make_shared(normalize); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(normalize); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -409,17 +410,17 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationNormalizeL2Transformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationPadTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto pads_begin = opset1::Constant::create(element::i32, {4}, {0, 0, 1, 1}); - auto pads_end = opset1::Constant::create(element::i32, {4}, {0, 0, 1, 1}); - auto pad = std::make_shared(mul, pads_begin, pads_end, op::PadMode::CONSTANT); - auto shapeOf = std::make_shared(pad); + auto pads_begin = ov::op::v0::Constant::create(element::i32, {4}, {0, 0, 1, 1}); + auto pads_end = ov::op::v0::Constant::create(element::i32, {4}, {0, 0, 1, 1}); + auto pad = std::make_shared(mul, pads_begin, pads_end, op::PadMode::CONSTANT); + auto shapeOf = std::make_shared(pad); - auto result1 = std::make_shared(pad); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(pad); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -431,16 +432,16 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationPadTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationPReluTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto slope = opset1::Constant::create(element::f32, {1, 3, 1, 1}, {0.01f}); - auto prelu = std::make_shared(mul, slope); - auto shapeOf = std::make_shared(prelu); + auto slope = ov::op::v0::Constant::create(element::f32, {1, 3, 1, 1}, {0.01f}); + auto prelu = std::make_shared(mul, slope); + auto shapeOf = std::make_shared(prelu); - auto result1 = std::make_shared(prelu); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(prelu); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -452,16 +453,16 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationPReluTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationReduceMaxTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto axes = opset1::Constant::create(element::i32, {2}, {2, 3}); - auto reduce = std::make_shared(mul, axes); - auto shapeOf = std::make_shared(reduce); + auto axes = ov::op::v0::Constant::create(element::i32, {2}, {2, 3}); + auto reduce = std::make_shared(mul, axes); + auto shapeOf = std::make_shared(reduce); - auto result1 = std::make_shared(reduce); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(reduce); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -473,16 +474,16 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationReduceMaxTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationReduceMeanTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto axes = opset1::Constant::create(element::i32, {2}, {2, 3}); - auto reduce = std::make_shared(mul, axes); - auto shapeOf = std::make_shared(reduce); + auto axes = ov::op::v0::Constant::create(element::i32, {2}, {2, 3}); + auto reduce = std::make_shared(mul, axes); + auto shapeOf = std::make_shared(reduce); - auto result1 = std::make_shared(reduce); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(reduce); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -494,16 +495,16 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationReduceMeanTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationReduceMinTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto axes = opset1::Constant::create(element::i32, {2}, {2, 3}); - auto reduce = std::make_shared(mul, axes); - auto shapeOf = std::make_shared(reduce); + auto axes = ov::op::v0::Constant::create(element::i32, {2}, {2, 3}); + auto reduce = std::make_shared(mul, axes); + auto shapeOf = std::make_shared(reduce); - auto result1 = std::make_shared(reduce); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(reduce); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -515,16 +516,16 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationReduceMinTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationReduceSumTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto axes = opset1::Constant::create(element::i32, {2}, {2, 3}); - auto reduce = std::make_shared(mul, axes); - auto shapeOf = std::make_shared(reduce); + auto axes = ov::op::v0::Constant::create(element::i32, {2}, {2, 3}); + auto reduce = std::make_shared(mul, axes); + auto shapeOf = std::make_shared(reduce); - auto result1 = std::make_shared(reduce); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(reduce); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -536,16 +537,16 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationReduceSumTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationReshapeTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto outShape = opset1::Constant::create(element::i32, {3}, {1, 3, -1}); - auto reshape = std::make_shared(mul, outShape, true); - auto shapeOf = std::make_shared(reshape); + auto outShape = ov::op::v0::Constant::create(element::i32, {3}, {1, 3, -1}); + auto reshape = std::make_shared(mul, outShape, true); + auto shapeOf = std::make_shared(reshape); - auto result1 = std::make_shared(reshape); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(reshape); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -557,15 +558,15 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationReshapeTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationReluTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto relu = std::make_shared(mul); - auto shapeOf = std::make_shared(relu); + auto relu = std::make_shared(mul); + auto shapeOf = std::make_shared(relu); - auto result1 = std::make_shared(relu); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(relu); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -577,16 +578,16 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationReluTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationSqueezeTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto axes = opset1::Constant::create(element::i32, {1}, {0}); - auto squeeze = std::make_shared(mul, axes); - auto shapeOf = std::make_shared(squeeze); + auto axes = ov::op::v0::Constant::create(element::i32, {1}, {0}); + auto squeeze = std::make_shared(mul, axes); + auto shapeOf = std::make_shared(squeeze); - auto result1 = std::make_shared(squeeze); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(squeeze); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -598,18 +599,18 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationSqueezeTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationSplitTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto axis = opset1::Constant::create(element::i32, {}, {1}); - auto split = std::make_shared(mul, axis, 3); - auto shapeOf = std::make_shared(split); + auto axis = ov::op::v0::Constant::create(element::i32, {}, {1}); + auto split = std::make_shared(mul, axis, 3); + auto shapeOf = std::make_shared(split); - auto result1 = std::make_shared(split->output(0)); - auto result2 = std::make_shared(split->output(1)); - auto result3 = std::make_shared(split->output(2)); - auto result4 = std::make_shared(shapeOf->output(0)); + auto result1 = std::make_shared(split->output(0)); + auto result2 = std::make_shared(split->output(1)); + auto result3 = std::make_shared(split->output(2)); + auto result4 = std::make_shared(shapeOf->output(0)); auto f = std::make_shared(ResultVector{result1, result2, result3, result4}, ParameterVector{input}); pass::Manager m; @@ -621,15 +622,15 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationSplitTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationShuffleChannelsTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto shuffleChannels = std::make_shared(mul); - auto shapeOf = std::make_shared(shuffleChannels); + auto shuffleChannels = std::make_shared(mul); + auto shapeOf = std::make_shared(shuffleChannels); - auto result1 = std::make_shared(shuffleChannels); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(shuffleChannels); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -641,23 +642,23 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationShuffleChannelsTransformation) } TEST(LPT, AvoidDequantizationToShapeOfPropagationStridedSliceTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); auto beginParam = ngraph::op::Constant::create(ngraph::element::i64, ngraph::Shape{4}, {0, 0, 0, 0}); auto endParam = ngraph::op::Constant::create(ngraph::element::i64, ngraph::Shape{4}, {1, 2, 1, 1}); auto stridesParam = ngraph::op::Constant::create(ngraph::element::i64, ngraph::Shape{4}, {1, 1, 1, 1}); - auto stridedSlice = std::make_shared(mul, - beginParam, - endParam, - stridesParam, - std::vector{1, 0, 1, 1}, - std::vector{1, 0, 1, 1}); - auto shapeOf = std::make_shared(stridedSlice); + auto stridedSlice = std::make_shared(mul, + beginParam, + endParam, + stridesParam, + std::vector{1, 0, 1, 1}, + std::vector{1, 0, 1, 1}); + auto shapeOf = std::make_shared(stridedSlice); - auto result1 = std::make_shared(stridedSlice); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(stridedSlice); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -669,16 +670,16 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationStridedSliceTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationTransposeTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); auto constant = ngraph::op::Constant::create(ngraph::element::i64, ngraph::Shape{4}, {0, 1, 3, 2}); - auto transpose = std::make_shared(mul, constant); - auto shapeOf = std::make_shared(transpose); + auto transpose = std::make_shared(mul, constant); + auto shapeOf = std::make_shared(transpose); - auto result1 = std::make_shared(transpose); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(transpose); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -690,16 +691,16 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationTransposeTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationUnsqueezeTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto axes = opset1::Constant::create(element::i32, {1}, {3}); - auto unsqueeze = std::make_shared(mul, axes); - auto shapeOf = std::make_shared(unsqueeze); + auto axes = ov::op::v0::Constant::create(element::i32, {1}, {3}); + auto unsqueeze = std::make_shared(mul, axes); + auto shapeOf = std::make_shared(unsqueeze); - auto result1 = std::make_shared(unsqueeze); - auto result2 = std::make_shared(shapeOf); + auto result1 = std::make_shared(unsqueeze); + auto result2 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; @@ -711,18 +712,18 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationUnsqueezeTransformation) { } TEST(LPT, AvoidDequantizationToShapeOfPropagationVariadicSplitTransformation) { - auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); - auto convert = std::make_shared(input, element::f32); - auto mul = std::make_shared(convert, opset1::Constant::create(element::f32, {}, {2.f})); + auto input = std::make_shared(element::u8, PartialShape{1, 3, 16, 16}); + auto convert = std::make_shared(input, element::f32); + auto mul = std::make_shared(convert, ov::op::v0::Constant::create(element::f32, {}, {2.f})); - auto axis = opset1::Constant::create(element::i32, {}, {1}); - auto lengths = opset1::Constant::create(element::i32, {2}, {1, 2}); - auto variadicSplit = std::make_shared(mul, axis, lengths); - auto shapeOf = std::make_shared(variadicSplit->output(0)); + auto axis = ov::op::v0::Constant::create(element::i32, {}, {1}); + auto lengths = ov::op::v0::Constant::create(element::i32, {2}, {1, 2}); + auto variadicSplit = std::make_shared(mul, axis, lengths); + auto shapeOf = std::make_shared(variadicSplit->output(0)); - auto result1 = std::make_shared(variadicSplit->output(0)); - auto result2 = std::make_shared(variadicSplit->output(1)); - auto result3 = std::make_shared(shapeOf); + auto result1 = std::make_shared(variadicSplit->output(0)); + auto result2 = std::make_shared(variadicSplit->output(1)); + auto result3 = std::make_shared(shapeOf); auto f = std::make_shared(ResultVector{result1, result2, result3}, ParameterVector{input}); pass::Manager m; diff --git a/src/common/low_precision_transformations/tests/lpt_public_methods_test.cpp b/src/common/low_precision_transformations/tests/lpt_public_methods_test.cpp index cb82e1a5091..4a37e5cf5da 100644 --- a/src/common/low_precision_transformations/tests/lpt_public_methods_test.cpp +++ b/src/common/low_precision_transformations/tests/lpt_public_methods_test.cpp @@ -14,15 +14,15 @@ using namespace testing; using namespace ngraph; -using namespace ngraph::pass; +using namespace ov::pass; // TODO: LPT: not implemented TEST(DISABLED_LPT, isQuantizedTransformation) { - const auto input = std::make_shared(element::f32, Shape{ 1, 3, 16, 16 }); + const auto input = std::make_shared(element::f32, Shape{ 1, 3, 16, 16 }); const auto mulConst = op::v0::Constant::create(element::f32, Shape{}, { 1.f }); - const auto mul = std::make_shared(input, mulConst); + const auto mul = std::make_shared(input, mulConst); const auto shapeConst = op::v0::Constant::create(ngraph::element::i64, ngraph::Shape{ 4 }, { 1, 3, 16, 16 }); - const auto layer = std::make_shared(mul, shapeConst, true); + const auto layer = std::make_shared(mul, shapeConst, true); // TODO: FIXME EXPECT_EQ(1, 0); diff --git a/src/common/low_precision_transformations/tests/markup_avg_pool_precisions_transformation.cpp b/src/common/low_precision_transformations/tests/markup_avg_pool_precisions_transformation.cpp index 745c18380ea..36e7a7996be 100644 --- a/src/common/low_precision_transformations/tests/markup_avg_pool_precisions_transformation.cpp +++ b/src/common/low_precision_transformations/tests/markup_avg_pool_precisions_transformation.cpp @@ -132,7 +132,7 @@ TEST_P(MarkupAvgPoolPrecisionsTransformation, CompareFunctions) { ov::pass::InitNodeInfo().run_on_model(actualFunction); actualFunction->validate_nodes_and_infer_types(); - const auto avgPoolOperations = LayerTransformation::get(actualFunction); + const auto avgPoolOperations = LayerTransformation::get(actualFunction); ASSERT_EQ(1ul, avgPoolOperations.size()) << "unexpected avgPoolOperations size: " << avgPoolOperations.size(); { @@ -142,7 +142,7 @@ TEST_P(MarkupAvgPoolPrecisionsTransformation, CompareFunctions) { ASSERT_EQ(true, avgPoolPrecisioinPreservedAttribute.as().value()); } - const auto precisionPreserved = LayerTransformation::get(actualFunction); + const auto precisionPreserved = LayerTransformation::get(actualFunction); ASSERT_TRUE(checkIfAttributesAreTheSame(precisionPreserved)) << "AvgPoolPrecisionPreservedAttribute are not the same"; diff --git a/src/common/low_precision_transformations/tests/markup_bias_transformation.cpp b/src/common/low_precision_transformations/tests/markup_bias_transformation.cpp index 3fa19665969..e96d84a018b 100644 --- a/src/common/low_precision_transformations/tests/markup_bias_transformation.cpp +++ b/src/common/low_precision_transformations/tests/markup_bias_transformation.cpp @@ -58,7 +58,7 @@ protected: TEST_P(MarkupBiasTests, CompareFunctions) { actualFunction->validate_nodes_and_infer_types(); - const auto addOps = LayerTransformation::get(actualFunction); + const auto addOps = LayerTransformation::get(actualFunction); EXPECT_EQ(1ul, addOps.size()) << "unexpected addOps size"; const bool is_bias = std::get<1>(GetParam()).is_bias; diff --git a/src/common/low_precision_transformations/tests/max_pool_transformation.cpp b/src/common/low_precision_transformations/tests/max_pool_transformation.cpp index 89f4ef2fd85..a7af6f164af 100644 --- a/src/common/low_precision_transformations/tests/max_pool_transformation.cpp +++ b/src/common/low_precision_transformations/tests/max_pool_transformation.cpp @@ -64,7 +64,7 @@ public: testValues.actual.dequantization2); SimpleLowPrecisionTransformer transform; - transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::MaxPoolFunction::get( diff --git a/src/common/low_precision_transformations/tests/move_fake_quantize_transformation.cpp b/src/common/low_precision_transformations/tests/move_fake_quantize_transformation.cpp index 45802e74c3f..c81eeaf0676 100644 --- a/src/common/low_precision_transformations/tests/move_fake_quantize_transformation.cpp +++ b/src/common/low_precision_transformations/tests/move_fake_quantize_transformation.cpp @@ -135,14 +135,14 @@ public: oneInputWithSplit); auto supportedPrecisionsOnActivation = std::vector( - {ngraph::pass::low_precision::PrecisionsRestriction::create( + {ngraph::pass::low_precision::PrecisionsRestriction::create( {{{0}, testValues.params.precisionsOnActivations}})}); auto quantizationRestrictions = - testValues.multiChannels ? std::vector() - : std::vector( - {ngraph::pass::low_precision::QuantizationGranularityRestriction::create< - ngraph::opset1::AvgPool>()}); + testValues.multiChannels + ? std::vector() + : std::vector( + {ngraph::pass::low_precision::QuantizationGranularityRestriction::create()}); const auto params = TestTransformationParams::toParams(testValues.params); ov::pass::Manager manager; @@ -199,7 +199,7 @@ TEST_P(MoveFakeQuantizeTransformation, CompareFunctions) { ASSERT_TRUE(LayerTransformation::allNamesAreUnique(actualFunction)) << "Not all names are unique"; - const auto actualFakeQuantizes = LayerTransformation::get(actualFunction); + const auto actualFakeQuantizes = LayerTransformation::get(actualFunction); ASSERT_TRUE(checkIfOutputAttributesSharedValuesAreTheSame(actualFakeQuantizes)) << "PrecisionsAttribute are not the same"; } diff --git a/src/common/low_precision_transformations/tests/multiply_to_group_convolution_transformation.cpp b/src/common/low_precision_transformations/tests/multiply_to_group_convolution_transformation.cpp index 86bceefe650..8eb9dca4e67 100644 --- a/src/common/low_precision_transformations/tests/multiply_to_group_convolution_transformation.cpp +++ b/src/common/low_precision_transformations/tests/multiply_to_group_convolution_transformation.cpp @@ -35,8 +35,8 @@ public: class Expected { public: ngraph::element::Type inputPrecision; - std::shared_ptr weights; - std::shared_ptr biases; + std::shared_ptr weights; + std::shared_ptr biases; ngraph::builder::subgraph::DequantizationOperations dequantization; }; @@ -62,14 +62,14 @@ public: testValues.haveMultiplyWithNoConstBeforeDequantization); auto precisionRestrictions = std::vector({ - ngraph::pass::low_precision::PrecisionsRestriction::create({ + ngraph::pass::low_precision::PrecisionsRestriction::create({ {{0}, {ngraph::element::u8}}, {{1}, {ngraph::element::i8}} }) }); SimpleLowPrecisionTransformer transformer(precisionRestrictions); - transformer.add(testValues.params); + transformer.add(testValues.params); transformer.transform(actualFunction); if (testValues.transformed) { @@ -127,7 +127,7 @@ const std::vector testValues }, { ngraph::element::u8, - std::make_shared(ngraph::element::i8, Shape{4, 1, 1, 1, 1}, std::vector{1.f, 1.f, 1.f, 1.f}), + std::make_shared(ngraph::element::i8, Shape{4, 1, 1, 1, 1}, std::vector{1.f, 1.f, 1.f, 1.f}), nullptr, { {}, @@ -152,7 +152,7 @@ const std::vector testValues }, { ngraph::element::u8, - std::make_shared(ngraph::element::i8, Shape{4, 1, 1, 1, 1}, std::vector{1.f, 1.f, 1.f, 1.f}), + std::make_shared(ngraph::element::i8, Shape{4, 1, 1, 1, 1}, std::vector{1.f, 1.f, 1.f, 1.f}), nullptr, { {}, @@ -193,8 +193,8 @@ const std::vector testValues }, { ngraph::element::u8, - std::make_shared(ngraph::element::i8, Shape{4, 1, 1, 1, 1}, std::vector{1.f, 1.f, 1.f, 1.f}), - std::make_shared(ngraph::element::f32, Shape{1, 4, 1, 1}, std::vector{0.77f, -0.8f, -0.1f, -1.5f}), + std::make_shared(ngraph::element::i8, Shape{4, 1, 1, 1, 1}, std::vector{1.f, 1.f, 1.f, 1.f}), + std::make_shared(ngraph::element::f32, Shape{1, 4, 1, 1}, std::vector{0.77f, -0.8f, -0.1f, -1.5f}), { {}, {}, @@ -218,8 +218,8 @@ const std::vector testValues }, { ngraph::element::u8, - std::make_shared(ngraph::element::i8, Shape{4, 1, 1, 1, 1}, std::vector{1.f, 1.f, 1.f, 1.f}), - std::make_shared(ngraph::element::f32, Shape{1, 4, 1, 1}, std::vector{0.77f, -0.8f, -0.1f, -1.5f}), + std::make_shared(ngraph::element::i8, Shape{4, 1, 1, 1, 1}, std::vector{1.f, 1.f, 1.f, 1.f}), + std::make_shared(ngraph::element::f32, Shape{1, 4, 1, 1}, std::vector{0.77f, -0.8f, -0.1f, -1.5f}), { {}, {}, @@ -259,8 +259,8 @@ const std::vector testValues }, { ngraph::element::u8, - std::make_shared(ngraph::element::i8, Shape{4, 1, 1, 1, 1}, std::vector{1.f, 1.f, 1.f, 1.f}), - std::make_shared(ngraph::element::f32, Shape{1, 4, 1, 1}, std::vector{-1.f, -2.f, -3.f, -4.f}), + std::make_shared(ngraph::element::i8, Shape{4, 1, 1, 1, 1}, std::vector{1.f, 1.f, 1.f, 1.f}), + std::make_shared(ngraph::element::f32, Shape{1, 4, 1, 1}, std::vector{-1.f, -2.f, -3.f, -4.f}), { {}, {}, @@ -284,8 +284,8 @@ const std::vector testValues }, { ngraph::element::u8, - std::make_shared(ngraph::element::i8, Shape{4, 1, 1, 1, 1}, std::vector{1.f, 1.f, 1.f, 1.f}), - std::make_shared(ngraph::element::f32, Shape{1, 4, 1, 1}, std::vector{-1.f, -2.f, -3.f, -4.f}), + std::make_shared(ngraph::element::i8, Shape{4, 1, 1, 1, 1}, std::vector{1.f, 1.f, 1.f, 1.f}), + std::make_shared(ngraph::element::f32, Shape{1, 4, 1, 1}, std::vector{-1.f, -2.f, -3.f, -4.f}), { {}, {}, @@ -309,8 +309,8 @@ const std::vector testValues }, { ngraph::element::u8, - std::make_shared(ngraph::element::i8, Shape{4, 1, 1, 1, 1, 1}, std::vector{1.f, 1.f, 1.f, 1.f}), - std::make_shared(ngraph::element::f32, Shape{1, 4, 1, 1, 1}, std::vector{-1.f, -2.f, -3.f, -4.f}), + std::make_shared(ngraph::element::i8, Shape{4, 1, 1, 1, 1, 1}, std::vector{1.f, 1.f, 1.f, 1.f}), + std::make_shared(ngraph::element::f32, Shape{1, 4, 1, 1, 1}, std::vector{-1.f, -2.f, -3.f, -4.f}), { {}, {}, @@ -382,7 +382,7 @@ const std::vector testValues }, { ngraph::element::u8, - std::make_shared(ngraph::element::i8, Shape{4, 1, 1, 1, 1}, std::vector{1.f, 1.f, 1.f, 1.f}), + std::make_shared(ngraph::element::i8, Shape{4, 1, 1, 1, 1}, std::vector{1.f, 1.f, 1.f, 1.f}), nullptr, { {}, @@ -406,7 +406,7 @@ const std::vector testValues }, { ngraph::element::u8, - std::make_shared(ngraph::element::i8, Shape{4, 1, 1, 1, 1}, std::vector{1.f, 1.f, 1.f, 1.f}), + std::make_shared(ngraph::element::i8, Shape{4, 1, 1, 1, 1}, std::vector{1.f, 1.f, 1.f, 1.f}), nullptr, { {}, diff --git a/src/common/low_precision_transformations/tests/multiply_transformation.cpp b/src/common/low_precision_transformations/tests/multiply_transformation.cpp index 1f7027b932d..0cf000886c7 100644 --- a/src/common/low_precision_transformations/tests/multiply_transformation.cpp +++ b/src/common/low_precision_transformations/tests/multiply_transformation.cpp @@ -55,7 +55,7 @@ public: actualFunction = MultiplyFunction::get(precision, testParams.actual); SimpleLowPrecisionTransformer transform; - transform.add(testParams.transformationParams); + transform.add(testParams.transformationParams); transform.transform(actualFunction); referenceFunction = MultiplyFunction::get(precision, testParams.expected); diff --git a/src/common/low_precision_transformations/tests/mvn_transformation.cpp b/src/common/low_precision_transformations/tests/mvn_transformation.cpp index 691ee45e2b7..f029a3a07d8 100644 --- a/src/common/low_precision_transformations/tests/mvn_transformation.cpp +++ b/src/common/low_precision_transformations/tests/mvn_transformation.cpp @@ -73,7 +73,7 @@ public: opset_version); SimpleLowPrecisionTransformer transformer; - transformer.add(testValues.params); + transformer.add(testValues.params); transformer.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::MVNFunction::getReference( diff --git a/src/common/low_precision_transformations/tests/normalize_l2_transformation.cpp b/src/common/low_precision_transformations/tests/normalize_l2_transformation.cpp index f21e015ab33..eadddcadb68 100644 --- a/src/common/low_precision_transformations/tests/normalize_l2_transformation.cpp +++ b/src/common/low_precision_transformations/tests/normalize_l2_transformation.cpp @@ -70,7 +70,7 @@ public: params.actual.dequantization); SimpleLowPrecisionTransformer transform; - transform.add(params.transformationParams); + transform.add(params.transformationParams); transform.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::NormalizeL2Function::getReference( diff --git a/src/common/low_precision_transformations/tests/pad_transformation.cpp b/src/common/low_precision_transformations/tests/pad_transformation.cpp index e269126441e..53191750bf9 100644 --- a/src/common/low_precision_transformations/tests/pad_transformation.cpp +++ b/src/common/low_precision_transformations/tests/pad_transformation.cpp @@ -74,7 +74,7 @@ public: { {}, {}, {} }); SimpleLowPrecisionTransformer transformer; - transformer.add(testValues.params); + transformer.add(testValues.params); transformer.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::PadFunction::get( diff --git a/src/common/low_precision_transformations/tests/prelu_transformation.cpp b/src/common/low_precision_transformations/tests/prelu_transformation.cpp index fce805128e6..c12e7497f30 100644 --- a/src/common/low_precision_transformations/tests/prelu_transformation.cpp +++ b/src/common/low_precision_transformations/tests/prelu_transformation.cpp @@ -58,7 +58,7 @@ public: testValues.actual.dequantization); SimpleLowPrecisionTransformer transformer; - transformer.add(testValues.params); + transformer.add(testValues.params); transformer.transform(actualFunction); referenceFunction = diff --git a/src/common/low_precision_transformations/tests/reduce_max_transformation.cpp b/src/common/low_precision_transformations/tests/reduce_max_transformation.cpp index d1b7f2e44c2..be7db3e8057 100644 --- a/src/common/low_precision_transformations/tests/reduce_max_transformation.cpp +++ b/src/common/low_precision_transformations/tests/reduce_max_transformation.cpp @@ -27,13 +27,13 @@ using namespace ngraph; using namespace ngraph::pass; using namespace ngraph::builder::subgraph; -class ReduceMaxTransformation : public ReduceTransformation { +class ReduceMaxTransformation : public ReduceTransformation { void SetUp() override { ReduceTransformation::SetUp(); const auto transformationParams = std::get<1>(GetParam()).params; SimpleLowPrecisionTransformer transform; - transform.add(transformationParams); + transform.add(transformationParams); transform.transform(actualFunction); } }; diff --git a/src/common/low_precision_transformations/tests/reduce_mean_transformation.cpp b/src/common/low_precision_transformations/tests/reduce_mean_transformation.cpp index c0780784fcd..79fdca9f65e 100644 --- a/src/common/low_precision_transformations/tests/reduce_mean_transformation.cpp +++ b/src/common/low_precision_transformations/tests/reduce_mean_transformation.cpp @@ -27,13 +27,13 @@ using namespace ngraph; using namespace ngraph::pass; using namespace ngraph::builder::subgraph; -class ReduceMeanTransformation : public ReduceTransformation { +class ReduceMeanTransformation : public ReduceTransformation { void SetUp() override { ReduceTransformation::SetUp(); const auto transformationParams = std::get<1>(GetParam()).params; SimpleLowPrecisionTransformer transform; - transform.add(transformationParams); + transform.add(transformationParams); transform.transform(actualFunction); } }; diff --git a/src/common/low_precision_transformations/tests/reduce_min_transformation.cpp b/src/common/low_precision_transformations/tests/reduce_min_transformation.cpp index 8cf0124a4df..af392aa2d77 100644 --- a/src/common/low_precision_transformations/tests/reduce_min_transformation.cpp +++ b/src/common/low_precision_transformations/tests/reduce_min_transformation.cpp @@ -27,13 +27,13 @@ using namespace ngraph; using namespace ngraph::pass; using namespace ngraph::builder::subgraph; -class ReduceMinTransformation : public ReduceTransformation { +class ReduceMinTransformation : public ReduceTransformation { void SetUp() override { ReduceTransformation::SetUp(); const auto transformationParams = std::get<1>(GetParam()).params; SimpleLowPrecisionTransformer transform; - transform.add(transformationParams); + transform.add(transformationParams); transform.transform(actualFunction); } }; diff --git a/src/common/low_precision_transformations/tests/reduce_sum_transformation.cpp b/src/common/low_precision_transformations/tests/reduce_sum_transformation.cpp index 19051ba6819..aaad199f39a 100644 --- a/src/common/low_precision_transformations/tests/reduce_sum_transformation.cpp +++ b/src/common/low_precision_transformations/tests/reduce_sum_transformation.cpp @@ -27,13 +27,13 @@ using namespace ngraph; using namespace ngraph::pass; using namespace ngraph::builder::subgraph; -class ReduceSumTransformation : public ReduceTransformation { +class ReduceSumTransformation : public ReduceTransformation { void SetUp() override { ReduceTransformation::SetUp(); const auto transformationParams = std::get<1>(GetParam()).params; SimpleLowPrecisionTransformer transform; - transform.add(transformationParams); + transform.add(transformationParams); transform.transform(actualFunction); } }; diff --git a/src/common/low_precision_transformations/tests/relu_transformation.cpp b/src/common/low_precision_transformations/tests/relu_transformation.cpp index 92324411c4e..6ebd4ef4a4e 100644 --- a/src/common/low_precision_transformations/tests/relu_transformation.cpp +++ b/src/common/low_precision_transformations/tests/relu_transformation.cpp @@ -62,7 +62,7 @@ public: testValues.actual.dequantization); SimpleLowPrecisionTransformer transformer; - transformer.add(testValues.params); + transformer.add(testValues.params); transformer.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::ReluFunction::getReference( diff --git a/src/common/low_precision_transformations/tests/reshape_transformation.cpp b/src/common/low_precision_transformations/tests/reshape_transformation.cpp index 205ce7cc47a..cd9916af7a2 100644 --- a/src/common/low_precision_transformations/tests/reshape_transformation.cpp +++ b/src/common/low_precision_transformations/tests/reshape_transformation.cpp @@ -59,7 +59,7 @@ public: testValues.actual.dequantization); SimpleLowPrecisionTransformer transformer; - transformer.add(testValues.params); + transformer.add(testValues.params); transformer.transform(actualFunction); referenceFunction = diff --git a/src/common/low_precision_transformations/tests/separate_in_standalone_branch_transformation.cpp b/src/common/low_precision_transformations/tests/separate_in_standalone_branch_transformation.cpp index af41e11f15d..aa402ac4d19 100644 --- a/src/common/low_precision_transformations/tests/separate_in_standalone_branch_transformation.cpp +++ b/src/common/low_precision_transformations/tests/separate_in_standalone_branch_transformation.cpp @@ -55,26 +55,26 @@ public: const ngraph::element::Type precision, const ngraph::Shape& inputShape, const ngraph::builder::subgraph::DequantizationOperations& dequantizations) -> std::shared_ptr { - const std::shared_ptr input = std::make_shared(precision, inputShape); - const auto relu = std::make_shared(input); + const std::shared_ptr input = std::make_shared(precision, inputShape); + const auto relu = std::make_shared(input); const auto dequantizationsNode = ngraph::builder::subgraph::makeDequantization(relu, dequantizations); - const std::shared_ptr reshape1 = std::make_shared( + const std::shared_ptr reshape1 = std::make_shared( dequantizationsNode, - std::make_shared(ngraph::element::i32, ngraph::Shape{ 2 }, std::vector({0, -1})), + std::make_shared(ngraph::element::i32, ngraph::Shape{ 2 }, std::vector({0, -1})), true); reshape1->set_friendly_name("reshape1"); - const std::shared_ptr reshape2 = std::make_shared( + const std::shared_ptr reshape2 = std::make_shared( dequantizationsNode, - std::make_shared(ngraph::element::i32, ngraph::Shape{ 2 }, std::vector({0, -1})), + std::make_shared(ngraph::element::i32, ngraph::Shape{ 2 }, std::vector({0, -1})), true); reshape2->set_friendly_name("reshape2"); return std::make_shared( ngraph::ResultVector{ - std::make_shared(reshape1), - std::make_shared(reshape2) + std::make_shared(reshape1), + std::make_shared(reshape2) }, std::vector> { input }, "SeparateInStandaloneBranchTransformation"); @@ -87,25 +87,25 @@ public: const ngraph::element::Type precision, const ngraph::Shape& inputShape, const ngraph::builder::subgraph::DequantizationOperations& dequantization) -> std::shared_ptr { - const std::shared_ptr input = std::make_shared(precision, inputShape); - const auto relu = std::make_shared(input); + const std::shared_ptr input = std::make_shared(precision, inputShape); + const auto relu = std::make_shared(input); - const std::shared_ptr reshape1 = std::make_shared( + const std::shared_ptr reshape1 = std::make_shared( ngraph::builder::subgraph::makeDequantization(relu, dequantization), - std::make_shared(ngraph::element::i32, ngraph::Shape{ 2 }, std::vector({0, -1})), + std::make_shared(ngraph::element::i32, ngraph::Shape{ 2 }, std::vector({0, -1})), true); reshape1->set_friendly_name("reshape1"); - const std::shared_ptr reshape2 = std::make_shared( + const std::shared_ptr reshape2 = std::make_shared( ngraph::builder::subgraph::makeDequantization(relu, dequantization), - std::make_shared(ngraph::element::i32, ngraph::Shape{ 2 }, std::vector({0, -1})), + std::make_shared(ngraph::element::i32, ngraph::Shape{ 2 }, std::vector({0, -1})), true); reshape2->set_friendly_name("reshape2"); return std::make_shared( ngraph::ResultVector{ - std::make_shared(reshape1), - std::make_shared(reshape2) + std::make_shared(reshape1), + std::make_shared(reshape2) }, std::vector> { input }, "SeparateInStandaloneBranchTransformation"); diff --git a/src/common/low_precision_transformations/tests/shuffle_channels_transformation.cpp b/src/common/low_precision_transformations/tests/shuffle_channels_transformation.cpp index e99026cb176..a43f51c698f 100644 --- a/src/common/low_precision_transformations/tests/shuffle_channels_transformation.cpp +++ b/src/common/low_precision_transformations/tests/shuffle_channels_transformation.cpp @@ -64,7 +64,7 @@ public: testValues.group); SimpleLowPrecisionTransformer transform; - transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::ShuffleChannelsFunction::getReference( diff --git a/src/common/low_precision_transformations/tests/split_transformation.cpp b/src/common/low_precision_transformations/tests/split_transformation.cpp index 9dbc5960ef8..deae160aefe 100644 --- a/src/common/low_precision_transformations/tests/split_transformation.cpp +++ b/src/common/low_precision_transformations/tests/split_transformation.cpp @@ -61,7 +61,7 @@ public: testValues.numSplits); SimpleLowPrecisionTransformer transformer; - transformer.add(testValues.params); + transformer.add(testValues.params); transformer.transform(actualFunction); referenceFunction = diff --git a/src/common/low_precision_transformations/tests/squeeze_transformation.cpp b/src/common/low_precision_transformations/tests/squeeze_transformation.cpp index 098d85830c7..c5bb67d46ce 100644 --- a/src/common/low_precision_transformations/tests/squeeze_transformation.cpp +++ b/src/common/low_precision_transformations/tests/squeeze_transformation.cpp @@ -59,7 +59,7 @@ public: testValues.actual.dequantization); SimpleLowPrecisionTransformer transform; - transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); diff --git a/src/common/low_precision_transformations/tests/strided_slice_transformation.cpp b/src/common/low_precision_transformations/tests/strided_slice_transformation.cpp index a5ca2013c9c..f11f186c395 100644 --- a/src/common/low_precision_transformations/tests/strided_slice_transformation.cpp +++ b/src/common/low_precision_transformations/tests/strided_slice_transformation.cpp @@ -83,7 +83,7 @@ public: testValues.layerParams.elipsisMask); SimpleLowPrecisionTransformer transformer; - transformer.add(testValues.params); + transformer.add(testValues.params); transformer.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::StridedSliceFunction::getReference( diff --git a/src/common/low_precision_transformations/tests/subgraph/src/fq_decomposition_with_shared_constants.cpp b/src/common/low_precision_transformations/tests/subgraph/src/fq_decomposition_with_shared_constants.cpp index 6d450b5d6da..4b66a16e6b6 100644 --- a/src/common/low_precision_transformations/tests/subgraph/src/fq_decomposition_with_shared_constants.cpp +++ b/src/common/low_precision_transformations/tests/subgraph/src/fq_decomposition_with_shared_constants.cpp @@ -30,33 +30,33 @@ public: const auto input_precision = ngraph::element::f32; { - auto input = std::make_shared(input_precision, shape); - auto shared_il = opset1::Constant::create(input_precision, {}, {0.f}); - auto shared_ih = opset1::Constant::create(input_precision, {}, {25.5f}); - auto shared_ol = opset1::Constant::create(input_precision, {}, {0.f}); - auto shared_oh = opset1::Constant::create(input_precision, {}, {25.5f}); + auto input = std::make_shared(input_precision, shape); + auto shared_il = ov::op::v0::Constant::create(input_precision, {}, {0.f}); + auto shared_ih = ov::op::v0::Constant::create(input_precision, {}, {25.5f}); + auto shared_ol = ov::op::v0::Constant::create(input_precision, {}, {0.f}); + auto shared_oh = ov::op::v0::Constant::create(input_precision, {}, {25.5f}); auto fq_before = - std::make_shared(input, shared_il, shared_ih, shared_ol, shared_oh, 256); + std::make_shared(input, shared_il, shared_ih, shared_ol, shared_oh, 256); auto fq_after = - std::make_shared(fq_before, shared_il, shared_ih, shared_ol, shared_oh, 256); - auto relu = std::make_shared(fq_after); + std::make_shared(fq_before, shared_il, shared_ih, shared_ol, shared_oh, 256); + auto relu = std::make_shared(fq_after); if (addIntervalsAlignment) { addAttributes( {fq_before, fq_after}, {IntervalsAlignmentAttribute(IntervalsAlignmentSharedValue::Interval{0.f, 2.55f}, 256ul)}); addAttributes({fq_after, relu}, {QuantizationAlignmentAttribute(true)}); } - ResultVector results{std::make_shared(relu)}; + ResultVector results{std::make_shared(relu)}; actualFunction = std::make_shared(results, ParameterVector{input}, "FakeQuantizeFunction"); } SimpleLowPrecisionTransformer transform; - transform.add( + transform.add( LayerTransformation::createParamsU8I8()); transform.transform(actualFunction); { - auto input = std::make_shared(input_precision, shape); + auto input = std::make_shared(input_precision, shape); auto fqStructure = FakeQuantizeOnData{256ul, Shape({}), {0.f}, {25.5f}, {0.f}, {255.f}, ngraph::element::u8}; auto deqStructure = DequantizationOperations{{element::f32}, {}, {0.1f}}; @@ -64,8 +64,8 @@ public: auto dq_before = makeDequantization(fq_before, deqStructure); auto fq_after = makeFakeQuantizeTypeRelaxed(dq_before, input_precision, fqStructure); auto dq_after = makeDequantization(fq_after, deqStructure); - auto relu = std::make_shared(dq_after); - ResultVector results{std::make_shared(relu)}; + auto relu = std::make_shared(dq_after); + ResultVector results{std::make_shared(relu)}; referenceFunction = std::make_shared(results, ParameterVector{input}, "FakeQuantizeFunction"); } } @@ -88,7 +88,7 @@ TEST_P(FQDecompositionWithSharedConstants, FQDecompositionWithSharedConstants) { // additional check: FQ constants after transformation mustn't be shared for (const auto& n : actualFunction->get_ordered_ops()) { - if (ov::is_type(n)) { + if (ov::is_type(n)) { EXPECT_EQ(n->get_output_target_inputs(0).size(), 1); } } diff --git a/src/common/low_precision_transformations/tests/transformations_after_split_transformation.cpp b/src/common/low_precision_transformations/tests/transformations_after_split_transformation.cpp index bd42ba89704..458183cad05 100644 --- a/src/common/low_precision_transformations/tests/transformations_after_split_transformation.cpp +++ b/src/common/low_precision_transformations/tests/transformations_after_split_transformation.cpp @@ -56,43 +56,43 @@ void getTransformerWithTransformationByName( using namespace pass::low_precision; if (name == "AddTransformationWithoutConcat" || name == "AddTransformationWithConcat") { - transformer.add(params); + transformer.add(params); return; } if (name == "AvgPoolTransformation") { - transformer.add(params); + transformer.add(params); return; } if (name == "ClampTransformation") { - transformer.add(params); + transformer.add(params); return; } if (name == "ConvolutionTransformation" || name == "AsymmetricConvolutionTransformation") { - transformer.add(params); + transformer.add(params); return; } if (name == "DepthToSpaceTransformation") { - transformer.add(params); + transformer.add(params); return; } if (name == "FakeQuantizeTransformation") { - transformer.add(params); + transformer.add(params); return; } if (name == "InterpolateTransformation") { - transformer.add(params); + transformer.add(params); return; } if (name == "MatMulTransformation") { - transformer.add(params); + transformer.add(params); return; } if (name == "MaxPoolTransformation") { - transformer.add(params); + transformer.add(params); return; } if (name == "MultiplyTransformation") { - transformer.add(params); + transformer.add(params); return; } if (name == "MVNTransformation") { @@ -100,51 +100,51 @@ void getTransformerWithTransformationByName( return; } if (name == "NormalizeL2Transformation") { - transformer.add(params); + transformer.add(params); return; } if (name == "PReluTransformation") { - transformer.add(params); + transformer.add(params); return; } if (name == "ReluTransformation") { - transformer.add(params); + transformer.add(params); return; } if (name == "ReshapeTransformation") { - transformer.add(params); + transformer.add(params); return; } if (name == "SqueezeTransformation") { - transformer.add(params); + transformer.add(params); return; } if (name == "StridedSliceTransformation") { - transformer.add(params); + transformer.add(params); return; } if (name == "TransposeTransformation") { - transformer.add(params); + transformer.add(params); return; } if (name == "UnsqueezeTransformation") { - transformer.add(params); + transformer.add(params); return; } if (name == "FuseConvertTransformation") { - transformer.add(params); + transformer.add(params); return; } if (name == "FuseSubtractToFakeQuantizeTransformation") { - transformer.add(params); + transformer.add(params); return; } if (name == "FuseMultiplyToFakeQuantizeTransformation") { - transformer.add(params); + transformer.add(params); return; } if (name == "MultiplyToGroupConvolutionTransformation") { - transformer.add(params); + transformer.add(params); return; } throw std::runtime_error("unexpected transformation name"); diff --git a/src/common/low_precision_transformations/tests/transpose_transformation.cpp b/src/common/low_precision_transformations/tests/transpose_transformation.cpp index d44a0991f6c..8fb6153ef01 100644 --- a/src/common/low_precision_transformations/tests/transpose_transformation.cpp +++ b/src/common/low_precision_transformations/tests/transpose_transformation.cpp @@ -60,8 +60,7 @@ public: testValues.actual.dequantization); SimpleLowPrecisionTransformer transformer; - transformer.add( - testValues.params); + transformer.add(testValues.params); transformer.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::TransposeFunction::getReference( diff --git a/src/common/low_precision_transformations/tests/unit/get_data_precision.cpp b/src/common/low_precision_transformations/tests/unit/get_data_precision.cpp index d6f6c0a2e28..cbb054510c7 100644 --- a/src/common/low_precision_transformations/tests/unit/get_data_precision.cpp +++ b/src/common/low_precision_transformations/tests/unit/get_data_precision.cpp @@ -12,10 +12,10 @@ using namespace ngraph; TEST(LPT_GetDataPrecision, getDataPrecision_reqU8_U8_to_U8) { - const auto input = std::make_shared(element::f32, Shape{1, 3, 299, 299}); - const auto low = std::make_shared(element::f32, Shape{}, std::vector{0.f}); - const auto high = std::make_shared(element::f32, Shape{}, std::vector{2.55f}); - const auto fakeQuantize = std::make_shared(input, low, high, low, high, 256); + const auto input = std::make_shared(element::f32, Shape{1, 3, 299, 299}); + const auto low = std::make_shared(element::f32, Shape{}, std::vector{0.f}); + const auto high = std::make_shared(element::f32, Shape{}, std::vector{2.55f}); + const auto fakeQuantize = std::make_shared(input, low, high, low, high, 256); auto const dequantization = pass::low_precision::QuantizationDetails::getDetails(fakeQuantize); @@ -28,10 +28,10 @@ TEST(LPT_GetDataPrecision, getDataPrecision_reqU8_U8_to_U8) { } TEST(LPT_GetDataPrecision, getDataPrecision_reqI8_I8_to_I8) { - const auto input = std::make_shared(element::f32, Shape{1, 3, 299, 299}); - const auto low = std::make_shared(element::f32, Shape{}, std::vector{-1.28f}); - const auto high = std::make_shared(element::f32, Shape{}, std::vector{1.27f}); - const auto fakeQuantize = std::make_shared(input, low, high, low, high, 256); + const auto input = std::make_shared(element::f32, Shape{1, 3, 299, 299}); + const auto low = std::make_shared(element::f32, Shape{}, std::vector{-1.28f}); + const auto high = std::make_shared(element::f32, Shape{}, std::vector{1.27f}); + const auto fakeQuantize = std::make_shared(input, low, high, low, high, 256); auto const dequantization = pass::low_precision::QuantizationDetails::getDetails(fakeQuantize); @@ -45,10 +45,10 @@ TEST(LPT_GetDataPrecision, getDataPrecision_reqI8_I8_to_I8) { } TEST(LPT_GetDataPrecision, getDataPrecision_reqU8_I8_to_U8zp) { - const auto input = std::make_shared(element::f32, Shape{1, 3, 299, 299}); - const auto low = std::make_shared(element::f32, Shape{}, std::vector{-1.28f}); - const auto high = std::make_shared(element::f32, Shape{}, std::vector{1.27f}); - const auto fakeQuantize = std::make_shared(input, low, high, low, high, 256); + const auto input = std::make_shared(element::f32, Shape{1, 3, 299, 299}); + const auto low = std::make_shared(element::f32, Shape{}, std::vector{-1.28f}); + const auto high = std::make_shared(element::f32, Shape{}, std::vector{1.27f}); + const auto fakeQuantize = std::make_shared(input, low, high, low, high, 256); auto const dequantization = pass::low_precision::QuantizationDetails::getDetails(fakeQuantize); @@ -61,10 +61,10 @@ TEST(LPT_GetDataPrecision, getDataPrecision_reqU8_I8_to_U8zp) { } TEST(LPT_GetDataPrecision, getDataPrecision_reqI8_U8_to_I8zp) { - const auto input = std::make_shared(element::f32, Shape{1, 3, 299, 299}); - const auto low = std::make_shared(element::f32, Shape{}, std::vector{0.f}); - const auto high = std::make_shared(element::f32, Shape{}, std::vector{2.55f}); - const auto fakeQuantize = std::make_shared(input, low, high, low, high, 256); + const auto input = std::make_shared(element::f32, Shape{1, 3, 299, 299}); + const auto low = std::make_shared(element::f32, Shape{}, std::vector{0.f}); + const auto high = std::make_shared(element::f32, Shape{}, std::vector{2.55f}); + const auto fakeQuantize = std::make_shared(input, low, high, low, high, 256); auto const dequantization = pass::low_precision::QuantizationDetails::getDetails(fakeQuantize); @@ -77,10 +77,10 @@ TEST(LPT_GetDataPrecision, getDataPrecision_reqI8_U8_to_I8zp) { } TEST(LPT_GetDataPrecision, getDataPrecision_reqU8_I8zp_to_U8zp) { - const auto input = std::make_shared(element::f32, Shape{1, 3, 299, 299}); - const auto low = std::make_shared(element::f32, Shape{}, std::vector{-0.875227511f}); - const auto high = std::make_shared(element::f32, Shape{}, std::vector{0.882119000f}); - const auto fakeQuantize = std::make_shared(input, low, high, low, high, 256); + const auto input = std::make_shared(element::f32, Shape{1, 3, 299, 299}); + const auto low = std::make_shared(element::f32, Shape{}, std::vector{-0.875227511f}); + const auto high = std::make_shared(element::f32, Shape{}, std::vector{0.882119000f}); + const auto fakeQuantize = std::make_shared(input, low, high, low, high, 256); auto const dequantization = pass::low_precision::QuantizationDetails::getDetails(fakeQuantize); @@ -93,10 +93,10 @@ TEST(LPT_GetDataPrecision, getDataPrecision_reqU8_I8zp_to_U8zp) { } TEST(LPT_GetDataPrecision, getDataPrecision_reqI8_U8zp_to_I8zp) { - const auto input = std::make_shared(element::f32, Shape{1, 3, 299, 299}); - const auto low = std::make_shared(element::f32, Shape{}, std::vector{0.875227511f}); - const auto high = std::make_shared(element::f32, Shape{}, std::vector{0.882119000f}); - const auto fakeQuantize = std::make_shared(input, low, high, low, high, 256); + const auto input = std::make_shared(element::f32, Shape{1, 3, 299, 299}); + const auto low = std::make_shared(element::f32, Shape{}, std::vector{0.875227511f}); + const auto high = std::make_shared(element::f32, Shape{}, std::vector{0.882119000f}); + const auto fakeQuantize = std::make_shared(input, low, high, low, high, 256); auto const dequantization = pass::low_precision::QuantizationDetails::getDetails(fakeQuantize); @@ -109,10 +109,10 @@ TEST(LPT_GetDataPrecision, getDataPrecision_reqI8_U8zp_to_I8zp) { } TEST(LPT_GetDataPrecision, getDataPrecision_reqNone_I8zp_to_undefzp) { - const auto input = std::make_shared(element::f32, Shape{1, 3, 299, 299}); - const auto low = std::make_shared(element::f32, Shape{}, std::vector{-0.875227511f}); - const auto high = std::make_shared(element::f32, Shape{}, std::vector{0.882119000f}); - const auto fakeQuantize = std::make_shared(input, low, high, low, high, 256); + const auto input = std::make_shared(element::f32, Shape{1, 3, 299, 299}); + const auto low = std::make_shared(element::f32, Shape{}, std::vector{-0.875227511f}); + const auto high = std::make_shared(element::f32, Shape{}, std::vector{0.882119000f}); + const auto fakeQuantize = std::make_shared(input, low, high, low, high, 256); auto const dequantization = pass::low_precision::QuantizationDetails::getDetails(fakeQuantize); @@ -125,10 +125,10 @@ TEST(LPT_GetDataPrecision, getDataPrecision_reqNone_I8zp_to_undefzp) { } TEST(LPT_GetDataPrecision, getDataPrecision_reqNone_U8zp_to_undefzp) { - const auto input = std::make_shared(element::f32, Shape{1, 3, 299, 299}); - const auto low = std::make_shared(element::f32, Shape{}, std::vector{0.875227511f}); - const auto high = std::make_shared(element::f32, Shape{}, std::vector{0.882119000f}); - const auto fakeQuantize = std::make_shared(input, low, high, low, high, 256); + const auto input = std::make_shared(element::f32, Shape{1, 3, 299, 299}); + const auto low = std::make_shared(element::f32, Shape{}, std::vector{0.875227511f}); + const auto high = std::make_shared(element::f32, Shape{}, std::vector{0.882119000f}); + const auto fakeQuantize = std::make_shared(input, low, high, low, high, 256); auto const dequantization = pass::low_precision::QuantizationDetails::getDetails(fakeQuantize); diff --git a/src/common/low_precision_transformations/tests/unsqueeze_transformation.cpp b/src/common/low_precision_transformations/tests/unsqueeze_transformation.cpp index b2e624d4f72..40e3db7b04d 100644 --- a/src/common/low_precision_transformations/tests/unsqueeze_transformation.cpp +++ b/src/common/low_precision_transformations/tests/unsqueeze_transformation.cpp @@ -59,7 +59,7 @@ public: testValues.actual.dequantization); SimpleLowPrecisionTransformer transform; - transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); diff --git a/src/common/low_precision_transformations/tests/variadic_split_transformation.cpp b/src/common/low_precision_transformations/tests/variadic_split_transformation.cpp index 3775ac933ea..c01ac2fba6d 100644 --- a/src/common/low_precision_transformations/tests/variadic_split_transformation.cpp +++ b/src/common/low_precision_transformations/tests/variadic_split_transformation.cpp @@ -58,7 +58,7 @@ public: testValues.splitLengths); SimpleLowPrecisionTransformer transformer; - transformer.add( + transformer.add( testValues.params); transformer.transform(actualFunction); diff --git a/src/common/transformations/tests/common_optimizations/clamp_fusion.cpp b/src/common/transformations/tests/common_optimizations/clamp_fusion.cpp index db50035bbef..fbc1385d49f 100644 --- a/src/common/transformations/tests/common_optimizations/clamp_fusion.cpp +++ b/src/common/transformations/tests/common_optimizations/clamp_fusion.cpp @@ -33,7 +33,7 @@ TEST_F(TransformationTestsF, ClampFusion) { } { - auto data = std::make_shared(element::f32, Shape{2, 2}); + auto data = std::make_shared(element::f32, Shape{2, 2}); auto clamp = std::make_shared(data, 0.1, 5); function_ref = std::make_shared(NodeVector{clamp}, ParameterVector{data}); } @@ -52,7 +52,7 @@ TEST_F(TransformationTestsF, ClampFusionScalars) { } { - auto data = std::make_shared(element::f32, Shape{2, 2}); + auto data = std::make_shared(element::f32, Shape{2, 2}); auto clamp = std::make_shared(data, 0.1, 5); function_ref = std::make_shared(NodeVector{clamp}, ParameterVector{data}); } @@ -94,7 +94,7 @@ TEST_F(TransformationTestsF, ClampFusionMinMax) { } { - auto data = std::make_shared(element::f32, Shape{2, 2}); + auto data = std::make_shared(element::f32, Shape{2, 2}); auto clamp = std::make_shared(data, 0.1, 5); function_ref = std::make_shared(NodeVector{clamp}, ParameterVector{data}); } @@ -113,7 +113,7 @@ TEST_F(TransformationTestsF, ClampFusionMinMaxScalars) { } { - auto data = std::make_shared(element::f32, Shape{2, 2}); + auto data = std::make_shared(element::f32, Shape{2, 2}); auto clamp = std::make_shared(data, 0.1, 5); function_ref = std::make_shared(NodeVector{clamp}, ParameterVector{data}); } diff --git a/src/common/transformations/tests/common_optimizations/compress_float_constants_test.cpp b/src/common/transformations/tests/common_optimizations/compress_float_constants_test.cpp index fa7ad5822c9..8ce48996fdd 100644 --- a/src/common/transformations/tests/common_optimizations/compress_float_constants_test.cpp +++ b/src/common/transformations/tests/common_optimizations/compress_float_constants_test.cpp @@ -147,25 +147,25 @@ TEST_F(TransformationTestsF, CompressConstants_f32_If) { default_scales_node, axes_node, interpolate4_attr); - auto then_op_result = std::make_shared(resize); + auto then_op_result = std::make_shared(resize); auto body_then_function = std::make_shared(ov::NodeVector{then_op_result}, ov::ParameterVector{input_then}); // create else body auto input_else = std::make_shared(ov::element::f32, ov::Shape{1, 3, 12, 12}); - auto else_op_result = std::make_shared(input_else); + auto else_op_result = std::make_shared(input_else); auto body_else_function = std::make_shared(ov::NodeVector{else_op_result}, ov::ParameterVector{input_else}); // create main graph auto input = std::make_shared(ov::element::f32, ov::Shape{1, 3, 12, 12}); - auto cond = std::make_shared(ngraph::element::boolean, ngraph::Shape{1}, true); + auto cond = std::make_shared(ngraph::element::boolean, ngraph::Shape{1}, true); auto if_op = std::make_shared(cond); if_op->set_then_body(body_then_function); if_op->set_else_body(body_else_function); if_op->set_input(input, input_then, input_else); if_op->set_output(then_op_result, else_op_result); - auto if_result = std::make_shared(if_op); + auto if_result = std::make_shared(if_op); function = std::make_shared(ngraph::NodeVector{if_result}, ngraph::ParameterVector{input}); @@ -212,25 +212,25 @@ TEST_F(TransformationTestsF, CompressConstants_f32_If) { default_scales_node, axes_node, interpolate4_attr); - auto then_op_result = std::make_shared(resize); + auto then_op_result = std::make_shared(resize); auto body_then_function = std::make_shared(ov::NodeVector{then_op_result}, ov::ParameterVector{input_then}); // create else body auto input_else = std::make_shared(ov::element::f32, ov::Shape{1, 3, 12, 12}); - auto else_op_result = std::make_shared(input_else); + auto else_op_result = std::make_shared(input_else); auto body_else_function = std::make_shared(ov::NodeVector{else_op_result}, ov::ParameterVector{input_else}); // create main graph auto input = std::make_shared(ov::element::f32, ov::Shape{1, 3, 12, 12}); - auto cond = std::make_shared(ngraph::element::boolean, ngraph::Shape{1}, true); + auto cond = std::make_shared(ngraph::element::boolean, ngraph::Shape{1}, true); auto if_op = std::make_shared(cond); if_op->set_then_body(body_then_function); if_op->set_else_body(body_else_function); if_op->set_input(input, input_then, input_else); if_op->set_output(then_op_result, else_op_result); - auto if_result = std::make_shared(if_op); + auto if_result = std::make_shared(if_op); function_ref = std::make_shared(ngraph::NodeVector{if_result}, ngraph::ParameterVector{input}); diff --git a/src/common/transformations/tests/common_optimizations/concat_reduce_fusion.cpp b/src/common/transformations/tests/common_optimizations/concat_reduce_fusion.cpp index f319d189436..ab4b3f914c8 100644 --- a/src/common/transformations/tests/common_optimizations/concat_reduce_fusion.cpp +++ b/src/common/transformations/tests/common_optimizations/concat_reduce_fusion.cpp @@ -13,6 +13,14 @@ #include #include "common_test_utils/ngraph_test_utils.hpp" +#include "openvino/op/add.hpp" +#include "openvino/op/concat.hpp" +#include "openvino/op/maximum.hpp" +#include "openvino/op/minimum.hpp" +#include "openvino/op/reduce_max.hpp" +#include "openvino/op/reduce_min.hpp" +#include "openvino/op/squeeze.hpp" +#include "openvino/op/unsqueeze.hpp" using namespace testing; using namespace ov; @@ -21,28 +29,29 @@ TEST_F(TransformationTestsF, ConcatReduceMaxFusionDynamicShape) { PartialShape shape{-1, -1, -1, -1}; std::int64_t reduce_axis = 2; { - auto left_input = std::make_shared(element::f32, shape); - auto right_input = std::make_shared(element::f32, shape); + auto left_input = std::make_shared(element::f32, shape); + auto right_input = std::make_shared(element::f32, shape); auto left_unsqueeze = - std::make_shared(left_input, - opset8::Constant::create(element::i64, Shape{}, {reduce_axis})); + std::make_shared(left_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {reduce_axis})); auto right_unsqueeze = - std::make_shared(right_input, - opset8::Constant::create(element::i64, Shape{}, {reduce_axis})); + std::make_shared(right_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {reduce_axis})); - auto concat = std::make_shared(NodeVector{left_unsqueeze, right_unsqueeze}, reduce_axis); + auto concat = std::make_shared(NodeVector{left_unsqueeze, right_unsqueeze}, reduce_axis); auto reduce_max = - std::make_shared(concat, opset8::Constant::create(element::i64, Shape{}, {reduce_axis})); + std::make_shared(concat, + ov::op::v0::Constant::create(element::i64, Shape{}, {reduce_axis})); function = std::make_shared(NodeVector{reduce_max}, ParameterVector{left_input, right_input}); manager.register_pass(); } { - auto left_input = std::make_shared(element::f32, shape); - auto right_input = std::make_shared(element::f32, shape); - auto maximum = std::make_shared(left_input, right_input); + auto left_input = std::make_shared(element::f32, shape); + auto right_input = std::make_shared(element::f32, shape); + auto maximum = std::make_shared(left_input, right_input); function_ref = std::make_shared(NodeVector{maximum}, ParameterVector{left_input, right_input}); } } @@ -51,37 +60,37 @@ TEST_F(TransformationTestsF, ConcatReduceMaxFusionKeepDimsDynamicShape) { PartialShape shape{-1, -1, -1, -1}; std::int64_t reduce_axis = 2; { - auto left_input = std::make_shared(element::f32, shape); - auto right_input = std::make_shared(element::f32, shape); + auto left_input = std::make_shared(element::f32, shape); + auto right_input = std::make_shared(element::f32, shape); auto left_unsqueeze = - std::make_shared(left_input, - opset8::Constant::create(element::i64, Shape{}, {reduce_axis})); + std::make_shared(left_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {reduce_axis})); auto right_unsqueeze = - std::make_shared(right_input, - opset8::Constant::create(element::i64, Shape{}, {reduce_axis})); + std::make_shared(right_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {reduce_axis})); - auto concat = std::make_shared(NodeVector{left_unsqueeze, right_unsqueeze}, reduce_axis); + auto concat = std::make_shared(NodeVector{left_unsqueeze, right_unsqueeze}, reduce_axis); auto reduce_max = - std::make_shared(concat, - opset8::Constant::create(element::i64, Shape{}, {reduce_axis}), - true); + std::make_shared(concat, + ov::op::v0::Constant::create(element::i64, Shape{}, {reduce_axis}), + true); function = std::make_shared(NodeVector{reduce_max}, ParameterVector{left_input, right_input}); manager.register_pass(); } { - auto left_input = std::make_shared(element::f32, shape); - auto right_input = std::make_shared(element::f32, shape); + auto left_input = std::make_shared(element::f32, shape); + auto right_input = std::make_shared(element::f32, shape); auto left_unsqueeze = - std::make_shared(left_input, - opset8::Constant::create(element::i64, Shape{}, {reduce_axis})); + std::make_shared(left_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {reduce_axis})); auto right_unsqueeze = - std::make_shared(right_input, - opset8::Constant::create(element::i64, Shape{}, {reduce_axis})); - auto maximum = std::make_shared(left_unsqueeze, right_unsqueeze); + std::make_shared(right_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {reduce_axis})); + auto maximum = std::make_shared(left_unsqueeze, right_unsqueeze); function_ref = std::make_shared(NodeVector{maximum}, ParameterVector{left_input, right_input}); } } @@ -90,28 +99,29 @@ TEST_F(TransformationTestsF, ConcatReduceMaxFusionDynamicRank) { PartialShape shape = PartialShape::dynamic(); std::int64_t reduce_axis = 3; { - auto left_input = std::make_shared(element::f32, shape); - auto right_input = std::make_shared(element::f32, shape); + auto left_input = std::make_shared(element::f32, shape); + auto right_input = std::make_shared(element::f32, shape); auto left_unsqueeze = - std::make_shared(left_input, - opset8::Constant::create(element::i64, Shape{}, {reduce_axis})); + std::make_shared(left_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {reduce_axis})); auto right_unsqueeze = - std::make_shared(right_input, - opset8::Constant::create(element::i64, Shape{}, {reduce_axis})); + std::make_shared(right_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {reduce_axis})); - auto concat = std::make_shared(NodeVector{left_unsqueeze, right_unsqueeze}, reduce_axis); + auto concat = std::make_shared(NodeVector{left_unsqueeze, right_unsqueeze}, reduce_axis); auto reduce_max = - std::make_shared(concat, opset8::Constant::create(element::i64, Shape{}, {reduce_axis})); + std::make_shared(concat, + ov::op::v0::Constant::create(element::i64, Shape{}, {reduce_axis})); function = std::make_shared(NodeVector{reduce_max}, ParameterVector{left_input, right_input}); manager.register_pass(); } { - auto left_input = std::make_shared(element::f32, shape); - auto right_input = std::make_shared(element::f32, shape); - auto maximum = std::make_shared(left_input, right_input); + auto left_input = std::make_shared(element::f32, shape); + auto right_input = std::make_shared(element::f32, shape); + auto maximum = std::make_shared(left_input, right_input); function_ref = std::make_shared(NodeVector{maximum}, ParameterVector{left_input, right_input}); } } @@ -120,28 +130,29 @@ TEST_F(TransformationTestsF, ConcatReduceMinFusionDynamicShape) { PartialShape shape{-1, -1, -1, -1}; std::int64_t reduce_axis = 2; { - auto left_input = std::make_shared(element::f32, shape); - auto right_input = std::make_shared(element::f32, shape); + auto left_input = std::make_shared(element::f32, shape); + auto right_input = std::make_shared(element::f32, shape); auto left_unsqueeze = - std::make_shared(left_input, - opset8::Constant::create(element::i64, Shape{}, {reduce_axis})); + std::make_shared(left_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {reduce_axis})); auto right_unsqueeze = - std::make_shared(right_input, - opset8::Constant::create(element::i64, Shape{}, {reduce_axis})); + std::make_shared(right_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {reduce_axis})); - auto concat = std::make_shared(NodeVector{left_unsqueeze, right_unsqueeze}, reduce_axis); + auto concat = std::make_shared(NodeVector{left_unsqueeze, right_unsqueeze}, reduce_axis); auto reduce_max = - std::make_shared(concat, opset8::Constant::create(element::i64, Shape{}, {reduce_axis})); + std::make_shared(concat, + ov::op::v0::Constant::create(element::i64, Shape{}, {reduce_axis})); function = std::make_shared(NodeVector{reduce_max}, ParameterVector{left_input, right_input}); manager.register_pass(); } { - auto left_input = std::make_shared(element::f32, shape); - auto right_input = std::make_shared(element::f32, shape); - auto maximum = std::make_shared(left_input, right_input); + auto left_input = std::make_shared(element::f32, shape); + auto right_input = std::make_shared(element::f32, shape); + auto maximum = std::make_shared(left_input, right_input); function_ref = std::make_shared(NodeVector{maximum}, ParameterVector{left_input, right_input}); } } @@ -150,28 +161,29 @@ TEST_F(TransformationTestsF, ConcatReduceMinFusionDynamicRank) { PartialShape shape = PartialShape::dynamic(); std::int64_t reduce_axis = 3; { - auto left_input = std::make_shared(element::f32, shape); - auto right_input = std::make_shared(element::f32, shape); + auto left_input = std::make_shared(element::f32, shape); + auto right_input = std::make_shared(element::f32, shape); auto left_unsqueeze = - std::make_shared(left_input, - opset8::Constant::create(element::i64, Shape{}, {reduce_axis})); + std::make_shared(left_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {reduce_axis})); auto right_unsqueeze = - std::make_shared(right_input, - opset8::Constant::create(element::i64, Shape{}, {reduce_axis})); + std::make_shared(right_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {reduce_axis})); - auto concat = std::make_shared(NodeVector{left_unsqueeze, right_unsqueeze}, reduce_axis); + auto concat = std::make_shared(NodeVector{left_unsqueeze, right_unsqueeze}, reduce_axis); auto reduce_max = - std::make_shared(concat, opset8::Constant::create(element::i64, Shape{}, {reduce_axis})); + std::make_shared(concat, + ov::op::v0::Constant::create(element::i64, Shape{}, {reduce_axis})); function = std::make_shared(NodeVector{reduce_max}, ParameterVector{left_input, right_input}); manager.register_pass(); } { - auto left_input = std::make_shared(element::f32, shape); - auto right_input = std::make_shared(element::f32, shape); - auto maximum = std::make_shared(left_input, right_input); + auto left_input = std::make_shared(element::f32, shape); + auto right_input = std::make_shared(element::f32, shape); + auto maximum = std::make_shared(left_input, right_input); function_ref = std::make_shared(NodeVector{maximum}, ParameterVector{left_input, right_input}); } } @@ -179,36 +191,43 @@ TEST_F(TransformationTestsF, ConcatReduceMinFusionDynamicRank) { TEST_F(TransformationTestsF, PullSqueezeThroughEltwiseStaticShape) { PartialShape shape{224, 224, 1, 1}; { - auto left_input = std::make_shared(element::f32, shape); - auto right_input = std::make_shared(element::f32, shape); + auto left_input = std::make_shared(element::f32, shape); + auto right_input = std::make_shared(element::f32, shape); auto left_unsqueeze = - std::make_shared(left_input, opset8::Constant::create(element::i64, Shape{}, {0})); + std::make_shared(left_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {0})); auto right_unsqueeze = - std::make_shared(right_input, opset8::Constant::create(element::i64, Shape{}, {0})); + std::make_shared(right_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {0})); - auto add = std::make_shared(left_unsqueeze, right_unsqueeze); + auto add = std::make_shared(left_unsqueeze, right_unsqueeze); - auto squeeze = std::make_shared(add, opset8::Constant::create(element::i64, Shape{}, {0})); + auto squeeze = + std::make_shared(add, ov::op::v0::Constant::create(element::i64, Shape{}, {0})); function = std::make_shared(NodeVector{squeeze}, ParameterVector{left_input, right_input}); manager.register_pass(); } { - auto left_input = std::make_shared(element::f32, shape); - auto right_input = std::make_shared(element::f32, shape); + auto left_input = std::make_shared(element::f32, shape); + auto right_input = std::make_shared(element::f32, shape); auto left_unsqueeze = - std::make_shared(left_input, opset8::Constant::create(element::i64, Shape{}, {0})); + std::make_shared(left_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {0})); auto left_squeeze = - std::make_shared(left_unsqueeze, opset8::Constant::create(element::i64, Shape{}, {0})); + std::make_shared(left_unsqueeze, + ov::op::v0::Constant::create(element::i64, Shape{}, {0})); auto right_unsqueeze = - std::make_shared(right_input, opset8::Constant::create(element::i64, Shape{}, {0})); + std::make_shared(right_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {0})); auto right_squeeze = - std::make_shared(right_unsqueeze, opset8::Constant::create(element::i64, Shape{}, {0})); + std::make_shared(right_unsqueeze, + ov::op::v0::Constant::create(element::i64, Shape{}, {0})); - auto add = std::make_shared(left_squeeze, right_squeeze); + auto add = std::make_shared(left_squeeze, right_squeeze); function_ref = std::make_shared(NodeVector{add}, ParameterVector{left_input, right_input}); } @@ -217,26 +236,29 @@ TEST_F(TransformationTestsF, PullSqueezeThroughEltwiseStaticShape) { TEST_F(TransformationTestsF, PullSqueezeThroughEltwiseSqueezeEliminationStaticShape) { PartialShape shape{224, 224, 1, 1}; { - auto left_input = std::make_shared(element::f32, shape); - auto right_input = std::make_shared(element::f32, shape); + auto left_input = std::make_shared(element::f32, shape); + auto right_input = std::make_shared(element::f32, shape); auto left_unsqueeze = - std::make_shared(left_input, opset8::Constant::create(element::i64, Shape{}, {0})); + std::make_shared(left_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {0})); auto right_unsqueeze = - std::make_shared(right_input, opset8::Constant::create(element::i64, Shape{}, {0})); + std::make_shared(right_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {0})); - auto add = std::make_shared(left_unsqueeze, right_unsqueeze); + auto add = std::make_shared(left_unsqueeze, right_unsqueeze); - auto squeeze = std::make_shared(add, opset8::Constant::create(element::i64, Shape{}, {0})); + auto squeeze = + std::make_shared(add, ov::op::v0::Constant::create(element::i64, Shape{}, {0})); function = std::make_shared(NodeVector{squeeze}, ParameterVector{left_input, right_input}); manager.register_pass(); } { - auto left_input = std::make_shared(element::f32, shape); - auto right_input = std::make_shared(element::f32, shape); + auto left_input = std::make_shared(element::f32, shape); + auto right_input = std::make_shared(element::f32, shape); - auto add = std::make_shared(left_input, right_input); + auto add = std::make_shared(left_input, right_input); function_ref = std::make_shared(NodeVector{add}, ParameterVector{left_input, right_input}); } @@ -245,26 +267,29 @@ TEST_F(TransformationTestsF, PullSqueezeThroughEltwiseSqueezeEliminationStaticSh TEST_F(TransformationTestsF, PullSqueezeThroughEltwiseSqueezeEliminationDynamicShape) { PartialShape shape{-1, -1, -1, -1}; { - auto left_input = std::make_shared(element::f32, shape); - auto right_input = std::make_shared(element::f32, shape); + auto left_input = std::make_shared(element::f32, shape); + auto right_input = std::make_shared(element::f32, shape); auto left_unsqueeze = - std::make_shared(left_input, opset8::Constant::create(element::i64, Shape{}, {0})); + std::make_shared(left_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {0})); auto right_unsqueeze = - std::make_shared(right_input, opset8::Constant::create(element::i64, Shape{}, {0})); + std::make_shared(right_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {0})); - auto add = std::make_shared(left_unsqueeze, right_unsqueeze); + auto add = std::make_shared(left_unsqueeze, right_unsqueeze); - auto squeeze = std::make_shared(add, opset8::Constant::create(element::i64, Shape{}, {0})); + auto squeeze = + std::make_shared(add, ov::op::v0::Constant::create(element::i64, Shape{}, {0})); function = std::make_shared(NodeVector{squeeze}, ParameterVector{left_input, right_input}); manager.register_pass(); } { - auto left_input = std::make_shared(element::f32, shape); - auto right_input = std::make_shared(element::f32, shape); + auto left_input = std::make_shared(element::f32, shape); + auto right_input = std::make_shared(element::f32, shape); - auto add = std::make_shared(left_input, right_input); + auto add = std::make_shared(left_input, right_input); function_ref = std::make_shared(NodeVector{add}, ParameterVector{left_input, right_input}); } @@ -273,26 +298,29 @@ TEST_F(TransformationTestsF, PullSqueezeThroughEltwiseSqueezeEliminationDynamicS TEST_F(TransformationTestsF, PullSqueezeThroughEltwiseSqueezeEliminationDynamicRank) { PartialShape shape = PartialShape::dynamic(); { - auto left_input = std::make_shared(element::f32, shape); - auto right_input = std::make_shared(element::f32, shape); + auto left_input = std::make_shared(element::f32, shape); + auto right_input = std::make_shared(element::f32, shape); auto left_unsqueeze = - std::make_shared(left_input, opset8::Constant::create(element::i64, Shape{}, {0})); + std::make_shared(left_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {0})); auto right_unsqueeze = - std::make_shared(right_input, opset8::Constant::create(element::i64, Shape{}, {0})); + std::make_shared(right_input, + ov::op::v0::Constant::create(element::i64, Shape{}, {0})); - auto add = std::make_shared(left_unsqueeze, right_unsqueeze); + auto add = std::make_shared(left_unsqueeze, right_unsqueeze); - auto squeeze = std::make_shared(add, opset8::Constant::create(element::i64, Shape{}, {0})); + auto squeeze = + std::make_shared(add, ov::op::v0::Constant::create(element::i64, Shape{}, {0})); function = std::make_shared(NodeVector{squeeze}, ParameterVector{left_input, right_input}); manager.register_pass(); } { - auto left_input = std::make_shared(element::f32, shape); - auto right_input = std::make_shared(element::f32, shape); + auto left_input = std::make_shared(element::f32, shape); + auto right_input = std::make_shared(element::f32, shape); - auto add = std::make_shared(left_input, right_input); + auto add = std::make_shared(left_input, right_input); function_ref = std::make_shared(NodeVector{add}, ParameterVector{left_input, right_input}); } diff --git a/src/common/transformations/tests/common_optimizations/convert_nms_gather_path_to_unsigned_test.cpp b/src/common/transformations/tests/common_optimizations/convert_nms_gather_path_to_unsigned_test.cpp index 5d6b1294f33..54bd5a9e5da 100644 --- a/src/common/transformations/tests/common_optimizations/convert_nms_gather_path_to_unsigned_test.cpp +++ b/src/common/transformations/tests/common_optimizations/convert_nms_gather_path_to_unsigned_test.cpp @@ -204,5 +204,5 @@ TEST(TransformationTests, test_convert_to_unsigned_nms_gather_3) { manager.register_pass(); manager.run_passes(f); ASSERT_NO_THROW(check_rt_info(f)); - ASSERT_EQ(count_ops_of_type(f), 0); + ASSERT_EQ(count_ops_of_type(f), 0); } diff --git a/src/common/transformations/tests/common_optimizations/fq_mul_fusion_test.cpp b/src/common/transformations/tests/common_optimizations/fq_mul_fusion_test.cpp index a23ecbb3ad9..6c44a37a19a 100644 --- a/src/common/transformations/tests/common_optimizations/fq_mul_fusion_test.cpp +++ b/src/common/transformations/tests/common_optimizations/fq_mul_fusion_test.cpp @@ -73,12 +73,12 @@ public: }; TEST_P(FQMulFusion, ExpectFusion) { - auto unh = std::make_shared(); + auto unh = std::make_shared(); ngraph::pass::Manager manager; - manager.register_pass(unh); + manager.register_pass(unh); manager.register_pass(); manager.register_pass(); - manager.register_pass(unh); + manager.register_pass(unh); manager.run_passes(m_function); ASSERT_NO_THROW(check_rt_info(m_function)); diff --git a/src/common/transformations/tests/common_optimizations/fq_reshape_fusion.cpp b/src/common/transformations/tests/common_optimizations/fq_reshape_fusion.cpp index a69f608341b..994d5f0b0a9 100644 --- a/src/common/transformations/tests/common_optimizations/fq_reshape_fusion.cpp +++ b/src/common/transformations/tests/common_optimizations/fq_reshape_fusion.cpp @@ -123,12 +123,12 @@ private: }; TEST_P(nGraphFQReshapeFusionTests, ReshapeMatMul) { - auto unh = std::make_shared(); + auto unh = std::make_shared(); ngraph::pass::Manager manager; - manager.register_pass(unh); + manager.register_pass(unh); manager.register_pass(); manager.register_pass(); - manager.register_pass(unh); + manager.register_pass(unh); manager.run_passes(f); ASSERT_NO_THROW(check_rt_info(f)); diff --git a/src/common/transformations/tests/common_optimizations/gelu_fusion.cpp b/src/common/transformations/tests/common_optimizations/gelu_fusion.cpp index ef537569032..455c1cce8cf 100644 --- a/src/common/transformations/tests/common_optimizations/gelu_fusion.cpp +++ b/src/common/transformations/tests/common_optimizations/gelu_fusion.cpp @@ -45,7 +45,7 @@ TEST_F(TransformationTestsF, GeluFusionPatternOne) { } { - auto data = std::make_shared(element::f32, Shape{2, 2}); + auto data = std::make_shared(element::f32, Shape{2, 2}); auto gelu = std::make_shared(data); function_ref = std::make_shared(NodeVector{gelu}, ParameterVector{data}); } @@ -71,7 +71,7 @@ TEST_F(TransformationTestsF, GeluFusionPatternOneF16) { } { - auto data = std::make_shared(element::f16, Shape{2, 2}); + auto data = std::make_shared(element::f16, Shape{2, 2}); auto gelu = std::make_shared(data); function_ref = std::make_shared(NodeVector{gelu}, ParameterVector{data}); } @@ -97,7 +97,7 @@ TEST_F(TransformationTestsF, GeluFusionPatternTwo) { } { - auto data = std::make_shared(element::f32, Shape{2, 2}); + auto data = std::make_shared(element::f32, Shape{2, 2}); auto gelu = std::make_shared(data); function_ref = std::make_shared(NodeVector{gelu}, ParameterVector{data}); } @@ -123,7 +123,7 @@ TEST_F(TransformationTestsF, GeluFusionPatternTwoF16) { } { - auto data = std::make_shared(element::f16, Shape{2, 2}); + auto data = std::make_shared(element::f16, Shape{2, 2}); auto gelu = std::make_shared(data); function_ref = std::make_shared(NodeVector{gelu}, ParameterVector{data}); } @@ -149,7 +149,7 @@ TEST_F(TransformationTestsF, GeluFusionPatternThree) { } { - auto data = std::make_shared(element::f32, Shape{2, 2}); + auto data = std::make_shared(element::f32, Shape{2, 2}); auto gelu = std::make_shared(data); function_ref = std::make_shared(NodeVector{gelu}, ParameterVector{data}); } @@ -175,7 +175,7 @@ TEST_F(TransformationTestsF, GeluFusionPatternThreeF16) { } { - auto data = std::make_shared(element::f16, Shape{2, 2}); + auto data = std::make_shared(element::f16, Shape{2, 2}); auto gelu = std::make_shared(data); function_ref = std::make_shared(NodeVector{gelu}, ParameterVector{data}); } @@ -201,7 +201,7 @@ TEST_F(TransformationTestsF, GeluFusionPatternFour) { } { - auto data = std::make_shared(element::f32, Shape{2, 2}); + auto data = std::make_shared(element::f32, Shape{2, 2}); auto gelu = std::make_shared(data); function_ref = std::make_shared(NodeVector{gelu}, ParameterVector{data}); } @@ -227,7 +227,7 @@ TEST_F(TransformationTestsF, GeluFusionPatternFourF16) { } { - auto data = std::make_shared(element::f16, Shape{2, 2}); + auto data = std::make_shared(element::f16, Shape{2, 2}); auto gelu = std::make_shared(data); function_ref = std::make_shared(NodeVector{gelu}, ParameterVector{data}); } diff --git a/src/common/transformations/tests/common_optimizations/hsigmoid_fusion_test.cpp b/src/common/transformations/tests/common_optimizations/hsigmoid_fusion_test.cpp index e0121771650..752adfa0799 100644 --- a/src/common/transformations/tests/common_optimizations/hsigmoid_fusion_test.cpp +++ b/src/common/transformations/tests/common_optimizations/hsigmoid_fusion_test.cpp @@ -146,13 +146,12 @@ TEST_F(TransformationTestsF, HSigmoidFusionWithClampMul) { TEST_F(TransformationTestsF, HSigmoidFusionWithClampDiv) { { - auto input = - std::make_shared(ngraph::element::f16, ngraph::PartialShape::dynamic(1)); - auto add_constant = ngraph::opset6::Constant::create(ngraph::element::f16, ngraph::Shape{}, {3.0}); - auto add = std::make_shared(input, add_constant); - auto clamp = std::make_shared(add, 0.0f, 6.0f); - auto div_constant = ngraph::opset6::Constant::create(ngraph::element::f16, ngraph::Shape{}, {6.0}); - auto div = std::make_shared(clamp, div_constant); + auto input = std::make_shared(ngraph::element::f16, ngraph::PartialShape::dynamic(1)); + auto add_constant = ov::op::v0::Constant::create(ngraph::element::f16, ngraph::Shape{}, {3.0}); + auto add = std::make_shared(input, add_constant); + auto clamp = std::make_shared(add, 0.0f, 6.0f); + auto div_constant = ov::op::v0::Constant::create(ngraph::element::f16, ngraph::Shape{}, {6.0}); + auto div = std::make_shared(clamp, div_constant); function = std::make_shared(ngraph::NodeVector{div}, ngraph::ParameterVector{input}); diff --git a/src/common/transformations/tests/common_optimizations/leaky_relu_fusion.cpp b/src/common/transformations/tests/common_optimizations/leaky_relu_fusion.cpp index 13cb0d5d84c..de7001a6796 100644 --- a/src/common/transformations/tests/common_optimizations/leaky_relu_fusion.cpp +++ b/src/common/transformations/tests/common_optimizations/leaky_relu_fusion.cpp @@ -32,7 +32,7 @@ TEST_F(TransformationTestsF, LeakyReluFusionConstant) { } { - auto data = std::make_shared(element::f32, Shape{2, 2}); + auto data = std::make_shared(element::f32, Shape{2, 2}); auto alpha = opset8::Constant::create(element::f32, Shape{1}, {0.1}); auto leaky_relu = std::make_shared(data, alpha); function_ref = std::make_shared(NodeVector{leaky_relu}, ParameterVector{data}); @@ -51,7 +51,7 @@ TEST_F(TransformationTestsF, LeakyReluFusionScalar) { } { - auto data = std::make_shared(element::f32, Shape{2, 2}); + auto data = std::make_shared(element::f32, Shape{2, 2}); auto alpha = opset8::Constant::create(element::f32, Shape{}, {0.1}); auto leaky_relu = std::make_shared(data, alpha); function_ref = std::make_shared(NodeVector{leaky_relu}, ParameterVector{data}); @@ -70,7 +70,7 @@ TEST_F(TransformationTestsF, LeakyReluFusionParameter) { } { - auto data = std::make_shared(element::f32, Shape{2, 2}); + auto data = std::make_shared(element::f32, Shape{2, 2}); auto alpha = std::make_shared(element::f32, Shape{}); auto leaky_relu = std::make_shared(data, alpha); function_ref = std::make_shared(NodeVector{leaky_relu}, ParameterVector{data, alpha}); diff --git a/src/common/transformations/tests/common_optimizations/low_latency_v2_test.cpp b/src/common/transformations/tests/common_optimizations/low_latency_v2_test.cpp index c2eebb9139f..373a4163c81 100644 --- a/src/common/transformations/tests/common_optimizations/low_latency_v2_test.cpp +++ b/src/common/transformations/tests/common_optimizations/low_latency_v2_test.cpp @@ -594,7 +594,7 @@ TEST(TransformationTests, LowLatency2_LSTM_Loop_Reshape) { auto results = body->get_results(); auto shape_of = std::make_shared(X); - const auto trip_count = std::make_shared(shape_of, + const auto trip_count = std::make_shared(shape_of, Constant::create(ngraph::element::i64, {1}, {0}), Constant::create(ngraph::element::i64, {1}, {0})); auto exec_condition = std::make_shared(element::boolean, Shape{}, true); diff --git a/src/common/transformations/tests/common_optimizations/ngraph_fq_transpose_test.cpp b/src/common/transformations/tests/common_optimizations/ngraph_fq_transpose_test.cpp index 2e66744a9df..8cf64d6e261 100644 --- a/src/common/transformations/tests/common_optimizations/ngraph_fq_transpose_test.cpp +++ b/src/common/transformations/tests/common_optimizations/ngraph_fq_transpose_test.cpp @@ -20,37 +20,38 @@ #include "common_test_utils/ngraph_test_utils.hpp" #include "common_test_utils/test_common.hpp" +#include "openvino/op/sigmoid.hpp" using namespace testing; TEST_F(TransformationTestsF, FQTransposeTest1) { { - auto data = ngraph::op::Constant::create(ngraph::element::f32, ngraph::Shape{1, 1, 3}, {1, 2, 3}); - auto input_low = ngraph::op::Constant::create(ngraph::element::f32, ngraph::Shape{1}, {2}); - auto input_high = ngraph::op::Constant::create(ngraph::element::f32, ngraph::Shape{1}, {3}); - auto output_low = ngraph::op::Constant::create(ngraph::element::f32, ngraph::Shape{1}, {2}); - auto output_high = ngraph::op::Constant::create(ngraph::element::f32, ngraph::Shape{1}, {3}); - auto transpose_order = ngraph::op::Constant::create(ngraph::element::i64, ngraph::Shape{3}, {0, 2, 1}); + auto data = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{1, 1, 3}, {1, 2, 3}); + auto input_low = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{1}, {2}); + auto input_high = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{1}, {3}); + auto output_low = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{1}, {2}); + auto output_high = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{1}, {3}); + auto transpose_order = ov::op::v0::Constant::create(ngraph::element::i64, ngraph::Shape{3}, {0, 2, 1}); - auto fq = std::make_shared(data, input_low, input_high, output_low, output_high, 1); - auto transpose = std::make_shared(fq, transpose_order); + auto fq = std::make_shared(data, input_low, input_high, output_low, output_high, 1); + auto transpose = std::make_shared(fq, transpose_order); function = std::make_shared(ngraph::NodeVector{transpose}, ngraph::ParameterVector{}); manager.register_pass(); - manager.register_pass([](std::shared_ptr f) { + manager.register_pass([](std::shared_ptr f) { check_rt_info(f); }); manager.register_pass(); } { - auto data = ngraph::op::Constant::create(ngraph::element::f32, ngraph::Shape{1, 3, 1}, {1, 2, 3}); - auto input_low = ngraph::op::Constant::create(ngraph::element::f32, ngraph::Shape{1, 1, 1}, {2}); - auto input_high = ngraph::op::Constant::create(ngraph::element::f32, ngraph::Shape{1, 1, 1}, {3}); - auto output_low = ngraph::op::Constant::create(ngraph::element::f32, ngraph::Shape{1, 1, 1}, {2}); - auto output_high = ngraph::op::Constant::create(ngraph::element::f32, ngraph::Shape{1, 1, 1}, {3}); + auto data = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{1, 3, 1}, {1, 2, 3}); + auto input_low = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{1, 1, 1}, {2}); + auto input_high = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{1, 1, 1}, {3}); + auto output_low = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{1, 1, 1}, {2}); + auto output_high = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{1, 1, 1}, {3}); - auto fq = std::make_shared(data, input_low, input_high, output_low, output_high, 1); + auto fq = std::make_shared(data, input_low, input_high, output_low, output_high, 1); function_ref = std::make_shared(ngraph::NodeVector{fq}, ngraph::ParameterVector{}); } @@ -58,17 +59,17 @@ TEST_F(TransformationTestsF, FQTransposeTest1) { TEST_F(TransformationTestsF, FQTransposeNegativeCase) { auto create_graph = []() -> std::shared_ptr { - auto data = std::make_shared(ngraph::element::f32, ngraph::PartialShape{1, 3, 1}); - auto sigmoid = std::make_shared(data); - auto input_low = ngraph::op::Constant::create(ngraph::element::f32, ngraph::Shape{1}, {2}); - auto input_high = ngraph::op::Constant::create(ngraph::element::f32, ngraph::Shape{1}, {3}); - auto output_low = ngraph::op::Constant::create(ngraph::element::f32, ngraph::Shape{1}, {2}); - auto output_high = ngraph::op::Constant::create(ngraph::element::f32, ngraph::Shape{1}, {3}); - auto transpose_order = ngraph::op::Constant::create(ngraph::element::i64, ngraph::Shape{3}, {0, 2, 1}); + auto data = std::make_shared(ngraph::element::f32, ngraph::PartialShape{1, 3, 1}); + auto sigmoid = std::make_shared(data); + auto input_low = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{1}, {2}); + auto input_high = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{1}, {3}); + auto output_low = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{1}, {2}); + auto output_high = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{1}, {3}); + auto transpose_order = ov::op::v0::Constant::create(ngraph::element::i64, ngraph::Shape{3}, {0, 2, 1}); auto fq = - std::make_shared(sigmoid, input_low, input_high, output_low, output_high, 1); - auto transpose = std::make_shared(fq, transpose_order); + std::make_shared(sigmoid, input_low, input_high, output_low, output_high, 1); + auto transpose = std::make_shared(fq, transpose_order); return std::make_shared(ngraph::NodeVector{transpose}, ngraph::ParameterVector{data}); }; @@ -76,7 +77,7 @@ TEST_F(TransformationTestsF, FQTransposeNegativeCase) { manager.register_pass(); manager.register_pass(); - manager.register_pass([](std::shared_ptr f) { + manager.register_pass([](std::shared_ptr f) { check_rt_info(f); }); diff --git a/src/common/transformations/tests/common_optimizations/nop_elimination.cpp b/src/common/transformations/tests/common_optimizations/nop_elimination.cpp index 0932709116a..d74b6d680f9 100644 --- a/src/common/transformations/tests/common_optimizations/nop_elimination.cpp +++ b/src/common/transformations/tests/common_optimizations/nop_elimination.cpp @@ -28,13 +28,13 @@ using namespace ngraph; using namespace std; TEST(nop_elimination, eliminate_convert) { - std::shared_ptr f; + std::shared_ptr f; { Shape shape{}; auto type = element::f32; auto A = make_shared(type, shape); auto c = make_shared(A, element::f32); - f = make_shared(make_shared(c), ParameterVector{A}); + f = make_shared(make_shared(c), ParameterVector{A}); } pass::Manager pass_manager; @@ -46,14 +46,13 @@ TEST(nop_elimination, eliminate_convert) { TEST(nop_elimination, convert_type_agnostic) { Shape shape{}; - std::shared_ptr f; + std::shared_ptr f; { - auto type = element::from(); - auto A = make_shared(type, shape); - auto c1 = make_shared(A, element::from()); - auto c = make_shared(c1, element::f32); + auto A = make_shared(ov::element::i8, shape); + auto c1 = make_shared(A, ov::element::u8); + auto c = make_shared(c1, ov::element::f32); auto z = make_shared(c); - f = make_shared(make_shared(z), ParameterVector{A}); + f = make_shared(make_shared(z), ParameterVector{A}); } pass::Manager pass_manager; @@ -66,12 +65,12 @@ TEST(nop_elimination, convert_type_agnostic) { template void test_nop_eliminate_broadcast() { - std::shared_ptr f; + std::shared_ptr f; { Shape shape{1}; auto A = make_shared(element::f32, shape); auto b = make_shared(A, op::Constant::create(element::u64, Shape{1}, {1})); - f = make_shared(make_shared(b), ParameterVector{A}); + f = make_shared(make_shared(b), ParameterVector{A}); } pass::Manager pass_manager; @@ -102,7 +101,7 @@ TEST(nop_elimination, reshape_elimination_v1) { auto reshape_v1_org = std::make_shared(arg, pattern_org, zero); auto reshape_v1 = std::make_shared(reshape_v1_org, pattern, zero); auto abs = std::make_shared(reshape_v1); - return std::make_shared(NodeVector{abs}, ParameterVector{arg}); + return std::make_shared(NodeVector{abs}, ParameterVector{arg}); }; auto func = generate_func(false); @@ -145,7 +144,7 @@ TEST(nop_elimination, reshape_v1_1D) { } TEST(nop_elimination, squeeze_reshape_elimination_check_info) { - std::shared_ptr f; + std::shared_ptr f; { auto arg = std::make_shared(element::f32, PartialShape{8, 16, 1, 3}); @@ -162,7 +161,7 @@ TEST(nop_elimination, squeeze_reshape_elimination_check_info) { auto abs = std::make_shared(reshape); - f = std::make_shared(NodeVector{abs}, ParameterVector{arg}); + f = std::make_shared(NodeVector{abs}, ParameterVector{arg}); } pass::Manager pass_manager; @@ -180,7 +179,7 @@ TEST(nop_elimination, squeeze_reshape_elimination_check_info) { } TEST(nop_elimination, squeeze_unsqueeze_elimination) { - std::shared_ptr f; + std::shared_ptr f; { auto arg = std::make_shared(element::f32, PartialShape{8, 16, 1, 3}); @@ -197,7 +196,7 @@ TEST(nop_elimination, squeeze_unsqueeze_elimination) { auto abs = std::make_shared(unsqueeze); - f = std::make_shared(NodeVector{abs}, ParameterVector{arg}); + f = std::make_shared(NodeVector{abs}, ParameterVector{arg}); } pass::Manager pass_manager; @@ -219,7 +218,7 @@ TEST(nop_elimination, reshape_elimination_v1_dynamic) { auto pattern = make_shared(element::i64, PartialShape::dynamic(1)); auto reshape_v1 = std::make_shared(arg, pattern, false); auto abs = std::make_shared(reshape_v1); - auto f = std::make_shared(NodeVector{abs}, ParameterVector{arg, pattern}); + auto f = std::make_shared(NodeVector{abs}, ParameterVector{arg, pattern}); pass::Manager pass_manager; pass_manager.register_pass(); pass_manager.run_passes(f); @@ -227,7 +226,7 @@ TEST(nop_elimination, reshape_elimination_v1_dynamic) { } TEST(nop_elimination, reshape_elimination_v1_check_consumer_count) { - std::shared_ptr f; + std::shared_ptr f; { auto arg = std::make_shared(element::f32, PartialShape{8, 16, 1, 3}); @@ -242,7 +241,7 @@ TEST(nop_elimination, reshape_elimination_v1_check_consumer_count) { auto relu = std::make_shared(reshape_1); relu->set_friendly_name("relu"); - f = std::make_shared(NodeVector{reshape_2, relu}, ParameterVector{arg}); + f = std::make_shared(NodeVector{reshape_2, relu}, ParameterVector{arg}); } pass::Manager pass_manager; @@ -256,7 +255,7 @@ TEST(nop_elimination, reshape_elimination_v1_check_consumer_count) { TEST(nop_elimination, concat_elimination_single_node) { int64_t a = 0; auto A = make_shared(element::f32, Shape{2, 3}); - auto f = make_shared(make_shared(NodeVector{A}, a), ParameterVector{A}); + auto f = make_shared(make_shared(NodeVector{A}, a), ParameterVector{A}); pass::Manager pass_manager; pass_manager.register_pass(); @@ -270,7 +269,7 @@ TEST(nop_elimination, concat_elimination_single_input) { int64_t a = 0; auto A = make_shared(element::f32, Shape{2, 3}); auto B = make_shared(NodeVector{A}, a); - auto f = make_shared(make_shared(B), ParameterVector{A}); + auto f = make_shared(make_shared(B), ParameterVector{A}); pass::Manager pass_manager; pass_manager.register_pass(); @@ -284,7 +283,7 @@ TEST(nop_elimination, concat_elimination_single_input_dynamic) { int64_t a = 0; auto A = make_shared(element::f32, PartialShape{Dimension::dynamic(), 3}); auto B = make_shared(NodeVector{A}, a); - auto f = make_shared(make_shared(B), ParameterVector{A}); + auto f = make_shared(make_shared(B), ParameterVector{A}); pass::Manager pass_manager; pass_manager.register_pass(); @@ -299,7 +298,7 @@ TEST(nop_elimination, unsqueeze_elimination) { const auto A = make_shared(element::f32, PartialShape{3, Dimension::dynamic(), Dimension::dynamic()}); const auto unsqueeze = make_shared(A, axis); - auto f = make_shared(unsqueeze, ParameterVector{A}); + auto f = make_shared(unsqueeze, ParameterVector{A}); pass::Manager pass_manager; pass_manager.register_pass(); @@ -369,8 +368,8 @@ TEST(nop_elimination, squeeze_unsqueeze_overlap_elimination) { B1 = make_shared(B, sq_axes); } - auto baseline_f = make_shared(make_shared(B1), ParameterVector{A}); - auto optimized_f = clone_function(*baseline_f); + auto baseline_f = make_shared(make_shared(B1), ParameterVector{A}); + auto optimized_f = baseline_f->clone(); pass::Manager pass_manager; pass_manager.register_pass(); @@ -561,8 +560,8 @@ TEST(nop_elimination, squeeze_squeeze_overlap_elimination) { auto A1 = make_shared(A); auto B = make_shared(A1, sq_axes_1); auto B1 = make_shared(B, sq_axes_2); - auto baseline_f = make_shared(make_shared(B1), ParameterVector{A}); - auto optimized_f = clone_function(*baseline_f); + auto baseline_f = make_shared(make_shared(B1), ParameterVector{A}); + auto optimized_f = baseline_f->clone(); pass::Manager pass_manager; pass_manager.register_pass(); @@ -595,8 +594,8 @@ TEST(nop_elimination, unsqueeze_unsqueeze_overlap_elimination) { auto A1 = make_shared(A); auto B = make_shared(A1, unsq_axes_1); auto B1 = make_shared(B, unsq_axes_2); - auto baseline_f = make_shared(make_shared(B1), ParameterVector{A}); - auto optimized_f = clone_function(*baseline_f); + auto baseline_f = make_shared(make_shared(B1), ParameterVector{A}); + auto optimized_f = baseline_f->clone(); pass::Manager pass_manager; pass_manager.register_pass(); @@ -623,7 +622,7 @@ TEST(nop_elimination, unsqueeze_squeeze_elimination) { auto A1 = make_shared(A); auto B = make_shared(A1, axes); auto B1 = make_shared(B, axes); - return make_shared(make_shared(B1), ParameterVector{A}); + return make_shared(make_shared(B1), ParameterVector{A}); }; auto check_usecase = [&](const Shape& shape, const std::vector& axes_val) { @@ -656,8 +655,8 @@ TEST(nop_elimination, reshape_unsqueeze_elimination) { auto B = make_shared(A1, pat, zero); auto pat2 = op::Constant::create(element::i64, Shape{2}, std::vector{0, -1}); auto B1 = make_shared(B, axes); - auto baseline_f = make_shared(make_shared(B1), ParameterVector{A}); - auto optimized_f = clone_function(*baseline_f); + auto baseline_f = make_shared(make_shared(B1), ParameterVector{A}); + auto optimized_f = baseline_f->clone(); ngraph::pass::Manager manager; manager.register_pass(); manager.run_passes(optimized_f); @@ -684,8 +683,8 @@ TEST(nop_elimination, reshape_squeeze_elimination) { auto B = make_shared(A1, pat, zero); auto pat2 = op::Constant::create(element::i64, Shape{2}, std::vector{0, -1}); auto B1 = make_shared(B, axes); - auto baseline_f = make_shared(make_shared(B1), ParameterVector{A}); - auto optimized_f = clone_function(*baseline_f); + auto baseline_f = make_shared(make_shared(B1), ParameterVector{A}); + auto optimized_f = baseline_f->clone(); ngraph::pass::Manager manager; manager.register_pass(); manager.run_passes(optimized_f); @@ -711,8 +710,8 @@ TEST(nop_elimination, reshape_reshape_elimination) { auto B = make_shared(A1, pat, zero); auto pat2 = op::Constant::create(element::i64, Shape{2}, std::vector{0, -1}); auto B1 = make_shared(B, pat2, true); - auto baseline_f = make_shared(make_shared(B1), ParameterVector{A}); - auto optimized_f = clone_function(*baseline_f); + auto baseline_f = make_shared(make_shared(B1), ParameterVector{A}); + auto optimized_f = baseline_f->clone(); ngraph::pass::Manager manager; manager.register_pass(); manager.run_passes(optimized_f); @@ -737,8 +736,8 @@ TEST(nop_elimination, squeeze_reshape_elimination) { auto B = make_shared(A1, indices); auto pat2 = op::Constant::create(element::i64, Shape{1}, std::vector{-1}); auto B1 = make_shared(B, pat2, false); - auto baseline_f = make_shared(make_shared(B1), ParameterVector{A}); - auto optimized_f = clone_function(*baseline_f); + auto baseline_f = make_shared(make_shared(B1), ParameterVector{A}); + auto optimized_f = baseline_f->clone(); ngraph::pass::Manager manager; manager.register_pass(); manager.run_passes(optimized_f); @@ -764,8 +763,8 @@ TEST(nop_elimination, unsqueeze_reshape_elimination) { auto B = make_shared(A1, indices); auto pat2 = op::Constant::create(element::i64, Shape{1}, std::vector{-1}); auto B1 = make_shared(B, pat2, false); - auto baseline_f = make_shared(make_shared(B1), ParameterVector{A}); - auto optimized_f = clone_function(*baseline_f); + auto baseline_f = make_shared(make_shared(B1), ParameterVector{A}); + auto optimized_f = baseline_f->clone(); ngraph::pass::Manager manager; manager.register_pass(); manager.run_passes(optimized_f); @@ -787,8 +786,8 @@ TEST(nop_elimination, squeeze_unsqueeze_elimination_negative) { auto indices = op::Constant::create(element::i64, Shape{indices_val.size()}, indices_val); auto input = make_shared(element::f32, shape); auto squeeze = make_shared(input, indices); - auto baseline_f = make_shared(squeeze, ParameterVector{input}); - auto optimized_f = clone_function(*baseline_f); + auto baseline_f = make_shared(squeeze, ParameterVector{input}); + auto optimized_f = baseline_f->clone(); ngraph::pass::Manager manager; manager.register_pass(); manager.run_passes(optimized_f); @@ -809,8 +808,8 @@ TEST(nop_elimination, topk_convert_elimination) { op::v1::TopK::Mode::MAX, op::v1::TopK::SortType::NONE); auto C = make_shared(B->output(0), B->output(0).get_element_type()); - auto baseline_f = make_shared(make_shared(C), ParameterVector{A}); - auto optimized_f = clone_function(*baseline_f); + auto baseline_f = make_shared(make_shared(C), ParameterVector{A}); + auto optimized_f = baseline_f->clone(); ngraph::pass::Manager manager; manager.register_pass(); manager.run_passes(optimized_f); @@ -860,8 +859,8 @@ TEST(nop_elimination, gather_3d_indices_constant_axis_1) { } auto G = make_shared((multiout ? A1->output(0) : A1), indices, axis); - auto baseline_f = make_shared(make_shared(G), ParameterVector{A}); - auto optimized_f = clone_function(*baseline_f); + auto baseline_f = make_shared(make_shared(G), ParameterVector{A}); + auto optimized_f = baseline_f->clone(); pass::Manager pass_manager; pass_manager.register_pass(); @@ -1049,13 +1048,13 @@ TEST_P(EliminateEltwiseTests, eliminate_eltwise) { ASSERT_FALSE(true) << "Invalid OpType"; } auto abs = make_shared(node); - function = make_shared(abs, ParameterVector{parameter}); + function = make_shared(abs, ParameterVector{parameter}); manager.register_pass(); if (can_fuse) { auto abs = make_shared(parameter); - function_ref = make_shared(abs, ParameterVector{parameter}); + function_ref = make_shared(abs, ParameterVector{parameter}); } comparator.enable(FunctionsComparator::CmpValues::CONST_VALUES); @@ -1131,13 +1130,13 @@ TEST_F(TransformationTestsF, eliminate_eltwise_dequantization_subgraph) { auto convert = make_shared(constant, element::f32); auto sub = make_shared(convert, opset8::Constant::create(element::f32, Shape{}, {0})); auto mul = make_shared(sub, opset8::Constant::create(element::f32, Shape{}, {1})); - function = make_shared(mul, ParameterVector{}); + function = make_shared(mul, ParameterVector{}); } { auto constant = opset8::Constant::create(element::i8, Shape{}, {2}); auto convert = make_shared(constant, element::f32); auto mul = make_shared(convert, opset8::Constant::create(element::f32, Shape{}, {1})); - function_ref = make_shared(mul, ParameterVector{}); + function_ref = make_shared(mul, ParameterVector{}); } manager.register_pass(); @@ -1320,7 +1319,7 @@ TEST(nop_elimination, gather_to_squeeze) { auto indices = op::Constant::create(element::i64, Shape{}, vector{0}); auto axis = op::Constant::create(element::i64, Shape{}, vector{gather_axis}); auto gather = std::make_shared(arg, indices, axis); - return std::make_shared(NodeVector{gather}, ParameterVector{arg}); + return std::make_shared(NodeVector{gather}, ParameterVector{arg}); }; auto func_axis_0 = generate_func(0); @@ -1329,7 +1328,7 @@ TEST(nop_elimination, gather_to_squeeze) { auto func_axis_3 = generate_func(3); pass::Manager pass_manager; pass_manager.register_pass(); - auto run_and_check = [&](std::shared_ptr& func) { + auto run_and_check = [&](std::shared_ptr& func) { pass_manager.run_passes(func); EXPECT_EQ(count_ops_of_type(func), 0); EXPECT_EQ(count_ops_of_type(func), 1); diff --git a/src/common/transformations/tests/common_optimizations/preprocessing_fusion_tests.cpp b/src/common/transformations/tests/common_optimizations/preprocessing_fusion_tests.cpp index 21fb2150f87..ecb4d257642 100644 --- a/src/common/transformations/tests/common_optimizations/preprocessing_fusion_tests.cpp +++ b/src/common/transformations/tests/common_optimizations/preprocessing_fusion_tests.cpp @@ -691,10 +691,10 @@ TEST_F(TransformationTestsF, RICFusionSplitConcatDetectionNegative3) { TEST_F(TransformationTestsF, FuseConvertLayout) { { - auto input = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 64}); - auto order = ngraph::opset6::Constant::create(ngraph::element::i64, ngraph::Shape{3}, {1, 2, 0}); - auto transpose = std::make_shared(input, order); - auto relu = std::make_shared(transpose); + auto input = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 64}); + auto order = ov::op::v0::Constant::create(ngraph::element::i64, ngraph::Shape{3}, {1, 2, 0}); + auto transpose = std::make_shared(input, order); + auto relu = std::make_shared(transpose); function = std::make_shared(ngraph::NodeVector{relu}, ngraph::ParameterVector{input}); @@ -708,9 +708,9 @@ TEST_F(TransformationTestsF, FuseConvertLayout) { } { - auto input = std::make_shared(ngraph::element::f16, ngraph::Shape{3, 64, 1}); - auto convert = std::make_shared(input, element::f32); - auto relu = std::make_shared(convert); + auto input = std::make_shared(ngraph::element::f16, ngraph::Shape{3, 64, 1}); + auto convert = std::make_shared(input, element::f32); + auto relu = std::make_shared(convert); function_ref = std::make_shared(ngraph::NodeVector{relu}, ngraph::ParameterVector{input}); } @@ -719,8 +719,8 @@ TEST_F(TransformationTestsF, FuseConvertLayout) { TEST_F(TransformationTestsF, FuseScaleValue) { { auto input = create_param({1, 64, 64, 3}); - auto order = ngraph::opset6::Constant::create(ngraph::element::i64, ngraph::Shape{4}, {0, 3, 1, 2}); - auto transpose = std::make_shared(input, order); + auto order = ov::op::v0::Constant::create(ngraph::element::i64, ngraph::Shape{4}, {0, 3, 1, 2}); + auto transpose = std::make_shared(input, order); auto conv = create_conv(transpose, {6, 3, 3, 3}); function = std::make_shared(NodeVector{conv}, ParameterVector{input}); @@ -736,8 +736,8 @@ TEST_F(TransformationTestsF, FuseScaleValue) { { auto input = create_param({1, 64, 64, 3}); - auto order = ngraph::opset6::Constant::create(ngraph::element::i64, ngraph::Shape{4}, {0, 3, 1, 2}); - auto transpose = std::make_shared(input, order); + auto order = ov::op::v0::Constant::create(ngraph::element::i64, ngraph::Shape{4}, {0, 3, 1, 2}); + auto transpose = std::make_shared(input, order); auto conv = create_conv(transpose, {6, 3, 3, 3}); function_ref = std::make_shared(NodeVector{conv}, ParameterVector{input}); } @@ -748,8 +748,8 @@ TEST_F(TransformationTestsF, FuseScaleValue) { TEST_F(TransformationTestsF, FuseScaleValues) { { auto input = create_param({1, 64, 64, 3}); - auto order = ngraph::opset6::Constant::create(ngraph::element::i64, ngraph::Shape{4}, {0, 3, 1, 2}); - auto transpose = std::make_shared(input, order); + auto order = ov::op::v0::Constant::create(ngraph::element::i64, ngraph::Shape{4}, {0, 3, 1, 2}); + auto transpose = std::make_shared(input, order); auto conv = create_conv(transpose, {6, 3, 3, 3}); function = std::make_shared(NodeVector{conv}, ParameterVector{input}); @@ -765,8 +765,8 @@ TEST_F(TransformationTestsF, FuseScaleValues) { { auto input = create_param({1, 64, 64, 3}); - auto order = ngraph::opset6::Constant::create(ngraph::element::i64, ngraph::Shape{4}, {0, 3, 1, 2}); - auto transpose = std::make_shared(input, order); + auto order = ov::op::v0::Constant::create(ngraph::element::i64, ngraph::Shape{4}, {0, 3, 1, 2}); + auto transpose = std::make_shared(input, order); auto conv = create_conv(transpose, {6, 3, 3, 3}); function_ref = std::make_shared(NodeVector{conv}, ParameterVector{input}); } diff --git a/src/common/transformations/tests/common_optimizations/shuffle_channels_fusion_test.cpp b/src/common/transformations/tests/common_optimizations/shuffle_channels_fusion_test.cpp index 16b3d51c8b0..3bce389cd26 100644 --- a/src/common/transformations/tests/common_optimizations/shuffle_channels_fusion_test.cpp +++ b/src/common/transformations/tests/common_optimizations/shuffle_channels_fusion_test.cpp @@ -64,13 +64,13 @@ public: f_ref = f; } - auto unh = std::make_shared(); + auto unh = std::make_shared(); ngraph::pass::Manager manager; auto pass_config = manager.get_pass_config(); - manager.register_pass(unh); + manager.register_pass(unh); manager.register_pass(); manager.register_pass(values.check_values); - manager.register_pass(unh); + manager.register_pass(unh); manager.run_passes(f); ASSERT_NO_THROW(check_rt_info(f)); } diff --git a/src/common/transformations/tests/common_optimizations/simplify_second_input_of_reshape_test.cpp b/src/common/transformations/tests/common_optimizations/simplify_second_input_of_reshape_test.cpp index bcaad619031..dd6e4321708 100644 --- a/src/common/transformations/tests/common_optimizations/simplify_second_input_of_reshape_test.cpp +++ b/src/common/transformations/tests/common_optimizations/simplify_second_input_of_reshape_test.cpp @@ -368,7 +368,7 @@ TEST_F(TransformationTestsF, SimplifySecondInputOfReshapeTest14) { { auto data = std::make_shared(element::f32, data_shape); - auto shape_of = std::make_shared(data); + auto shape_of = std::make_shared(data); auto gather_op = gather(shape_of, std::vector{0, 1}); auto constant = opset7::Constant::create(element::i64, Shape{1}, {768}); auto concat = std::make_shared(OutputVector{gather_op, constant}, 0); diff --git a/src/common/transformations/tests/common_optimizations/softmax_fusion.cpp b/src/common/transformations/tests/common_optimizations/softmax_fusion.cpp index e64d8b3daac..d008e476d57 100644 --- a/src/common/transformations/tests/common_optimizations/softmax_fusion.cpp +++ b/src/common/transformations/tests/common_optimizations/softmax_fusion.cpp @@ -36,12 +36,12 @@ TEST_P(SoftmaxFusionFixture, SoftmaxFusion) { auto div = std::make_shared(exp, reduce_sum); f = std::make_shared(NodeVector{div}, ParameterVector{data}); - auto unh = std::make_shared(); + auto unh = std::make_shared(); pass::Manager m; - m.register_pass(unh); + m.register_pass(unh); m.register_pass(); m.register_pass(); - m.register_pass(unh); + m.register_pass(unh); m.run_passes(f); ASSERT_NO_THROW(check_rt_info(f)); } @@ -81,12 +81,12 @@ TEST_P(SoftmaxFusionSimplePatternFixture, SoftmaxFusionSimplePatternTest) { auto div = std::make_shared(exp, reduce_sum); f = std::make_shared(NodeVector{div}, ParameterVector{data}); - auto unh = std::make_shared(); + auto unh = std::make_shared(); pass::Manager m; - m.register_pass(unh); + m.register_pass(unh); m.register_pass(); m.register_pass(); - m.register_pass(unh); + m.register_pass(unh); m.run_passes(f); ASSERT_NO_THROW(check_rt_info(f)); } @@ -136,12 +136,12 @@ TEST_P(NegativeSoftmaxFusionFixture, NegativeSoftmaxFusion) { auto div = std::make_shared(exp, reduce_sum); f = std::make_shared(NodeVector{div}, ParameterVector{data}); - auto unh = std::make_shared(); + auto unh = std::make_shared(); pass::Manager m; - m.register_pass(unh); + m.register_pass(unh); m.register_pass(); m.register_pass(); - m.register_pass(unh); + m.register_pass(unh); m.run_passes(f); ASSERT_NO_THROW(check_rt_info(f)); ASSERT_EQ(count_ops_of_type(f), 1); diff --git a/src/common/transformations/tests/common_optimizations/strides_optimization.cpp b/src/common/transformations/tests/common_optimizations/strides_optimization.cpp index 0e598fe3112..42d7b50437c 100644 --- a/src/common/transformations/tests/common_optimizations/strides_optimization.cpp +++ b/src/common/transformations/tests/common_optimizations/strides_optimization.cpp @@ -21,41 +21,41 @@ using namespace testing; // Pl->Conv(1x1,1x1)->Conv(1x1,2x2) => Pl->Conv(1x1,2x2)->Conv(1x1,1x1) TEST_F(TransformationTestsF, StridesOptimization1) { { - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); - auto weights_1 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_1 = std::make_shared(data, - weights_1, - ngraph::Strides{}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); - auto weights_2 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_2 = std::make_shared(conv_1, - weights_2, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); + auto weights_1 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_1 = std::make_shared(data, + weights_1, + ngraph::Strides{}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); + auto weights_2 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_2 = std::make_shared(conv_1, + weights_2, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); function = std::make_shared(ngraph::NodeVector{conv_2}, ngraph::ParameterVector{data}); manager.register_pass(); } { - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); - auto weights_1 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_1 = std::make_shared(data, - weights_1, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); - auto weights_2 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_2 = std::make_shared(conv_1, - weights_2, - ngraph::Strides{}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); + auto weights_1 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_1 = std::make_shared(data, + weights_1, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); + auto weights_2 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_2 = std::make_shared(conv_1, + weights_2, + ngraph::Strides{}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); function_ref = std::make_shared(ngraph::NodeVector{conv_2}, ngraph::ParameterVector{data}); } @@ -64,41 +64,41 @@ TEST_F(TransformationTestsF, StridesOptimization1) { // Pl->Conv(3x3,2x2)->Conv(1x1,2x2) => Pl->Conv(3x3,4x4)->Conv(1x1,1x1) TEST_F(TransformationTestsF, StridesOptimization2) { { - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); - auto weights_1 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); - auto conv_1 = std::make_shared(data, - weights_1, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); - auto weights_2 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_2 = std::make_shared(conv_1, - weights_2, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); + auto weights_1 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); + auto conv_1 = std::make_shared(data, + weights_1, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); + auto weights_2 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_2 = std::make_shared(conv_1, + weights_2, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); function = std::make_shared(ngraph::NodeVector{conv_2}, ngraph::ParameterVector{data}); manager.register_pass(); } { - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); - auto weights_1 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); - auto conv_1 = std::make_shared(data, - weights_1, - ngraph::Strides{4, 4}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); - auto weights_2 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_2 = std::make_shared(conv_1, - weights_2, - ngraph::Strides{}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); + auto weights_1 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); + auto conv_1 = std::make_shared(data, + weights_1, + ngraph::Strides{4, 4}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); + auto weights_2 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_2 = std::make_shared(conv_1, + weights_2, + ngraph::Strides{}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); function_ref = std::make_shared(ngraph::NodeVector{conv_2}, ngraph::ParameterVector{data}); } @@ -107,41 +107,41 @@ TEST_F(TransformationTestsF, StridesOptimization2) { // Pl->Conv(3x3,2x2)->Conv(3x3,2x2) => Same TEST_F(TransformationTestsF, StridesOptimization3) { { - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); - auto weights_1 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); - auto conv_1 = std::make_shared(data, - weights_1, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); - auto weights_2 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); - auto conv_2 = std::make_shared(conv_1, - weights_2, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); + auto weights_1 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); + auto conv_1 = std::make_shared(data, + weights_1, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); + auto weights_2 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); + auto conv_2 = std::make_shared(conv_1, + weights_2, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); function = std::make_shared(ngraph::NodeVector{conv_2}, ngraph::ParameterVector{data}); manager.register_pass(); } { - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); - auto weights_1 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); - auto conv_1 = std::make_shared(data, - weights_1, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); - auto weights_2 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); - auto conv_2 = std::make_shared(conv_1, - weights_2, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); + auto weights_1 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); + auto conv_1 = std::make_shared(data, + weights_1, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); + auto weights_2 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); + auto conv_2 = std::make_shared(conv_1, + weights_2, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); function_ref = std::make_shared(ngraph::NodeVector{conv_2}, ngraph::ParameterVector{data}); } @@ -151,61 +151,61 @@ TEST_F(TransformationTestsF, StridesOptimization3) { // `-->Conv(3x3,2x2)->ReLU---` `-->Conv(3x3,4x4)->ReLU---` TEST_F(TransformationTestsF, StridesOptimization4) { { - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); - auto weights_1 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); - auto conv_1 = std::make_shared(data, - weights_1, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); + auto weights_1 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); + auto conv_1 = std::make_shared(data, + weights_1, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); auto relu_1 = std::make_shared(conv_1); - auto weights_2 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); - auto conv_2 = std::make_shared(data, - weights_2, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto weights_2 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); + auto conv_2 = std::make_shared(data, + weights_2, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); auto relu_2 = std::make_shared(conv_2); auto add = std::make_shared(relu_1, relu_2); - auto weights_3 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_3 = std::make_shared(add, - weights_3, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto weights_3 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_3 = std::make_shared(add, + weights_3, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); function = std::make_shared(ngraph::NodeVector{conv_3}, ngraph::ParameterVector{data}); manager.register_pass(); } { - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); - auto weights_1 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); - auto conv_1 = std::make_shared(data, - weights_1, - ngraph::Strides{4, 4}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); + auto weights_1 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); + auto conv_1 = std::make_shared(data, + weights_1, + ngraph::Strides{4, 4}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); auto relu_1 = std::make_shared(conv_1); - auto weights_2 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); - auto conv_2 = std::make_shared(data, - weights_2, - ngraph::Strides{4, 4}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto weights_2 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); + auto conv_2 = std::make_shared(data, + weights_2, + ngraph::Strides{4, 4}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); auto relu_2 = std::make_shared(conv_2); auto add = std::make_shared(relu_1, relu_2); - auto weights_3 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_3 = std::make_shared(add, - weights_3, - ngraph::Strides{1, 1}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto weights_3 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_3 = std::make_shared(add, + weights_3, + ngraph::Strides{1, 1}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); function_ref = std::make_shared(ngraph::NodeVector{conv_3}, ngraph::ParameterVector{data}); } @@ -215,37 +215,37 @@ TEST_F(TransformationTestsF, StridesOptimization4) { // `----------------->ReLU---` `-->Pool(1x1,2x2)->ReLU---` TEST_F(TransformationTestsF, StridesOptimization5) { { - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); - auto weights_1 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_1 = std::make_shared(data, - weights_1, - ngraph::Strides{1, 1}, - ngraph::CoordinateDiff{0, 0}, - ngraph::CoordinateDiff{0, 0}, - ngraph::Strides{}); + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); + auto weights_1 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_1 = std::make_shared(data, + weights_1, + ngraph::Strides{1, 1}, + ngraph::CoordinateDiff{0, 0}, + ngraph::CoordinateDiff{0, 0}, + ngraph::Strides{}); auto relu_1 = std::make_shared(conv_1); auto relu_2 = std::make_shared(data); auto add = std::make_shared(relu_1, relu_2); - auto weights_2 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_2 = std::make_shared(add, - weights_2, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto weights_2 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_2 = std::make_shared(add, + weights_2, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); function = std::make_shared(ngraph::NodeVector{conv_2}, ngraph::ParameterVector{data}); manager.register_pass(); } { - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); - auto weights_1 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_1 = std::make_shared(data, - weights_1, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); + auto weights_1 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_1 = std::make_shared(data, + weights_1, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); auto relu_1 = std::make_shared(conv_1); auto pool = std::make_shared(data, ngraph::Strides{2, 2}, @@ -254,13 +254,13 @@ TEST_F(TransformationTestsF, StridesOptimization5) { ngraph::Shape{1, 1}); auto relu_2 = std::make_shared(pool); auto add = std::make_shared(relu_1, relu_2); - auto weights_2 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_2 = std::make_shared(add, - weights_2, - ngraph::Strides{1, 1}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto weights_2 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_2 = std::make_shared(add, + weights_2, + ngraph::Strides{1, 1}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); function_ref = std::make_shared(ngraph::NodeVector{conv_2}, ngraph::ParameterVector{data}); } @@ -271,69 +271,69 @@ TEST_F(TransformationTestsF, StridesOptimization5) { // Pl->Conv(1x1,2x2)->Conv(1x1,1x1)->Conv(3x3,2x2)->Conv(1x1,1x1) TEST_F(TransformationTestsF, StridesOptimization6) { { - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); - auto weights_1 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_1 = std::make_shared(data, - weights_1, - ngraph::Strides{1, 1}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); - auto weights_2 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_2 = std::make_shared(conv_1, - weights_2, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); - auto weights_3 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); - auto conv_3 = std::make_shared(conv_2, - weights_3, - ngraph::Strides{1, 1}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); - auto weights_4 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_4 = std::make_shared(conv_3, - weights_4, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); + auto weights_1 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_1 = std::make_shared(data, + weights_1, + ngraph::Strides{1, 1}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); + auto weights_2 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_2 = std::make_shared(conv_1, + weights_2, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); + auto weights_3 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); + auto conv_3 = std::make_shared(conv_2, + weights_3, + ngraph::Strides{1, 1}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); + auto weights_4 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_4 = std::make_shared(conv_3, + weights_4, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); function = std::make_shared(ngraph::NodeVector{conv_4}, ngraph::ParameterVector{data}); manager.register_pass(); } { - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); - auto weights_1 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_1 = std::make_shared(data, - weights_1, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); - auto weights_2 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_2 = std::make_shared(conv_1, - weights_2, - ngraph::Strides{1, 1}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); - auto weights_3 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); - auto conv_3 = std::make_shared(conv_2, - weights_3, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); - auto weights_4 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_4 = std::make_shared(conv_3, - weights_4, - ngraph::Strides{1, 1}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); + auto weights_1 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_1 = std::make_shared(data, + weights_1, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); + auto weights_2 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_2 = std::make_shared(conv_1, + weights_2, + ngraph::Strides{1, 1}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); + auto weights_3 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 3, 3}, {128}); + auto conv_3 = std::make_shared(conv_2, + weights_3, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); + auto weights_4 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_4 = std::make_shared(conv_3, + weights_4, + ngraph::Strides{1, 1}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); function_ref = std::make_shared(ngraph::NodeVector{conv_4}, ngraph::ParameterVector{data}); } @@ -346,77 +346,77 @@ TEST_F(TransformationTestsF, StridesOptimization6) { // `--> Pool(1x1, 2x2) -> Relu --> Conv(1x1,1x1) TEST_F(TransformationTestsF, StridesOptimization7) { { - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); - auto weights_1 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_1 = std::make_shared(data, - weights_1, - ngraph::Strides{1, 1}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); - auto weights_2 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_2 = std::make_shared(conv_1, - weights_2, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); - auto weights_3 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_3 = std::make_shared(conv_2, - weights_3, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); + auto weights_1 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_1 = std::make_shared(data, + weights_1, + ngraph::Strides{1, 1}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); + auto weights_2 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_2 = std::make_shared(conv_1, + weights_2, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); + auto weights_3 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_3 = std::make_shared(conv_2, + weights_3, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); auto relu = std::make_shared(conv_1); - auto weights_4 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_4 = std::make_shared(relu, - weights_4, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto weights_4 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_4 = std::make_shared(relu, + weights_4, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); function = std::make_shared(ngraph::NodeVector{conv_3, conv_4}, ngraph::ParameterVector{data}); manager.register_pass(); } { - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); - auto weights_1 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_1 = std::make_shared(data, - weights_1, - ngraph::Strides{1, 1}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); - auto weights_2 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_2 = std::make_shared(conv_1, - weights_2, - ngraph::Strides{4, 4}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); - auto weights_3 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_3 = std::make_shared(conv_2, - weights_3, - ngraph::Strides{1, 1}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); + auto weights_1 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_1 = std::make_shared(data, + weights_1, + ngraph::Strides{1, 1}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); + auto weights_2 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_2 = std::make_shared(conv_1, + weights_2, + ngraph::Strides{4, 4}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); + auto weights_3 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_3 = std::make_shared(conv_2, + weights_3, + ngraph::Strides{1, 1}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); auto pool = std::make_shared(conv_1, ngraph::Strides{2, 2}, ngraph::Shape{0, 0}, ngraph::Shape{0, 0}, ngraph::Shape{1, 1}); auto relu = std::make_shared(pool); - auto weights_4 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_4 = std::make_shared(relu, - weights_4, - ngraph::Strides{1, 1}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto weights_4 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_4 = std::make_shared(relu, + weights_4, + ngraph::Strides{1, 1}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); function_ref = std::make_shared(ngraph::NodeVector{conv_3, conv_4}, ngraph::ParameterVector{data}); @@ -430,64 +430,64 @@ TEST_F(TransformationTestsF, StridesOptimization7) { // Const-->MaxPool(1x1,4x4)-->Squeeze` Pl--->MaxPool(1x1,2x2)-->Squeeze` TEST_F(TransformationTestsF, StridesOptimization8) { { - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); - auto weights_1 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_1 = std::make_shared(data, - weights_1, - ngraph::Strides{1, 1}, - ngraph::CoordinateDiff{0, 0}, - ngraph::CoordinateDiff{0, 0}, - ngraph::Strides{}); + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); + auto weights_1 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_1 = std::make_shared(data, + weights_1, + ngraph::Strides{1, 1}, + ngraph::CoordinateDiff{0, 0}, + ngraph::CoordinateDiff{0, 0}, + ngraph::Strides{}); auto relu_1 = std::make_shared(conv_1); ngraph::Shape const_shape{1, 3, 224, 224}; auto constant = ngraph::opset7::Constant::create(ngraph::element::f32, const_shape, std::vector(shape_size(const_shape), 1)); auto add = std::make_shared(relu_1, constant); - auto weights_2 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_2 = std::make_shared(add, - weights_2, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); - auto data_2 = std::make_shared(ngraph::element::f32, ngraph::Shape{3, 112, 112}); + auto weights_2 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_2 = std::make_shared(add, + weights_2, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); + auto data_2 = std::make_shared(ngraph::element::f32, ngraph::Shape{3, 112, 112}); auto add_2 = std::make_shared(conv_2, data_2); - auto weights_3 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_3 = std::make_shared(add_2, - weights_3, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto weights_3 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_3 = std::make_shared(add_2, + weights_3, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); function = std::make_shared(ngraph::NodeVector{conv_3}, ngraph::ParameterVector{data, data_2}); manager.register_pass(); } { - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); - auto weights_1 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_1 = std::make_shared(data, - weights_1, - ngraph::Strides{4, 4}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); + auto weights_1 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_1 = std::make_shared(data, + weights_1, + ngraph::Strides{4, 4}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); auto relu_1 = std::make_shared(conv_1); ngraph::Shape const_shape{1, 3, 56, 56}; auto constant = ngraph::opset7::Constant::create(ngraph::element::f32, const_shape, std::vector(shape_size(const_shape), 1)); auto add = std::make_shared(relu_1, constant); - auto weights_2 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_2 = std::make_shared(add, - weights_2, - ngraph::Strides{1, 1}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); - auto data_2 = std::make_shared(ngraph::element::f32, ngraph::Shape{3, 112, 112}); + auto weights_2 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_2 = std::make_shared(add, + weights_2, + ngraph::Strides{1, 1}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); + auto data_2 = std::make_shared(ngraph::element::f32, ngraph::Shape{3, 112, 112}); auto reshape = std::make_shared( data_2, ngraph::opset7::Constant::create(ngraph::element::i64, ngraph::Shape{4}, {1, 3, 112, 112}), @@ -501,13 +501,13 @@ TEST_F(TransformationTestsF, StridesOptimization8) { pool_2, ngraph::op::Constant::create(ngraph::element::u64, ngraph::Shape{1}, {0})); auto add_2 = std::make_shared(conv_2, squeeze); - auto weights_3 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_3 = std::make_shared(add_2, - weights_3, - ngraph::Strides{1, 1}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto weights_3 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_3 = std::make_shared(add_2, + weights_3, + ngraph::Strides{1, 1}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); function_ref = std::make_shared(ngraph::NodeVector{conv_3}, ngraph::ParameterVector{data, data_2}); @@ -523,59 +523,59 @@ TEST_F(TransformationTestsF, StridesOptimization8) { // Const--` Const-` Const--` Const-` TEST_F(TransformationTestsF, StridesOptimization9) { { - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); - auto weights_1 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_1 = std::make_shared(data, - weights_1, - ngraph::Strides{1, 1}, - ngraph::CoordinateDiff{0, 0}, - ngraph::CoordinateDiff{0, 0}, - ngraph::Strides{}); + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); + auto weights_1 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_1 = std::make_shared(data, + weights_1, + ngraph::Strides{1, 1}, + ngraph::CoordinateDiff{0, 0}, + ngraph::CoordinateDiff{0, 0}, + ngraph::Strides{}); - auto data_2 = std::make_shared(ngraph::element::f32, ngraph::Shape{224}); - auto add_const = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{224}, {128}); + auto data_2 = std::make_shared(ngraph::element::f32, ngraph::Shape{224}); + auto add_const = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{224}, {128}); auto add = std::make_shared(data_2, add_const); - auto add_2_const = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{224}, {128}); + auto add_2_const = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{224}, {128}); auto add_2 = std::make_shared(add, add_2_const); auto add_3 = std::make_shared(conv_1, add_2); - auto weights_2 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_2 = std::make_shared(add_3, - weights_2, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto weights_2 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_2 = std::make_shared(add_3, + weights_2, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); - auto data_3 = std::make_shared(ngraph::element::f32, ngraph::Shape{}); - auto add_4_const = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{}, {128}); + auto data_3 = std::make_shared(ngraph::element::f32, ngraph::Shape{}); + auto add_4_const = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{}, {128}); auto add_4 = std::make_shared(data_3, add_4_const); - auto add_5_const = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{1}, {128}); + auto add_5_const = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{1}, {128}); auto add_5 = std::make_shared(add_4, add_5_const); auto add_6 = std::make_shared(conv_2, add_5); - auto weights_3 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_3 = std::make_shared(add_6, - weights_3, - ngraph::Strides{2, 2}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto weights_3 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_3 = std::make_shared(add_6, + weights_3, + ngraph::Strides{2, 2}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); function = std::make_shared(ngraph::NodeVector{conv_3}, ngraph::ParameterVector{data, data_2, data_3}); manager.register_pass(); } { - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); - auto weights_1 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_1 = std::make_shared(data, - weights_1, - ngraph::Strides{4, 4}, - ngraph::CoordinateDiff{0, 0}, - ngraph::CoordinateDiff{0, 0}, - ngraph::Strides{}); + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 224, 224}); + auto weights_1 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_1 = std::make_shared(data, + weights_1, + ngraph::Strides{4, 4}, + ngraph::CoordinateDiff{0, 0}, + ngraph::CoordinateDiff{0, 0}, + ngraph::Strides{}); - auto data_2 = std::make_shared(ngraph::element::f32, ngraph::Shape{224}); + auto data_2 = std::make_shared(ngraph::element::f32, ngraph::Shape{224}); auto reshape = std::make_shared( data_2, ngraph::opset7::Constant::create(ngraph::element::i64, ngraph::Shape{4}, {1, 1, 1, 224}), @@ -588,22 +588,22 @@ TEST_F(TransformationTestsF, StridesOptimization9) { auto squeeze = std::make_shared( pool, ngraph::op::Constant::create(ngraph::element::u64, ngraph::Shape{3}, {0, 1, 2})); - auto add_const = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{56}, {128}); + auto add_const = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{56}, {128}); auto add = std::make_shared(squeeze, add_const); - auto add_2_const = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{56}, {128}); + auto add_2_const = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{56}, {128}); auto add_2 = std::make_shared(add, add_2_const); auto add_3 = std::make_shared(conv_1, add_2); - auto weights_2 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_2 = std::make_shared(add_3, - weights_2, - ngraph::Strides{1, 1}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto weights_2 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_2 = std::make_shared(add_3, + weights_2, + ngraph::Strides{1, 1}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); - auto data_3 = std::make_shared(ngraph::element::f32, ngraph::Shape{}); - auto new_shape = ngraph::opset1::Constant::create(ngraph::element::i64, ngraph::Shape{4}, {1, 1, 1, 1}); + auto data_3 = std::make_shared(ngraph::element::f32, ngraph::Shape{}); + auto new_shape = ov::op::v0::Constant::create(ngraph::element::i64, ngraph::Shape{4}, {1, 1, 1, 1}); auto reshape_2 = std::make_shared(data_3, new_shape, false); auto pool_2 = std::make_shared(reshape_2, ngraph::Strides{2, 2}, @@ -613,18 +613,18 @@ TEST_F(TransformationTestsF, StridesOptimization9) { auto squeeze_2 = std::make_shared( pool_2, ngraph::op::Constant::create(ngraph::element::u64, ngraph::Shape{4}, {0, 1, 2, 3})); - auto add_4_const = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{}, {128}); + auto add_4_const = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{}, {128}); auto add_4 = std::make_shared(squeeze_2, add_4_const); - auto add_5_const = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{1}, {128}); + auto add_5_const = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{1}, {128}); auto add_5 = std::make_shared(add_4, add_5_const); auto add_6 = std::make_shared(conv_2, add_5); - auto weights_3 = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); - auto conv_3 = std::make_shared(add_6, - weights_3, - ngraph::Strides{1, 1}, - ngraph::CoordinateDiff{}, - ngraph::CoordinateDiff{}, - ngraph::Strides{}); + auto weights_3 = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 3, 1, 1}, {128}); + auto conv_3 = std::make_shared(add_6, + weights_3, + ngraph::Strides{1, 1}, + ngraph::CoordinateDiff{}, + ngraph::CoordinateDiff{}, + ngraph::Strides{}); function_ref = std::make_shared(ngraph::NodeVector{conv_3}, ngraph::ParameterVector{data, data_2, data_3}); diff --git a/src/common/transformations/tests/common_optimizations/transpose_reshape_elimination_for_matmul.cpp b/src/common/transformations/tests/common_optimizations/transpose_reshape_elimination_for_matmul.cpp index 64105f67ca6..2c6e559ffee 100644 --- a/src/common/transformations/tests/common_optimizations/transpose_reshape_elimination_for_matmul.cpp +++ b/src/common/transformations/tests/common_optimizations/transpose_reshape_elimination_for_matmul.cpp @@ -22,25 +22,25 @@ TEST_F(TransformationTestsF, TransposeReshapeEliminationForMatMul) { Shape data_shape_1{10, 2}; Shape data_shape_2{10, 2, 25}; { - auto data_1 = std::make_shared(element::f32, data_shape_1); - auto data_2 = std::make_shared(element::f32, data_shape_2); - auto const_transpose_before = opset1::Constant::create(element::i32, Shape{3}, {1, 2, 0}); - auto transpose_before = std::make_shared(data_2, const_transpose_before); - auto const_reshape_before = opset1::Constant::create(element::i32, Shape{2}, {2, 250}); - auto reshape_before = std::make_shared(transpose_before, const_reshape_before, false); - auto matmul = std::make_shared(data_1, reshape_before); - auto const_reshape_after = opset1::Constant::create(element::i32, Shape{3}, {10, 10, 25}); - auto reshape_after = std::make_shared(matmul, const_reshape_after, false); - auto const_tranpose_after = opset1::Constant::create(element::i32, Shape{3}, {2, 0, 1}); - auto tranpose_after = std::make_shared(reshape_after, const_tranpose_after); + auto data_1 = std::make_shared(element::f32, data_shape_1); + auto data_2 = std::make_shared(element::f32, data_shape_2); + auto const_transpose_before = ov::op::v0::Constant::create(element::i32, Shape{3}, {1, 2, 0}); + auto transpose_before = std::make_shared(data_2, const_transpose_before); + auto const_reshape_before = ov::op::v0::Constant::create(element::i32, Shape{2}, {2, 250}); + auto reshape_before = std::make_shared(transpose_before, const_reshape_before, false); + auto matmul = std::make_shared(data_1, reshape_before); + auto const_reshape_after = ov::op::v0::Constant::create(element::i32, Shape{3}, {10, 10, 25}); + auto reshape_after = std::make_shared(matmul, const_reshape_after, false); + auto const_tranpose_after = ov::op::v0::Constant::create(element::i32, Shape{3}, {2, 0, 1}); + auto tranpose_after = std::make_shared(reshape_after, const_tranpose_after); function = std::make_shared(NodeVector{tranpose_after}, ParameterVector{data_1, data_2}); manager.register_pass(); manager.register_pass(); } { - auto data_1 = std::make_shared(element::f32, data_shape_1); - auto data_2 = std::make_shared(element::f32, data_shape_2); - auto matmul = std::make_shared(data_1, data_2); + auto data_1 = std::make_shared(element::f32, data_shape_1); + auto data_2 = std::make_shared(element::f32, data_shape_2); + auto matmul = std::make_shared(data_1, data_2); function_ref = std::make_shared(NodeVector{matmul}, ParameterVector{data_1, data_2}); } } @@ -49,24 +49,24 @@ TEST_F(TransformationTestsF, TransposeReshapeEliminationForMatMul_TransposedA) { Shape data_shape_1{2, 10}; Shape data_shape_2{10, 2, 25}; { - auto data_1 = std::make_shared(element::f32, data_shape_1); - auto data_2 = std::make_shared(element::f32, data_shape_2); - auto const_transpose_before = opset1::Constant::create(element::i32, Shape{3}, {1, 2, 0}); - auto transpose_before = std::make_shared(data_2, const_transpose_before); - auto const_reshape_before = opset1::Constant::create(element::i32, Shape{2}, {2, 250}); - auto reshape_before = std::make_shared(transpose_before, const_reshape_before, false); - auto matmul = std::make_shared(data_1, reshape_before, true, false); - auto const_reshape_after = opset1::Constant::create(element::i32, Shape{3}, {10, 10, 25}); - auto reshape_after = std::make_shared(matmul, const_reshape_after, false); - auto const_tranpose_after = opset1::Constant::create(element::i32, Shape{3}, {2, 0, 1}); - auto tranpose_after = std::make_shared(reshape_after, const_tranpose_after); + auto data_1 = std::make_shared(element::f32, data_shape_1); + auto data_2 = std::make_shared(element::f32, data_shape_2); + auto const_transpose_before = ov::op::v0::Constant::create(element::i32, Shape{3}, {1, 2, 0}); + auto transpose_before = std::make_shared(data_2, const_transpose_before); + auto const_reshape_before = ov::op::v0::Constant::create(element::i32, Shape{2}, {2, 250}); + auto reshape_before = std::make_shared(transpose_before, const_reshape_before, false); + auto matmul = std::make_shared(data_1, reshape_before, true, false); + auto const_reshape_after = ov::op::v0::Constant::create(element::i32, Shape{3}, {10, 10, 25}); + auto reshape_after = std::make_shared(matmul, const_reshape_after, false); + auto const_tranpose_after = ov::op::v0::Constant::create(element::i32, Shape{3}, {2, 0, 1}); + auto tranpose_after = std::make_shared(reshape_after, const_tranpose_after); function = std::make_shared(NodeVector{tranpose_after}, ParameterVector{data_1, data_2}); manager.register_pass(); } { - auto data_1 = std::make_shared(element::f32, data_shape_1); - auto data_2 = std::make_shared(element::f32, data_shape_2); - auto matmul = std::make_shared(data_1, data_2, true, false); + auto data_1 = std::make_shared(element::f32, data_shape_1); + auto data_2 = std::make_shared(element::f32, data_shape_2); + auto matmul = std::make_shared(data_1, data_2, true, false); function_ref = std::make_shared(NodeVector{matmul}, ParameterVector{data_1, data_2}); } } @@ -75,24 +75,24 @@ TEST_F(TransformationTestsF, TransposeReshapeEliminationForMatMul_TransposedB) { Shape data_shape_1{10, 2}; Shape data_shape_2{10, 2, 25}; { - auto data_1 = std::make_shared(element::f32, data_shape_1); - auto data_2 = std::make_shared(element::f32, data_shape_2); - auto const_transpose_before = opset1::Constant::create(element::i32, Shape{3}, {0, 2, 1}); - auto transpose_before = std::make_shared(data_2, const_transpose_before); - auto const_reshape_before = opset1::Constant::create(element::i32, Shape{2}, {250, 2}); - auto reshape_before = std::make_shared(transpose_before, const_reshape_before, false); - auto matmul = std::make_shared(data_1, reshape_before, false, true); - auto const_reshape_after = opset1::Constant::create(element::i32, Shape{3}, {10, 10, 25}); - auto reshape_after = std::make_shared(matmul, const_reshape_after, false); - auto const_tranpose_after = opset1::Constant::create(element::i32, Shape{3}, {1, 0, 2}); - auto tranpose_after = std::make_shared(reshape_after, const_tranpose_after); + auto data_1 = std::make_shared(element::f32, data_shape_1); + auto data_2 = std::make_shared(element::f32, data_shape_2); + auto const_transpose_before = ov::op::v0::Constant::create(element::i32, Shape{3}, {0, 2, 1}); + auto transpose_before = std::make_shared(data_2, const_transpose_before); + auto const_reshape_before = ov::op::v0::Constant::create(element::i32, Shape{2}, {250, 2}); + auto reshape_before = std::make_shared(transpose_before, const_reshape_before, false); + auto matmul = std::make_shared(data_1, reshape_before, false, true); + auto const_reshape_after = ov::op::v0::Constant::create(element::i32, Shape{3}, {10, 10, 25}); + auto reshape_after = std::make_shared(matmul, const_reshape_after, false); + auto const_tranpose_after = ov::op::v0::Constant::create(element::i32, Shape{3}, {1, 0, 2}); + auto tranpose_after = std::make_shared(reshape_after, const_tranpose_after); function = std::make_shared(NodeVector{tranpose_after}, ParameterVector{data_1, data_2}); manager.register_pass(); } { - auto data_1 = std::make_shared(element::f32, data_shape_1); - auto data_2 = std::make_shared(element::f32, data_shape_2); - auto matmul = std::make_shared(data_1, data_2); + auto data_1 = std::make_shared(element::f32, data_shape_1); + auto data_2 = std::make_shared(element::f32, data_shape_2); + auto matmul = std::make_shared(data_1, data_2); function_ref = std::make_shared(NodeVector{matmul}, ParameterVector{data_1, data_2}); } } @@ -101,24 +101,24 @@ TEST_F(TransformationTestsF, TransposeReshapeEliminationForMatMul_TransposedAB) Shape data_shape_1{2, 10}; Shape data_shape_2{10, 2, 25}; { - auto data_1 = std::make_shared(element::f32, data_shape_1); - auto data_2 = std::make_shared(element::f32, data_shape_2); - auto const_transpose_before = opset1::Constant::create(element::i32, Shape{3}, {0, 2, 1}); - auto transpose_before = std::make_shared(data_2, const_transpose_before); - auto const_reshape_before = opset1::Constant::create(element::i32, Shape{2}, {250, 2}); - auto reshape_before = std::make_shared(transpose_before, const_reshape_before, false); - auto matmul = std::make_shared(data_1, reshape_before, true, true); - auto const_reshape_after = opset1::Constant::create(element::i32, Shape{3}, {10, 10, 25}); - auto reshape_after = std::make_shared(matmul, const_reshape_after, false); - auto const_tranpose_after = opset1::Constant::create(element::i32, Shape{3}, {1, 0, 2}); - auto tranpose_after = std::make_shared(reshape_after, const_tranpose_after); + auto data_1 = std::make_shared(element::f32, data_shape_1); + auto data_2 = std::make_shared(element::f32, data_shape_2); + auto const_transpose_before = ov::op::v0::Constant::create(element::i32, Shape{3}, {0, 2, 1}); + auto transpose_before = std::make_shared(data_2, const_transpose_before); + auto const_reshape_before = ov::op::v0::Constant::create(element::i32, Shape{2}, {250, 2}); + auto reshape_before = std::make_shared(transpose_before, const_reshape_before, false); + auto matmul = std::make_shared(data_1, reshape_before, true, true); + auto const_reshape_after = ov::op::v0::Constant::create(element::i32, Shape{3}, {10, 10, 25}); + auto reshape_after = std::make_shared(matmul, const_reshape_after, false); + auto const_tranpose_after = ov::op::v0::Constant::create(element::i32, Shape{3}, {1, 0, 2}); + auto tranpose_after = std::make_shared(reshape_after, const_tranpose_after); function = std::make_shared(NodeVector{tranpose_after}, ParameterVector{data_1, data_2}); manager.register_pass(); } { - auto data_1 = std::make_shared(element::f32, data_shape_1); - auto data_2 = std::make_shared(element::f32, data_shape_2); - auto matmul = std::make_shared(data_1, data_2, true, false); + auto data_1 = std::make_shared(element::f32, data_shape_1); + auto data_2 = std::make_shared(element::f32, data_shape_2); + auto matmul = std::make_shared(data_1, data_2, true, false); function_ref = std::make_shared(NodeVector{matmul}, ParameterVector{data_1, data_2}); } } @@ -127,21 +127,21 @@ TEST_F(TransformationTestsF, TransposeReshapeEliminationForMatMul_Einsum) { Shape data_shape_1{5, 2}; Shape data_shape_2{10, 2, 25}; { - auto data_1 = std::make_shared(element::f32, data_shape_1); - auto data_2 = std::make_shared(element::f32, data_shape_2); + auto data_1 = std::make_shared(element::f32, data_shape_1); + auto data_2 = std::make_shared(element::f32, data_shape_2); auto einsum = std::make_shared(OutputVector{data_1, data_2}, "kl,mlj->mkj"); function = std::make_shared(NodeVector{einsum}, ParameterVector{data_1, data_2}); manager.register_pass(); manager.register_pass(); } { - auto data_1 = std::make_shared(element::f32, data_shape_1); - auto data_2 = std::make_shared(element::f32, data_shape_2); + auto data_1 = std::make_shared(element::f32, data_shape_1); + auto data_2 = std::make_shared(element::f32, data_shape_2); // for some cases Reshape may be first input for Matmul auto shape_constant = - std::make_shared(element::i64, Shape{data_shape_1.size()}, data_shape_1); - auto reshape = std::make_shared(data_1, shape_constant, false); - auto matmul = std::make_shared(reshape, data_2, false, false); + std::make_shared(element::i64, Shape{data_shape_1.size()}, data_shape_1); + auto reshape = std::make_shared(data_1, shape_constant, false); + auto matmul = std::make_shared(reshape, data_2, false, false); function_ref = std::make_shared(NodeVector{matmul}, ParameterVector{data_1, data_2}); } } diff --git a/src/common/transformations/tests/common_optimizations/transpose_sinking_test.cpp b/src/common/transformations/tests/common_optimizations/transpose_sinking_test.cpp index 17078d50372..4f84720bc68 100644 --- a/src/common/transformations/tests/common_optimizations/transpose_sinking_test.cpp +++ b/src/common/transformations/tests/common_optimizations/transpose_sinking_test.cpp @@ -96,13 +96,13 @@ public: }; TEST_P(TransposeSinkingFQ, TransposeFQReduce) { - auto unh = std::make_shared(); + auto unh = std::make_shared(); ngraph::pass::Manager manager; - manager.register_pass(unh); + manager.register_pass(unh); manager.register_pass(); manager.register_pass(); manager.register_pass(); - manager.register_pass(unh); + manager.register_pass(unh); manager.run_passes(f); ASSERT_NO_THROW(check_rt_info(f)); @@ -215,12 +215,12 @@ private: }; TEST_P(TransposeSinking, TransposeReduction) { - auto unh = std::make_shared(); + auto unh = std::make_shared(); ngraph::pass::Manager manager; - manager.register_pass(unh); + manager.register_pass(unh); manager.register_pass(); manager.register_pass(); - manager.register_pass(unh); + manager.register_pass(unh); manager.run_passes(f); ASSERT_NO_THROW(check_rt_info(f)); diff --git a/src/common/transformations/tests/common_optimizations/transpose_to_reshape_test.cpp b/src/common/transformations/tests/common_optimizations/transpose_to_reshape_test.cpp index 1d171447575..2b0e3eba827 100644 --- a/src/common/transformations/tests/common_optimizations/transpose_to_reshape_test.cpp +++ b/src/common/transformations/tests/common_optimizations/transpose_to_reshape_test.cpp @@ -107,12 +107,12 @@ private: }; TEST_P(TransposeToReshapeTests, CompareFunctions) { - auto unh = std::make_shared(); + auto unh = std::make_shared(); pass::Manager m; - m.register_pass(unh); + m.register_pass(unh); m.register_pass(); m.register_pass(); - m.register_pass(unh); + m.register_pass(unh); m.run_passes(f); f->validate_nodes_and_infer_types(); ASSERT_NO_THROW(check_rt_info(f)); @@ -207,13 +207,13 @@ TEST(TransformationTests, replace_transpose_with_reshape) { auto baseline_f = make_shared(transpose1, ParameterVector{param}); auto optimized_f = baseline_f->clone(); - auto unh = std::make_shared(); + auto unh = std::make_shared(); pass::Manager m; - m.register_pass(unh); + m.register_pass(unh); m.register_pass(); - m.register_pass(); + m.register_pass(); m.register_pass(); - m.register_pass(unh); + m.register_pass(unh); m.run_passes(optimized_f); auto ps = baseline_f->get_results()[0]->get_output_partial_shape(0); diff --git a/src/common/transformations/tests/common_optimizations/weights_dequantize_to_fake_quantize.cpp b/src/common/transformations/tests/common_optimizations/weights_dequantize_to_fake_quantize.cpp index 4acf68979e2..232ca981ffc 100644 --- a/src/common/transformations/tests/common_optimizations/weights_dequantize_to_fake_quantize.cpp +++ b/src/common/transformations/tests/common_optimizations/weights_dequantize_to_fake_quantize.cpp @@ -93,12 +93,12 @@ public: }; TEST_P(TranslateNewWeightFormatToOldOne, ReshapeMatMul) { - auto unh = std::make_shared(); + auto unh = std::make_shared(); ngraph::pass::Manager m; - m.register_pass(unh); + m.register_pass(unh); m.register_pass(); m.register_pass(); - m.register_pass(unh); + m.register_pass(unh); m.run_passes(f); ASSERT_NO_THROW(check_rt_info(f)); diff --git a/src/common/transformations/tests/control_flow/unroll_if_test.cpp b/src/common/transformations/tests/control_flow/unroll_if_test.cpp index 7019f72deee..83bca932fef 100644 --- a/src/common/transformations/tests/control_flow/unroll_if_test.cpp +++ b/src/common/transformations/tests/control_flow/unroll_if_test.cpp @@ -5,7 +5,6 @@ #include #include -#include #include #include #include @@ -13,32 +12,39 @@ #include #include "common_test_utils/ngraph_test_utils.hpp" +#include "openvino/op/add.hpp" +#include "openvino/op/if.hpp" +#include "openvino/op/logical_not.hpp" +#include "openvino/op/multiply.hpp" +#include "openvino/op/split.hpp" +#include "openvino/op/subtract.hpp" +#include "openvino/op/variadic_split.hpp" using namespace testing; std::shared_ptr get_then_body() { - auto Xt = std::make_shared(ov::element::f32, ov::Shape{3}); - auto Yt = std::make_shared(ov::element::f32, ov::Shape{3}); - auto add_op = std::make_shared(Xt, Yt); - auto then_op_result = std::make_shared(add_op); + auto Xt = std::make_shared(ov::element::f32, ov::Shape{3}); + auto Yt = std::make_shared(ov::element::f32, ov::Shape{3}); + auto add_op = std::make_shared(Xt, Yt); + auto then_op_result = std::make_shared(add_op); auto then_body = std::make_shared(ov::OutputVector{then_op_result}, ov::ParameterVector{Xt, Yt}); return then_body; } std::shared_ptr get_else_body() { - auto Xe = std::make_shared(ov::element::f32, ov::Shape{3}); - auto Ye = std::make_shared(ov::element::f32, ov::Shape{3}); - auto mul_op = std::make_shared(Xe, Ye); - auto else_op_result = std::make_shared(mul_op); + auto Xe = std::make_shared(ov::element::f32, ov::Shape{3}); + auto Ye = std::make_shared(ov::element::f32, ov::Shape{3}); + auto mul_op = std::make_shared(Xe, Ye); + auto else_op_result = std::make_shared(mul_op); auto else_body = std::make_shared(ov::OutputVector{else_op_result}, ov::ParameterVector{Xe, Ye}); return else_body; } std::shared_ptr create_if_model(bool condition) { - auto X = std::make_shared(ov::element::f32, ov::Shape{3}); - auto Y = std::make_shared(ov::element::f32, ov::Shape{3}); - auto cond = std::make_shared(ov::element::boolean, ov::Shape{1}, condition); - auto if_op = std::make_shared(cond); + auto X = std::make_shared(ov::element::f32, ov::Shape{3}); + auto Y = std::make_shared(ov::element::f32, ov::Shape{3}); + auto cond = std::make_shared(ov::element::boolean, ov::Shape{1}, condition); + auto if_op = std::make_shared(cond); const auto& then_body = get_then_body(); const auto& else_body = get_else_body(); @@ -49,7 +55,7 @@ std::shared_ptr create_if_model(bool condition) { if_op->set_input(X, then_p[0], else_p[0]); if_op->set_input(Y, then_p[1], else_p[1]); if_op->set_output(then_body->get_results()[0], else_body->get_results()[0]); - auto if_result = std::make_shared(if_op); + auto if_result = std::make_shared(if_op); return std::make_shared(ov::NodeVector{if_result}, ov::ParameterVector{X, Y}); } @@ -95,12 +101,12 @@ TEST(TransformationTests, UnrollIfCondIsFalse) { TEST(TransformationTests, UnrollIfWithSplitInput) { std::shared_ptr f(nullptr), f_ref(nullptr); { - auto X = std::make_shared(ov::element::f32, ov::Shape{2, 3}); - auto Y = std::make_shared(ov::element::f32, ov::Shape{3}); + auto X = std::make_shared(ov::element::f32, ov::Shape{2, 3}); + auto Y = std::make_shared(ov::element::f32, ov::Shape{3}); auto split = - std::make_shared(X, ov::opset9::Constant::create(ov::element::i32, ov::Shape{}, {0}), 2); - auto cond = std::make_shared(ov::element::boolean, ov::Shape{1}, false); - auto if_op = std::make_shared(cond); + std::make_shared(X, ov::op::v0::Constant::create(ov::element::i32, ov::Shape{}, {0}), 2); + auto cond = std::make_shared(ov::element::boolean, ov::Shape{1}, false); + auto if_op = std::make_shared(cond); const auto& then_body = get_then_body(); const auto& else_body = get_else_body(); @@ -113,7 +119,7 @@ TEST(TransformationTests, UnrollIfWithSplitInput) { if_op->set_input(split->output(1), nullptr, else_p[0]); if_op->set_input(Y, then_p[1], else_p[1]); if_op->set_output(then_body->get_results()[0], else_body->get_results()[0]); - auto if_result = std::make_shared(if_op); + auto if_result = std::make_shared(if_op); f = std::make_shared(ov::NodeVector{if_result}, ov::ParameterVector{X, Y}); @@ -126,12 +132,12 @@ TEST(TransformationTests, UnrollIfWithSplitInput) { } { - auto X = std::make_shared(ov::element::f32, ov::Shape{2, 3}); - auto Y = std::make_shared(ov::element::f32, ov::Shape{3}); + auto X = std::make_shared(ov::element::f32, ov::Shape{2, 3}); + auto Y = std::make_shared(ov::element::f32, ov::Shape{3}); auto split = - std::make_shared(X, ov::opset9::Constant::create(ov::element::i32, ov::Shape{}, {0}), 2); - auto mul_op = std::make_shared(split->output(1), Y); - auto if_result = std::make_shared(mul_op); + std::make_shared(X, ov::op::v0::Constant::create(ov::element::i32, ov::Shape{}, {0}), 2); + auto mul_op = std::make_shared(split->output(1), Y); + auto if_result = std::make_shared(mul_op); f_ref = std::make_shared(ov::NodeVector{if_result}, ov::ParameterVector{X, Y}); } @@ -142,14 +148,14 @@ TEST(TransformationTests, UnrollIfWithSplitInput) { TEST(TransformationTests, UnrollNestedIfThenBody) { std::shared_ptr f(nullptr), f_ref(nullptr); { - auto X = std::make_shared(ov::element::f32, ov::Shape{3}); - auto Y = std::make_shared(ov::element::f32, ov::Shape{3}); + auto X = std::make_shared(ov::element::f32, ov::Shape{3}); + auto Y = std::make_shared(ov::element::f32, ov::Shape{3}); auto then_body = create_if_model(true); auto else_body = create_if_model(false); - auto cond = std::make_shared(ov::element::boolean, ov::Shape{1}, true); - auto if_op = std::make_shared(cond); + auto cond = std::make_shared(ov::element::boolean, ov::Shape{1}, true); + auto if_op = std::make_shared(cond); if_op->set_then_body(then_body); if_op->set_else_body(else_body); @@ -158,7 +164,7 @@ TEST(TransformationTests, UnrollNestedIfThenBody) { if_op->set_input(X, then_p[0], else_p[0]); if_op->set_input(Y, then_p[1], else_p[1]); if_op->set_output(then_body->get_results()[0], else_body->get_results()[0]); - auto if_result = std::make_shared(if_op); + auto if_result = std::make_shared(if_op); f = std::make_shared(ov::NodeVector{if_result}, ov::ParameterVector{X, Y}); ov::pass::Manager manager; @@ -177,20 +183,20 @@ TEST(TransformationTests, UnrollNestedIfThenBody) { TEST(TransformationTests, UnrollIfCondIsTrueMultiOutput) { std::shared_ptr f(nullptr), f_ref(nullptr); { - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{3}); - auto X = std::make_shared( + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{3}); + auto X = std::make_shared( data, - ngraph::opset6::Constant::create(ngraph::element::i32, {1}, {0}), - ngraph::opset6::Constant::create(ngraph::element::i32, {2}, {1, 2})); - auto cond = std::make_shared(ngraph::element::boolean, ngraph::Shape{1}, true); - auto if_op = std::make_shared(cond); - auto Xt = std::make_shared(ngraph::element::f32, ngraph::Shape{2}); - auto then_op_result = std::make_shared(Xt); + ov::op::v0::Constant::create(ngraph::element::i32, {1}, {0}), + ov::op::v0::Constant::create(ngraph::element::i32, {2}, {1, 2})); + auto cond = std::make_shared(ngraph::element::boolean, ngraph::Shape{1}, true); + auto if_op = std::make_shared(cond); + auto Xt = std::make_shared(ngraph::element::f32, ngraph::Shape{2}); + auto then_op_result = std::make_shared(Xt); auto then_body = std::make_shared(ngraph::OutputVector{then_op_result}, ngraph::ParameterVector{Xt}); - auto Xe = std::make_shared(ngraph::element::f32, ngraph::Shape{2}); - auto else_op_result = std::make_shared(Xe); + auto Xe = std::make_shared(ngraph::element::f32, ngraph::Shape{2}); + auto else_op_result = std::make_shared(Xe); auto else_body = std::make_shared(ngraph::OutputVector{else_op_result}, ngraph::ParameterVector{Xe}); @@ -198,11 +204,11 @@ TEST(TransformationTests, UnrollIfCondIsTrueMultiOutput) { if_op->set_else_body(else_body); if_op->set_input(X->output(1), Xt, Xe); if_op->set_output(then_op_result, else_op_result); - auto if_result = std::make_shared(if_op); + auto if_result = std::make_shared(if_op); f = std::make_shared(ngraph::NodeVector{if_result}, ngraph::ParameterVector{data}); - ngraph::pass::Manager manager; + ov::pass::Manager manager; manager.register_pass(); manager.register_pass(); manager.run_passes(f); @@ -211,12 +217,12 @@ TEST(TransformationTests, UnrollIfCondIsTrueMultiOutput) { } { - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{3}); - auto X = std::make_shared( + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{3}); + auto X = std::make_shared( data, - ngraph::opset6::Constant::create(ngraph::element::i32, {1}, {0}), - ngraph::opset6::Constant::create(ngraph::element::i32, {2}, {1, 2})); - auto if_result = std::make_shared(X->output(1)); + ov::op::v0::Constant::create(ngraph::element::i32, {1}, {0}), + ov::op::v0::Constant::create(ngraph::element::i32, {2}, {1, 2})); + auto if_result = std::make_shared(X->output(1)); f_ref = std::make_shared(ngraph::NodeVector{if_result}, ngraph::ParameterVector{data}); } @@ -227,32 +233,32 @@ TEST(TransformationTests, UnrollIfCondIsTrueMultiOutput) { TEST(TransformationTests, UnrollIfInsideIf) { std::shared_ptr f(nullptr), f_ref(nullptr); { - auto cond = std::make_shared(ov::element::boolean, ov::Shape{1}, true); - auto not_cond = std::make_shared(cond); - auto if_op = std::make_shared(cond); + auto cond = std::make_shared(ov::element::boolean, ov::Shape{1}, true); + auto not_cond = std::make_shared(cond); + auto if_op = std::make_shared(cond); std::shared_ptr then_body; { - auto cond_inside = std::make_shared(ov::element::boolean, ov::Shape{1}); - auto if_inside = std::make_shared(cond_inside); + auto cond_inside = std::make_shared(ov::element::boolean, ov::Shape{1}); + auto if_inside = std::make_shared(cond_inside); std::shared_ptr then_body_inside; { - auto X = std::make_shared(ov::element::f32, ov::Shape{3}); - auto Y = std::make_shared(ov::element::f32, ov::Shape{3}); - auto add = std::make_shared(X, Y); + auto X = std::make_shared(ov::element::f32, ov::Shape{3}); + auto Y = std::make_shared(ov::element::f32, ov::Shape{3}); + auto add = std::make_shared(X, Y); then_body_inside = std::make_shared(add, ov::ParameterVector{X, Y}); } std::shared_ptr else_body_inside; { - auto X = std::make_shared(ov::element::f32, ov::Shape{3}); - auto Y = std::make_shared(ov::element::f32, ov::Shape{3}); - auto mul = std::make_shared(X, Y); + auto X = std::make_shared(ov::element::f32, ov::Shape{3}); + auto Y = std::make_shared(ov::element::f32, ov::Shape{3}); + auto mul = std::make_shared(X, Y); else_body_inside = std::make_shared(mul, ov::ParameterVector{X, Y}); } - auto X = std::make_shared(ov::element::f32, ov::Shape{3}); - auto Y = std::make_shared(ov::element::f32, ov::Shape{3}); + auto X = std::make_shared(ov::element::f32, ov::Shape{3}); + auto Y = std::make_shared(ov::element::f32, ov::Shape{3}); if_inside->set_then_body(then_body_inside); if_inside->set_else_body(else_body_inside); auto then_p = then_body_inside->get_parameters(); @@ -260,21 +266,21 @@ TEST(TransformationTests, UnrollIfInsideIf) { if_inside->set_input(X, then_p[0], else_p[0]); if_inside->set_input(Y, then_p[1], else_p[1]); if_inside->set_output(then_body_inside->get_results()[0], else_body_inside->get_results()[0]); - auto if_result = std::make_shared(if_inside); + auto if_result = std::make_shared(if_inside); then_body = std::make_shared(if_result, ov::ParameterVector{cond_inside, X, Y}); } std::shared_ptr else_body; { - auto X = std::make_shared(ov::element::f32, ov::Shape{3}); - auto Y = std::make_shared(ov::element::f32, ov::Shape{3}); - auto sub = std::make_shared(X, Y); + auto X = std::make_shared(ov::element::f32, ov::Shape{3}); + auto Y = std::make_shared(ov::element::f32, ov::Shape{3}); + auto sub = std::make_shared(X, Y); else_body = std::make_shared(sub, ov::ParameterVector{X, Y}); } - auto X = std::make_shared(ov::element::f32, ov::Shape{3}); - auto Y = std::make_shared(ov::element::f32, ov::Shape{3}); + auto X = std::make_shared(ov::element::f32, ov::Shape{3}); + auto Y = std::make_shared(ov::element::f32, ov::Shape{3}); if_op->set_then_body(then_body); if_op->set_else_body(else_body); auto then_p = then_body->get_parameters(); @@ -283,7 +289,7 @@ TEST(TransformationTests, UnrollIfInsideIf) { if_op->set_input(X, then_p[1], else_p[0]); if_op->set_input(Y, then_p[2], else_p[1]); if_op->set_output(then_body->get_results()[0], else_body->get_results()[0]); - auto if_result = std::make_shared(if_op); + auto if_result = std::make_shared(if_op); f = std::make_shared(ov::NodeVector{if_result}, ov::ParameterVector{X, Y}); ov::pass::Manager manager; @@ -296,9 +302,9 @@ TEST(TransformationTests, UnrollIfInsideIf) { } { - auto X = std::make_shared(ov::element::f32, ov::Shape{3}); - auto Y = std::make_shared(ov::element::f32, ov::Shape{3}); - auto mul = std::make_shared(X, Y); + auto X = std::make_shared(ov::element::f32, ov::Shape{3}); + auto Y = std::make_shared(ov::element::f32, ov::Shape{3}); + auto mul = std::make_shared(X, Y); f_ref = std::make_shared(mul, ov::ParameterVector{X, Y}); } diff --git a/src/common/transformations/tests/op_conversions/convert_nms9_to_nms_ie_internal_test.cpp b/src/common/transformations/tests/op_conversions/convert_nms9_to_nms_ie_internal_test.cpp index 1104731f86d..12b8e911025 100644 --- a/src/common/transformations/tests/op_conversions/convert_nms9_to_nms_ie_internal_test.cpp +++ b/src/common/transformations/tests/op_conversions/convert_nms9_to_nms_ie_internal_test.cpp @@ -24,18 +24,18 @@ using namespace ngraph; TEST_F(TransformationTestsF, ConvertPreviousNMSToNMSIEInternal) { { - auto boxes = std::make_shared(element::f32, Shape{1, 1000, 4}); - auto scores = std::make_shared(element::f32, Shape{1, 1, 1000}); - auto max_output_boxes_per_class = opset1::Constant::create(element::i64, Shape{}, {10}); - auto iou_threshold = opset1::Constant::create(element::f32, Shape{}, {0.75}); - auto score_threshold = opset1::Constant::create(element::f32, Shape{}, {0.7}); - auto nms = std::make_shared(boxes, - scores, - max_output_boxes_per_class, - iou_threshold, - score_threshold, - op::v1::NonMaxSuppression::BoxEncodingType::CORNER, - true); + auto boxes = std::make_shared(element::f32, Shape{1, 1000, 4}); + auto scores = std::make_shared(element::f32, Shape{1, 1, 1000}); + auto max_output_boxes_per_class = ov::op::v0::Constant::create(element::i64, Shape{}, {10}); + auto iou_threshold = ov::op::v0::Constant::create(element::f32, Shape{}, {0.75}); + auto score_threshold = ov::op::v0::Constant::create(element::f32, Shape{}, {0.7}); + auto nms = std::make_shared(boxes, + scores, + max_output_boxes_per_class, + iou_threshold, + score_threshold, + op::v1::NonMaxSuppression::BoxEncodingType::CORNER, + true); function = std::make_shared(NodeVector{nms}, ParameterVector{boxes, scores}); @@ -49,11 +49,11 @@ TEST_F(TransformationTestsF, ConvertPreviousNMSToNMSIEInternal) { } { - auto boxes = std::make_shared(element::f32, Shape{1, 1000, 4}); - auto scores = std::make_shared(element::f32, Shape{1, 1, 1000}); - auto max_output_boxes_per_class = opset1::Constant::create(element::i64, Shape{1}, {10}); - auto iou_threshold = opset1::Constant::create(element::f32, Shape{1}, {0.75}); - auto score_threshold = opset1::Constant::create(element::f32, Shape{1}, {0.7}); + auto boxes = std::make_shared(element::f32, Shape{1, 1000, 4}); + auto scores = std::make_shared(element::f32, Shape{1, 1, 1000}); + auto max_output_boxes_per_class = ov::op::v0::Constant::create(element::i64, Shape{1}, {10}); + auto iou_threshold = ov::op::v0::Constant::create(element::f32, Shape{1}, {0.75}); + auto score_threshold = ov::op::v0::Constant::create(element::f32, Shape{1}, {0.7}); auto nms = std::make_shared(boxes, scores, max_output_boxes_per_class, @@ -62,7 +62,7 @@ TEST_F(TransformationTestsF, ConvertPreviousNMSToNMSIEInternal) { 0, true, element::i32); - auto convert = std::make_shared(nms->output(0), element::i64); + auto convert = std::make_shared(nms->output(0), element::i64); function_ref = std::make_shared(NodeVector{convert}, ParameterVector{boxes, scores}); } @@ -70,12 +70,12 @@ TEST_F(TransformationTestsF, ConvertPreviousNMSToNMSIEInternal) { TEST_F(TransformationTestsF, ConvertNMS9ToNMSIEInternal) { { - auto boxes = std::make_shared(element::f32, Shape{1, 1000, 4}); - auto scores = std::make_shared(element::f32, Shape{1, 1, 1000}); - auto max_output_boxes_per_class = opset1::Constant::create(element::i32, Shape{}, {10}); - auto iou_threshold = opset1::Constant::create(element::f32, Shape{}, {0.75}); - auto score_threshold = opset1::Constant::create(element::f32, Shape{}, {0.7}); - auto soft_nms_sigma = opset1::Constant::create(element::f32, Shape{}, {0.5}); + auto boxes = std::make_shared(element::f32, Shape{1, 1000, 4}); + auto scores = std::make_shared(element::f32, Shape{1, 1, 1000}); + auto max_output_boxes_per_class = ov::op::v0::Constant::create(element::i32, Shape{}, {10}); + auto iou_threshold = ov::op::v0::Constant::create(element::f32, Shape{}, {0.75}); + auto score_threshold = ov::op::v0::Constant::create(element::f32, Shape{}, {0.7}); + auto soft_nms_sigma = ov::op::v0::Constant::create(element::f32, Shape{}, {0.5}); auto nms = std::make_shared(boxes, scores, max_output_boxes_per_class, @@ -93,12 +93,12 @@ TEST_F(TransformationTestsF, ConvertNMS9ToNMSIEInternal) { } { - auto boxes = std::make_shared(element::f32, Shape{1, 1000, 4}); - auto scores = std::make_shared(element::f32, Shape{1, 1, 1000}); - auto max_output_boxes_per_class = opset1::Constant::create(element::i32, Shape{1}, {10}); - auto iou_threshold = opset1::Constant::create(element::f32, Shape{1}, {0.75}); - auto score_threshold = opset1::Constant::create(element::f32, Shape{1}, {0.7}); - auto soft_nms_sigma = opset1::Constant::create(element::f32, Shape{1}, {0.5}); + auto boxes = std::make_shared(element::f32, Shape{1, 1000, 4}); + auto scores = std::make_shared(element::f32, Shape{1, 1, 1000}); + auto max_output_boxes_per_class = ov::op::v0::Constant::create(element::i32, Shape{1}, {10}); + auto iou_threshold = ov::op::v0::Constant::create(element::f32, Shape{1}, {0.75}); + auto score_threshold = ov::op::v0::Constant::create(element::f32, Shape{1}, {0.7}); + auto soft_nms_sigma = ov::op::v0::Constant::create(element::f32, Shape{1}, {0.5}); auto nms = std::make_shared(boxes, scores, max_output_boxes_per_class, diff --git a/src/common/transformations/tests/op_conversions/convert_reduce_to_pooling_test.cpp b/src/common/transformations/tests/op_conversions/convert_reduce_to_pooling_test.cpp index d0022db2e88..36fc777eaf4 100644 --- a/src/common/transformations/tests/op_conversions/convert_reduce_to_pooling_test.cpp +++ b/src/common/transformations/tests/op_conversions/convert_reduce_to_pooling_test.cpp @@ -135,12 +135,12 @@ public: }; TEST_P(ConvertReduceToPoolingTests, CompareFunctions) { - auto unh = std::make_shared(); + auto unh = std::make_shared(); ngraph::pass::Manager m; - m.register_pass(unh); + m.register_pass(unh); m.register_pass(); m.register_pass(); - m.register_pass(unh); + m.register_pass(unh); m.run_passes(f); ASSERT_NO_THROW(check_rt_info(f)); diff --git a/src/common/transformations/tests/op_conversions/convert_scatter_elements_to_scatter_test.cpp b/src/common/transformations/tests/op_conversions/convert_scatter_elements_to_scatter_test.cpp index d203eaaf486..a962420bf00 100644 --- a/src/common/transformations/tests/op_conversions/convert_scatter_elements_to_scatter_test.cpp +++ b/src/common/transformations/tests/op_conversions/convert_scatter_elements_to_scatter_test.cpp @@ -81,13 +81,13 @@ std::shared_ptr get_reference_function(const ngraph::PartialSh } void test(std::shared_ptr f, std::shared_ptr f_ref) { - auto unh = std::make_shared(); + auto unh = std::make_shared(); ngraph::pass::Manager manager; - manager.register_pass(unh); + manager.register_pass(unh); manager.register_pass(); manager.register_pass(); - manager.register_pass(unh); - manager.register_pass([](std::shared_ptr f) { + manager.register_pass(unh); + manager.register_pass([](std::shared_ptr f) { check_rt_info(f); }); manager.register_pass(); diff --git a/src/common/transformations/tests/op_conversions/ngraph_depth_to_space_transform_test.cpp b/src/common/transformations/tests/op_conversions/ngraph_depth_to_space_transform_test.cpp index 2c13cceedd1..26f249f1903 100644 --- a/src/common/transformations/tests/op_conversions/ngraph_depth_to_space_transform_test.cpp +++ b/src/common/transformations/tests/op_conversions/ngraph_depth_to_space_transform_test.cpp @@ -43,7 +43,7 @@ TEST(TransformationTests, TestDepthToSpaceTransformBlockFirst) { ASSERT_EQ(consumers.size(), 1); auto reshape_begin = consumers.begin()->get_node(); - auto shape_begin = std::dynamic_pointer_cast( + auto shape_begin = std::dynamic_pointer_cast( reshape_begin->input(1).get_source_output().get_node_shared_ptr()); std::vector shape_begin_value = shape_begin->get_vector(); std::vector shape_begin_value_ref{1, 2, 2, 3, 1080, 1616}; @@ -54,14 +54,14 @@ TEST(TransformationTests, TestDepthToSpaceTransformBlockFirst) { auto transpose = consumers.begin()->get_node(); auto order = - std::dynamic_pointer_cast(transpose->input(1).get_source_output().get_node_shared_ptr()); + std::dynamic_pointer_cast(transpose->input(1).get_source_output().get_node_shared_ptr()); std::vector order_value = order->get_vector(); std::vector order_value_ref{0, 3, 4, 1, 5, 2}; ASSERT_EQ(order_value, order_value_ref); consumers = transpose->output(0).get_target_inputs(); auto reshape_end = consumers.begin()->get_node(); - auto shape_end = std::dynamic_pointer_cast( + auto shape_end = std::dynamic_pointer_cast( reshape_end->input(1).get_source_output().get_node_shared_ptr()); std::vector shape_end_value = shape_end->get_vector(); std::vector shape_end_value_ref{1, 3, 2 * 1080, 2 * 1616}; @@ -89,7 +89,7 @@ TEST(TransformationTests, TestDepthToSpaceTransformDepthFirst) { ASSERT_EQ(consumers.size(), 1); auto reshape_begin = consumers.begin()->get_node(); - auto shape_begin = std::dynamic_pointer_cast( + auto shape_begin = std::dynamic_pointer_cast( reshape_begin->input(1).get_source_output().get_node_shared_ptr()); std::vector shape_begin_value = shape_begin->get_vector(); std::vector shape_begin_value_ref{1, 3, 2, 2, 1080, 1616}; @@ -100,14 +100,14 @@ TEST(TransformationTests, TestDepthToSpaceTransformDepthFirst) { auto transpose = consumers.begin()->get_node(); auto order = - std::dynamic_pointer_cast(transpose->input(1).get_source_output().get_node_shared_ptr()); + std::dynamic_pointer_cast(transpose->input(1).get_source_output().get_node_shared_ptr()); std::vector order_value = order->get_vector(); std::vector order_value_ref{0, 1, 4, 2, 5, 3}; ASSERT_EQ(order_value, order_value_ref); consumers = transpose->output(0).get_target_inputs(); auto reshape_end = consumers.begin()->get_node(); - auto shape_end = std::dynamic_pointer_cast( + auto shape_end = std::dynamic_pointer_cast( reshape_end->input(1).get_source_output().get_node_shared_ptr()); std::vector shape_end_value = shape_end->get_vector(); std::vector shape_end_value_ref{1, 3, 2 * 1080, 2 * 1616}; @@ -135,7 +135,7 @@ TEST(TransformationTests, TestSpaceToDepthTransformBlockFirst) { ASSERT_EQ(consumers.size(), 1); auto reshape_begin = consumers.begin()->get_node(); - auto shape_begin = std::dynamic_pointer_cast( + auto shape_begin = std::dynamic_pointer_cast( reshape_begin->input(1).get_source_output().get_node_shared_ptr()); std::vector shape_begin_value = shape_begin->get_vector(); std::vector shape_begin_value_ref{1, 12, 1080 / 2, 2, 1616 / 2, 2}; @@ -146,14 +146,14 @@ TEST(TransformationTests, TestSpaceToDepthTransformBlockFirst) { auto transpose = consumers.begin()->get_node(); auto order = - std::dynamic_pointer_cast(transpose->input(1).get_source_output().get_node_shared_ptr()); + std::dynamic_pointer_cast(transpose->input(1).get_source_output().get_node_shared_ptr()); std::vector order_value = order->get_vector(); std::vector order_value_ref{0, 3, 5, 1, 2, 4}; ASSERT_EQ(order_value, order_value_ref); consumers = transpose->output(0).get_target_inputs(); auto reshape_end = consumers.begin()->get_node(); - auto shape_end = std::dynamic_pointer_cast( + auto shape_end = std::dynamic_pointer_cast( reshape_end->input(1).get_source_output().get_node_shared_ptr()); std::vector shape_end_value = shape_end->get_vector(); std::vector shape_end_value_ref{1, 12 * 4, 1080 / 2, 1616 / 2}; @@ -181,7 +181,7 @@ TEST(TransformationTests, TestSpaceToDepthTransformDepthFirst) { ASSERT_EQ(consumers.size(), 1); auto reshape_begin = consumers.begin()->get_node(); - auto shape_begin = std::dynamic_pointer_cast( + auto shape_begin = std::dynamic_pointer_cast( reshape_begin->input(1).get_source_output().get_node_shared_ptr()); std::vector shape_begin_value = shape_begin->get_vector(); std::vector shape_begin_value_ref{1, 12, 1080 / 2, 2, 1616 / 2, 2}; @@ -192,14 +192,14 @@ TEST(TransformationTests, TestSpaceToDepthTransformDepthFirst) { auto transpose = consumers.begin()->get_node(); auto order = - std::dynamic_pointer_cast(transpose->input(1).get_source_output().get_node_shared_ptr()); + std::dynamic_pointer_cast(transpose->input(1).get_source_output().get_node_shared_ptr()); std::vector order_value = order->get_vector(); std::vector order_value_ref{0, 1, 3, 5, 2, 4}; ASSERT_EQ(order_value, order_value_ref); consumers = transpose->output(0).get_target_inputs(); auto reshape_end = consumers.begin()->get_node(); - auto shape_end = std::dynamic_pointer_cast( + auto shape_end = std::dynamic_pointer_cast( reshape_end->input(1).get_source_output().get_node_shared_ptr()); std::vector shape_end_value = shape_end->get_vector(); std::vector shape_end_value_ref{1, 12 * 4, 1080 / 2, 1616 / 2}; diff --git a/src/common/transformations/tests/op_conversions/ngraph_mode_decomposition_test.cpp b/src/common/transformations/tests/op_conversions/ngraph_mode_decomposition_test.cpp index e2338eec5c5..c69a1ffd438 100644 --- a/src/common/transformations/tests/op_conversions/ngraph_mode_decomposition_test.cpp +++ b/src/common/transformations/tests/op_conversions/ngraph_mode_decomposition_test.cpp @@ -31,12 +31,12 @@ TEST(TransformationTests, ModDecompositionTests) { auto mod = std::make_shared(data1, data2); f = std::make_shared(ngraph::NodeVector{mod}, ngraph::ParameterVector{}); - auto unh = std::make_shared(); + auto unh = std::make_shared(); ngraph::pass::Manager m; - m.register_pass(unh); + m.register_pass(unh); m.register_pass(); m.register_pass(); - m.register_pass(unh); + m.register_pass(unh); m.run_passes(f); ASSERT_NO_THROW(check_rt_info(f)); } diff --git a/src/common/transformations/tests/smart_reshape/sr_mimicking_sbs.cpp b/src/common/transformations/tests/smart_reshape/sr_mimicking_sbs.cpp index 0f436fe5496..c4909ea72c7 100644 --- a/src/common/transformations/tests/smart_reshape/sr_mimicking_sbs.cpp +++ b/src/common/transformations/tests/smart_reshape/sr_mimicking_sbs.cpp @@ -23,7 +23,7 @@ TEST(SmartReshapeTests, MimickingSBS) { InferenceEngine::CNNNetwork network(f); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); ASSERT_NO_THROW(network.setBatchSize(2)); check_unique_names(f, unh); @@ -45,7 +45,7 @@ TEST(SmartReshapeTests, MimickingSBS_1) { InferenceEngine::CNNNetwork network(f); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); ASSERT_NO_THROW(network.setBatchSize(2)); check_unique_names(f, unh); @@ -67,7 +67,7 @@ TEST(SmartReshapeTests, MimickingSBS_2) { InferenceEngine::CNNNetwork network(f); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); ASSERT_NO_THROW(network.setBatchSize(1)); check_unique_names(f, unh); diff --git a/src/common/transformations/tests/smart_reshape/sr_proposal_scales.cpp b/src/common/transformations/tests/smart_reshape/sr_proposal_scales.cpp index 921cc29daea..de6346c06f0 100644 --- a/src/common/transformations/tests/smart_reshape/sr_proposal_scales.cpp +++ b/src/common/transformations/tests/smart_reshape/sr_proposal_scales.cpp @@ -42,7 +42,7 @@ TEST(SmartReshapeTests, Proposal1Scales) { } InferenceEngine::CNNNetwork network(f); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); ASSERT_NO_THROW(network.setBatchSize(2)); check_unique_names(f, unh); @@ -81,7 +81,7 @@ TEST(SmartReshapeTests, Proposal1Scales_WithConvert) { } InferenceEngine::CNNNetwork network(f); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); ASSERT_NO_THROW(network.setBatchSize(2)); check_unique_names(f, unh); @@ -120,7 +120,7 @@ TEST(SmartReshapeTests, Proposal4Scales) { InferenceEngine::CNNNetwork network(f); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); ASSERT_NO_THROW(network.setBatchSize(2)); check_unique_names(f, unh); @@ -161,7 +161,7 @@ TEST(SmartReshapeTests, Proposal4Scales_WithConvert) { InferenceEngine::CNNNetwork network(f); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); ASSERT_NO_THROW(network.setBatchSize(2)); check_unique_names(f, unh); diff --git a/src/common/transformations/tests/smart_reshape/sr_reshape_1d.cpp b/src/common/transformations/tests/smart_reshape/sr_reshape_1d.cpp index 5075106f910..6f448418425 100644 --- a/src/common/transformations/tests/smart_reshape/sr_reshape_1d.cpp +++ b/src/common/transformations/tests/smart_reshape/sr_reshape_1d.cpp @@ -27,7 +27,7 @@ TEST(SmartReshapeTests, Reshape1d) { ngraph::PartialShape::dynamic())); ASSERT_TRUE(network.getFunction()->get_parameters()[0]->get_partial_shape().compatible({5})); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); ASSERT_NO_THROW(network.reshape( InferenceEngine::ICNNNetwork::InputShapes{{f->get_parameters()[0]->get_friendly_name(), {1, 3, 300, 300}}})); @@ -52,7 +52,7 @@ TEST(SmartReshapeTests, Reshape1d_negative) { ngraph::PartialShape::dynamic())); ASSERT_TRUE(network.getFunction()->get_parameters()[0]->get_partial_shape().is_dynamic()); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); ASSERT_NO_THROW(network.reshape( InferenceEngine::ICNNNetwork::InputShapes{{f->get_parameters()[0]->get_friendly_name(), {1, 3, 300, 300}}})); diff --git a/src/common/transformations/tests/smart_reshape/sr_strided_slice_squeeze.cpp b/src/common/transformations/tests/smart_reshape/sr_strided_slice_squeeze.cpp index 5733be7d59a..69efb276190 100644 --- a/src/common/transformations/tests/smart_reshape/sr_strided_slice_squeeze.cpp +++ b/src/common/transformations/tests/smart_reshape/sr_strided_slice_squeeze.cpp @@ -34,7 +34,7 @@ TEST(SmartReshapeTests, SS_Squeeze) { << network.getFunction()->get_results()[0]->get_output_partial_shape(0); ASSERT_TRUE(network.getFunction()->get_parameters()[0]->get_partial_shape().compatible({1, 3})); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); ASSERT_NO_THROW(network.setBatchSize(2)); check_unique_names(f, unh); @@ -69,7 +69,7 @@ TEST(SmartReshapeTests, SS_Squeeze_partial_begin_end_mask) { << network.getFunction()->get_results()[0]->get_output_partial_shape(0); ASSERT_TRUE(network.getFunction()->get_parameters()[0]->get_partial_shape().compatible({1, 128, 768})); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); auto inputname = network.getFunction()->get_parameters()[0]->get_friendly_name(); ASSERT_NO_THROW(network.reshape(InferenceEngine::ICNNNetwork::InputShapes{{inputname, {2, 128, 768}}})); @@ -107,7 +107,7 @@ TEST(SmartReshapeTests, SS_Squeeze_partial_begin_end) { << network.getFunction()->get_results()[0]->get_output_partial_shape(0); ASSERT_TRUE(network.getFunction()->get_parameters()[0]->get_partial_shape().compatible({1, 1, 768})); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); auto inputname = network.getFunction()->get_parameters()[0]->get_friendly_name(); ASSERT_NO_THROW(network.reshape(InferenceEngine::ICNNNetwork::InputShapes{{inputname, {2, 1, 768}}})); @@ -143,7 +143,7 @@ TEST(SmartReshapeTests, SS_Squeeze_mask_use_negative) { << network.getFunction()->get_results()[0]->get_output_partial_shape(0); ASSERT_TRUE(network.getFunction()->get_parameters()[0]->get_partial_shape().compatible({1, 3})); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); ASSERT_ANY_THROW(network.setBatchSize(2)); check_unique_names(f, unh); @@ -174,7 +174,7 @@ TEST(SmartReshapeTests, SS_Squeeze_negative_stride_negative) { << network.getFunction()->get_results()[0]->get_output_partial_shape(0); ASSERT_TRUE(network.getFunction()->get_parameters()[0]->get_partial_shape().compatible({1, 3})); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); ASSERT_ANY_THROW(network.setBatchSize(2)); check_unique_names(f, unh); @@ -208,7 +208,7 @@ TEST(SmartReshapeTests, SS_SharedSqueezes) { << network.getFunction()->get_results()[0]->get_output_partial_shape(0); ASSERT_TRUE(network.getFunction()->get_parameters()[0]->get_partial_shape().compatible({1, 3})); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); ASSERT_NO_THROW(network.setBatchSize(2)); check_unique_names(f, unh); @@ -243,7 +243,7 @@ TEST(SmartReshapeTests, SS_SqueezeNegativeAxes) { << network.getFunction()->get_results()[0]->get_output_partial_shape(0); ASSERT_TRUE(network.getFunction()->get_parameters()[0]->get_partial_shape().compatible({1, 3, 1, 8, 1, 2})); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); ASSERT_NO_THROW(network.setBatchSize(2)); check_unique_names(f, unh); @@ -277,7 +277,7 @@ TEST(SmartReshapeTests, Squeeze_SSNegativeAxes) { << network.getFunction()->get_results()[0]->get_output_partial_shape(0); ASSERT_TRUE(network.getFunction()->get_parameters()[0]->get_partial_shape().compatible({1, 3, 1, 8, 1, 2})); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); ASSERT_NO_THROW(network.setBatchSize(2)); check_unique_names(f, unh); diff --git a/src/common/transformations/tests/smart_reshape/sr_sub_graph_ops.cpp b/src/common/transformations/tests/smart_reshape/sr_sub_graph_ops.cpp index b2bed54edca..227064ce847 100644 --- a/src/common/transformations/tests/smart_reshape/sr_sub_graph_ops.cpp +++ b/src/common/transformations/tests/smart_reshape/sr_sub_graph_ops.cpp @@ -59,7 +59,7 @@ TEST(SmartReshapeTests, TensorIteratorStaticParameters) { ASSERT_TRUE(network.getFunction()->get_results()[2]->get_output_partial_shape(0).compatible({1, 1, 1})); ASSERT_TRUE(network.getFunction()->get_results()[3]->get_output_partial_shape(0).compatible({1, 1, 1})); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); ASSERT_NO_THROW(network.reshape( InferenceEngine::ICNNNetwork::InputShapes{{f->get_parameters()[0]->get_friendly_name(), {32, 1, 10}}, @@ -121,7 +121,7 @@ TEST(SmartReshapeTests, TensorIteratorDynamicParameters) { ASSERT_TRUE(network.getFunction()->get_results()[2]->get_output_partial_shape(0).compatible({1, 1, 1})); ASSERT_TRUE(network.getFunction()->get_results()[3]->get_output_partial_shape(0).compatible({1, 1, 1})); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); ASSERT_NO_THROW(network.reshape( InferenceEngine::ICNNNetwork::InputShapes{{f->get_parameters()[0]->get_friendly_name(), {32, 1, 10}}, @@ -191,7 +191,7 @@ TEST(SmartReshapeTests, LoopStaticParameters) { ASSERT_TRUE( network.getFunction()->get_results()[3]->get_output_partial_shape(0).compatible(PartialShape::dynamic())); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); ASSERT_NO_THROW(network.reshape( InferenceEngine::ICNNNetwork::InputShapes{{f->get_parameters()[0]->get_friendly_name(), {32, 1, 10}}, @@ -261,7 +261,7 @@ TEST(SmartReshapeTests, LoopDynamicParameters) { ASSERT_TRUE( network.getFunction()->get_results()[3]->get_output_partial_shape(0).compatible(PartialShape::dynamic())); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); ASSERT_NO_THROW(network.reshape( InferenceEngine::ICNNNetwork::InputShapes{{f->get_parameters()[0]->get_friendly_name(), {32, 1, 10}}, @@ -335,7 +335,7 @@ TEST(SmartReshapeTests, LoopParentParametersUsedInBody) { ASSERT_TRUE( network.getFunction()->get_results()[3]->get_output_partial_shape(0).compatible(PartialShape::dynamic())); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); ASSERT_NO_THROW(network.reshape( InferenceEngine::ICNNNetwork::InputShapes{{f->get_parameters()[0]->get_friendly_name(), {4, 3, 2}}, @@ -401,7 +401,7 @@ TEST(SmartReshapeTests, TensorIteratorParentParameterUsedInBody) { ASSERT_TRUE(network.getFunction()->get_results()[2]->get_output_partial_shape(0).compatible({1, 1, 1})); ASSERT_TRUE(network.getFunction()->get_results()[3]->get_output_partial_shape(0).compatible({1, 1, 1})); - auto unh = std::make_shared(); + auto unh = std::make_shared(); init_unique_names(f, unh); ASSERT_NO_THROW(network.reshape( InferenceEngine::ICNNNetwork::InputShapes{{f->get_parameters()[0]->get_friendly_name(), {32, 1, 10}}, diff --git a/src/common/transformations/tests/utils/compare_functions_test.cpp b/src/common/transformations/tests/utils/compare_functions_test.cpp index c89eddb97a4..d58d7a4a339 100644 --- a/src/common/transformations/tests/utils/compare_functions_test.cpp +++ b/src/common/transformations/tests/utils/compare_functions_test.cpp @@ -483,7 +483,7 @@ TEST(TransformationTests, ReorgYoloNegativeDifferentMax) { auto param = std::make_shared(ngraph::element::f32, ngraph::Shape{10, 10, 10, 10}); auto reorg_yolo = std::make_shared(param, stride); - return std::make_shared(std::make_shared(reorg_yolo), + return std::make_shared(std::make_shared(reorg_yolo), ngraph::ParameterVector{param}); }; diff --git a/src/core/tests/pass/serialization/custom_ops.cpp b/src/core/tests/pass/serialization/custom_ops.cpp index 08f2ed73f37..78b85f2e3fd 100644 --- a/src/core/tests/pass/serialization/custom_ops.cpp +++ b/src/core/tests/pass/serialization/custom_ops.cpp @@ -29,30 +29,28 @@ protected: } }; -class FrameworkNodeExtension : public InferenceEngine::IExtension { +class TemplateOpExtension : public ov::op::Op { public: - void GetVersion(const InferenceEngine::Version*& versionInfo) const noexcept override { - static InferenceEngine::Version ExtensionDescription = {{1, 0}, "1.0", "framework_node_ext"}; + OPENVINO_OP("Template", "custom_opset"); + TemplateOpExtension() = default; - versionInfo = &ExtensionDescription; + bool visit_attributes(ov::AttributeVisitor& visitor) override { + return true; } - std::map getOpSets() override { - static std::map opsets; - if (opsets.empty()) { - ngraph::OpSet opset; - opset.insert(); - opsets["util"] = opset; - } - return opsets; + void validate_and_infer_types() override { + set_output_size(1); + set_output_type(0, get_input_element_type(0), get_input_partial_shape(0)); } - void Unload() noexcept override {} + std::shared_ptr clone_with_new_inputs(const ov::OutputVector& inputs) const override { + return nullptr; + } }; TEST_F(CustomOpsSerializationTest, CustomOpNoExtensions) { const std::string model = R"V0G0N( - + @@ -66,9 +64,8 @@ TEST_F(CustomOpsSerializationTest, CustomOpNoExtensions) { - - + 2 2 2 @@ -76,7 +73,7 @@ TEST_F(CustomOpsSerializationTest, CustomOpNoExtensions) { - + 2 2 2 @@ -96,21 +93,18 @@ TEST_F(CustomOpsSerializationTest, CustomOpNoExtensions) { - - + + )V0G0N"; ov::Core core; - auto extension = std::make_shared(); + auto extension = std::make_shared>(); core.add_extension(extension); auto expected = core.read_model(model, ov::Tensor()); ov::pass::Manager manager; - manager.register_pass(m_out_xml_path, - m_out_bin_path, - extension->getOpSets(), - ov::pass::Serialize::Version::IR_V10); + manager.register_pass(m_out_xml_path, m_out_bin_path, ov::pass::Serialize::Version::IR_V11); manager.run_passes(expected); auto result = core.read_model(m_out_xml_path, m_out_bin_path); diff --git a/src/core/tests/pass/serialization/deterministicity.cpp b/src/core/tests/pass/serialization/deterministicity.cpp index b51ba488462..4c139026df4 100644 --- a/src/core/tests/pass/serialization/deterministicity.cpp +++ b/src/core/tests/pass/serialization/deterministicity.cpp @@ -295,6 +295,6 @@ TEST_P(SerializationDeterministicityInputOutputTest, FromIrModel) { EXPECT_TRUE(files_equal(xml_2, xml_1)); } -INSTANTIATE_TEST_CASE_P(DeterministicityInputOutput, - SerializationDeterministicityInputOutputTest, - ::testing::Values(ov::pass::Serialize::Version::IR_V10, ov::pass::Serialize::Version::IR_V11)); +INSTANTIATE_TEST_SUITE_P(DeterministicityInputOutput, + SerializationDeterministicityInputOutputTest, + ::testing::Values(ov::pass::Serialize::Version::IR_V10, ov::pass::Serialize::Version::IR_V11)); diff --git a/src/core/tests/pass/serialization/from_model.cpp b/src/core/tests/pass/serialization/from_model.cpp index 5fa253d8c82..d3e2ebf5f7c 100644 --- a/src/core/tests/pass/serialization/from_model.cpp +++ b/src/core/tests/pass/serialization/from_model.cpp @@ -8,6 +8,11 @@ #include "common_test_utils/common_utils.hpp" #include "common_test_utils/graph_comparator.hpp" +#include "openvino/op/add.hpp" +#include "openvino/op/if.hpp" +#include "openvino/op/relu.hpp" +#include "openvino/op/split.hpp" +#include "openvino/op/subtract.hpp" #include "openvino/pass/serialize.hpp" #include "openvino/util/file_util.hpp" #include "read_ir.hpp" @@ -73,12 +78,12 @@ std::shared_ptr create_model_if_mixed_inputs() { Ze->output(0).get_tensor().set_names({"Z_else"}); auto cond = std::make_shared(element::boolean, Shape{1}, true); auto axis_then = std::make_shared(element::i32, Shape{}, 0); - auto split_y = std::make_shared(Yt, axis_then, 2); - auto then_op = std::make_shared(Xt, split_y->output(0)); + auto split_y = std::make_shared(Yt, axis_then, 2); + auto then_op = std::make_shared(Xt, split_y->output(0)); auto res0 = std::make_shared(then_op); auto axis_else = std::make_shared(element::i32, Shape{}, 0); - auto split_z = std::make_shared(Ze, axis_else, 4); - auto else_op = std::make_shared(split_z); + auto split_z = std::make_shared(Ze, axis_else, 4); + auto else_op = std::make_shared(split_z); auto res1 = std::make_shared(else_op); auto then_body = std::make_shared(OutputVector{res0}, ParameterVector{Yt, Xt}, "then_body"); auto else_body = std::make_shared(OutputVector{res1}, ParameterVector{Ze}, "else_body"); @@ -105,7 +110,7 @@ std::vector get_models() { p1->output(0).set_names({"X"}); auto p2 = std::make_shared(element::f32, Shape{2}); p2->output(0).set_names({"Y"}); - auto op = std::make_shared(p1, p2); + auto op = std::make_shared(p1, p2); auto res = std::make_shared(op); return std::make_shared(OutputVector{res}, ParameterVector{p1, p2}); }; @@ -125,7 +130,7 @@ std::vector get_models() { p1->output(0).set_names({"X"}); auto c1 = std::make_shared(element::u8, shape, data.data()); c1->output(0).set_names({"C"}); - auto op = std::make_shared(p1, c1); + auto op = std::make_shared(p1, c1); auto res = std::make_shared(op); return std::make_shared(OutputVector{res}, ParameterVector{p1}); }; @@ -178,7 +183,7 @@ TEST_P(SerializationFromModelTest_large, DISABLED_Model_very_large) { p1->output(0).set_names({"X"}); auto c1 = std::make_shared(element::u8, shape, data.data()); c1->output(0).set_names({"C"}); - auto op = std::make_shared(p1, c1); + auto op = std::make_shared(p1, c1); auto res = std::make_shared(op); auto model = std::make_shared(OutputVector{res}, ParameterVector{p1}); ov::pass::Serialize(m_out_xml_path, m_out_bin_path).run_on_model(model); diff --git a/src/frontends/ir/tests/rt_info_deserialization.cpp b/src/frontends/ir/tests/rt_info_deserialization.cpp index ff1b1128b29..ae43bb01e54 100644 --- a/src/frontends/ir/tests/rt_info_deserialization.cpp +++ b/src/frontends/ir/tests/rt_info_deserialization.cpp @@ -12,6 +12,12 @@ #include "ie/ie_core.hpp" #include "openvino/core/preprocess/input_tensor_info.hpp" #include "openvino/frontend/manager.hpp" +#include "openvino/op/add.hpp" +#include "openvino/op/convert.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/result.hpp" +#include "openvino/op/round.hpp" +#include "openvino/op/transpose.hpp" #include "openvino/runtime/core.hpp" #include "transformations/rt_info/fused_names_attribute.hpp" #include "transformations/rt_info/old_api_map_element_type_attribute.hpp" @@ -148,20 +154,20 @@ TEST_F(RTInfoDeserialization, node_v10) { { ov::Shape shape{1, 3, 22, 22}; auto type = ov::element::f32; - auto param = std::make_shared(type, shape); + auto param = std::make_shared(type, shape); param->set_friendly_name("in1"); param->get_output_tensor(0).set_names({"input_tensor", param->get_friendly_name()}); // TODO: No guarantee that exactly 'Convert' will be added - auto convert_param = std::make_shared(param, ov::element::f16); + auto convert_param = std::make_shared(param, ov::element::f16); - auto round = std::make_shared(convert_param, ov::opset8::Round::RoundMode::HALF_TO_EVEN); + auto round = std::make_shared(convert_param, ov::op::v5::Round::RoundMode::HALF_TO_EVEN); - auto convert_result = std::make_shared(round, type); + auto convert_result = std::make_shared(round, type); convert_result->set_friendly_name("Round"); convert_result->get_output_tensor(0).set_names({"output_tensor", convert_result->get_friendly_name()}); - auto result = std::make_shared(convert_result); + auto result = std::make_shared(convert_result); result->set_friendly_name("output"); auto f_10_ref = std::make_shared(ov::ResultVector{result}, ov::ParameterVector{param}); @@ -393,18 +399,18 @@ TEST_F(RTInfoDeserialization, input_and_output_v10) { { const ov::Shape shape{1, 3, 22, 22}; const auto type = ov::element::i64; - auto param = std::make_shared(type, shape); + auto param = std::make_shared(type, shape); param->set_friendly_name("in1"); param->get_output_tensor(0).set_names({"input_tensor", param->get_friendly_name()}); - auto sum = std::make_shared(param, param); + auto sum = std::make_shared(param, param); // TODO: No guarantee that exactly 'convert' will be added by post-processing - auto convert_result = std::make_shared(sum, ov::element::i32); + auto convert_result = std::make_shared(sum, ov::element::i32); convert_result->set_friendly_name("sum"); convert_result->get_output_tensor(0).set_names({"output_tensor", convert_result->get_friendly_name()}); - auto result = std::make_shared(convert_result); + auto result = std::make_shared(convert_result); result->set_friendly_name("output"); auto f_10_ref = std::make_shared(ov::ResultVector{result}, ov::ParameterVector{param}); @@ -554,31 +560,31 @@ TEST_F(RTInfoDeserialization, node_v11) { { const ov::PartialShape shape{1, 3, 22, 22}; auto type = ov::element::f16; - auto param = std::make_shared(type, shape); + auto param = std::make_shared(type, shape); param->set_friendly_name("in1"); param->get_output_tensor(0).set_names({"input_tensor"}); // TODO: No guarantee that Transpose will use exactly 'uint64_t' constant auto constant_param = - std::make_shared(ov::element::u64, ov::Shape{4}, std::vector{0, 2, 3, 1}); - auto transpose_param = std::make_shared(param, constant_param); + std::make_shared(ov::element::u64, ov::Shape{4}, std::vector{0, 2, 3, 1}); + auto transpose_param = std::make_shared(param, constant_param); // TODO: No guarantee that only 'convert' will be added by implicit pre-processing - auto convert_param = std::make_shared(transpose_param, ov::element::f32); + auto convert_param = std::make_shared(transpose_param, ov::element::f32); - auto round = std::make_shared(convert_param, ov::opset8::Round::RoundMode::HALF_TO_EVEN); + auto round = std::make_shared(convert_param, ov::op::v5::Round::RoundMode::HALF_TO_EVEN); // TODO: runtime information should migrate as well? round->get_rt_info()[ov::FusedNames::get_type_info_static()] = ov::FusedNames("Round1,Round2"); // TODO: No guarantee that exactly 'convert, then transpose' will be added by implicit post-processing auto constant_result = - std::make_shared(ov::element::u64, ov::Shape{4}, std::vector{0, 3, 1, 2}); - auto transpose_result = std::make_shared(round, constant_result); + std::make_shared(ov::element::u64, ov::Shape{4}, std::vector{0, 3, 1, 2}); + auto transpose_result = std::make_shared(round, constant_result); transpose_result->set_friendly_name("Round"); transpose_result->get_output_tensor(0).set_names({"output_tensor"}); - auto result = std::make_shared(transpose_result); + auto result = std::make_shared(transpose_result); result->set_friendly_name("output"); auto f_10_ref = std::make_shared(ov::ResultVector{result}, ov::ParameterVector{param}); @@ -697,24 +703,24 @@ TEST_F(RTInfoDeserialization, node_v11_uint8) { // read IR v11 with old API and check that old_api_map is applied const ov::PartialShape shape{1, 3, 22, 22}; auto type = ov::element::f16; - auto param = std::make_shared(type, shape); + auto param = std::make_shared(type, shape); param->set_friendly_name("in1"); param->get_output_tensor(0).set_names({"input_tensor"}); auto constant_param = - std::make_shared(ov::element::u64, ov::Shape{4}, std::vector{0, 2, 3, 1}); - auto transpose_param = std::make_shared(param, constant_param); + std::make_shared(ov::element::u64, ov::Shape{4}, std::vector{0, 2, 3, 1}); + auto transpose_param = std::make_shared(param, constant_param); - auto round = std::make_shared(transpose_param, ov::opset8::Round::RoundMode::HALF_TO_EVEN); + auto round = std::make_shared(transpose_param, ov::op::v5::Round::RoundMode::HALF_TO_EVEN); round->get_rt_info()[ov::FusedNames::get_type_info_static()] = ov::FusedNames("Round1,Round2"); auto constant_result = - std::make_shared(ov::element::u64, ov::Shape{4}, std::vector{0, 3, 1, 2}); - auto transpose_result = std::make_shared(round, constant_result); + std::make_shared(ov::element::u64, ov::Shape{4}, std::vector{0, 3, 1, 2}); + auto transpose_result = std::make_shared(round, constant_result); transpose_result->set_friendly_name("Round"); transpose_result->get_output_tensor(0).set_names({"output_tensor"}); - auto result = std::make_shared(transpose_result); + auto result = std::make_shared(transpose_result); result->set_friendly_name("output"); auto f_10_ref = std::make_shared(ov::ResultVector{result}, ov::ParameterVector{param}); diff --git a/src/frontends/onnx/tests/onnx_editor_topological_sort.cpp b/src/frontends/onnx/tests/onnx_editor_topological_sort.cpp index c5412adc2bb..6bd80aa80d8 100644 --- a/src/frontends/onnx/tests/onnx_editor_topological_sort.cpp +++ b/src/frontends/onnx/tests/onnx_editor_topological_sort.cpp @@ -19,31 +19,30 @@ using namespace ngraph::test; static std::string s_manifest = "${MANIFEST}"; NGRAPH_TEST(onnx_editor, topological_sort_two_nodes_swap) { - ONNXModelEditor editor{ngraph::file_util::path_join(CommonTestUtils::getExecutableDirectory(), - SERIALIZED_ZOO, - "onnx/model_editor/topological_sort/two_nodes_swap.onnx")}; + ONNXModelEditor editor{ov::util::path_join({CommonTestUtils::getExecutableDirectory(), + SERIALIZED_ZOO, + "onnx/model_editor/topological_sort/two_nodes_swap.onnx"})}; ASSERT_NO_THROW(editor.get_function()); } NGRAPH_TEST(onnx_editor, topological_sort_completely_unsorted) { - ONNXModelEditor editor{ngraph::file_util::path_join(CommonTestUtils::getExecutableDirectory(), - SERIALIZED_ZOO, - "onnx/model_editor/topological_sort/completely_unsorted.onnx")}; + ONNXModelEditor editor{ov::util::path_join({CommonTestUtils::getExecutableDirectory(), + SERIALIZED_ZOO, + "onnx/model_editor/topological_sort/completely_unsorted.onnx"})}; ASSERT_NO_THROW(editor.get_function()); } NGRAPH_TEST(onnx_editor, topological_sort_completely_unsorted_2) { - ONNXModelEditor editor{ - ngraph::file_util::path_join(CommonTestUtils::getExecutableDirectory(), - SERIALIZED_ZOO, - "onnx/model_editor/topological_sort/completely_unsorted_2.onnx")}; + ONNXModelEditor editor{ov::util::path_join({CommonTestUtils::getExecutableDirectory(), + SERIALIZED_ZOO, + "onnx/model_editor/topological_sort/completely_unsorted_2.onnx"})}; ASSERT_NO_THROW(editor.get_function()); } NGRAPH_TEST(onnx_editor, topological_sort_constant_node_in_the_graph) { const std::string rel_path_to_model = "onnx/model_editor/topological_sort/add_abc_const_node_unsorted.onnx"; ONNXModelEditor editor{ - ngraph::file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, rel_path_to_model)}; + ov::util::path_join({CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, rel_path_to_model})}; ASSERT_NO_THROW(editor.get_function()); } @@ -51,7 +50,7 @@ NGRAPH_TEST(onnx_editor, topological_sort_constant_node_in_the_graph) { NGRAPH_TEST(onnx_editor, topological_sort_multioutput_node) { const std::string rel_path_to_model = "onnx/model_editor/topological_sort/multioutput_split_unsorted.onnx"; ONNXModelEditor editor{ - ngraph::file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, rel_path_to_model)}; + ov::util::path_join({CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, rel_path_to_model})}; ASSERT_NO_THROW(editor.get_function()); } @@ -60,11 +59,11 @@ NGRAPH_TEST(onnx_editor, topological_sort_graph_not_changed_if_the_same_name_of_ const std::string rel_path_to_model = "onnx/model_editor/topological_sort/same_name_of_unsorted_node_and_initializer.onnx"; ONNXModelEditor editor{ - ngraph::file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, rel_path_to_model)}; + ov::util::path_join({CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, rel_path_to_model})}; // topological sorting is called only via Editor importing const auto ref_model = - ngraph::file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, rel_path_to_model); + ov::util::path_join({CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, rel_path_to_model}); const auto result = compare_onnx_models(editor.model_string(), ref_model); EXPECT_TRUE(result.is_ok) << result.error_message; @@ -73,11 +72,11 @@ NGRAPH_TEST(onnx_editor, topological_sort_graph_not_changed_if_the_same_name_of_ NGRAPH_TEST(onnx_editor, topological_sort_graph_not_changed_if_empty_input_name) { const std::string rel_path_to_model = "onnx/model_editor/topological_sort/empty_input_name.onnx"; ONNXModelEditor editor{ - ngraph::file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, rel_path_to_model)}; + ov::util::path_join({CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, rel_path_to_model})}; // topological sorting is called only via Editor importing const auto ref_model = - ngraph::file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, rel_path_to_model); + ov::util::path_join({CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, rel_path_to_model}); const auto result = compare_onnx_models(editor.model_string(), ref_model); EXPECT_TRUE(result.is_ok) << result.error_message; diff --git a/src/frontends/onnx/tests/onnx_ops_registration.cpp b/src/frontends/onnx/tests/onnx_ops_registration.cpp index 8a255c3c054..3cabc72d9b9 100644 --- a/src/frontends/onnx/tests/onnx_ops_registration.cpp +++ b/src/frontends/onnx/tests/onnx_ops_registration.cpp @@ -23,7 +23,7 @@ static std::string s_manifest = "${MANIFEST}"; NGRAPH_TEST(ops_registration, check_importing_abs_in_all_opset_versions) { ONNXModelEditor editor{ - ngraph::file_util::path_join(CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/abs.onnx")}; + ov::util::path_join({CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/abs.onnx"})}; for (int version = 1; version <= ONNX_OPSET_VERSION; ++version) { const auto changed_opset_model = change_opset_version(editor.model_string(), {version}); std::stringstream model_stream{changed_opset_model}; @@ -37,9 +37,8 @@ NGRAPH_TEST(ops_registration, check_importing_add_in_different_opsets) { return std::string{op->get_type_name()} == "Reshape"; }) != std::end(ops); }; - ONNXModelEditor editor{ngraph::file_util::path_join(CommonTestUtils::getExecutableDirectory(), - SERIALIZED_ZOO, - "onnx/add_v6_broadcast_dynamic.onnx")}; + ONNXModelEditor editor{ov::util::path_join( + {CommonTestUtils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/add_v6_broadcast_dynamic.onnx"})}; for (int version = 1; version <= ONNX_OPSET_VERSION; ++version) { const auto changed_opset_model = change_opset_version(editor.model_string(), {version}); std::stringstream model_stream{changed_opset_model}; diff --git a/src/frontends/onnx/tests/op_extension.cpp b/src/frontends/onnx/tests/op_extension.cpp index 2a02bdf5fdb..fcb3480ab47 100644 --- a/src/frontends/onnx/tests/op_extension.cpp +++ b/src/frontends/onnx/tests/op_extension.cpp @@ -177,6 +177,9 @@ TEST(ONNXOpExtensionViaCommonConstructor, onnx_op_extension_via_ov_type_name_wit EXPECT_NO_THROW(fe->convert(input_model)); } +OPENVINO_SUPPRESS_DEPRECATED_START +// Old API test + namespace { class OldApiNode : public InferenceEngine::IExtension { void GetVersion(const InferenceEngine::Version*& versionInfo) const noexcept override { @@ -206,3 +209,5 @@ TEST(ONNXOpExtensionViaCommonConstructor, onnx_op_extension_mixed_legacy_and_new core.add_extension(new_api_ext); EXPECT_NO_THROW(core.read_model(input_model_path)); } + +OPENVINO_SUPPRESS_DEPRECATED_END \ No newline at end of file diff --git a/src/frontends/tests/frontend/shared/src/library_extension.cpp b/src/frontends/tests/frontend/shared/src/library_extension.cpp index 23e6356028e..2dc82cda119 100644 --- a/src/frontends/tests/frontend/shared/src/library_extension.cpp +++ b/src/frontends/tests/frontend/shared/src/library_extension.cpp @@ -8,6 +8,8 @@ #include #include "common_test_utils/file_utils.hpp" +#include "openvino/op/relu.hpp" +#include "openvino/op/swish.hpp" #include "utils.hpp" using namespace ov::frontend; @@ -52,7 +54,7 @@ TEST_P(FrontendLibraryExtensionTest, verifyFunctions) { ASSERT_NE(std::find_if(nodes.begin(), nodes.end(), [](const std::shared_ptr& n) { - return ov::is_type(n); + return ov::is_type(n); }), nodes.end()); } @@ -76,13 +78,13 @@ TEST_P(FrontendLibraryExtensionTest, verifyFunctions) { ASSERT_EQ(std::find_if(nodes.begin(), nodes.end(), [](const std::shared_ptr& n) { - return ov::is_type(n); + return ov::is_type(n); }), nodes.end()); ASSERT_NE(std::find_if(nodes.begin(), nodes.end(), [](const std::shared_ptr& n) { - return ov::is_type(n); + return ov::is_type(n); }), nodes.end()); } diff --git a/src/inference/tests/functional/CMakeLists.txt b/src/inference/tests/functional/CMakeLists.txt index 5b8ff536d4f..26618a66eec 100644 --- a/src/inference/tests/functional/CMakeLists.txt +++ b/src/inference/tests/functional/CMakeLists.txt @@ -46,6 +46,7 @@ ov_add_test_target( funcTestUtils INCLUDES $/src + ${CMAKE_CURRENT_SOURCE_DIR} ADD_CLANG_FORMAT LABELS OV diff --git a/src/inference/tests/functional/legacy/ov_extension_test.cpp b/src/inference/tests/functional/legacy/ov_extension_test.cpp new file mode 100644 index 00000000000..a9b0e3060f9 --- /dev/null +++ b/src/inference/tests/functional/legacy/ov_extension_test.cpp @@ -0,0 +1,64 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "ov_extension_test.hpp" + +#include "common_test_utils/file_utils.hpp" +#include "ie_iextension.h" +#include "openvino/op/op.hpp" +#include "openvino/runtime/core.hpp" + +OPENVINO_SUPPRESS_DEPRECATED_START + +class CustomOldIdentity : public ov::op::Op { +public: + OPENVINO_OP("Identity"); + + CustomOldIdentity() = default; + CustomOldIdentity(const ov::Output& arg) : Op({arg}) { + constructor_validate_and_infer_types(); + } + + void validate_and_infer_types() override { + set_output_type(0, get_input_element_type(0), get_input_partial_shape(0)); + } + + std::shared_ptr clone_with_new_inputs(const ov::OutputVector& new_args) const override { + if (new_args.size() != 1) { + OPENVINO_THROW("Incorrect number of new arguments"); + } + + return std::make_shared(new_args.at(0)); + } + + bool visit_attributes(ov::AttributeVisitor& visitor) override { + return true; + } +}; + +class TestTileOldExtension : public InferenceEngine::IExtension { +public: + void GetVersion(const InferenceEngine::Version*& versionInfo) const noexcept override {} + + void Unload() noexcept override {} + + std::map getOpSets() override { + static std::map opsets; + if (opsets.empty()) { + ngraph::OpSet opset; + opset.insert(); + opsets["extension"] = opset; + } + return opsets; + } +}; + +TEST_F(OVExtensionTests, ReshapeIRWithOldExtension) { + OPENVINO_SUPPRESS_DEPRECATED_START + core.add_extension(std::make_shared()); + OPENVINO_SUPPRESS_DEPRECATED_END + test(); +} + +OPENVINO_SUPPRESS_DEPRECATED_END \ No newline at end of file diff --git a/src/inference/tests/functional/ov_extension_test.cpp b/src/inference/tests/functional/ov_extension_test.cpp index e02a45ae920..4dfbc5b8447 100644 --- a/src/inference/tests/functional/ov_extension_test.cpp +++ b/src/inference/tests/functional/ov_extension_test.cpp @@ -2,177 +2,15 @@ // SPDX-License-Identifier: Apache-2.0 // -#include - -#include -#include -#include -#include -#include +#include "ov_extension_test.hpp" #include "common_test_utils/file_utils.hpp" -#include "common_test_utils/test_common.hpp" -#include "ie_iextension.h" -#include "ngraph/op/op.hpp" -#include "openvino/core/except.hpp" -#include "openvino/core/op_extension.hpp" -#include "openvino/runtime/core.hpp" #include "openvino/util/file_util.hpp" using namespace testing; using namespace InferenceEngine; using namespace CommonTestUtils; -class OVExtensionTests : public TestsCommon { -public: - ov::Core core; - - void test() { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - ov::Tensor weights; - ov::PartialShape refBeforeReshape{1, 3, 22, 22}; - ov::PartialShape refAfterReshape{8, 9, 33, 66}; - - auto network = core.read_model(model, weights); - std::map newShapes; - newShapes["in_data"] = refAfterReshape; - - EXPECT_EQ(refBeforeReshape, network->output().get_partial_shape()); - EXPECT_NO_THROW(network->reshape(newShapes)); - EXPECT_EQ(refAfterReshape, network->output().get_partial_shape()); - } - - void test_two_op() { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - -)V0G0N"; - ov::Tensor weights; - ov::PartialShape refBeforeReshape{1, 3, 22, 22}; - ov::PartialShape refAfterReshape{8, 9, 33, 66}; - - auto network = core.read_model(model, weights); - std::map newShapes; - newShapes["in_data"] = refAfterReshape; - - EXPECT_EQ(refBeforeReshape, network->output().get_partial_shape()); - EXPECT_NO_THROW(network->reshape(newShapes)); - EXPECT_EQ(refAfterReshape, network->output().get_partial_shape()); - } -}; - namespace { std::string getOVExtensionPath() { @@ -199,49 +37,6 @@ std::string getRelativeOVExtensionPath() { } // namespace -class CustomOldIdentity : public ngraph::op::Op { -public: - OPENVINO_OP("Identity"); - - CustomOldIdentity() = default; - CustomOldIdentity(const ngraph::Output& arg) : Op({arg}) { - constructor_validate_and_infer_types(); - } - - void validate_and_infer_types() override { - set_output_type(0, get_input_element_type(0), get_input_partial_shape(0)); - } - - std::shared_ptr clone_with_new_inputs(const ngraph::OutputVector& new_args) const override { - if (new_args.size() != 1) { - OPENVINO_THROW("Incorrect number of new arguments"); - } - - return std::make_shared(new_args.at(0)); - } - - bool visit_attributes(ngraph::AttributeVisitor& visitor) override { - return true; - } -}; - -class TestTileOldExtension : public InferenceEngine::IExtension { -public: - void GetVersion(const InferenceEngine::Version*& versionInfo) const noexcept override {} - - void Unload() noexcept override {} - - std::map getOpSets() override { - static std::map opsets; - if (opsets.empty()) { - ngraph::OpSet opset; - opset.insert(); - opsets["extension"] = opset; - } - return opsets; - } -}; - class CustomNewIdentity : public ov::op::Op { public: OPENVINO_OP("Identity") @@ -291,12 +86,6 @@ public: }; #if defined(ENABLE_OV_IR_FRONTEND) -TEST_F(OVExtensionTests, ReshapeIRWithOldExtension) { - OPENVINO_SUPPRESS_DEPRECATED_START - core.add_extension(std::make_shared()); - OPENVINO_SUPPRESS_DEPRECATED_END - test(); -} TEST_F(OVExtensionTests, ReshapeIRWithNewExtensionsLib) { core.add_extension(getOVExtensionPath()); diff --git a/src/inference/tests/functional/ov_extension_test.hpp b/src/inference/tests/functional/ov_extension_test.hpp new file mode 100644 index 00000000000..99768c33ebe --- /dev/null +++ b/src/inference/tests/functional/ov_extension_test.hpp @@ -0,0 +1,157 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include "common_test_utils/test_common.hpp" +#include "openvino/runtime/core.hpp" + +class OVExtensionTests : public CommonTestUtils::TestsCommon { +public: + ov::Core core; + + void test() { + std::string model = R"V0G0N( + + + + + + + 1 + 3 + 22 + 22 + + + + + + + 1 + 3 + 22 + 22 + + + + + 1 + 3 + 22 + 22 + + + + + + + 1 + 3 + 22 + 22 + + + + + + + + + +)V0G0N"; + ov::Tensor weights; + ov::PartialShape refBeforeReshape{1, 3, 22, 22}; + ov::PartialShape refAfterReshape{8, 9, 33, 66}; + + auto network = core.read_model(model, weights); + std::map newShapes; + newShapes["in_data"] = refAfterReshape; + + EXPECT_EQ(refBeforeReshape, network->output().get_partial_shape()); + EXPECT_NO_THROW(network->reshape(newShapes)); + EXPECT_EQ(refAfterReshape, network->output().get_partial_shape()); + } + + void test_two_op() { + std::string model = R"V0G0N( + + + + + + + 1 + 3 + 22 + 22 + + + + + + + 1 + 3 + 22 + 22 + + + + + 1 + 3 + 22 + 22 + + + + + + + 1 + 3 + 22 + 22 + + + + + 1 + 3 + 22 + 22 + + + + + + + 1 + 3 + 22 + 22 + + + + + + + + + + +)V0G0N"; + ov::Tensor weights; + ov::PartialShape refBeforeReshape{1, 3, 22, 22}; + ov::PartialShape refAfterReshape{8, 9, 33, 66}; + + auto network = core.read_model(model, weights); + std::map newShapes; + newShapes["in_data"] = refAfterReshape; + + EXPECT_EQ(refBeforeReshape, network->output().get_partial_shape()); + EXPECT_NO_THROW(network->reshape(newShapes)); + EXPECT_EQ(refAfterReshape, network->output().get_partial_shape()); + } +}; diff --git a/src/inference/tests/unit/add_preprocessing.cpp b/src/inference/tests/unit/add_preprocessing.cpp index 5f3337cd609..5ed602cc702 100644 --- a/src/inference/tests/unit/add_preprocessing.cpp +++ b/src/inference/tests/unit/add_preprocessing.cpp @@ -12,6 +12,7 @@ #include "common_test_utils/ngraph_test_utils.hpp" #include "common_test_utils/test_common.hpp" #include "dev/preprocessing/preprocessing.hpp" +#include "openvino/op/add.hpp" #include "openvino/runtime/common.hpp" using namespace testing; diff --git a/src/inference/tests/unit/ie_extension_test.cpp b/src/inference/tests/unit/ie_extension_test.cpp index 92bfefeedda..628f13bf7ea 100644 --- a/src/inference/tests/unit/ie_extension_test.cpp +++ b/src/inference/tests/unit/ie_extension_test.cpp @@ -19,6 +19,8 @@ using ExtensionTests = ::testing::Test; #ifndef OPENVINO_STATIC_LIBRARY +OPENVINO_SUPPRESS_DEPRECATED_START + static std::string getExtensionPath() { return FileUtils::makePluginLibraryName(CommonTestUtils::getExecutableDirectory(), std::string("template_extension") + IE_BUILD_POSTFIX); @@ -55,4 +57,6 @@ TEST(ExtensionTests, testGetImplementationThrowsIfNgraphNodeIsNullPtr) { ASSERT_THROW(extension->getImplementation(std::shared_ptr(), ""), InferenceEngine::Exception); } +OPENVINO_SUPPRESS_DEPRECATED_END + #endif // OPENVINO_STATIC_LIBRARY diff --git a/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/fuse_non0_output_port.cpp b/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/fuse_non0_output_port.cpp index cfce6366f18..8c45099acd4 100644 --- a/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/fuse_non0_output_port.cpp +++ b/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/fuse_non0_output_port.cpp @@ -26,7 +26,7 @@ class FuseNon0OuputPort : public SubgraphBaseTest { params[2] = ngraph::builder::makeParams(ov::element::i32, {z_shape})[0]; // make a sub function - const auto cond = ov::opset8::Constant::create(ov::element::boolean, {1}, {true}); + const auto cond = ov::op::v0::Constant::create(ov::element::boolean, {1}, {true}); ngraph::ParameterVector sub_params(3); sub_params[0] = ngraph::builder::makeParams(ov::element::f32, {x_shape})[0]; sub_params[1] = ngraph::builder::makeParams(ov::element::i32, {y_shape})[0]; @@ -38,8 +38,8 @@ class FuseNon0OuputPort : public SubgraphBaseTest { const auto sub_model = std::make_shared(sub_results, sub_params); // loop ops - const auto trip = ov::opset8::Constant::create(ov::element::i64, {1}, {2}); - const auto loop = std::make_shared(trip, cond); + const auto trip = ov::op::v0::Constant::create(ov::element::i64, {1}, {2}); + const auto loop = std::make_shared(trip, cond); loop->set_function(sub_model); loop->set_invariant_input(sub_params[0], params[0]); loop->set_invariant_input(sub_params[1], params[1]); @@ -50,9 +50,9 @@ class FuseNon0OuputPort : public SubgraphBaseTest { const auto out2 = loop->get_iter_value(sub_results[2]->output(0), -1); // main function - const auto c = ov::opset8::Constant::create(ov::element::i32, {1}, {1}); - const auto z1 = std::make_shared(params[2], c); - const auto d = std::make_shared(out1, z1); + const auto c = ov::op::v0::Constant::create(ov::element::i32, {1}, {1}); + const auto z1 = std::make_shared(params[2], c); + const auto d = std::make_shared(out1, z1); function = std::make_shared(ov::OutputVector{d->output(0), out0, out2}, params, "FuseNon0OuputPort"); } }; diff --git a/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/fuse_transpose_reorder.cpp b/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/fuse_transpose_reorder.cpp index 07c531e1738..dd184865cb8 100644 --- a/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/fuse_transpose_reorder.cpp +++ b/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/fuse_transpose_reorder.cpp @@ -318,19 +318,19 @@ void FuseTransposeAndReorderTest4::CreateGraph() { auto memFmt = nhwc; auto inputParams = ngraph::builder::makeParams(ngPrc, {inputShape}); - const auto relu = std::make_shared(inputParams[0]); - const auto transposeOrder = ov::opset8::Constant::create(ov::element::i32, {4}, {0, 3, 1, 2}); - const auto transpose1 = std::make_shared(relu, transposeOrder); + const auto relu = std::make_shared(inputParams[0]); + const auto transposeOrder = ov::op::v0::Constant::create(ov::element::i32, {4}, {0, 3, 1, 2}); + const auto transpose1 = std::make_shared(relu, transposeOrder); const auto conv1 = ngraph::builder::makeConvolution(transpose1, ngPrc, kernel, stride, padBegin, padEnd, dilation, ngraph::op::PadType::AUTO, convOutChannels); conv1->get_rt_info() = makeCPUInfo({memFmt}, {memFmt}, {}); - const auto transpose2 = std::make_shared(relu, transposeOrder); + const auto transpose2 = std::make_shared(relu, transposeOrder); const auto conv2 = ngraph::builder::makeConvolution(transpose2, ngPrc, kernel, stride, padBegin, padEnd, dilation, ngraph::op::PadType::AUTO, convOutChannels); conv2->get_rt_info() = makeCPUInfo({memFmt}, {memFmt}, {}); - const auto add = std::make_shared(conv1, conv2); + const auto add = std::make_shared(conv1, conv2); - ov::ResultVector results{std::make_shared(add->output(0))}; + ov::ResultVector results{std::make_shared(add->output(0))}; function = std::make_shared(results, inputParams, "TransposeReorder"); } diff --git a/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/interaction.cpp b/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/interaction.cpp index 2470d1cdc3a..f1fcc4adbc0 100644 --- a/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/interaction.cpp +++ b/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/interaction.cpp @@ -54,7 +54,7 @@ static std::shared_ptr makeInteraction(const ElementType inType, cons features.push_back(sparse_feat); inputsParams.push_back(sparse_input); } - auto shapeof = std::make_shared(dense_feature); + auto shapeof = std::make_shared(dense_feature); auto gather_batch_indices = std::make_shared(element::i32, ov::Shape{1}, std::vector{0}); auto gather_batch_axis = std::make_shared(element::i32, ov::Shape{}, 0); auto gather_batch = std::make_shared(shapeof, gather_batch_indices, gather_batch_axis); diff --git a/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/reshape_inplace.cpp b/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/reshape_inplace.cpp index 4b4404857a7..4402c32374d 100644 --- a/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/reshape_inplace.cpp +++ b/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/reshape_inplace.cpp @@ -46,10 +46,10 @@ protected: targetDevice = CommonTestUtils::DEVICE_CPU; params[0] = ngraph::builder::makeParams(rtPrc, {inpShape})[0]; params[1] = ngraph::builder::makeParams(ov::element::i32, {secShape})[0]; - auto shape = std::make_shared(params[0]); + auto shape = std::make_shared(params[0]); auto c = ngraph::builder::makeConstant(rtPrc, {}, {1.0f}); - auto broadcast = std::make_shared(c, shape); - auto reshape = std::make_shared(broadcast, params[1], false); + auto broadcast = std::make_shared(c, shape); + auto reshape = std::make_shared(broadcast, params[1], false); ov::ResultVector results{std::make_shared(reshape->output(0))}; function = std::make_shared(results, params, "reshape_check"); } diff --git a/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/subgraph_with_blocked_format.cpp b/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/subgraph_with_blocked_format.cpp index 0cc49b8ae7c..43b3507271f 100644 --- a/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/subgraph_with_blocked_format.cpp +++ b/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/subgraph_with_blocked_format.cpp @@ -20,10 +20,10 @@ protected: auto weights = builder::makeConstant(type, Shape{32, 32, 1, 1}, std::vector{}, true); auto conv = std::make_shared(param, weights, Strides{1, 1}, CoordinateDiff{0, 0}, CoordinateDiff{0, 0}, Strides{1, 1}); auto mean = std::make_shared(conv, opset8::Constant::create(element::i32, Shape{2}, {2, 3}), true); - auto reshape_before = std::make_shared(mean, opset8::Constant::create(element::i32, Shape{3}, {0, 16, -1}), true); + auto reshape_before = std::make_shared(mean, opset8::Constant::create(element::i32, Shape{3}, {0, 16, -1}), true); auto mvn = std::make_shared(reshape_before, opset8::Constant::create(element::i32, Shape{1}, {2}), false, 0.1, op::MVNEpsMode::INSIDE_SQRT); - auto reshape_after = std::make_shared(mvn, std::make_shared(mean), false); + auto reshape_after = std::make_shared(mvn, std::make_shared(mean), false); auto mul = std::make_shared(reshape_after, builder::makeConstant(type, Shape{32, 1, 1}, std::vector{}, true)); auto add = std::make_shared(mul, builder::makeConstant(type, Shape{32, 1, 1}, std::vector{}, true)); auto sigmoid = std::make_shared(add); diff --git a/src/plugins/intel_cpu/tests/unit/ngraph_transformations/x64/convert_to_interaction.cpp b/src/plugins/intel_cpu/tests/unit/ngraph_transformations/x64/convert_to_interaction.cpp index b380da6dee7..b295ecf3529 100644 --- a/src/plugins/intel_cpu/tests/unit/ngraph_transformations/x64/convert_to_interaction.cpp +++ b/src/plugins/intel_cpu/tests/unit/ngraph_transformations/x64/convert_to_interaction.cpp @@ -140,12 +140,12 @@ TEST(TransformationTests, ConvertToInteractionTest1) { } //construct ref interaction { - auto dense_feature = std::make_shared(element::f32, inputShape); + auto dense_feature = std::make_shared(element::f32, inputShape); NodeVector features{dense_feature}; ParameterVector inputsParams{dense_feature}; const size_t sparse_feature_num = 26; for (size_t i = 0; i < sparse_feature_num; i++) { - auto sparse_feat = std::make_shared(element::f32, inputShape); + auto sparse_feat = std::make_shared(element::f32, inputShape); features.push_back(sparse_feat); inputsParams.push_back(sparse_feat); } @@ -175,12 +175,12 @@ TEST(TransformationTests, FuseFQtoInteractionTest1) { } //construct ref interaction { - auto dense_feature = std::make_shared(element::f32, inputShape); + auto dense_feature = std::make_shared(element::f32, inputShape); NodeVector features{dense_feature}; ParameterVector inputsParams{dense_feature}; const size_t sparse_feature_num = 26; for (size_t i = 0; i < sparse_feature_num; i++) { - auto sparse_feat = std::make_shared(element::f32, inputShape); + auto sparse_feat = std::make_shared(element::f32, inputShape); features.push_back(sparse_feat); inputsParams.push_back(sparse_feat); } @@ -210,13 +210,13 @@ TEST(TransformationTests, FuseFQtoInteractionTest2) { } //construct ref interaction { - auto dense_input = std::make_shared(element::f32, inputShape); + auto dense_input = std::make_shared(element::f32, inputShape); auto dense_feature = createFQ(dense_input); NodeVector features{dense_feature}; ParameterVector inputsParams{dense_input}; const size_t sparse_feature_num = 26; for (size_t i = 0; i < sparse_feature_num; i++) { - auto sparse_input = std::make_shared(element::f32, inputShape); + auto sparse_input = std::make_shared(element::f32, inputShape); auto sparse_feat = createFQ(sparse_input); features.push_back(sparse_feat); inputsParams.push_back(sparse_input); diff --git a/src/plugins/intel_cpu/tests/unit/snippets_transformations/fake_quantize_tokenization_test.cpp b/src/plugins/intel_cpu/tests/unit/snippets_transformations/fake_quantize_tokenization_test.cpp index d61ea9cf0d1..b55d96da449 100644 --- a/src/plugins/intel_cpu/tests/unit/snippets_transformations/fake_quantize_tokenization_test.cpp +++ b/src/plugins/intel_cpu/tests/unit/snippets_transformations/fake_quantize_tokenization_test.cpp @@ -12,7 +12,6 @@ #include "snippets/op/subgraph.hpp" #include "transformations/snippets/x64/pass/snippets_mark_skipped.hpp" #include "function_helper.hpp" - namespace ov { namespace test { namespace snippets { @@ -90,7 +89,7 @@ TEST_F(FakeQuantizeTokenizationTest, smoke_Snippets_ConvolutionWithFakeQuantize) {{}, {}, {}, {}}, true, FunctionHelper::makePrerequisitesOriginal(), - std::make_shared()); + std::make_shared()); function_ref = FakeQuantizeFunction::getOperationAndFakeQuantize( {{1, 3, 16, 16}}, @@ -98,7 +97,7 @@ TEST_F(FakeQuantizeTokenizationTest, smoke_Snippets_ConvolutionWithFakeQuantize) {{}, {}, {}, {}}, true, FunctionHelper::makePrerequisitesOriginal(), - std::make_shared()); + std::make_shared()); register_passes(); } diff --git a/src/plugins/intel_gna/legacy/tests/conv_fusion_test.cpp b/src/plugins/intel_gna/legacy/tests/conv_fusion_test.cpp index 3998d77c595..1c601ac6e9d 100644 --- a/src/plugins/intel_gna/legacy/tests/conv_fusion_test.cpp +++ b/src/plugins/intel_gna/legacy/tests/conv_fusion_test.cpp @@ -130,13 +130,13 @@ private: }; TEST_P(ConvFusionTests, CompareFunctions) { - auto unh = std::make_shared(); + auto unh = std::make_shared(); ngraph::pass::Manager manager; - manager.register_pass(unh); + manager.register_pass(unh); manager.register_pass(); manager.register_pass(); manager.register_pass(); - manager.register_pass(unh); + manager.register_pass(unh); manager.run_passes(f); ASSERT_NO_THROW(check_rt_info(f)); diff --git a/src/plugins/intel_gna/legacy/tests/convert_nms5_test.cpp b/src/plugins/intel_gna/legacy/tests/convert_nms5_test.cpp index 3b29d807977..ffe51e904c9 100644 --- a/src/plugins/intel_gna/legacy/tests/convert_nms5_test.cpp +++ b/src/plugins/intel_gna/legacy/tests/convert_nms5_test.cpp @@ -812,7 +812,7 @@ TEST_F(TransformationTestsF, ConvertNMS5ToNMSIEDynamic2TwoInputs) { true, element::i32); - auto convert_0 = std::make_shared(nms->output(0), element::i64); + auto convert_0 = std::make_shared(nms->output(0), element::i64); function_ref = std::make_shared(NodeVector{convert_0}, ParameterVector{boxes, scores}); } diff --git a/src/plugins/intel_gna/legacy/tests/convert_topk_test.cpp b/src/plugins/intel_gna/legacy/tests/convert_topk_test.cpp index c29839a5c31..52717633bd9 100644 --- a/src/plugins/intel_gna/legacy/tests/convert_topk_test.cpp +++ b/src/plugins/intel_gna/legacy/tests/convert_topk_test.cpp @@ -30,7 +30,7 @@ TEST_F(TransformationTestsF, ConvertTopKToTopKIEStatic) { std::make_shared(ngraph::OutputVector{topk->output(0)}, ngraph::ParameterVector{input}); manager.register_pass(); - manager.register_pass([](std::shared_ptr f) { + manager.register_pass([](std::shared_ptr f) { check_rt_info(f); }); manager.register_pass(); diff --git a/src/plugins/intel_gna/legacy/tests/fc_bias_fusion_test.cpp b/src/plugins/intel_gna/legacy/tests/fc_bias_fusion_test.cpp index 0cee4adae80..d785a372c1f 100644 --- a/src/plugins/intel_gna/legacy/tests/fc_bias_fusion_test.cpp +++ b/src/plugins/intel_gna/legacy/tests/fc_bias_fusion_test.cpp @@ -36,7 +36,7 @@ TEST_F(TransformationTestsF, FullyConnectedBiasFusionTest3D) { function = std::make_shared(ngraph::NodeVector{add}, ngraph::ParameterVector{input1}); manager.register_pass(); - manager.register_pass([](std::shared_ptr f) { + manager.register_pass([](std::shared_ptr f) { check_rt_info(f); }); manager.register_pass(); @@ -64,7 +64,7 @@ TEST_F(TransformationTestsF, FullyConnectedBiasFusionTest2D) { function = std::make_shared(ngraph::NodeVector{add}, ngraph::ParameterVector{input1}); manager.register_pass(); - manager.register_pass([](std::shared_ptr f) { + manager.register_pass([](std::shared_ptr f) { check_rt_info(f); }); manager.register_pass(); @@ -94,7 +94,7 @@ TEST_F(TransformationTestsF, FullyConnectedBiasFusionTestBias1x1) { function = std::make_shared(ngraph::NodeVector{add}, ngraph::ParameterVector{input1}); manager.register_pass(); - manager.register_pass([](std::shared_ptr function) { + manager.register_pass([](std::shared_ptr function) { check_rt_info(function); }); manager.register_pass(); diff --git a/src/plugins/intel_gna/legacy/tests/mul_add_conversion_test.cpp b/src/plugins/intel_gna/legacy/tests/mul_add_conversion_test.cpp index c1b935bce2a..cc1d6bf1e60 100644 --- a/src/plugins/intel_gna/legacy/tests/mul_add_conversion_test.cpp +++ b/src/plugins/intel_gna/legacy/tests/mul_add_conversion_test.cpp @@ -145,14 +145,14 @@ public: class MulOrAddConversionTests : public MulAddConversionTests {}; TEST_P(MulAddConversionTests, CompareFunctions) { - auto unh = std::make_shared(); + auto unh = std::make_shared(); ngraph::pass::Manager manager; - manager.register_pass(unh); + manager.register_pass(unh); manager.register_pass(); manager.register_pass(); - manager.register_pass(unh); - manager.register_pass([](std::shared_ptr f) { + manager.register_pass(unh); + manager.register_pass([](std::shared_ptr f) { check_rt_info(f); }); manager.register_pass(); @@ -166,14 +166,14 @@ TEST_P(MulAddConversionTests, CompareFunctions) { } TEST_P(MulOrAddConversionTests, CompareFunctions) { - auto unh = std::make_shared(); + auto unh = std::make_shared(); ngraph::pass::Manager manager; - manager.register_pass(unh); + manager.register_pass(unh); manager.register_pass(); manager.register_pass(); - manager.register_pass(unh); - manager.register_pass([](std::shared_ptr f) { + manager.register_pass(unh); + manager.register_pass([](std::shared_ptr f) { check_rt_info(f); }); manager.register_pass(); diff --git a/src/plugins/intel_gna/legacy/tests/reshape_fc_fusion_test.cpp b/src/plugins/intel_gna/legacy/tests/reshape_fc_fusion_test.cpp index 873516890f8..1b4df7b7232 100644 --- a/src/plugins/intel_gna/legacy/tests/reshape_fc_fusion_test.cpp +++ b/src/plugins/intel_gna/legacy/tests/reshape_fc_fusion_test.cpp @@ -35,12 +35,12 @@ TEST(TransformationTests, ReshapeFCFusiuonTest1) { f = std::make_shared(ngraph::NodeVector{fc}, ngraph::ParameterVector{}); - auto unh = std::make_shared(); + auto unh = std::make_shared(); ngraph::pass::Manager m; - m.register_pass(unh); + m.register_pass(unh); m.register_pass(); m.register_pass(); - m.register_pass(unh); + m.register_pass(unh); m.run_passes(f); ASSERT_NO_THROW(check_rt_info(f)); } @@ -59,12 +59,12 @@ TEST(TransformationTests, ReshapeFCFusiuonTest2) { auto fc = std::make_shared(reshape, fc_weights, fc_biases, ngraph::Shape{1, 6}); f = std::make_shared(ngraph::NodeVector{fc}, ngraph::ParameterVector{}); - auto unh = std::make_shared(); + auto unh = std::make_shared(); ngraph::pass::Manager m; - m.register_pass(unh); + m.register_pass(unh); m.register_pass(); m.register_pass(); - m.register_pass(unh); + m.register_pass(unh); m.run_passes(f); ASSERT_NO_THROW(check_rt_info(f)); } @@ -83,12 +83,12 @@ TEST(TransformationTests, ReshapeFCFusiuonTest3) { auto fc = std::make_shared(reshape, fc_weights, fc_biases, ngraph::Shape{2, 6}); f = std::make_shared(ngraph::NodeVector{fc}, ngraph::ParameterVector{}); - auto unh = std::make_shared(); + auto unh = std::make_shared(); ngraph::pass::Manager m; - m.register_pass(unh); + m.register_pass(unh); m.register_pass(); m.register_pass(); - m.register_pass(unh); + m.register_pass(unh); m.run_passes(f); ASSERT_NO_THROW(check_rt_info(f)); } @@ -105,12 +105,12 @@ TEST(TransformationTests, ReshapeFCFusiuonDynamic) { auto fc = std::make_shared(reshape, fc_weights, fc_biases, ngraph::Shape{1, 6}); auto f = std::make_shared(ngraph::NodeVector{fc}, ngraph::ParameterVector{}); - auto unh = std::make_shared(); + auto unh = std::make_shared(); ngraph::pass::Manager m; - m.register_pass(unh); + m.register_pass(unh); m.register_pass(); m.register_pass(); - m.register_pass(unh); + m.register_pass(unh); m.run_passes(f); ASSERT_NO_THROW(check_rt_info(f)); } diff --git a/src/plugins/intel_gna/tests/deprecated/helpers/tests_file_utils.cpp b/src/plugins/intel_gna/tests/deprecated/helpers/tests_file_utils.cpp index 77feb7acb9b..a0f9f9475ec 100644 --- a/src/plugins/intel_gna/tests/deprecated/helpers/tests_file_utils.cpp +++ b/src/plugins/intel_gna/tests/deprecated/helpers/tests_file_utils.cpp @@ -27,10 +27,10 @@ using namespace std; void FileUtils::readAllFile(const std::string &file_name, void *buffer, size_t maxSize) { std::ifstream inputFile; inputFile.open(file_name, std::ios::binary | std::ios::in); - if (!inputFile.is_open()) IE_THROW() << "cannot open file " << file_name; + if (!inputFile.is_open()) OPENVINO_THROW("cannot open file ", file_name); if (!inputFile.read(static_cast (buffer), maxSize)) { inputFile.close(); - IE_THROW() << "cannot read " << maxSize << " bytes from file " << file_name; + OPENVINO_THROW("cannot read ", maxSize, " bytes from file ", file_name); } inputFile.close(); diff --git a/src/plugins/intel_gna/tests/deprecated/unit/inference_engine_tests/cnn_ngraph_impl_tests.cpp b/src/plugins/intel_gna/tests/deprecated/unit/inference_engine_tests/cnn_ngraph_impl_tests.cpp index af9e974c824..2c9ae02ea8d 100644 --- a/src/plugins/intel_gna/tests/deprecated/unit/inference_engine_tests/cnn_ngraph_impl_tests.cpp +++ b/src/plugins/intel_gna/tests/deprecated/unit/inference_engine_tests/cnn_ngraph_impl_tests.cpp @@ -35,11 +35,11 @@ #include #include "cnn_network_ngraph_impl.hpp" +#include "cnnlayer_utils.hpp" #include "common_test_utils/common_utils.hpp" #include "common_test_utils/file_utils.hpp" #include "ie_precision.hpp" #include "transformations/rt_info/primitives_priority_attribute.hpp" -#include "cnnlayer_utils.hpp" using namespace testing; using namespace InferenceEngine; @@ -763,11 +763,11 @@ TEST(CNNNGraphImplTests, ReadMeanImageFromCNNNetReader) { auto f = network.getFunction(); std::shared_ptr f_ref; - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 22, 22}); + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 22, 22}); { - auto mean_image = ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 22, 22}, {1}); - auto sub = std::make_shared(data, mean_image); - auto relu = std::make_shared(sub); + auto mean_image = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 22, 22}, {1}); + auto sub = std::make_shared(data, mean_image); + auto relu = std::make_shared(sub); f_ref = std::make_shared(ngraph::NodeVector{relu}, ngraph::ParameterVector{data}); } @@ -846,11 +846,10 @@ TEST(CNNNGraphImplTests, ReadMeanValueFromCNNNetReader) { std::shared_ptr f_ref; { - auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 22, 22}); - auto mean_image = - ngraph::opset1::Constant::create(ngraph::element::f32, ngraph::Shape{3, 1, 1}, {1.1, 2.2, 3.3}); - auto sub = std::make_shared(data, mean_image); - auto relu = std::make_shared(sub); + auto data = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 3, 22, 22}); + auto mean_image = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{3, 1, 1}, {1.1, 2.2, 3.3}); + auto sub = std::make_shared(data, mean_image); + auto relu = std::make_shared(sub); f_ref = std::make_shared(ngraph::NodeVector{relu}, ngraph::ParameterVector{data}); } @@ -1988,38 +1987,38 @@ TEST(CNNNGraphImplTests, CheckNonUniqueNewResultName) { TEST(CNNNGraphImplTests, RemoveLoopDanglingParametersIfConcatEmptyTensor) { CNNNetwork network; - auto trip_count = std::make_shared(ov::element::i64, ov::Shape{}, 10); - auto condition = std::make_shared(ov::element::boolean, ov::Shape{}, true); + auto trip_count = std::make_shared(ov::element::i64, ov::Shape{}, 10); + auto condition = std::make_shared(ov::element::boolean, ov::Shape{}, true); - auto a = std::make_shared(ov::element::f32, ov::Shape{2, 2}); - auto ai = std::make_shared(ov::element::f32, ov::Shape{2, 2}); - auto b = std::make_shared(ov::element::f32, ov::Shape{2}); + auto a = std::make_shared(ov::element::f32, ov::Shape{2, 2}); + auto ai = std::make_shared(ov::element::f32, ov::Shape{2, 2}); + auto b = std::make_shared(ov::element::f32, ov::Shape{2}); auto b_broadcast = - std::make_shared(b, ov::opset8::Constant::create(ngraph::element::i64, {2}, {0, 2})); - auto bi = std::make_shared(ov::element::f32, ov::Shape{0, 2}); + std::make_shared(b, ov::op::v0::Constant::create(ngraph::element::i64, {2}, {0, 2})); + auto bi = std::make_shared(ov::element::f32, ov::Shape{0, 2}); { - auto concat = std::make_shared(ov::NodeVector{ai, bi}, 0); + auto concat = std::make_shared(ov::NodeVector{ai, bi}, 0); auto body = std::make_shared(ov::OutputVector{condition, concat}, ov::ParameterVector{ai, bi}); - auto loop = std::make_shared(trip_count, condition); + auto loop = std::make_shared(trip_count, condition); loop->set_special_body_ports({-1, 0}); loop->set_function(body); loop->set_invariant_input(ai, a); loop->set_invariant_input(bi, b_broadcast); - auto loop_res = std::make_shared(loop->get_iter_value(concat)); + auto loop_res = std::make_shared(loop->get_iter_value(concat)); auto model = std::make_shared(ov::OutputVector{loop_res}, ov::ParameterVector{a, b}); network = CNNNetwork(model); } { - auto concat = std::make_shared(ov::NodeVector{ai}, 0); + auto concat = std::make_shared(ov::NodeVector{ai}, 0); auto body = std::make_shared(ov::OutputVector{condition, concat}, ov::ParameterVector{ai}); - auto loop = std::make_shared(trip_count, condition); + auto loop = std::make_shared(trip_count, condition); loop->set_special_body_ports({-1, 0}); loop->set_function(body); loop->set_invariant_input(ai, a); - auto loop_res = std::make_shared(loop->get_iter_value(concat)); + auto loop_res = std::make_shared(loop->get_iter_value(concat)); auto model_ref = std::make_shared(ov::OutputVector{loop_res}, ov::ParameterVector{a, b}); const auto fc = FunctionsComparator::with_default() diff --git a/src/plugins/template/tests/functional/subgraph_reference/preprocess.cpp b/src/plugins/template/tests/functional/subgraph_reference/preprocess.cpp index 7a28d910d62..0b58dc517d8 100644 --- a/src/plugins/template/tests/functional/subgraph_reference/preprocess.cpp +++ b/src/plugins/template/tests/functional/subgraph_reference/preprocess.cpp @@ -836,11 +836,11 @@ static RefPreprocessParams set_shape_custom_crop() { p.input().preprocess().custom([](const Output& node) { // Add custom crop to model's dimensions using 'Slice' operation // Middle part 2x2x2x2 of original user's 4x4x4x4 input tensor will be extracted - auto start = opset8::Constant::create(element::i32, {4}, {1, 1, 1, 1}); - auto stop = opset8::Constant::create(element::i32, {4}, {3, 3, 3, 3}); - auto step = opset8::Constant::create(element::i32, {4}, {1, 1, 1, 1}); - auto axis = opset8::Constant::create(element::i32, {4}, {0, 1, 2, 3}); - auto slice = std::make_shared(node, start, stop, step, axis); + auto start = ov::op::v0::Constant::create(element::i32, {4}, {1, 1, 1, 1}); + auto stop = ov::op::v0::Constant::create(element::i32, {4}, {3, 3, 3, 3}); + auto step = ov::op::v0::Constant::create(element::i32, {4}, {1, 1, 1, 1}); + auto axis = ov::op::v0::Constant::create(element::i32, {4}, {0, 1, 2, 3}); + auto slice = std::make_shared(node, start, stop, step, axis); return slice; }); p.build(); diff --git a/src/tests/functional/plugin/conformance/subgraphs_dumper/src/matchers/convolutions.cpp b/src/tests/functional/plugin/conformance/subgraphs_dumper/src/matchers/convolutions.cpp index 772726c9257..b00cce93542 100644 --- a/src/tests/functional/plugin/conformance/subgraphs_dumper/src/matchers/convolutions.cpp +++ b/src/tests/functional/plugin/conformance/subgraphs_dumper/src/matchers/convolutions.cpp @@ -4,6 +4,9 @@ #include "matchers/convolutions.hpp" +#include "openvino/op/convolution.hpp" +#include "openvino/op/group_conv.hpp" + using namespace SubgraphsDumper; ConvolutionsMatcher::ConvolutionsMatcher() { default_configs = { diff --git a/src/tests/functional/plugin/conformance/subgraphs_dumper/src/matchers/single_op.cpp b/src/tests/functional/plugin/conformance/subgraphs_dumper/src/matchers/single_op.cpp index 0c079a661f7..8f9f98895a2 100644 --- a/src/tests/functional/plugin/conformance/subgraphs_dumper/src/matchers/single_op.cpp +++ b/src/tests/functional/plugin/conformance/subgraphs_dumper/src/matchers/single_op.cpp @@ -181,7 +181,7 @@ bool SingleOpMatcher::match(const std::shared_ptr &node, SingleOpMatcher::SingleOpMatcher() { default_configs = { std::make_shared>(std::vector{}, std::vector{0}), - std::make_shared>(std::vector{}, + std::make_shared>(std::vector{}, std::vector{0, 1, 2, 3, 4}), std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 3, 10, 10})); - const auto weights = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 3, 3, 3}), 1); + const auto param = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 3, 10, 10})); + const auto weights = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 3, 3, 3}), 1); const auto op1 = std::make_shared(param, weights, ov::Strides(0, 0), ov::CoordinateDiff(0, 0), ov::CoordinateDiff(0, 0), ov::Strides(0, 0)); - const auto param2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 5, 20, 20})); - const auto weights2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 5, 3, 3}), 1); + const auto param2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 5, 20, 20})); + const auto weights2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 5, 3, 3}), 1); const auto op2 = std::make_shared(param2, weights2, ov::Strides(0, 0), ov::CoordinateDiff(0, 0), ov::CoordinateDiff(0, 0), ov::Strides(0, 0)); ASSERT_TRUE(matcher.match(op1, op2, op_info)); @@ -35,13 +35,13 @@ TEST_F(ConvolutionMatcherTest, ConvsSameKernelSize) { // Check that two convolutions with different input ov::Shapes but same kernel size are match each other TEST_F(ConvolutionMatcherTest, ConvsDifferentKernelSize) { - const auto param = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 3, 10, 10})); - const auto weights = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 3, 3, 5}), 1); + const auto param = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 3, 10, 10})); + const auto weights = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 3, 3, 5}), 1); const auto op1 = std::make_shared(param, weights, ov::Strides(0, 0), ov::CoordinateDiff(0, 0), ov::CoordinateDiff(0, 0), ov::Strides(0, 0)); - const auto param2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 5, 20, 20})); - const auto weights2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 5, 3, 3}), 1); + const auto param2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 5, 20, 20})); + const auto weights2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 5, 3, 3}), 1); const auto op2 = std::make_shared(param2, weights2, ov::Strides(0, 0), ov::CoordinateDiff(0, 0), ov::CoordinateDiff(0, 0), ov::Strides(0, 0)); ASSERT_FALSE(matcher.match(op1, op2, op_info)); @@ -49,13 +49,13 @@ TEST_F(ConvolutionMatcherTest, ConvsDifferentKernelSize) { // Check that two group convolutions with different input ov::Shapes but same kernel size are match each other TEST_F(ConvolutionMatcherTest, GroupConvsSameKernelSize) { - const auto param = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 4, 10, 10})); - const auto weights = std::make_shared(ov::element::Type_t::f32, ov::Shape({2, 10, 2, 3, 3}), 1); + const auto param = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 4, 10, 10})); + const auto weights = std::make_shared(ov::element::Type_t::f32, ov::Shape({2, 10, 2, 3, 3}), 1); const auto op1 = std::make_shared(param, weights, ov::Strides(0, 0), ov::CoordinateDiff(0, 0), ov::CoordinateDiff(0, 0), ov::Strides(0, 0)); - const auto param2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 6, 20, 20})); - const auto weights2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({2, 10, 3, 3, 3}), 1); + const auto param2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 6, 20, 20})); + const auto weights2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({2, 10, 3, 3, 3}), 1); const auto op2 = std::make_shared(param2, weights2, ov::Strides(0, 0), ov::CoordinateDiff(0, 0), ov::CoordinateDiff(0, 0), ov::Strides(0, 0)); ASSERT_TRUE(matcher.match(op1, op2, op_info)); @@ -63,13 +63,13 @@ TEST_F(ConvolutionMatcherTest, GroupConvsSameKernelSize) { // Check that two group convolutions with different input ov::Shapes but same kernel size are match each other TEST_F(ConvolutionMatcherTest, GroupConvsDifferentKernelSize) { - const auto param = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 4, 10, 10})); - const auto weights = std::make_shared(ov::element::Type_t::f32, ov::Shape({2, 10, 2, 3, 5}), 1); + const auto param = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 4, 10, 10})); + const auto weights = std::make_shared(ov::element::Type_t::f32, ov::Shape({2, 10, 2, 3, 5}), 1); const auto op1 = std::make_shared(param, weights, ov::Strides(0, 0), ov::CoordinateDiff(0, 0), ov::CoordinateDiff(0, 0), ov::Strides(0, 0)); - const auto param2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 6, 20, 20})); - const auto weights2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({2, 10, 3, 3, 3}), 1); + const auto param2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 6, 20, 20})); + const auto weights2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({2, 10, 3, 3, 3}), 1); const auto op2 = std::make_shared(param2, weights2, ov::Strides(0, 0), ov::CoordinateDiff(0, 0), ov::CoordinateDiff(0, 0), ov::Strides(0, 0)); ASSERT_FALSE(matcher.match(op1, op2, op_info)); diff --git a/src/tests/functional/plugin/conformance/subgraphs_dumper/tests/matchers/generic_single_op.cpp b/src/tests/functional/plugin/conformance/subgraphs_dumper/tests/matchers/generic_single_op.cpp index ef094031193..0fb9edda85e 100644 --- a/src/tests/functional/plugin/conformance/subgraphs_dumper/tests/matchers/generic_single_op.cpp +++ b/src/tests/functional/plugin/conformance/subgraphs_dumper/tests/matchers/generic_single_op.cpp @@ -21,19 +21,19 @@ protected: // Check that different values of constant nodes on port 0 (default value) are ignored in match() TEST_F(SingleOpMatcherTest, AllPortsAreConsts_IgnoreConstPortVals) { - const auto const1 = std::make_shared(ov::element::Type_t::f32, ov::Shape({5, 5}), 1); - const auto shape_pattern = std::make_shared(ov::element::Type_t::i64, ov::Shape({2}), std::vector{1, 25}); + const auto const1 = std::make_shared(ov::element::Type_t::f32, ov::Shape({5, 5}), 1); + const auto shape_pattern = std::make_shared(ov::element::Type_t::i64, ov::Shape({2}), std::vector{1, 25}); const auto op1 = std::make_shared(const1, shape_pattern, false); - const auto const2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({5, 5}), 2); + const auto const2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({5, 5}), 2); const auto op2 = std::make_shared(const2, shape_pattern, false); ASSERT_TRUE(matcher.match(op1, op2, op_info)); } // Check match of equal nodes TEST_F(SingleOpMatcherTest, AllPortsAreParams_NodesEqual) { - const auto param1 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 10})); - const auto param2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 20})); + const auto param1 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 10})); + const auto param2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 20})); const auto op1 = std::make_shared(ov::OutputVector({param1, param2}), 1); const auto op2 = std::make_shared(ov::OutputVector({param1, param2}), 1); ASSERT_TRUE(matcher.match(op1, op2, op_info)); @@ -41,48 +41,48 @@ TEST_F(SingleOpMatcherTest, AllPortsAreParams_NodesEqual) { // Check nodes doesn't match - different input ranks TEST_F(SingleOpMatcherTest, AllPortsAreParams_RanksNotEqual) { - const auto param1 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 10})); - const auto param2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 20})); + const auto param1 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 10})); + const auto param2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 20})); const auto op1 = std::make_shared(ov::OutputVector({param1, param2}), 1); - const auto param3 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 40, 10})); - const auto param4 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 40, 10})); + const auto param3 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 40, 10})); + const auto param4 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 40, 10})); const auto op2 = std::make_shared(ov::OutputVector({param3, param4}), 1); ASSERT_FALSE(matcher.match(op1, op2, op_info)); } // Check nodes doesn't match - different input element types TEST_F(SingleOpMatcherTest, AllPortsAreParams_TypesNotEqual) { - const auto param1 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 10})); - const auto param2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 20})); + const auto param1 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 10})); + const auto param2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 20})); const auto op1 = std::make_shared(ov::OutputVector({param1, param2}), 1); - const auto param3 = std::make_shared(ov::element::Type_t::f16, ov::Shape({10, 10})); - const auto param4 = std::make_shared(ov::element::Type_t::f16, ov::Shape({10, 20})); + const auto param3 = std::make_shared(ov::element::Type_t::f16, ov::Shape({10, 10})); + const auto param4 = std::make_shared(ov::element::Type_t::f16, ov::Shape({10, 20})); const auto op2 = std::make_shared(ov::OutputVector({param3, param4}), 1); ASSERT_FALSE(matcher.match(op1, op2, op_info)); } // Check nodes doesn't match - different input element types TEST_F(SingleOpMatcherTest, AllPortsAreParams_AttrsNotEqual) { - const auto param1 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 10, 10})); - const auto param2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 10, 10})); + const auto param1 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 10, 10})); + const auto param2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 10, 10})); const auto op1 = std::make_shared(ov::OutputVector({param1, param2}), 1); - const auto param3 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 10, 10})); - const auto param4 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 10, 10})); + const auto param3 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 10, 10})); + const auto param4 = std::make_shared(ov::element::Type_t::f32, ov::Shape({10, 10, 10})); const auto op2 = std::make_shared(ov::OutputVector({param3, param4}), 2); ASSERT_FALSE(matcher.match(op1, op2, op_info)); } // Check nodes Add OPs match with different constants on ports TEST_F(SingleOpMatcherTest, ChecAddOpConfiguration) { - const auto const1 = std::make_shared(ov::element::Type_t::f32, ov::Shape({5, 5}), 1); - const auto const2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({5, 5}), 2); + const auto const1 = std::make_shared(ov::element::Type_t::f32, ov::Shape({5, 5}), 1); + const auto const2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({5, 5}), 2); const auto op1 = std::make_shared(const1, const2); - const auto const3 = std::make_shared(ov::element::Type_t::f32, ov::Shape({5, 5}), 3); - const auto const4 = std::make_shared(ov::element::Type_t::f32, ov::Shape({5, 5}), 4); + const auto const3 = std::make_shared(ov::element::Type_t::f32, ov::Shape({5, 5}), 3); + const auto const4 = std::make_shared(ov::element::Type_t::f32, ov::Shape({5, 5}), 4); const auto op2 = std::make_shared(const1, const2); ASSERT_TRUE(matcher.match(op1, op2, op_info)); } 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 2078e555ed6..58894f3d857 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 @@ -525,16 +525,16 @@ TEST_P(OVCompiledModelBaseTest, loadIncorrectV10Model) { // Create simple function { - auto param1 = std::make_shared(element::Type_t::f32, ngraph::Shape({1, 3, 24, 24})); + auto param1 = std::make_shared(element::Type_t::f32, ngraph::Shape({1, 3, 24, 24})); param1->set_friendly_name("param1"); param1->output(0).get_tensor().set_names({"data1"}); - auto param2 = std::make_shared(element::Type_t::f32, ngraph::Shape({1, 3, 24, 24})); + auto param2 = std::make_shared(element::Type_t::f32, ngraph::Shape({1, 3, 24, 24})); param2->set_friendly_name("param2"); param2->output(0).get_tensor().set_names({"data2"}); - auto concat = std::make_shared(OutputVector{param1, param2}, 1); + auto concat = std::make_shared(OutputVector{param1, param2}, 1); concat->set_friendly_name("data1"); concat->output(0).get_tensor().set_names({"concat"}); - auto result = std::make_shared(concat); + auto result = std::make_shared(concat); result->set_friendly_name("result"); function = std::make_shared(ngraph::ResultVector{result}, ngraph::ParameterVector{param1, param2}); function->get_rt_info()["version"] = int64_t(10); @@ -548,16 +548,16 @@ TEST_P(OVCompiledModelBaseTest, loadIncorrectV11Model) { // Create simple function { - auto param1 = std::make_shared(element::Type_t::f32, ngraph::Shape({1, 3, 24, 24})); + auto param1 = std::make_shared(element::Type_t::f32, ngraph::Shape({1, 3, 24, 24})); param1->set_friendly_name("param1"); param1->output(0).get_tensor().set_names({"data1"}); - auto param2 = std::make_shared(element::Type_t::f32, ngraph::Shape({1, 3, 24, 24})); + auto param2 = std::make_shared(element::Type_t::f32, ngraph::Shape({1, 3, 24, 24})); param2->set_friendly_name("param2"); param2->output(0).get_tensor().set_names({"data2"}); - auto concat = std::make_shared(OutputVector{param1, param2}, 1); + auto concat = std::make_shared(OutputVector{param1, param2}, 1); concat->set_friendly_name("data1"); concat->output(0).get_tensor().set_names({"concat"}); - auto result = std::make_shared(concat); + auto result = std::make_shared(concat); result->set_friendly_name("result"); function = std::make_shared(ngraph::ResultVector{result}, ngraph::ParameterVector{param1, param2}); function->get_rt_info()["version"] = int64_t(11); diff --git a/src/tests/functional/plugin/shared/include/behavior/compiled_model/import_export.hpp b/src/tests/functional/plugin/shared/include/behavior/compiled_model/import_export.hpp index f5abef8c27d..1509314287f 100644 --- a/src/tests/functional/plugin/shared/include/behavior/compiled_model/import_export.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/compiled_model/import_export.hpp @@ -74,21 +74,21 @@ TEST_P(OVCompiledGraphImportExportTest, importExportedFunction) { // Create simple function { - auto param1 = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); + auto param1 = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); param1->set_friendly_name("param1"); param1->output(0).get_tensor().set_names({"data1"}); - auto param2 = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); + auto param2 = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); param2->set_friendly_name("param2"); param2->output(0).get_tensor().set_names({"data2"}); - auto relu = std::make_shared(param1); + 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); + auto result1 = std::make_shared(relu); result1->set_friendly_name("result1"); - auto concat = std::make_shared(OutputVector{relu, param2}, 1); + 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); + auto result2 = std::make_shared(concat); result2->set_friendly_name("result2"); function = std::make_shared(ngraph::ResultVector{result1, result2}, ngraph::ParameterVector{param1, param2}); @@ -151,10 +151,10 @@ TEST_P(OVCompiledGraphImportExportTest, importExportedFunction) { TEST_P(OVCompiledGraphImportExportTest, importExportedFunctionParameterResultOnly) { // Create a simple function { - auto param = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); + auto param = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); param->set_friendly_name("param"); param->output(0).get_tensor().set_names({"data"}); - auto result = std::make_shared(param); + auto result = std::make_shared(param); result->set_friendly_name("result"); function = std::make_shared(ngraph::ResultVector{result}, ngraph::ParameterVector{param}); @@ -187,10 +187,10 @@ TEST_P(OVCompiledGraphImportExportTest, importExportedFunctionParameterResultOnl TEST_P(OVCompiledGraphImportExportTest, importExportedFunctionConstantResultOnly) { // Create a simple function { - auto constant = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); + auto constant = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); constant->set_friendly_name("constant"); constant->output(0).get_tensor().set_names({"data"}); - auto result = std::make_shared(constant); + auto result = std::make_shared(constant); result->set_friendly_name("result"); function = std::make_shared(ngraph::ResultVector{result}, ngraph::ParameterVector{}); @@ -318,21 +318,21 @@ TEST_P(OVCompiledGraphImportExportTest, importExportedIENetwork) { // Create simple function { - auto param1 = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); + auto param1 = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); param1->set_friendly_name("param1"); param1->output(0).get_tensor().set_names({"data1"}); - auto param2 = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); + auto param2 = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); param2->set_friendly_name("param2"); param2->output(0).get_tensor().set_names({"data2"}); - auto relu = std::make_shared(param1); + 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); + auto result1 = std::make_shared(relu); result1->set_friendly_name("result1"); - auto concat = std::make_shared(OutputVector{relu, param2}, 1); + 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); + auto result2 = std::make_shared(concat); result2->set_friendly_name("result2"); function = std::make_shared(ngraph::ResultVector{result1, result2}, ngraph::ParameterVector{param1, param2}); @@ -380,10 +380,10 @@ TEST_P(OVCompiledGraphImportExportTest, importExportedIENetworkParameterResultOn // Create a simple function { - auto param = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); + auto param = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); param->set_friendly_name("param"); param->output(0).get_tensor().set_names({"data"}); - auto result = std::make_shared(param); + auto result = std::make_shared(param); result->set_friendly_name("result"); function = std::make_shared(ngraph::ResultVector{result}, ngraph::ParameterVector{param}); function->set_friendly_name("ParamResult"); @@ -418,10 +418,10 @@ TEST_P(OVCompiledGraphImportExportTest, importExportedIENetworkConstantResultOnl // Create a simple function { - auto constant = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); + auto constant = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); constant->set_friendly_name("constant"); constant->output(0).get_tensor().set_names({"data"}); - auto result = std::make_shared(constant); + auto result = std::make_shared(constant); result->set_friendly_name("result"); function = std::make_shared(ngraph::ResultVector{result}, ngraph::ParameterVector{}); @@ -459,21 +459,21 @@ TEST_P(OVCompiledGraphImportExportTest, ovImportExportedFunction) { // Create simple function { - auto param1 = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); + auto param1 = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); param1->set_friendly_name("param1"); param1->output(0).get_tensor().set_names({"data1"}); - auto param2 = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); + auto param2 = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); param2->set_friendly_name("param2"); param2->output(0).get_tensor().set_names({"data2"}); - auto relu = std::make_shared(param1); + 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); + auto result1 = std::make_shared(relu); result1->set_friendly_name("result1"); - auto concat = std::make_shared(OutputVector{relu, param2}, 1); + 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); + auto result2 = std::make_shared(concat); result2->set_friendly_name("result2"); function = std::make_shared(ngraph::ResultVector{result1, result2}, ngraph::ParameterVector{param1, param2}); 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 47948f959de..7b51819995b 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 @@ -334,13 +334,13 @@ TEST_P(ExecutableNetworkBaseTest, loadIncorrectV10Model) { // Create simple function { - auto param1 = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 3, 24, 24})); + auto param1 = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 3, 24, 24})); param1->set_friendly_name("param1"); param1->output(0).get_tensor().set_names({"data1"}); - auto relu = std::make_shared(param1); + auto relu = std::make_shared(param1); relu->set_friendly_name("data1"); relu->output(0).get_tensor().set_names({"relu"}); - auto result = std::make_shared(relu); + auto result = std::make_shared(relu); result->set_friendly_name("result"); function = std::make_shared(ov::ResultVector{result}, ov::ParameterVector{param1}); function->get_rt_info()["version"] = int64_t(10); @@ -357,13 +357,13 @@ TEST_P(ExecutableNetworkBaseTest, loadIncorrectV11Model) { // Create simple function { - auto param1 = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 3, 24, 24})); + auto param1 = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 3, 24, 24})); param1->set_friendly_name("param1"); param1->output(0).get_tensor().set_names({"data1"}); - auto relu = std::make_shared(param1); + auto relu = std::make_shared(param1); relu->set_friendly_name("data1"); relu->output(0).get_tensor().set_names({"relu"}); - auto result = std::make_shared(relu); + auto result = std::make_shared(relu); result->set_friendly_name("result"); function = std::make_shared(ov::ResultVector{result}, ov::ParameterVector{param1}); function->get_rt_info()["version"] = int64_t(11); 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 7c7fb541863..f560abbb112 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 @@ -138,10 +138,10 @@ TEST_P(OVExecGraphImportExportTest, importExportedFunctionParameterResultOnly) { // Create a simple function { - auto param = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); + auto param = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); param->set_friendly_name("param"); param->output(0).get_tensor().set_names({"data"}); - auto result = std::make_shared(param); + auto result = std::make_shared(param); result->set_friendly_name("result"); function = std::make_shared(ngraph::ResultVector{result}, ngraph::ParameterVector{param}); @@ -178,10 +178,10 @@ TEST_P(OVExecGraphImportExportTest, importExportedFunctionConstantResultOnly) { // Create a simple function { - auto constant = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); + auto constant = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); constant->set_friendly_name("constant"); constant->output(0).get_tensor().set_names({"data"}); - auto result = std::make_shared(constant); + auto result = std::make_shared(constant); result->set_friendly_name("result"); function = std::make_shared(ngraph::ResultVector{result}, ngraph::ParameterVector{}); @@ -385,10 +385,10 @@ TEST_P(OVExecGraphImportExportTest, importExportedIENetworkParameterResultOnly) // Create a simple function { - auto param = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); + auto param = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); param->set_friendly_name("param"); param->output(0).get_tensor().set_names({"data"}); - auto result = std::make_shared(param); + auto result = std::make_shared(param); result->set_friendly_name("result"); function = std::make_shared(ngraph::ResultVector{result}, ngraph::ParameterVector{param}); function->set_friendly_name("ParamResult"); @@ -427,10 +427,10 @@ TEST_P(OVExecGraphImportExportTest, importExportedIENetworkConstantResultOnly) { // Create a simple function { - auto constant = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); + auto constant = std::make_shared(elementType, ngraph::Shape({1, 3, 24, 24})); constant->set_friendly_name("constant"); constant->output(0).get_tensor().set_names({"data"}); - auto result = std::make_shared(constant); + auto result = std::make_shared(constant); result->set_friendly_name("result"); function = std::make_shared(ngraph::ResultVector{result}, ngraph::ParameterVector{}); 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 277655c1c9e..d90414a3448 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 @@ -574,16 +574,16 @@ TEST_P(OVExecutableNetworkBaseTest, loadIncorrectV10Model) { // Create simple function { - auto param1 = std::make_shared(element::Type_t::f32, ngraph::Shape({1, 3, 24, 24})); + auto param1 = std::make_shared(element::Type_t::f32, ngraph::Shape({1, 3, 24, 24})); param1->set_friendly_name("param1"); param1->output(0).get_tensor().set_names({"data1"}); - auto param2 = std::make_shared(element::Type_t::f32, ngraph::Shape({1, 3, 24, 24})); + auto param2 = std::make_shared(element::Type_t::f32, ngraph::Shape({1, 3, 24, 24})); param2->set_friendly_name("param2"); param2->output(0).get_tensor().set_names({"data2"}); - auto concat = std::make_shared(OutputVector{param1, param2}, 1); + auto concat = std::make_shared(OutputVector{param1, param2}, 1); concat->set_friendly_name("data1"); concat->output(0).get_tensor().set_names({"concat"}); - auto result = std::make_shared(concat); + auto result = std::make_shared(concat); result->set_friendly_name("result"); function = std::make_shared(ngraph::ResultVector{result}, ngraph::ParameterVector{param1, param2}); function->get_rt_info()["version"] = int64_t(10); @@ -597,16 +597,16 @@ TEST_P(OVExecutableNetworkBaseTest, loadIncorrectV11Model) { // Create simple function { - auto param1 = std::make_shared(element::Type_t::f32, ngraph::Shape({1, 3, 24, 24})); + auto param1 = std::make_shared(element::Type_t::f32, ngraph::Shape({1, 3, 24, 24})); param1->set_friendly_name("param1"); param1->output(0).get_tensor().set_names({"data1"}); - auto param2 = std::make_shared(element::Type_t::f32, ngraph::Shape({1, 3, 24, 24})); + auto param2 = std::make_shared(element::Type_t::f32, ngraph::Shape({1, 3, 24, 24})); param2->set_friendly_name("param2"); param2->output(0).get_tensor().set_names({"data2"}); - auto concat = std::make_shared(OutputVector{param1, param2}, 1); + auto concat = std::make_shared(OutputVector{param1, param2}, 1); concat->set_friendly_name("data1"); concat->output(0).get_tensor().set_names({"concat"}); - auto result = std::make_shared(concat); + auto result = std::make_shared(concat); result->set_friendly_name("result"); function = std::make_shared(ngraph::ResultVector{result}, ngraph::ParameterVector{param1, param2}); function->get_rt_info()["version"] = int64_t(11); diff --git a/src/tests/functional/plugin/shared/src/behavior/ov_infer_request/infer_correctness.cpp b/src/tests/functional/plugin/shared/src/behavior/ov_infer_request/infer_correctness.cpp index d832d94379d..cee5fbe09f6 100644 --- a/src/tests/functional/plugin/shared/src/behavior/ov_infer_request/infer_correctness.cpp +++ b/src/tests/functional/plugin/shared/src/behavior/ov_infer_request/infer_correctness.cpp @@ -11,13 +11,13 @@ namespace ov { namespace test { namespace behavior { std::shared_ptr GetDefaultGraph() { - auto input = std::make_shared(ov::element::f32, ov::Shape{1, 3, 224, 224}); + auto input = std::make_shared(ov::element::f32, ov::Shape{1, 3, 224, 224}); size_t spatialDims = 2; std::vector padBegin(spatialDims, 0), padEnd(spatialDims, 0); ngraph::Shape strides(spatialDims, 1); auto weights = ngraph::builder::makeConstant(ov::element::f32, {64, 3, 7, 7}, {}, true); - auto conv1 = std::make_shared(input, weights, strides, + auto conv1 = std::make_shared(input, weights, strides, padBegin, padEnd, strides); auto gamma = ngraph::builder::makeConstant(ov::element::f32, {64}, {}, true); @@ -27,10 +27,10 @@ std::shared_ptr GetDefaultGraph() { true); auto variance = ngraph::builder::makeConstant(ov::element::f32, {64}, {}, true); - auto batchNorm1 = std::make_shared(conv1, gamma, + auto batchNorm1 = std::make_shared(conv1, gamma, beta, mean, variance, 1e-5); - auto relu1 = std::make_shared(batchNorm1); - auto pool = std::make_shared(relu1, strides, ov::Shape{1, 1}, + auto relu1 = std::make_shared(batchNorm1); + auto pool = std::make_shared(relu1, strides, ov::Shape{1, 1}, ov::Shape{1, 1}, ov::Shape{4, 4}, true); return std::make_shared(ngraph::OutputVector{pool}, ngraph::ParameterVector{input}, diff --git a/src/tests/functional/plugin/shared/src/snippets/check_broadcast.cpp b/src/tests/functional/plugin/shared/src/snippets/check_broadcast.cpp index 3730771a1a4..4734e397942 100644 --- a/src/tests/functional/plugin/shared/src/snippets/check_broadcast.cpp +++ b/src/tests/functional/plugin/shared/src/snippets/check_broadcast.cpp @@ -19,19 +19,19 @@ public: const PartialShape& input_shape2, const ov::element::Type input_type, const ov::op::AutoBroadcastSpec broadcast) { - const auto parameter1 = std::make_shared(input_type, input_shape1); + const auto parameter1 = std::make_shared(input_type, input_shape1); parameter1->set_friendly_name("parameter1"); - const auto parameter2 = std::make_shared(input_type, input_shape2); + const auto parameter2 = std::make_shared(input_type, input_shape2); parameter2->set_friendly_name("parameter2"); - std::shared_ptr parent = std::make_shared( + std::shared_ptr parent = std::make_shared( parameter1, parameter2, broadcast); parent->set_friendly_name("multiply"); - const auto result = std::make_shared(parent); + const auto result = std::make_shared(parent); result->set_friendly_name("result"); return std::make_shared( diff --git a/src/tests/functional/shared_test_classes/src/single_layer/random_uniform.cpp b/src/tests/functional/shared_test_classes/src/single_layer/random_uniform.cpp index c60c694a814..3aae851c322 100644 --- a/src/tests/functional/shared_test_classes/src/single_layer/random_uniform.cpp +++ b/src/tests/functional/shared_test_classes/src/single_layer/random_uniform.cpp @@ -63,7 +63,7 @@ void RandomUniformLayerTest::SetUp() { std::string targetName; std::tie(output_shape, randomUniformParams, global_seed, op_seed, targetDevice) = this->GetParam(); const auto precision = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(randomUniformParams.precision); - auto out_shape_ = std::make_shared(ov::element::i64, + auto out_shape_ = std::make_shared(ov::element::i64, ov::Shape{output_shape.size()}, output_shape); diff --git a/src/tests/ie_test_utils/common_test_utils/common_utils.cpp b/src/tests/ie_test_utils/common_test_utils/common_utils.cpp index 41d4f840127..9f991f27885 100644 --- a/src/tests/ie_test_utils/common_test_utils/common_utils.cpp +++ b/src/tests/ie_test_utils/common_test_utils/common_utils.cpp @@ -3,6 +3,7 @@ // #include "common_test_utils/common_utils.hpp" +#include "openvino/core/except.hpp" #include @@ -20,7 +21,7 @@ std::ostream& operator<<(std::ostream& os, OpType type) { os << "VECTOR"; break; default: - IE_THROW() << "NOT_SUPPORTED_OP_TYPE"; + OPENVINO_THROW("NOT_SUPPORTED_OP_TYPE"); } return os; } diff --git a/src/tests/ie_test_utils/common_test_utils/common_utils.hpp b/src/tests/ie_test_utils/common_test_utils/common_utils.hpp index 2db03ad813f..115412fb99a 100644 --- a/src/tests/ie_test_utils/common_test_utils/common_utils.hpp +++ b/src/tests/ie_test_utils/common_test_utils/common_utils.hpp @@ -4,23 +4,18 @@ #pragma once -#include +#include "openvino/core/partial_shape.hpp" #include #include #include #include -#include #include #include #include #include #include -namespace InferenceEngine { -class CNNLayer; -} - namespace CommonTestUtils { enum class OpType { SCALAR, VECTOR }; @@ -45,7 +40,7 @@ inline void replaceSubstringInString(std::string& str, const std::string& from, } } -inline std::string partialShape2str(const std::vector& partialShapes) { +inline std::string partialShape2str(const std::vector& partialShapes) { std::ostringstream result; for (const auto& partialShape : partialShapes) { result << partialShape; diff --git a/src/tests/ie_test_utils/common_test_utils/data_utils.cpp b/src/tests/ie_test_utils/common_test_utils/data_utils.cpp index 7135350d1d9..798144610dc 100644 --- a/src/tests/ie_test_utils/common_test_utils/data_utils.cpp +++ b/src/tests/ie_test_utils/common_test_utils/data_utils.cpp @@ -8,11 +8,14 @@ #include #include +#include "openvino/core/deprecated.hpp" using namespace InferenceEngine::details; namespace CommonTestUtils { +OPENVINO_SUPPRESS_DEPRECATED_START + bool isDenseBlob(const InferenceEngine::Blob::Ptr& blob) { auto blk_desc = blob->getTensorDesc().getBlockingDesc(); auto dims = blk_desc.getBlockDims(); @@ -251,4 +254,6 @@ void fill_data_const(InferenceEngine::Blob::Ptr& blob, const std::vector void fill_data_const(InferenceEngine::Blob::Ptr& blob, float val) { fill_data_const(blob, std::vector {val}); } + +OPENVINO_SUPPRESS_DEPRECATED_END } // namespace CommonTestUtils diff --git a/src/tests/ie_test_utils/common_test_utils/data_utils.hpp b/src/tests/ie_test_utils/common_test_utils/data_utils.hpp index 91add1b97e8..78a29d0740e 100644 --- a/src/tests/ie_test_utils/common_test_utils/data_utils.hpp +++ b/src/tests/ie_test_utils/common_test_utils/data_utils.hpp @@ -18,6 +18,7 @@ #include namespace CommonTestUtils { +OPENVINO_SUPPRESS_DEPRECATED_START inline void fill_data(float *data, size_t size, size_t duty_ratio = 10) { for (size_t i = 0; i < size; i++) { @@ -508,4 +509,6 @@ inline ngraph::float16 ie_abs(const ngraph::float16 &val) { return ngraph::float16::from_bits(val.to_bits() & 0x7FFF); } +OPENVINO_SUPPRESS_DEPRECATED_END + } // namespace CommonTestUtils diff --git a/src/tests/ie_test_utils/common_test_utils/graph_comparator.cpp b/src/tests/ie_test_utils/common_test_utils/graph_comparator.cpp index 164b2f92a9b..7c63b94c407 100644 --- a/src/tests/ie_test_utils/common_test_utils/graph_comparator.cpp +++ b/src/tests/ie_test_utils/common_test_utils/graph_comparator.cpp @@ -5,7 +5,6 @@ #include "common_test_utils/graph_comparator.hpp" #include -#include "ie_common.h" #include #include @@ -13,9 +12,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -24,8 +20,14 @@ #include #include "common_test_utils/ov_tensor_utils.hpp" +#include "ie_common.h" #include "ngraph_functions/utils/ngraph_helpers.hpp" - +#include "openvino/op/constant.hpp" +#include "openvino/op/loop.hpp" +#include "openvino/op/result.hpp" +#include "openvino/op/tensor_iterator.hpp" +#include "openvino/op/util/op_types.hpp" +#include "openvino/op/util/sub_graph_base.hpp" namespace { inline namespace tools { @@ -33,15 +35,16 @@ bool is_type_relaxed(const std::string& type) { return type.find_first_of("TypeRelaxed") == 0; } -bool compare_type_info(const ngraph::DiscreteTypeInfo& info1, const ngraph::DiscreteTypeInfo& info2) { - if (!is_type_relaxed(info1.name) && !is_type_relaxed(info2.name) && (std::strcmp(info1.version_id, info2.version_id) != 0)) { +bool compare_type_info(const ov::DiscreteTypeInfo& info1, const ov::DiscreteTypeInfo& info2) { + if (!is_type_relaxed(info1.name) && !is_type_relaxed(info2.name) && + (std::strcmp(info1.version_id, info2.version_id) != 0)) { return false; } const std::string info1Name = - is_type_relaxed(info1.name) && (info1.parent != nullptr) ? info1.parent->name : info1.name; + is_type_relaxed(info1.name) && (info1.parent != nullptr) ? info1.parent->name : info1.name; const std::string info2Name = - is_type_relaxed(info2.name) && (info2.parent != nullptr) ? info2.parent->name : info2.name; + is_type_relaxed(info2.name) && (info2.parent != nullptr) ? info2.parent->name : info2.name; return info1Name == info2Name; } @@ -73,19 +76,19 @@ bool compare_rt_keys(const T& node1, const T& node2, std::ostream& err_log) { return true; } -bool has_more_than_1_tensor_names(const std::shared_ptr &node) { +bool has_more_than_1_tensor_names(const std::shared_ptr& node) { return node->input_value(0).get_tensor_ptr()->get_names().size() > 1; } ov::ResultVector intersect_results(const ov::ResultVector& results_1, const ov::ResultVector& results_2) { ov::ResultVector out_results(results_2.size()); for (size_t idx_1 = 0; idx_1 < results_1.size(); ++idx_1) { - const auto &names_mp_1 = results_1[idx_1]->input(0).get_tensor().get_names(); + const auto& names_mp_1 = results_1[idx_1]->input(0).get_tensor().get_names(); - for (const auto & res_2 : results_2) { - const auto &names_mp_2 = res_2->input(0).get_tensor().get_names(); + for (const auto& res_2 : results_2) { + const auto& names_mp_2 = res_2->input(0).get_tensor().get_names(); - for (const auto &element : names_mp_1) { + for (const auto& element : names_mp_1) { if (names_mp_2.count(element) > 0) { out_results[idx_1] = res_2; break; @@ -101,24 +104,24 @@ ov::ResultVector intersect_results(const ov::ResultVector& results_1, const ov:: return out_results; } -bool less_by_friendly_name(const std::shared_ptr& l, const std::shared_ptr& r) { +bool less_by_friendly_name(const std::shared_ptr& l, const std::shared_ptr& r) { const auto& l_name = l->get_friendly_name(); const auto& r_name = r->get_friendly_name(); return l_name.size() < r_name.size() || (l_name.size() == r_name.size() && l_name < r_name); } -bool less_by_parent_friendly_name(const std::shared_ptr& l, - const std::shared_ptr& r) { +bool less_by_parent_friendly_name(const std::shared_ptr& l, + const std::shared_ptr& r) { const auto& l_name = l->get_input_node_shared_ptr(0)->get_friendly_name(); const auto& r_name = r->get_input_node_shared_ptr(0)->get_friendly_name(); return l_name.size() < r_name.size() || (l_name.size() == r_name.size() && l_name < r_name); } -std::string typeInfoToStr(const ngraph::Node::type_info_t& typeInfo) { +std::string typeInfoToStr(const ov::Node::type_info_t& typeInfo) { return std::string(typeInfo.name) + "/" + std::string(typeInfo.version_id); } -std::string tensor_names(const ngraph::descriptor::Tensor& t) { +std::string tensor_names(const ov::descriptor::Tensor& t) { std::string n; const char* glue = ""; for (const auto& name : t.get_names()) { @@ -146,22 +149,23 @@ bool equal_type_and_partial_shape(const InOut1& lhs, const InOut2& rhs) { template bool equal_type_and_partial_shape_compatible(const InOut1& lhs, const InOut2& rhs) { - return lhs.get_element_type() == rhs.get_element_type() && lhs.get_partial_shape().compatible(rhs.get_partial_shape()); + return lhs.get_element_type() == rhs.get_element_type() && + lhs.get_partial_shape().compatible(rhs.get_partial_shape()); } class NodeAndInputDescription { public: using SubGraphOp = ov::op::util::SubGraphOp; using InputDescripton = SubGraphOp::InputDescription; - using InputNode = ngraph::Input; - using Parameter = ov::opset8::Parameter; + using InputNode = ov::Input; + using Parameter = ov::op::v0::Parameter; explicit NodeAndInputDescription(const InputNode& input, const Parameter* parameter, const InputDescripton* description) - : m_input(input), - m_parameter(not_null(parameter)), - m_description(not_null(description)) {} + : m_input(input), + m_parameter(not_null(parameter)), + m_description(not_null(description)) {} static bool equal_descriptions(const InputDescripton* lhs, const InputDescripton* rhs) { if (!lhs || !rhs || lhs->get_type_info() != rhs->get_type_info()) { @@ -188,7 +192,7 @@ public: bool parameter_and_input_match(size_t num_iterations) const { if (const SubGraphOp::SliceInputDescription* slice_description = - ngraph::as_type(m_description)) { + ov::as_type(m_description)) { if (m_parameter->get_element_type() != m_input.get_element_type()) { return false; } @@ -210,7 +214,7 @@ public: } for (size_t i = 0; i != param_shape.size(); ++i) { const auto expected_axis_size = - i == slice_description->m_axis ? slice_description->m_part_size * num_iterations : param_shape[i]; + i == slice_description->m_axis ? slice_description->m_part_size * num_iterations : param_shape[i]; if (input_shape[i] != expected_axis_size) { return false; } @@ -218,7 +222,8 @@ public: return true; } else if (m_description->get_type_info() == SubGraphOp::MergedInputDescription::get_type_info_static() || m_description->get_type_info() == SubGraphOp::InvariantInputDescription::get_type_info_static()) { - // If loop op has back edge it may change the parameter to dynamic. The shape will be different with the initial op + // If loop op has back edge it may change the parameter to dynamic. The shape will be different with the + // initial op return equal_type_and_partial_shape_compatible(*m_parameter, m_input); } @@ -248,15 +253,15 @@ class NodeAndOutputDescription { public: using SubGraphOp = ov::op::util::SubGraphOp; using OutputDescription = SubGraphOp::OutputDescription; - using OutputNode = ngraph::Output; - using Result = ov::opset8::Result; + using OutputNode = ov::Output; + using Result = ov::op::v0::Result; explicit NodeAndOutputDescription(const OutputNode& output, const Result* result, const OutputDescription* description) - : m_output(output), - m_result(not_null(result)), - m_description(not_null(description)) {} + : m_output(output), + m_result(not_null(result)), + m_description(not_null(description)) {} static bool equal_descriptions(const OutputDescription* lhs, const OutputDescription* rhs) { if (!lhs || !rhs || lhs->get_type_info() != rhs->get_type_info()) { @@ -283,7 +288,7 @@ public: } bool result_and_output_match(size_t num_iterations) const { - if (const auto concat_desciption = ngraph::as_type(m_description)) { + if (const auto concat_desciption = ov::as_type(m_description)) { if (m_result->output(0).get_element_type() != m_output.get_element_type()) { return false; } @@ -336,13 +341,13 @@ private: class BackEdge { public: - using Parameter = ov::opset8::Parameter; - using Result = ov::opset8::Result; + using Parameter = ov::op::v0::Parameter; + using Result = ov::op::v0::Result; using Id = uint64_t; explicit BackEdge(const Parameter* parameter, const Result* result) - : m_parameter(not_null(parameter)), - m_result(not_null(result)) {} + : m_parameter(not_null(parameter)), + m_result(not_null(result)) {} bool result_and_parameter_match() const { if (m_parameter->get_element_type() != m_result->output(0).get_element_type()) { @@ -359,9 +364,10 @@ public: if (param_rank.get_length() != result_rank.get_length()) { return false; } - for (int i=0; i < param_rank.get_length(); ++i) { + for (int i = 0; i < param_rank.get_length(); ++i) { if (param_shape[i].is_static() && param_shape[i].get_length() == 0) { - continue; // zero-dim-shape is acceptable for subgraph op param and can be not compatible with a result shape + continue; // zero-dim-shape is acceptable for subgraph op param and can be not compatible with a + // result shape } if (!param_shape[i].compatible(result_shape[i])) { return false; @@ -416,7 +422,7 @@ std::vector extract_backedges(ov::op::util::SubGraphOp* sub) { const auto& fs_results = fn_body->get_results(); for (const auto& in_desc : sub->get_input_descriptions()) { - if (const auto& merged_in_desc = ngraph::as_type_ptr(in_desc)) { + if (const auto& merged_in_desc = ov::as_type_ptr(in_desc)) { const auto parameter = fs_parameters.at(merged_in_desc->m_body_parameter_index); const auto result = fs_results.at(merged_in_desc->m_body_value_index); edges.emplace_back(parameter.get(), result.get()); @@ -443,7 +449,7 @@ bool not_valid_back_edge(const BackEdge& be) { return !be.result_and_parameter_match(); } -bool equal_body_ports(ov::opset8::Loop* lhs, ov::opset8::Loop* rhs) { +bool equal_body_ports(ov::op::v5::Loop* lhs, ov::op::v5::Loop* rhs) { if (!lhs || !rhs) { return false; } @@ -561,8 +567,8 @@ private: !std::is_permutation(begin(lhs_back_edges), end(lhs_back_edges), begin(rhs_back_edges))) { return Result::error("different SubGraph BackEdges"); } - if (auto loop_lhs = ngraph::as_type(sub_lhs)) { - auto loop_rhs = ngraph::as_type(sub_rhs); + if (auto loop_lhs = ov::as_type(sub_lhs)) { + auto loop_rhs = ov::as_type(sub_rhs); if (!equal_body_ports(loop_lhs, loop_rhs)) { return Result::error("different Special Body Ports"); } @@ -571,11 +577,10 @@ private: } static int64_t get_num_iterations(ov::op::util::SubGraphOp* sub) { - using namespace ov::opset8; - if (const auto ti = dynamic_cast(sub)) { + if (const auto ti = dynamic_cast(sub)) { return ti->get_num_iterations(); } - if (const auto l = dynamic_cast(sub)) { + if (const auto l = dynamic_cast(sub)) { return l->get_num_iterations(); } @@ -594,10 +599,9 @@ Comparator::Result compare_io(ov::op::util::SubGraphOp* sub_lhs, } } // namespace subgraph } // namespace -Comparator::Result Comparator::compare(const std::shared_ptr& f, - const std::shared_ptr& f_ref) { +Comparator::Result Comparator::compare(const std::shared_ptr& f, const std::shared_ptr& f_ref) { /* - * This function compares two nGraph functions and requires them to have exactly one output + * This function compares two ov::Model and requires them to have exactly one output * + Check nodes types * + Check number of inputs * + Check shapes @@ -621,8 +625,8 @@ Comparator::Result Comparator::compare(const std::shared_ptr& if (new_ref_results.empty()) { auto cmp = less_by_friendly_name; - // In case if Result source output has more than one name so the Result may have any of this names as a friendly - // name An in case of multiple names we sort Result operation using their parent node names + // In case if Result source output has more than one name so the Result may have any of this names as a + // friendly name An in case of multiple names we sort Result operation using their parent node names if (std::any_of(f_results.begin(), f_results.end(), has_more_than_1_tensor_names) || std::any_of(f_ref_results.begin(), f_ref_results.end(), has_more_than_1_tensor_names)) { @@ -634,8 +638,8 @@ Comparator::Result Comparator::compare(const std::shared_ptr& f_ref_results = new_ref_results; } - const auto &f_sinks = f->get_sinks(); - const auto &f_ref_sinks = f_ref->get_sinks(); + const auto& f_sinks = f->get_sinks(); + const auto& f_ref_sinks = f_ref->get_sinks(); if (f_sinks.size() != f_ref_sinks.size()) { return Result::error("Number of sinks is different: " + to_str(f_sinks.size()) + " and " + to_str(f_ref_sinks.size())); @@ -647,7 +651,7 @@ Comparator::Result Comparator::compare(const std::shared_ptr& used.insert(f_sinks[0].get()); } else { // Cast to Assign and find those that have same variable_id suffix - for (const auto &sink1 : f_sinks) { + for (const auto& sink1 : f_sinks) { auto assign1 = std::dynamic_pointer_cast(sink1); if (!assign1) { return Result::error("Sink '" + name(sink1) + @@ -655,7 +659,7 @@ Comparator::Result Comparator::compare(const std::shared_ptr& } auto name1 = assign1->get_variable_id(); std::shared_ptr found_sink2; - for (const auto &sink2 : f_ref_sinks) { + for (const auto& sink2 : f_ref_sinks) { auto assign2 = std::dynamic_pointer_cast(sink2); if (!assign2) { return Result::error("Sink '" + name(sink2) + @@ -680,9 +684,8 @@ Comparator::Result Comparator::compare(const std::shared_ptr& if (name(f_results[i]->get_input_node_shared_ptr(0)) != name(f_ref_results[i]->get_input_node_shared_ptr(0))) { return Result::error( - "Different output node names: " + name(f_results[i]->get_input_node_shared_ptr(0)) + - " and " + - name(f_ref_results[i]->get_input_node_shared_ptr(0))); + "Different output node names: " + name(f_results[i]->get_input_node_shared_ptr(0)) + " and " + + name(f_ref_results[i]->get_input_node_shared_ptr(0))); } } q.push({f_results[i].get(), f_ref_results[i].get()}); @@ -692,8 +695,8 @@ Comparator::Result Comparator::compare(const std::shared_ptr& std::stringstream errors; while (!q.empty()) { - ngraph::Node *const node1 = q.front().first; - ngraph::Node *const node2 = q.front().second; + ov::Node* const node1 = q.front().first; + ov::Node* const node2 = q.front().second; q.pop(); const auto result = compare(node1, node2, errors); @@ -715,7 +718,7 @@ Comparator::Result Comparator::compare(const std::shared_ptr& } } -Comparator::Result Comparator::compare(ngraph::Node* node1, ngraph::Node* node2, std::ostream& err_log) { +Comparator::Result Comparator::compare(ov::Node* node1, ov::Node* node2, std::ostream& err_log) { auto type_info1 = node1->get_type_info(); auto type_info2 = node2->get_type_info(); @@ -763,14 +766,14 @@ Comparator::Result Comparator::compare(ngraph::Node* node1, ngraph::Node* node2, return Result::ok("Check if any minor error was log in to err_log"); } -void Comparator::compare_inputs(ngraph::Node* node1, ngraph::Node* node2, std::ostream& err_log) { +void Comparator::compare_inputs(ov::Node* node1, ov::Node* node2, std::ostream& err_log) { for (size_t i = 0; i < node1->inputs().size(); ++i) { if (should_compare(CmpValues::CONST_VALUES)) { - using Constant = ov::opset8::Constant; + using Constant = ov::op::v0::Constant; const auto equal_value = ::attributes::detail::equal::Equal>::equal_value; - auto const1 = ngraph::as_type_ptr(node1->get_input_node_shared_ptr(i)); - auto const2 = ngraph::as_type_ptr(node2->get_input_node_shared_ptr(i)); + auto const1 = ov::as_type_ptr(node1->get_input_node_shared_ptr(i)); + auto const2 = ov::as_type_ptr(node2->get_input_node_shared_ptr(i)); if (const1 && const2 && !equal_value(const1, const2)) { err_log << "Different Constant values detected\n" << const1->get_friendly_name() << " & " << const2->get_friendly_name() << "\n" @@ -808,7 +811,7 @@ void Comparator::compare_inputs(ngraph::Node* node1, ngraph::Node* node2, std::o } } -void Comparator::compare_outputs(ngraph::Node* node1, ngraph::Node* node2, std::ostream& err_log) { +void Comparator::compare_outputs(ov::Node* node1, ov::Node* node2, std::ostream& err_log) { // Some transformations create new tensors with autogenerated names for (int i = 0; i < node1->outputs().size(); ++i) { const auto& tensor1 = node1->output(i).get_tensor(); @@ -836,17 +839,18 @@ void Comparator::compare_outputs(ngraph::Node* node1, ngraph::Node* node2, std:: if (should_compare(CmpValues::CONSUMERS_COUNT)) { if (node1->output(i).get_target_inputs().size() != node2->output(i).get_target_inputs().size()) { err_log << "Different consumers number detected\n" - << name(node1) << " Output(" << i << ") " << node1->output(i).get_target_inputs().size() << " and " - << name(node2) << " Output(" << i << ") " << node2->output(i).get_target_inputs().size() << std::endl; + << name(node1) << " Output(" << i << ") " << node1->output(i).get_target_inputs().size() + << " and " << name(node2) << " Output(" << i << ") " + << node2->output(i).get_target_inputs().size() << std::endl; } } } } -void Comparator::compare_nodes(ngraph::Node* node1, ngraph::Node* node2, std::ostream& err_log) { +void Comparator::compare_nodes(ov::Node* node1, ov::Node* node2, std::ostream& err_log) { if (should_compare(CmpValues::RUNTIME_KEYS) && !compare_rt_keys(*node1, *node2, err_log)) { err_log << "Different runtime info detected\n" + name(node1) + " and " + name(node2) + - " not equal runtime info.\n"; + " not equal runtime info.\n"; } if (should_compare(CmpValues::ATTRIBUTES)) { @@ -856,7 +860,7 @@ void Comparator::compare_nodes(ngraph::Node* node1, ngraph::Node* node2, std::os } } -void Comparator::add_nodes_inputs_to_queue(ngraph::Node* node1, ngraph::Node* node2) { +void Comparator::add_nodes_inputs_to_queue(ov::Node* node1, ov::Node* node2) { for (int i = 0; i < node1->inputs().size(); ++i) { if (!used.count(node1->input_value(i).get_node())) { q.push({node1->input_value(i).get_node(), node2->input_value(i).get_node()}); @@ -865,12 +869,12 @@ void Comparator::add_nodes_inputs_to_queue(ngraph::Node* node1, ngraph::Node* no } } -FunctionsComparator::Result FunctionsComparator::compare(const std::shared_ptr& f, - const std::shared_ptr& f_ref) const { +FunctionsComparator::Result FunctionsComparator::compare(const std::shared_ptr& f, + const std::shared_ptr& f_ref) const { return Comparator(m_comparison_flags).compare(f, f_ref); } -void check_rt_info(const std::shared_ptr& f) { +void check_rt_info(const std::shared_ptr& f) { static const std::vector attrs_to_check{"fused_names_0"}; std::ostringstream err_log; @@ -892,117 +896,115 @@ void check_rt_info(const std::shared_ptr& f) { namespace attributes { namespace detail { - void ReadAndStoreAttributes::on_adapter(const std::string& name, ngraph::ValueAccessor& adapter) { - if (auto inputs = ngraph::as_type>(&adapter)) { - insert(name, inputs->get()); - } else if (auto outputs = ngraph::as_type>(&adapter)) { - insert(name, outputs->get()); - } else if (ngraph::is_type>(&adapter)) { - // drop comparison, no more info than port indexes which will be check in - // subgraph::compare_io - } else if (auto a = ngraph::as_type>>( - &adapter)) { - const auto beg = static_cast(a->get()->get_ptr()); - const auto end = beg + a->get()->size(); - insert(name, storage::MemoryChunk{storage::MemoryChunk::Data(beg, end)}); - } else if (auto framework_node_attr = - ngraph::as_type>(&adapter)) { - insert(name, framework_node_attr->get()); - } else if (auto variable_ptr = - ngraph::as_type>>(&adapter)) { - insert(name, variable_ptr->get()); - } else if (auto shape_ptr = ngraph::as_type>(&adapter)) { - insert(name, shape_ptr->get()); - } else if (auto dim_ptr = ngraph::as_type>(&adapter)) { - insert(name, dim_ptr->get()); - } else { - m_read_result += "store attr [ ERR ]: " + name + " [drop `void` comparison which is '" + - adapter.get_type_info().name + "']"; - } +void ReadAndStoreAttributes::on_adapter(const std::string& name, ov::ValueAccessor& adapter) { + if (auto inputs = ov::as_type>(&adapter)) { + insert(name, inputs->get()); + } else if (auto outputs = ov::as_type>(&adapter)) { + insert(name, outputs->get()); + } else if (ov::is_type>(&adapter)) { + // drop comparison, no more info than port indexes which will be check in + // subgraph::compare_io + } else if (auto a = ov::as_type>>(&adapter)) { + const auto beg = static_cast(a->get()->get_ptr()); + const auto end = beg + a->get()->size(); + insert(name, storage::MemoryChunk{storage::MemoryChunk::Data(beg, end)}); + } else if (auto framework_node_attr = + ov::as_type>(&adapter)) { + insert(name, framework_node_attr->get()); + } else if (auto variable_ptr = + ov::as_type>>(&adapter)) { + insert(name, variable_ptr->get()); + } else if (auto shape_ptr = ov::as_type>(&adapter)) { + insert(name, shape_ptr->get()); + } else if (auto dim_ptr = ov::as_type>(&adapter)) { + insert(name, dim_ptr->get()); + } else { + m_read_result += "store attr [ ERR ]: " + name + " [drop `void` comparison which is '" + + adapter.get_type_info().name + "']"; } - template - void ReadAndCompareAttributes::verify(const std::string& name, const AttrValue& attr_value) { - if (should_return()) { - return; - } - m_visited_attributes.insert(name); - const auto ref_value = m_attr_ref.get(name); - if (!ref_value) { - m_cmp_result += "missing attribute name: '" + name + "'"; - return; - } - - if (!equal::Equal::equal_value(*ref_value, attr_value)) { - m_cmp_result += "mismatch in value: '" + name + "' : " + str::Get::value(*ref_value) + " vs " + - str::Get::value(attr_value); - } +} +template +void ReadAndCompareAttributes::verify(const std::string& name, const AttrValue& attr_value) { + if (should_return()) { + return; + } + m_visited_attributes.insert(name); + const auto ref_value = m_attr_ref.get(name); + if (!ref_value) { + m_cmp_result += "missing attribute name: '" + name + "'"; + return; } - void ReadAndCompareAttributes::verify_mem_buf(const std::string& name, - const std::shared_ptr& buffer) { - if (should_return()) { - return; - } - m_visited_attributes.insert(name); - const auto ref_value = m_attr_ref.get(name); - if (!ref_value) { - m_cmp_result += "missing attribute name: '" + name + "'"; - return; - } + if (!equal::Equal::equal_value(*ref_value, attr_value)) { + m_cmp_result += "mismatch in value: '" + name + "' : " + str::Get::value(*ref_value) + " vs " + + str::Get::value(attr_value); + } +} - if (buffer->size() != ref_value->size() || - std::memcmp(ref_value->data(), buffer->get_ptr(), ref_value->size()) != 0) { - m_cmp_result += "mismatch in value: '" + name + "' : look in to the mem buffer"; - return; - } +void ReadAndCompareAttributes::verify_mem_buf(const std::string& name, + const std::shared_ptr& buffer) { + if (should_return()) { + return; + } + m_visited_attributes.insert(name); + const auto ref_value = m_attr_ref.get(name); + if (!ref_value) { + m_cmp_result += "missing attribute name: '" + name + "'"; + return; } - void ReadAndCompareAttributes::verify_function(const std::string& name, ModelAccessor& adapter) { - if (should_return()) { - return; - } - m_visited_attributes.insert(name); - const auto ref_value = m_attr_ref.get>(name); - if (!ref_value) { - m_cmp_result += "missing attribute name: '" + name + "'"; - return; - } - Comparator c(m_check_flags); - const auto result = c.compare(*ref_value, adapter.get()); - if (!result.valid) { - m_cmp_result += result.message; - } + if (buffer->size() != ref_value->size() || + std::memcmp(ref_value->data(), buffer->get_ptr(), ref_value->size()) != 0) { + m_cmp_result += "mismatch in value: '" + name + "' : look in to the mem buffer"; + return; } +} - void ReadAndCompareAttributes::verify_others(const std::string& name, ngraph::ValueAccessor& adapter) { - if (auto inputs = ngraph::as_type>(&adapter)) { - verify(name, inputs->get()); - } else if (auto outputs = ngraph::as_type>(&adapter)) { - verify(name, outputs->get()); - } else if (ngraph::is_type>(&adapter)) { - // drop comparison, no more info than port indexes which will be check in - // subgraph::compare_io - } else if (auto a = ngraph::as_type>>( - &adapter)) { - verify_mem_buf(name, a->get()); - } else if (auto attrs = ngraph::as_type>(&adapter)) { - verify(name, attrs->get()); - } else if (auto variable_ptr = - ngraph::as_type>>(&adapter)) { - verify(name, variable_ptr->get()); - } else if (auto shape_ptr = ngraph::as_type>(&adapter)) { - verify(name, shape_ptr->get()); - } else if (auto dim_ptr = ngraph::as_type>(&adapter)) { - verify(name, dim_ptr->get()); - } else { - m_cmp_result += "compare attr [ ERR ]: " + name + " [drop `void` comparison which is '" + - adapter.get_type_info().name + "']"; - } +void ReadAndCompareAttributes::verify_function(const std::string& name, ModelAccessor& adapter) { + if (should_return()) { + return; } + m_visited_attributes.insert(name); + const auto ref_value = m_attr_ref.get>(name); + if (!ref_value) { + m_cmp_result += "missing attribute name: '" + name + "'"; + return; + } + Comparator c(m_check_flags); + const auto result = c.compare(*ref_value, adapter.get()); + if (!result.valid) { + m_cmp_result += result.message; + } +} + +void ReadAndCompareAttributes::verify_others(const std::string& name, ov::ValueAccessor& adapter) { + if (auto inputs = ov::as_type>(&adapter)) { + verify(name, inputs->get()); + } else if (auto outputs = ov::as_type>(&adapter)) { + verify(name, outputs->get()); + } else if (ov::is_type>(&adapter)) { + // drop comparison, no more info than port indexes which will be check in + // subgraph::compare_io + } else if (auto a = ov::as_type>>(&adapter)) { + verify_mem_buf(name, a->get()); + } else if (auto attrs = ov::as_type>(&adapter)) { + verify(name, attrs->get()); + } else if (auto variable_ptr = + ov::as_type>>(&adapter)) { + verify(name, variable_ptr->get()); + } else if (auto shape_ptr = ov::as_type>(&adapter)) { + verify(name, shape_ptr->get()); + } else if (auto dim_ptr = ov::as_type>(&adapter)) { + verify(name, dim_ptr->get()); + } else { + m_cmp_result += "compare attr [ ERR ]: " + name + " [drop `void` comparison which is '" + + adapter.get_type_info().name + "']"; + } +} } // namespace detail -Comparator::Result compare(ngraph::Node* node1, ngraph::Node* node2, Comparator::CmpValues comparition_flags) { +Comparator::Result compare(ov::Node* node1, ov::Node* node2, Comparator::CmpValues comparition_flags) { detail::CompareNodesAttributes compare_nodes_attr(comparition_flags); node1->visit_attributes(compare_nodes_attr.get_ref_reader()); node2->visit_attributes(compare_nodes_attr.get_cmp_reader()); @@ -1026,9 +1028,9 @@ AccuracyCheckResult accuracy_check(const std::shared_ptr& ref_functio std::map, ov::Tensor> ref_input_data; std::map, ov::Tensor> cur_input_data; for (size_t i = 0; i < ref_function->get_parameters().size(); i++) { - const auto &tensor = ov::test::utils::create_and_fill_tensor( - ref_function->get_parameters()[i]->get_element_type(), - ref_function->get_parameters()[i]->get_shape()); + const auto& tensor = + ov::test::utils::create_and_fill_tensor(ref_function->get_parameters()[i]->get_element_type(), + ref_function->get_parameters()[i]->get_shape()); ref_input_data[ref_function->get_parameters()[i]] = tensor; cur_input_data[cur_function->get_parameters()[i]] = tensor; } @@ -1041,10 +1043,9 @@ AccuracyCheckResult accuracy_check(const std::shared_ptr& ref_functio for (int i = 0; i < ref_outputs.size(); i++) { ov::test::utils::compare(ref_outputs[i], outputs[i], 5e-4, 1e-3); } - } - catch (const std::runtime_error &re) { + } catch (const std::runtime_error& re) { return AccuracyCheckResult{false, re.what()}; - } catch (const std::exception &ex) { + } catch (const std::exception& ex) { return AccuracyCheckResult{false, ex.what()}; } catch (...) { return AccuracyCheckResult{false, ""}; diff --git a/src/tests/ie_test_utils/common_test_utils/graph_comparator.hpp b/src/tests/ie_test_utils/common_test_utils/graph_comparator.hpp index 93f468ee88f..e11d5c9a9e2 100644 --- a/src/tests/ie_test_utils/common_test_utils/graph_comparator.hpp +++ b/src/tests/ie_test_utils/common_test_utils/graph_comparator.hpp @@ -11,10 +11,9 @@ #include "openvino/core/dimension.hpp" #include "openvino/core/except.hpp" #include "openvino/core/model.hpp" +#include "openvino/op/loop.hpp" #include "openvino/op/util/framework_node.hpp" -#include "openvino/opsets/opset8.hpp" -#include "openvino/pass/pass.hpp" -#include "openvino/pass/serialize.hpp" +#include "openvino/op/util/sub_graph_base.hpp" class FunctionsComparator { public: @@ -69,10 +68,9 @@ public: bool should_compare(CmpValues f) const noexcept { return m_comparison_flags & f; } - Result compare(const std::shared_ptr& f, const std::shared_ptr& f_ref) const; + Result compare(const std::shared_ptr& f, const std::shared_ptr& f_ref) const; - Result operator()(const std::shared_ptr& f, - const std::shared_ptr& f_ref) const { + Result operator()(const std::shared_ptr& f, const std::shared_ptr& f_ref) const { return compare(f, f_ref); } @@ -85,8 +83,8 @@ private: /// \deprecated /// \brief compare_functions is obsolete function use FunctionsComparator instead. /// -inline std::pair compare_functions(const std::shared_ptr& f, - const std::shared_ptr& f_ref, +inline std::pair compare_functions(const std::shared_ptr& f, + const std::shared_ptr& f_ref, const bool compareConstValues = false, const bool compareNames = false, const bool compareRuntimeKeys = false, @@ -114,17 +112,17 @@ inline std::pair compare_functions(const std::shared_ptr& f); +void check_rt_info(const std::shared_ptr& f); -namespace ngraph { +namespace ov { namespace pass { class InjectionPass : public ov::pass::ModelPass { public: - using injection_callback = std::function)>; + using injection_callback = std::function)>; explicit InjectionPass(injection_callback callback) : ModelPass(), m_callback(std::move(callback)) {} - bool run_on_model(const std::shared_ptr& f) override { + bool run_on_model(const std::shared_ptr& f) override { m_callback(f); return false; } @@ -155,7 +153,7 @@ public: UniqueNamesHolder() = default; - void init_names(std::shared_ptr f) { + void init_names(std::shared_ptr f) { // initialize function with unique friendly and tensor names for (auto node : f->get_ordered_ops()) { const auto& node_name = generate_friendly_name(); @@ -185,7 +183,7 @@ public: } } - void check_unique_names(std::shared_ptr f) { + void check_unique_names(std::shared_ptr f) { // Check that all tensor names and friendly names are unique names_t unique_tensor_names, unique_friendly_names; for (auto node : f->get_ordered_ops()) { @@ -197,13 +195,13 @@ public: } unique_friendly_names.insert(node->get_friendly_name()); - if (as_type_ptr(node)) + if (as_type_ptr(node)) continue; for (auto output : node->outputs()) { const auto& tensor_names = output.get_names(); if (std::any_of(tensor_names.begin(), tensor_names.end(), [&](const std::string& name) { - return unique_tensor_names.count(name); - })) { + return unique_tensor_names.count(name); + })) { std::stringstream ss; ss << "Node: " << node->get_type_info() << " with name " << node->get_friendly_name() << " "; ss << "has non unique tensor name."; @@ -230,8 +228,8 @@ public: if (m_result_friendly_names_check) { // Check that result input node names are preserved bool is_multi_output = m_result_node_names.at(r.get()).second; - const auto &ref_node_name = m_result_node_names.at(r.get()).first; - const auto &cur_node_name = r->input_value(0).get_node()->get_friendly_name(); + const auto& ref_node_name = m_result_node_names.at(r.get()).first; + const auto& cur_node_name = r->input_value(0).get_node()->get_friendly_name(); if (is_multi_output || m_soft_names_comparison) { if (cur_node_name.find(ref_node_name) == std::string::npos) { std::stringstream ss; @@ -262,7 +260,7 @@ class InitUniqueNames : public ov::pass::ModelPass { public: InitUniqueNames(UniqueNamesHolder::Ptr unh) : m_unh(unh) {} - bool run_on_model(const std::shared_ptr& f) override { + bool run_on_model(const std::shared_ptr& f) override { m_unh->init_names(f); return false; } @@ -272,32 +270,35 @@ class CheckUniqueNames : public ov::pass::ModelPass { UniqueNamesHolder::Ptr m_unh; public: - CheckUniqueNames(UniqueNamesHolder::Ptr unh, bool soft_names_comparison = false, bool result_friendly_names_check = true) : m_unh(unh) { + CheckUniqueNames(UniqueNamesHolder::Ptr unh, + bool soft_names_comparison = false, + bool result_friendly_names_check = true) + : m_unh(unh) { if (soft_names_comparison) m_unh->enable_soft_names_comparison(); if (!result_friendly_names_check) m_unh->disable_result_friendly_names_check(); } - bool run_on_model(const std::shared_ptr& f) override { + bool run_on_model(const std::shared_ptr& f) override { m_unh->check_unique_names(f); return false; } }; } // namespace pass -} // namespace ngraph +} // namespace ov class Comparator { public: using CmpValues = FunctionsComparator::CmpValues; using Result = FunctionsComparator::Result; - using ComparedNodes = std::pair; + using ComparedNodes = std::pair; explicit Comparator(CmpValues f) : m_comparison_flags(f) {} - Result compare(const std::shared_ptr& f, const std::shared_ptr& f_ref); + Result compare(const std::shared_ptr& f, const std::shared_ptr& f_ref); - Result compare(ngraph::Node* node1, ngraph::Node* node2) { + Result compare(ov::Node* node1, ov::Node* node2) { std::stringstream errors; const auto result = compare(node1, node2, errors); if (!result.valid) { @@ -311,11 +312,11 @@ public: return Comparator(m_comparison_flags); } - void compare_inputs(ngraph::Node* node1, ngraph::Node* node2, std::ostream& err_log); + void compare_inputs(ov::Node* node1, ov::Node* node2, std::ostream& err_log); - void compare_outputs(ngraph::Node* node1, ngraph::Node* node2, std::ostream& err_log); + void compare_outputs(ov::Node* node1, ov::Node* node2, std::ostream& err_log); - void compare_nodes(ngraph::Node* node1, ngraph::Node* node2, std::ostream& err_log); + void compare_nodes(ov::Node* node1, ov::Node* node2, std::ostream& err_log); private: bool should_compare(CmpValues f) const noexcept { @@ -326,15 +327,15 @@ private: /// \param err_log - will be fill by minor errors if happen /// \return only fatality error if some minor one appears it will be add to err_log /// - Result compare(ngraph::Node* node1, ngraph::Node* node2, std::ostream& err_log); + Result compare(ov::Node* node1, ov::Node* node2, std::ostream& err_log); - void add_nodes_inputs_to_queue(ngraph::Node* node1, ngraph::Node* node2); + void add_nodes_inputs_to_queue(ov::Node* node1, ov::Node* node2); //-- DATA -- CmpValues m_comparison_flags; std::queue q; - std::unordered_set used; + std::unordered_set used; }; inline namespace tools { @@ -381,7 +382,7 @@ using SubGraphOpInputDescription = std::vector>; -using SpecialBodyPorts = ov::opset8::Loop::SpecialBodyPorts; +using SpecialBodyPorts = ov::op::v5::Loop::SpecialBodyPorts; namespace storage { @@ -449,11 +450,11 @@ class Storage : private AttributeStorage, private AttributeStorage>, private AttributeStorage>, private AttributeStorage>, - private AttributeStorage>, + private AttributeStorage>, private AttributeStorage, private AttributeStorage, private AttributeStorage, - private AttributeStorage>, + private AttributeStorage>, private AttributeStorage, private AttributeStorage { public: @@ -484,25 +485,25 @@ public: storage>().get_attributes_number() + storage>().get_attributes_number() + storage>().get_attributes_number() + - storage>().get_attributes_number() + + storage>().get_attributes_number() + storage().get_attributes_number() + storage().get_attributes_number() + storage().get_attributes_number() + - storage>().get_attributes_number() + + storage>().get_attributes_number() + storage().get_attributes_number() + storage().get_attributes_number(); } }; } // namespace storage -class ReadAndStoreAttributes : public ngraph::AttributeVisitor, protected storage::Storage { +class ReadAndStoreAttributes : public ov::AttributeVisitor, protected storage::Storage { public: - void on_adapter(const std::string& name, ngraph::ValueAccessor& adapter) override; + void on_adapter(const std::string& name, ov::ValueAccessor& adapter) override; -#define ON_ADAPTER(TYPE) \ -void on_adapter(const std::string& name, ngraph::ValueAccessor& adapter) override { \ -insert(name, adapter.get()); \ -} +#define ON_ADAPTER(TYPE) \ + void on_adapter(const std::string& name, ov::ValueAccessor& adapter) override { \ + insert(name, adapter.get()); \ + } ON_ADAPTER(bool) ON_ADAPTER(std::string) @@ -527,7 +528,7 @@ insert(name, adapter.get()); ON_ADAPTER(std::vector) ON_ADAPTER(std::vector) ON_ADAPTER(std::vector) - ON_ADAPTER(std::shared_ptr) + ON_ADAPTER(std::shared_ptr) #undef ON_ADAPTER @@ -563,8 +564,8 @@ struct Equal { }; template <> -struct Equal { - static bool equal_value(ngraph::bfloat16 lhs, ngraph::bfloat16 rhs) { +struct Equal { + static bool equal_value(ov::bfloat16 lhs, ov::bfloat16 rhs) { if (lhs.to_bits() == rhs.to_bits()) { return true; } @@ -573,8 +574,8 @@ struct Equal { }; template <> -struct Equal { - static bool equal_value(ngraph::float16 lhs, ngraph::float16 rhs) { +struct Equal { + static bool equal_value(ov::float16 lhs, ov::float16 rhs) { if (lhs.to_bits() == rhs.to_bits()) { return true; } @@ -686,9 +687,9 @@ struct Equal { }; template <> -struct Equal> { - static bool equal_value(const std::shared_ptr& lhs, - const std::shared_ptr& rhs) { +struct Equal> { + static bool equal_value(const std::shared_ptr& lhs, + const std::shared_ptr& rhs) { return lhs->get_info() == rhs->get_info(); } }; @@ -719,7 +720,7 @@ struct Equal { } }; -using Constant = ov::opset8::Constant; +using Constant = ov::op::v0::Constant; template <> struct Equal> { static bool equal_value(const std::shared_ptr& lhs, const std::shared_ptr& rhs) { @@ -730,37 +731,37 @@ struct Equal> { } switch (lhs_t) { - case ngraph::element::Type_t::u1: { - const auto lhs_v = static_cast(lhs->get_data_ptr()); - const auto rhs_v = static_cast(rhs->get_data_ptr()); - const auto lhs_bit_size = shape_size(lhs->get_shape()); - const auto rhs_bit_size = shape_size(rhs->get_shape()); - return Equal::equal_value(lhs_v, rhs_v, lhs_bit_size, rhs_bit_size); - } - case ngraph::element::Type_t::bf16: { - auto lhs_v = lhs->cast_vector(); - auto rhs_v = rhs->cast_vector(); - return Equal>::equal_value(lhs_v, rhs_v); - break; - } - case ngraph::element::Type_t::f16: { - const auto& lhs_v = lhs->cast_vector(); - const auto& rhs_v = rhs->cast_vector(); - return Equal>::equal_value(lhs_v, rhs_v); - break; - } - case ngraph::element::Type_t::f32: { - const auto& lhs_v = lhs->cast_vector(); - const auto& rhs_v = rhs->cast_vector(); - return Equal>::equal_value(lhs_v, rhs_v); - break; - } - default: { - const auto& lhs_v = lhs->cast_vector(); - const auto& rhs_v = rhs->cast_vector(); - return Equal>::equal_value(lhs_v, rhs_v); - break; - } + case ov::element::Type_t::u1: { + const auto lhs_v = static_cast(lhs->get_data_ptr()); + const auto rhs_v = static_cast(rhs->get_data_ptr()); + const auto lhs_bit_size = shape_size(lhs->get_shape()); + const auto rhs_bit_size = shape_size(rhs->get_shape()); + return Equal::equal_value(lhs_v, rhs_v, lhs_bit_size, rhs_bit_size); + } + case ov::element::Type_t::bf16: { + auto lhs_v = lhs->cast_vector(); + auto rhs_v = rhs->cast_vector(); + return Equal>::equal_value(lhs_v, rhs_v); + break; + } + case ov::element::Type_t::f16: { + const auto& lhs_v = lhs->cast_vector(); + const auto& rhs_v = rhs->cast_vector(); + return Equal>::equal_value(lhs_v, rhs_v); + break; + } + case ov::element::Type_t::f32: { + const auto& lhs_v = lhs->cast_vector(); + const auto& rhs_v = rhs->cast_vector(); + return Equal>::equal_value(lhs_v, rhs_v); + break; + } + default: { + const auto& lhs_v = lhs->cast_vector(); + const auto& rhs_v = rhs->cast_vector(); + return Equal>::equal_value(lhs_v, rhs_v); + break; + } } return false; } @@ -863,8 +864,8 @@ struct Get { }; template <> -struct Get, void> { - static std::string value(const std::shared_ptr& variable) { +struct Get, void> { + static std::string value(const std::shared_ptr& variable) { std::stringstream oss; const auto variable_info = variable->get_info(); oss << "["; @@ -878,21 +879,21 @@ struct Get, void> { } // namespace str -class ReadAndCompareAttributes : public ngraph::AttributeVisitor { +class ReadAndCompareAttributes : public ov::AttributeVisitor { public: ReadAndCompareAttributes(const ReadAndStoreAttributes& ref, Comparator::CmpValues check_flags) - : m_attr_ref(ref), - m_cmp_result{ref.read_result()}, - m_check_flags(check_flags) {} + : m_attr_ref(ref), + m_cmp_result{ref.read_result()}, + m_check_flags(check_flags) {} - void on_adapter(const std::string& name, ngraph::ValueAccessor& adapter) override { + void on_adapter(const std::string& name, ov::ValueAccessor& adapter) override { verify_others(name, adapter); } -#define ON_ADAPTER(TYPE) \ -void on_adapter(const std::string& name, ngraph::ValueAccessor& adapter) override { \ -verify(name, adapter.get()); \ -} +#define ON_ADAPTER(TYPE) \ + void on_adapter(const std::string& name, ov::ValueAccessor& adapter) override { \ + verify(name, adapter.get()); \ + } ON_ADAPTER(bool) ON_ADAPTER(std::string) @@ -920,8 +921,7 @@ verify(name, adapter.get()); #undef ON_ADAPTER - void on_adapter(const std::string& name, - ngraph::ValueAccessor>& adapter) override { + void on_adapter(const std::string& name, ov::ValueAccessor>& adapter) override { verify_function(name, adapter); } @@ -947,11 +947,11 @@ private: void verify_mem_buf(const std::string& name, const std::shared_ptr& buffer); - using ModelAccessor = ngraph::ValueAccessor>; + using ModelAccessor = ov::ValueAccessor>; void verify_function(const std::string& name, ModelAccessor& adapter); - void verify_others(const std::string& name, ngraph::ValueAccessor& adapter); + void verify_others(const std::string& name, ov::ValueAccessor& adapter); //-- DATA -- const ReadAndStoreAttributes& m_attr_ref; Result m_cmp_result; @@ -997,7 +997,7 @@ private: } // namespace detail -Comparator::Result compare(ngraph::Node* node1, ngraph::Node* node2, Comparator::CmpValues comparition_flags); +Comparator::Result compare(ov::Node* node1, ov::Node* node2, Comparator::CmpValues comparition_flags); } // namespace attributes diff --git a/src/tests/ie_test_utils/common_test_utils/ngraph_test_utils.cpp b/src/tests/ie_test_utils/common_test_utils/ngraph_test_utils.cpp index 2ef5860b2d3..b2827d4ad59 100644 --- a/src/tests/ie_test_utils/common_test_utils/ngraph_test_utils.cpp +++ b/src/tests/ie_test_utils/common_test_utils/ngraph_test_utils.cpp @@ -23,19 +23,20 @@ public: } return false; } + private: // we store a reference to shared_ptr because it will be initialized later in the test body const std::shared_ptr& m_ref_model; }; -} // namespace pass -} // namespace ov +} // namespace pass +} // namespace ov TransformationTestsF::TransformationTestsF() : model(function), model_ref(function_ref), comparator(FunctionsComparator::no_default()) { - m_unh = std::make_shared(); + m_unh = std::make_shared(); comparator.enable(FunctionsComparator::CmpValues::NODES); comparator.enable(FunctionsComparator::CmpValues::PRECISIONS); comparator.enable(FunctionsComparator::CmpValues::RUNTIME_KEYS); @@ -47,7 +48,7 @@ TransformationTestsF::TransformationTestsF() } void TransformationTestsF::SetUp() { - manager.register_pass(m_unh); + manager.register_pass(m_unh); manager.register_pass(); manager.register_pass(function_ref); } @@ -58,16 +59,16 @@ void TransformationTestsF::TearDown() { std::shared_ptr cloned_function; auto acc_enabled = comparator.should_compare(FunctionsComparator::ACCURACY); if (!function_ref) { - cloned_function = ngraph::clone_function(*function); + cloned_function = function->clone(); function_ref = cloned_function; } else if (acc_enabled) { - cloned_function = ngraph::clone_function(*function); + cloned_function = function->clone(); } - manager.register_pass(m_unh, m_soft_names_comparison, m_result_friendly_names_check); + manager.register_pass(m_unh, m_soft_names_comparison, m_result_friendly_names_check); manager.run_passes(function); if (!m_disable_rt_info_check) { - ASSERT_NO_THROW(check_rt_info(function)); + ASSERT_NO_THROW(check_rt_info(function)); } if (acc_enabled) { @@ -94,18 +95,18 @@ void TransformationTestsF::disable_result_friendly_names_check() { m_result_friendly_names_check = false; } -void init_unique_names(std::shared_ptr f, const std::shared_ptr& unh) { - ngraph::pass::Manager manager; - manager.register_pass(unh); +void init_unique_names(const std::shared_ptr& f, const std::shared_ptr& unh) { + ov::pass::Manager manager; + manager.register_pass(unh); manager.run_passes(f); } -void check_unique_names(std::shared_ptr f, const std::shared_ptr& unh) { - ngraph::pass::Manager manager; - manager.register_pass(unh, true); +void check_unique_names(const std::shared_ptr& f, const std::shared_ptr& unh) { + ov::pass::Manager manager; + manager.register_pass(unh, true); manager.run_passes(f); } -std::shared_ptr create_zero_constant(const ov::element::Type_t& et, const ov::Shape& shape) { - return ov::opset8::Constant::create(et, shape, {0}); +std::shared_ptr create_zero_constant(const ov::element::Type_t& et, const ov::Shape& shape) { + return ov::op::v0::Constant::create(et, shape, {0}); } diff --git a/src/tests/ie_test_utils/common_test_utils/ngraph_test_utils.hpp b/src/tests/ie_test_utils/common_test_utils/ngraph_test_utils.hpp index 0505445ad42..951e0059c30 100644 --- a/src/tests/ie_test_utils/common_test_utils/ngraph_test_utils.hpp +++ b/src/tests/ie_test_utils/common_test_utils/ngraph_test_utils.hpp @@ -8,25 +8,19 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "test_common.hpp" - #include "graph_comparator.hpp" +#include "openvino/core/dimension.hpp" +#include "openvino/core/model.hpp" +#include "openvino/pass/manager.hpp" +#include "openvino/pass/pass.hpp" +#include "test_common.hpp" +#include "transformations/init_node_info.hpp" -#define DYN ngraph::Dimension::dynamic() +#define DYN ov::Dimension::dynamic() using TransformationTests = CommonTestUtils::TestsCommon; -class TransformationTestsF : public CommonTestUtils::TestsCommon { +class TransformationTestsF : public CommonTestUtils::TestsCommon { public: TransformationTestsF(); @@ -44,25 +38,25 @@ public: std::shared_ptr function, function_ref; // Aliases to function and function_ref pointers to be more corresponding with ov namespace. std::shared_ptr&model, &model_ref; - ngraph::pass::Manager manager; + ov::pass::Manager manager; FunctionsComparator comparator; private: - std::shared_ptr m_unh; + std::shared_ptr m_unh; bool m_disable_rt_info_check{false}; bool m_soft_names_comparison{true}; bool m_result_friendly_names_check{true}; }; -void init_unique_names(std::shared_ptr f, const std::shared_ptr& unh); +void init_unique_names(const std::shared_ptr& f, const std::shared_ptr& unh); -void check_unique_names(std::shared_ptr f, const std::shared_ptr& unh); +void check_unique_names(const std::shared_ptr& f, const std::shared_ptr& unh); template -size_t count_ops_of_type(const std::shared_ptr& f) { +size_t count_ops_of_type(const std::shared_ptr& f) { size_t count = 0; for (auto op : f->get_ops()) { - if (ngraph::is_type(op)) { + if (ov::is_type(op)) { count++; } } @@ -70,10 +64,12 @@ size_t count_ops_of_type(const std::shared_ptr& f) { return count; } -template -std::shared_ptr create_constant(const std::vector& data, const ov::element::Type_t et = ov::element::i64, bool scalar = false) { +template +std::shared_ptr create_constant(const std::vector& data, + const ov::element::Type_t et = ov::element::i64, + bool scalar = false) { ov::Shape shape = scalar ? ov::Shape{} : ov::Shape{data.size()}; - return ov::opset8::Constant::create(et, shape, data); + return ov::op::v0::Constant::create(et, shape, data); } -std::shared_ptr create_zero_constant(const ov::element::Type_t& et, const ov::Shape& shape); +std::shared_ptr create_zero_constant(const ov::element::Type_t& et, const ov::Shape& shape); diff --git a/src/tests/ie_test_utils/common_test_utils/ov_tensor_utils.cpp b/src/tests/ie_test_utils/common_test_utils/ov_tensor_utils.cpp index 4d9771cf8bf..37da4fc88ea 100644 --- a/src/tests/ie_test_utils/common_test_utils/ov_tensor_utils.cpp +++ b/src/tests/ie_test_utils/common_test_utils/ov_tensor_utils.cpp @@ -5,7 +5,6 @@ #include #include "openvino/core/type/element_type_traits.hpp" -#include "ngraph/coordinate_transform.hpp" #include "common_test_utils/data_utils.hpp" #include "common_test_utils/ov_tensor_utils.hpp" diff --git a/src/tests/ie_test_utils/common_test_utils/tests/graph_comparator_tests.cpp b/src/tests/ie_test_utils/common_test_utils/tests/graph_comparator_tests.cpp index 4e881b49f78..322c57d94e6 100644 --- a/src/tests/ie_test_utils/common_test_utils/tests/graph_comparator_tests.cpp +++ b/src/tests/ie_test_utils/common_test_utils/tests/graph_comparator_tests.cpp @@ -4,15 +4,22 @@ #include #include - +#include "openvino/op/add.hpp" +#include "openvino/op/convert.hpp" +#include "openvino/op/convolution.hpp" +#include "openvino/op/squeeze.hpp" +#include "openvino/op/unsqueeze.hpp" +#include "openvino/op/tensor_iterator.hpp" +#include "openvino/op/gru_cell.hpp" +#include "openvino/op/multiply.hpp" TEST(GraphComparatorTests, AllEnablePositiveCheck) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {1}, {0}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {1}, {0}); + auto add = std::make_shared(input, constant); function_ref = std::make_shared(ngraph::NodeVector{ add}, ngraph::ParameterVector{ input }); function = function_ref->clone(); } @@ -32,15 +39,15 @@ TEST(GraphComparatorTests, CheckbyDefault) { FunctionsComparator comparator(FunctionsComparator::with_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); - auto input2 = std::make_shared(ngraph::element::i64, ov::Shape{3}); - auto add = std::make_shared(input, input2); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); + auto input2 = std::make_shared(ngraph::element::i64, ov::Shape{3}); + auto add = std::make_shared(input, input2); function_ref = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input, input2 }); } { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {3}, {12}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {3}, {12}); + auto add = std::make_shared(input, constant); function = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); } auto res = comparator.compare(function, function_ref); @@ -51,17 +58,17 @@ TEST(GraphComparatorTests, CheckResultsNumber) { FunctionsComparator comparator(FunctionsComparator::with_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); - auto input2 = std::make_shared(ngraph::element::i64, ov::Shape{3}); - auto add = std::make_shared(input, input2); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); + auto input2 = std::make_shared(ngraph::element::i64, ov::Shape{3}); + auto add = std::make_shared(input, input2); function_ref = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input, input2 }); } { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {3}, {12}); - auto add = std::make_shared(input, constant); - auto result1 = std::make_shared(constant); - auto result2 = std::make_shared(add); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {3}, {12}); + auto add = std::make_shared(input, constant); + auto result1 = std::make_shared(constant); + auto result2 = std::make_shared(add); function = std::make_shared(ngraph::ResultVector{ result1, result2 }, ngraph::ParameterVector{ input }); } auto res = comparator.compare(function, function_ref); @@ -72,20 +79,20 @@ TEST(GraphComparatorTests, NamesCheckPositive) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); input->set_friendly_name("new_name1"); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {1}, {0}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {1}, {0}); constant->set_friendly_name("new_name2"); - auto add = std::make_shared(input, constant); + auto add = std::make_shared(input, constant); add->set_friendly_name("new_name3"); function_ref = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); } { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); input->set_friendly_name("new_name1"); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {1}, {0}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {1}, {0}); constant->set_friendly_name("new_name2"); - auto add = std::make_shared(input, constant); + auto add = std::make_shared(input, constant); add->set_friendly_name("new_name3"); function = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); } @@ -99,20 +106,20 @@ TEST(GraphComparatorTests, NamesCheckNegative) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); input->set_friendly_name("new_name1"); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {1}, {0}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {1}, {0}); constant->set_friendly_name("new_name2"); - auto add = std::make_shared(input, constant); + auto add = std::make_shared(input, constant); add->set_friendly_name("new_name3"); function_ref = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); } { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); input->set_friendly_name("new_name1"); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {1}, {0}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {1}, {0}); constant->set_friendly_name("new_name2"); - auto add = std::make_shared(input, constant); + auto add = std::make_shared(input, constant); add->set_friendly_name("new_name3_different"); function = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); } @@ -126,15 +133,15 @@ TEST(GraphComparatorTests, ConstCheckWithoutEnable) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {3}, {0}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {3}, {0}); + auto add = std::make_shared(input, constant); function_ref = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); } { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {3}, {12}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {3}, {12}); + auto add = std::make_shared(input, constant); function = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); } comparator.enable(FunctionsComparator::NODES); @@ -146,15 +153,15 @@ TEST(GraphComparatorTests, ConstCheckNegative) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {3}, {0}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {3}, {0}); + auto add = std::make_shared(input, constant); function_ref = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); } { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {3}, {12}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {3}, {12}); + auto add = std::make_shared(input, constant); function = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); } comparator.enable(FunctionsComparator::CONST_VALUES) @@ -167,9 +174,9 @@ TEST(GraphComparatorTests, TensorNamesCheckNegative) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {1}, {0}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {1}, {0}); + auto add = std::make_shared(input, constant); function_ref = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); function = function_ref->clone(); add->get_input_tensor(0).set_names({"new_name"}); @@ -184,9 +191,9 @@ TEST(GraphComparatorTests, TensorNamesCheckWithoutEnable) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {1}, {0}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {1}, {0}); + auto add = std::make_shared(input, constant); function_ref = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); function = function_ref->clone(); add->get_input_tensor(0).set_names({"new_name"}); @@ -200,12 +207,12 @@ TEST(GraphComparatorTests, CheckAttributesNegative) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ov::element::f32, ov::Shape{ 1, 3, 12, 12 }); - auto const_weights = ov::opset8::Constant::create(ov::element::f16, + auto input = std::make_shared(ov::element::f32, ov::Shape{ 1, 3, 12, 12 }); + auto const_weights = ov::op::v0::Constant::create(ov::element::f16, ov::Shape{ 1, 3, 3, 3 }, { 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9 }); - auto convert_ins1 = std::make_shared(const_weights, ov::element::f32); - auto conv = std::make_shared(input, + auto convert_ins1 = std::make_shared(const_weights, ov::element::f32); + auto conv = std::make_shared(input, convert_ins1, ov::Strides{ 1, 1 }, ov::CoordinateDiff{ 1, 1 }, @@ -214,12 +221,12 @@ TEST(GraphComparatorTests, CheckAttributesNegative) { function_ref = std::make_shared(ngraph::NodeVector{ conv }, ngraph::ParameterVector{ input }); } { - auto input = std::make_shared(ov::element::f32, ov::Shape{ 1, 3, 12, 12 }); - auto const_weights = ov::opset8::Constant::create(ov::element::f16, + auto input = std::make_shared(ov::element::f32, ov::Shape{ 1, 3, 12, 12 }); + auto const_weights = ov::op::v0::Constant::create(ov::element::f16, ov::Shape{ 1, 3, 3, 3 }, { 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9 }); - auto convert_ins1 = std::make_shared(const_weights, ov::element::f32); - auto conv = std::make_shared(input, + auto convert_ins1 = std::make_shared(const_weights, ov::element::f32); + auto conv = std::make_shared(input, convert_ins1, ov::Strides{ 1, 1 }, ov::CoordinateDiff{ 0, 0 }, @@ -237,15 +244,15 @@ TEST(GraphComparatorTests, CheckPrecisionsNegative) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {3}, {0}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {3}, {0}); + auto add = std::make_shared(input, constant); function_ref = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); } { - auto input = std::make_shared(ngraph::element::f32, ov::Shape{3}); - auto constant = ov::opset8::Constant::create(ngraph::element::f32, {3}, {0}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::f32, ov::Shape{3}); + auto constant = ov::op::v0::Constant::create(ngraph::element::f32, {3}, {0}); + auto add = std::make_shared(input, constant); function = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); } comparator.enable(FunctionsComparator::PRECISIONS) @@ -258,15 +265,15 @@ TEST(GraphComparatorTests, CheckPrecisionsWithoutEnable) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {3}, {0}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {3}, {0}); + auto add = std::make_shared(input, constant); function_ref = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); } { - auto input = std::make_shared(ngraph::element::f32, ov::Shape{3}); - auto constant = ov::opset8::Constant::create(ngraph::element::f32, {3}, {0}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::f32, ov::Shape{3}); + auto constant = ov::op::v0::Constant::create(ngraph::element::f32, {3}, {0}); + auto add = std::make_shared(input, constant); function = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); } comparator.enable(FunctionsComparator::NODES); @@ -278,16 +285,16 @@ TEST(GraphComparatorTests, CheckRTInfo) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {3}, {0}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {3}, {0}); + auto add = std::make_shared(input, constant); add->get_rt_info()["my_info"] = 42; function_ref = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); } { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {3}, {0}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {3}, {0}); + auto add = std::make_shared(input, constant); function = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); } comparator.enable(FunctionsComparator::RUNTIME_KEYS) @@ -300,15 +307,15 @@ TEST(GraphComparatorTests, CheckRTInfoReverse) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {3}, {0}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {3}, {0}); + auto add = std::make_shared(input, constant); function_ref = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); } { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {3}, {0}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {3}, {0}); + auto add = std::make_shared(input, constant); add->get_rt_info()["my_info"] = 42; function = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); } @@ -322,16 +329,16 @@ TEST(GraphComparatorTests, CheckRTInfoInput) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {3}, {0}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {3}, {0}); + auto add = std::make_shared(input, constant); add->input(0).get_rt_info()["my_info"] = 42; function_ref = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); } { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {3}, {0}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {3}, {0}); + auto add = std::make_shared(input, constant); function = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); } comparator.enable(FunctionsComparator::RUNTIME_KEYS) @@ -344,16 +351,16 @@ TEST(GraphComparatorTests, CheckRTInfoOutput) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {3}, {0}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {3}, {0}); + auto add = std::make_shared(input, constant); add->output(0).get_rt_info()["my_info"] = 42; function_ref = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); } { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {3}, {0}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{3}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {3}, {0}); + auto add = std::make_shared(input, constant); function = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); } comparator.enable(FunctionsComparator::RUNTIME_KEYS) @@ -366,31 +373,31 @@ TEST(GraphComparatorTests, CheckTensorIteratorPositive) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto X = std::make_shared(ngraph::element::f32, ngraph::Shape{2, 1, 16}); - auto Y = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 128}); + auto X = std::make_shared(ngraph::element::f32, ngraph::Shape{2, 1, 16}); + auto Y = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 128}); - auto Xi = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 1, 16}); - auto Yi = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 128}); + auto Xi = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 1, 16}); + auto Yi = std::make_shared(ngraph::element::f32, ngraph::Shape{1, 128}); // Body - auto axis = ov::opset8::Constant::create(ngraph::element::i64, ngraph::Shape{}, {0}); - auto squeeze = std::make_shared(Xi, axis); + auto axis = ov::op::v0::Constant::create(ngraph::element::i64, ngraph::Shape{}, {0}); + auto squeeze = std::make_shared(Xi, axis); auto w_val = std::vector(384*16, 0); auto r_val = std::vector(384*128, 0); auto b_val = std::vector(384, 0); - auto W = ov::opset8::Constant::create(ngraph::element::f32, ngraph::Shape{384, 16}, w_val); - auto R = ov::opset8::Constant::create(ngraph::element::f32, ngraph::Shape{384, 128}, r_val); - auto B = ov::opset8::Constant::create(ngraph::element::f32, ngraph::Shape{384}, b_val); + auto W = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{384, 16}, w_val); + auto R = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{384, 128}, r_val); + auto B = ov::op::v0::Constant::create(ngraph::element::f32, ngraph::Shape{384}, b_val); - auto gru_cell = std::make_shared(squeeze, Yi, W, R, B, 128); - auto res_1 = std::make_shared(gru_cell); - auto unsqueeze = std::make_shared(gru_cell, axis); - auto res_2 = std::make_shared(unsqueeze); + auto gru_cell = std::make_shared(squeeze, Yi, W, R, B, 128); + auto res_1 = std::make_shared(gru_cell); + auto unsqueeze = std::make_shared(gru_cell, axis); + auto res_2 = std::make_shared(unsqueeze); auto body = std::make_shared(ngraph::OutputVector{res_1, res_2}, ngraph::ParameterVector{Xi, Yi}); - auto tensor_iterator = std::make_shared(); + auto tensor_iterator = std::make_shared(); tensor_iterator->set_body(body); tensor_iterator->set_sliced_input(Xi, X, 0, 1, 1, -1, 0); @@ -399,7 +406,7 @@ TEST(GraphComparatorTests, CheckTensorIteratorPositive) { auto out0 = tensor_iterator->get_iter_value(res_1, -1); auto out1 = tensor_iterator->get_concatenated_slices(res_2, 0, 1, 1, -1, 0); - auto res_ti_1 = std::make_shared(tensor_iterator->output(1)); + auto res_ti_1 = std::make_shared(tensor_iterator->output(1)); function_ref = std::make_shared(ngraph::NodeVector{res_ti_1}, ngraph::ParameterVector{X, Y}); function = function_ref->clone(); @@ -413,36 +420,36 @@ TEST(GraphComparatorTests, CheckLoopPositive) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto X = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); - auto Y = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); - auto M = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); + auto X = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); + auto Y = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); + auto M = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); // Set up the cell body, a function from (Xi, Yi) -> (Zo) // Body parameters - auto Xi = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); - auto Yi = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); - auto M_body = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); - auto body_condition = std::make_shared(ov::element::boolean, ov::Shape{1}, true); + auto Xi = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); + auto Yi = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); + auto M_body = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); + auto body_condition = std::make_shared(ov::element::boolean, ov::Shape{1}, true); - auto trip_count = std::make_shared(ngraph::element::i64, ov::Shape{1}, 3); - auto exec_condition = std::make_shared(ngraph::element::boolean, ov::Shape{1}, true); + auto trip_count = std::make_shared(ngraph::element::i64, ov::Shape{1}, 3); + auto exec_condition = std::make_shared(ngraph::element::boolean, ov::Shape{1}, true); // Body - auto sum = std::make_shared(Xi, Yi); - auto Zo = std::make_shared(sum, M_body); + auto sum = std::make_shared(Xi, Yi); + auto Zo = std::make_shared(sum, M_body); auto body = std::make_shared(ov::OutputVector{body_condition, Zo}, ov::ParameterVector{Xi, Yi, M_body}); - auto loop = std::make_shared(trip_count, exec_condition); + auto loop = std::make_shared(trip_count, exec_condition); loop->set_function(body); loop->set_invariant_input(Xi, X); loop->set_invariant_input(Yi, Y); loop->set_merged_input(M_body, M, Zo); - loop->set_special_body_ports(ov::opset8::Loop::SpecialBodyPorts{-1, 0}); + loop->set_special_body_ports(ov::op::v5::Loop::SpecialBodyPorts{-1, 0}); // Output is last Zo - auto result = std::make_shared(loop->get_iter_value(Zo, -1)); + auto result = std::make_shared(loop->get_iter_value(Zo, -1)); function_ref = std::make_shared(ov::ResultVector{result}, ov::ParameterVector{X, Y, M}); function = function_ref->clone(); } @@ -455,21 +462,21 @@ TEST(GraphComparatorTests, CheckSinksPositive) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto arg = std::make_shared(ov::element::f32, ov::Shape{1, 1}); - auto init_const = ov::opset8::Constant::create(ov::element::f32, ov::Shape{1, 1}, {0}); + auto arg = std::make_shared(ov::element::f32, ov::Shape{1, 1}); + auto init_const = ov::op::v0::Constant::create(ov::element::f32, ov::Shape{1, 1}, {0}); const std::string variable_name("variable0"); auto variable = std::make_shared(ngraph::VariableInfo{ov::PartialShape::dynamic(), ov::element::dynamic, variable_name}); - auto read = std::make_shared(init_const, variable); - auto read2 = std::make_shared(init_const, variable); - auto add = std::make_shared(arg, read); - auto add2 = std::make_shared(arg, read2); - auto assign = std::make_shared(add, variable); - auto assign2 = std::make_shared(add, variable); + auto read = std::make_shared(init_const, variable); + auto read2 = std::make_shared(init_const, variable); + auto add = std::make_shared(arg, read); + auto add2 = std::make_shared(arg, read2); + auto assign = std::make_shared(add, variable); + auto assign2 = std::make_shared(add, variable); - auto res = std::make_shared(add); - auto res2 = std::make_shared(add2); + auto res = std::make_shared(add); + auto res2 = std::make_shared(add2); function_ref = std::make_shared(ov::ResultVector({res, res2}), ov::SinkVector({assign, assign2}), ov::ParameterVector({arg})); @@ -484,42 +491,42 @@ TEST(GraphComparatorTests, CheckSinksNegative) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto arg = std::make_shared(ov::element::f32, ov::Shape{1, 1}); - auto init_const = ov::opset8::Constant::create(ov::element::f32, ov::Shape{1, 1}, {0}); + auto arg = std::make_shared(ov::element::f32, ov::Shape{1, 1}); + auto init_const = ov::op::v0::Constant::create(ov::element::f32, ov::Shape{1, 1}, {0}); const std::string variable_name("variable0"); auto variable = std::make_shared(ngraph::VariableInfo{ov::PartialShape::dynamic(), ov::element::dynamic, variable_name}); - auto read = std::make_shared(init_const, variable); - auto read2 = std::make_shared(init_const, variable); - auto add = std::make_shared(arg, read); - auto add2 = std::make_shared(arg, read2); - auto assign = std::make_shared(add, variable); - auto assign2 = std::make_shared(add, variable); + auto read = std::make_shared(init_const, variable); + auto read2 = std::make_shared(init_const, variable); + auto add = std::make_shared(arg, read); + auto add2 = std::make_shared(arg, read2); + auto assign = std::make_shared(add, variable); + auto assign2 = std::make_shared(add, variable); - auto res = std::make_shared(add); - auto res2 = std::make_shared(add2); + auto res = std::make_shared(add); + auto res2 = std::make_shared(add2); function_ref = std::make_shared(ov::ResultVector({res, res2}), ov::SinkVector({assign, assign2}), ov::ParameterVector({arg})); } { - auto arg = std::make_shared(ov::element::f32, ov::Shape{1, 1}); - auto init_const = ov::opset8::Constant::create(ov::element::f32, ov::Shape{1, 1}, {0}); + auto arg = std::make_shared(ov::element::f32, ov::Shape{1, 1}); + auto init_const = ov::op::v0::Constant::create(ov::element::f32, ov::Shape{1, 1}, {0}); const std::string variable_name("variable_different"); auto variable = std::make_shared(ngraph::VariableInfo{ov::PartialShape::dynamic(), ov::element::dynamic, variable_name}); - auto read = std::make_shared(init_const, variable); - auto read2 = std::make_shared(init_const, variable); - auto add = std::make_shared(arg, read); - auto add2 = std::make_shared(arg, read2); - auto assign = std::make_shared(add, variable); - auto assign2 = std::make_shared(add, variable); + auto read = std::make_shared(init_const, variable); + auto read2 = std::make_shared(init_const, variable); + auto add = std::make_shared(arg, read); + auto add2 = std::make_shared(arg, read2); + auto assign = std::make_shared(add, variable); + auto assign2 = std::make_shared(add, variable); - auto res = std::make_shared(add); - auto res2 = std::make_shared(add2); + auto res = std::make_shared(add); + auto res2 = std::make_shared(add2); function = std::make_shared(ov::ResultVector({res, res2}), ov::SinkVector({assign, assign2}), ov::ParameterVector({arg})); @@ -533,9 +540,9 @@ TEST(GraphComparatorTests, DisableCheck) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {1}, {0}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {1}, {0}); + auto add = std::make_shared(input, constant); function_ref = std::make_shared(ngraph::NodeVector{ add }, ngraph::ParameterVector{ input }); function = function_ref->clone(); } @@ -549,15 +556,15 @@ TEST(GraphComparatorTests, CheckAccuracyPositive) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {1}, {0}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {1}, {0}); + auto add = std::make_shared(input, constant); function_ref = std::make_shared(ngraph::NodeVector{ add}, ngraph::ParameterVector{ input }); } { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {1}, {0}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {1}, {0}); + auto add = std::make_shared(input, constant); function = std::make_shared(ngraph::NodeVector{ add}, ngraph::ParameterVector{ input }); } comparator.enable(FunctionsComparator::ACCURACY); @@ -569,15 +576,15 @@ TEST(GraphComparatorTests, CheckAccuracyNegative) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {1}, {12}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {1}, {12}); + auto add = std::make_shared(input, constant); function_ref = std::make_shared(ngraph::NodeVector{ add}, ngraph::ParameterVector{ input }); } { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {1}, {200}); - auto add = std::make_shared(input, constant); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {1}, {200}); + auto add = std::make_shared(input, constant); function = std::make_shared(ngraph::NodeVector{ add}, ngraph::ParameterVector{ input }); } comparator.enable(FunctionsComparator::ACCURACY); @@ -589,12 +596,12 @@ TEST(GraphComparatorTests, CheckAccuracyNotEnabled) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ov::element::f32, ov::Shape{ 1, 3, 12, 12 }); - auto const_weights = ov::opset8::Constant::create(ov::element::f16, + auto input = std::make_shared(ov::element::f32, ov::Shape{ 1, 3, 12, 12 }); + auto const_weights = ov::op::v0::Constant::create(ov::element::f16, ov::Shape{ 1, 3, 3, 3 }, { 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9 }); - auto convert_ins1 = std::make_shared(const_weights, ov::element::f32); - auto conv = std::make_shared(input, + auto convert_ins1 = std::make_shared(const_weights, ov::element::f32); + auto conv = std::make_shared(input, convert_ins1, ov::Strides{ 1, 1 }, ov::CoordinateDiff{ 1, 1 }, @@ -603,12 +610,12 @@ TEST(GraphComparatorTests, CheckAccuracyNotEnabled) { function_ref = std::make_shared(ngraph::NodeVector{ conv }, ngraph::ParameterVector{ input }); } { - auto input = std::make_shared(ov::element::f32, ov::Shape{ 1, 3, 12, 12 }); - auto const_weights = ov::opset8::Constant::create(ov::element::f16, + auto input = std::make_shared(ov::element::f32, ov::Shape{ 1, 3, 12, 12 }); + auto const_weights = ov::op::v0::Constant::create(ov::element::f16, ov::Shape{ 1, 3, 3, 3 }, { 1, 9, 3, 4, 5, 6, 7, 8, 9, 1, 12, 3, 9, 5, 0, 7, 8, 9, 1, 2, 12, 4, 9, 6, 7, 8, 9 }); - auto convert_ins1 = std::make_shared(const_weights, ov::element::f32); - auto conv = std::make_shared(input, + auto convert_ins1 = std::make_shared(const_weights, ov::element::f32); + auto conv = std::make_shared(input, convert_ins1, ov::Strides{ 1, 1 }, ov::CoordinateDiff{ 1, 1 }, @@ -625,19 +632,19 @@ TEST(GraphComparatorTests, CheckConsumersCountPositive) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {1}, {0}); - auto add_1 = std::make_shared(input, constant); - auto add_2 = std::make_shared(input, constant); - auto mul = std::make_shared(add_1, add_2); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {1}, {0}); + auto add_1 = std::make_shared(input, constant); + auto add_2 = std::make_shared(input, constant); + auto mul = std::make_shared(add_1, add_2); function_ref = std::make_shared(ngraph::NodeVector{ mul }, ngraph::ParameterVector{ input }); } { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {1}, {0}); - auto add_1 = std::make_shared(input, constant); - auto add_2 = std::make_shared(input, constant); - auto mul = std::make_shared(add_1, add_2); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {1}, {0}); + auto add_1 = std::make_shared(input, constant); + auto add_2 = std::make_shared(input, constant); + auto mul = std::make_shared(add_1, add_2); function = std::make_shared(ngraph::NodeVector{ mul }, ngraph::ParameterVector{ input }); } comparator.enable(FunctionsComparator::NODES).enable(FunctionsComparator::CONSUMERS_COUNT); @@ -649,20 +656,20 @@ TEST(GraphComparatorTests, CheckConsumersCountNegative) { FunctionsComparator comparator(FunctionsComparator::no_default()); std::shared_ptr function, function_ref; { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); - auto constant = ov::opset8::Constant::create(ngraph::element::i64, {1}, {0}); - auto add_1 = std::make_shared(input, constant); - auto add_2 = std::make_shared(input, constant); - auto mul = std::make_shared(add_1, add_2); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); + auto constant = ov::op::v0::Constant::create(ngraph::element::i64, {1}, {0}); + auto add_1 = std::make_shared(input, constant); + auto add_2 = std::make_shared(input, constant); + auto mul = std::make_shared(add_1, add_2); function_ref = std::make_shared(ngraph::NodeVector{ mul }, ngraph::ParameterVector{ input }); } { - auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); - auto constant_1 = ov::opset8::Constant::create(ngraph::element::i64, {1}, {0}); - auto constant_2 = ov::opset8::Constant::create(ngraph::element::i64, {1}, {0}); - auto add_1 = std::make_shared(input, constant_1); - auto add_2 = std::make_shared(input, constant_2); - auto mul = std::make_shared(add_1, add_2); + auto input = std::make_shared(ngraph::element::i64, ov::Shape{1}); + auto constant_1 = ov::op::v0::Constant::create(ngraph::element::i64, {1}, {0}); + auto constant_2 = ov::op::v0::Constant::create(ngraph::element::i64, {1}, {0}); + auto add_1 = std::make_shared(input, constant_1); + auto add_2 = std::make_shared(input, constant_2); + auto mul = std::make_shared(add_1, add_2); function = std::make_shared(ngraph::NodeVector{ mul }, ngraph::ParameterVector{ input }); } comparator.enable(FunctionsComparator::NODES).enable(FunctionsComparator::CONSUMERS_COUNT); diff --git a/src/tests/ngraph_helpers/lpt_ngraph_functions/include/lpt_ngraph_functions/fake_quantize_on_weights_and_unsupported_child_function.hpp b/src/tests/ngraph_helpers/lpt_ngraph_functions/include/lpt_ngraph_functions/fake_quantize_on_weights_and_unsupported_child_function.hpp index 83fbf973ee7..cd6da2784b1 100644 --- a/src/tests/ngraph_helpers/lpt_ngraph_functions/include/lpt_ngraph_functions/fake_quantize_on_weights_and_unsupported_child_function.hpp +++ b/src/tests/ngraph_helpers/lpt_ngraph_functions/include/lpt_ngraph_functions/fake_quantize_on_weights_and_unsupported_child_function.hpp @@ -19,7 +19,7 @@ public: static std::shared_ptr get( const ngraph::Shape& inputShape, const ngraph::element::Type inputPrecision, - const std::shared_ptr weights, + const std::shared_ptr weights, const ngraph::builder::subgraph::FakeQuantizeOnWeights fqOnWeights); }; diff --git a/src/tests/ngraph_helpers/lpt_ngraph_functions/include/lpt_ngraph_functions/reduce_function.hpp b/src/tests/ngraph_helpers/lpt_ngraph_functions/include/lpt_ngraph_functions/reduce_function.hpp index e61ccbb5640..650f114f9d9 100644 --- a/src/tests/ngraph_helpers/lpt_ngraph_functions/include/lpt_ngraph_functions/reduce_function.hpp +++ b/src/tests/ngraph_helpers/lpt_ngraph_functions/include/lpt_ngraph_functions/reduce_function.hpp @@ -25,10 +25,10 @@ public: const ngraph::builder::subgraph::DequantizationOperations& dequantizationBefore, const std::vector& constantValues, const bool keepDims) { - const auto input = std::make_shared(precision, inputShape); + const auto input = std::make_shared(precision, inputShape); const auto dequantization = makeDequantization(input, dequantizationBefore); - const auto constant = std::make_shared( + const auto constant = std::make_shared( ngraph::element::i32, ngraph::Shape{ constantValues.size() }, constantValues); @@ -42,7 +42,7 @@ public: keepDims); reduce->set_friendly_name("Output"); - const auto result = std::make_shared(reduce); + const auto result = std::make_shared(reduce); const auto function = std::make_shared( ngraph::ResultVector{ result }, ngraph::ParameterVector{ input }, @@ -61,7 +61,7 @@ public: const std::vector& constantValues, const bool keepDims, ngraph::builder::subgraph::DequantizationOperations& dequantizationAfter) { - const auto input = std::make_shared(precision, inputShape); + const auto input = std::make_shared(precision, inputShape); std::shared_ptr parent = input; if (!fqOnData.empty()) { @@ -69,14 +69,14 @@ public: } if (!convert.empty()) { - parent = std::make_shared(parent, convert.outPrecision); + parent = std::make_shared(parent, convert.outPrecision); } if (!dequantizationBefore.empty()) { parent = makeDequantization(parent, dequantizationBefore); } - const auto constant = std::make_shared( + const auto constant = std::make_shared( ngraph::element::i32, ngraph::Shape{ constantValues.size() }, constantValues); @@ -88,7 +88,7 @@ public: parent = makeDequantization(parent, dequantizationAfter); } - const auto result = std::make_shared(parent); + const auto result = std::make_shared(parent); const auto function = std::make_shared( ngraph::ResultVector{ result }, ngraph::ParameterVector{ input }, @@ -106,10 +106,10 @@ public: const bool keepDims, const ngraph::element::Type precisionAfterOperation, const ngraph::builder::subgraph::DequantizationOperations& dequantizationAfter) { - const auto input = std::make_shared(precision, inputShape); + const auto input = std::make_shared(precision, inputShape); const auto dequantization = makeDequantization(input, dequantizationBefore); - const auto constant = std::make_shared( + const auto constant = std::make_shared( ngraph::element::i32, ngraph::Shape{ constantValues.size() }, constantValues); @@ -123,7 +123,7 @@ public: std::shared_ptr lastOperation = makeDequantization(reduce, dequantizationAfter); lastOperation->set_friendly_name("Output"); - const auto result = std::make_shared(lastOperation); + const auto result = std::make_shared(lastOperation); const auto function = std::make_shared( ngraph::ResultVector{ result }, ngraph::ParameterVector{ input }, diff --git a/src/tests/ngraph_helpers/snippets_ngraph_functions/src/subgraph_simple.cpp b/src/tests/ngraph_helpers/snippets_ngraph_functions/src/subgraph_simple.cpp index 9211ed9b076..a1e3555a33e 100644 --- a/src/tests/ngraph_helpers/snippets_ngraph_functions/src/subgraph_simple.cpp +++ b/src/tests/ngraph_helpers/snippets_ngraph_functions/src/subgraph_simple.cpp @@ -328,20 +328,20 @@ std::shared_ptr EdgeReplaceFunction::initOriginal() const { auto mul_rhs = split->output(1); // first parent subgraph in tokenization stage - const auto data0 = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 1, 1, 3, 2}), + const auto data0 = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 1, 1, 3, 2}), std::vector{0.0, 0.2, 0.4, 0.6, 0.8, 1.0}); - const auto const_a4 = std::make_shared(ov::element::Type_t::f32, ov::Shape({2}), std::vector{0.2, 0.1}); + const auto const_a4 = std::make_shared(ov::element::Type_t::f32, ov::Shape({2}), std::vector{0.2, 0.1}); auto mul_a4 = std::make_shared(mul_rhs, const_a4); auto add_a1 = std::make_shared(mul_a4, data0); auto mul_a5 = std::make_shared(add_a1, mul_lhs); // second parent subgraph in tokenization stage - const auto data1 = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 1, 1, 3, 2}), + const auto data1 = std::make_shared(ov::element::Type_t::f32, ov::Shape({1, 1, 1, 3, 2}), std::vector{0.1, 0.3, 0.5, 0.7, 0.9, 1.0}); auto mul_a1 = std::make_shared(data1, mul_lhs); - const auto const_a2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({2}), std::vector{0.2, 0.4}); + const auto const_a2 = std::make_shared(ov::element::Type_t::f32, ov::Shape({2}), std::vector{0.2, 0.4}); auto mul_a2 = std::make_shared(mul_a1, const_a2); - const auto const_a3 = std::make_shared(ov::element::Type_t::f32, ov::Shape({2}), std::vector{0.3, 0.1}); + const auto const_a3 = std::make_shared(ov::element::Type_t::f32, ov::Shape({2}), std::vector{0.3, 0.1}); auto mul_a3 = std::make_shared(mul_a2, const_a3); auto add_a3 = std::make_shared(mul_a5, mul_a3);