From 679369c7071d624a334a2c52145cc0457a56e318 Mon Sep 17 00:00:00 2001 From: Ilya Churaev Date: Fri, 25 Aug 2023 10:50:59 +0400 Subject: [PATCH] Move Visitor tests to new api (#19379) * Moved visitor tests to new API * Fixed build for Windows --- src/core/tests/visitors/dimension.cpp | 41 +++--- src/core/tests/visitors/op/abs.cpp | 4 +- src/core/tests/visitors/op/acos.cpp | 4 +- src/core/tests/visitors/op/acosh.cpp | 4 +- .../tests/visitors/op/adaptive_avg_pool.cpp | 24 ++-- .../tests/visitors/op/adaptive_max_pool.cpp | 26 ++-- src/core/tests/visitors/op/add.cpp | 7 +- src/core/tests/visitors/op/asin.cpp | 5 +- src/core/tests/visitors/op/asinh.cpp | 5 +- src/core/tests/visitors/op/assign.cpp | 39 +++-- src/core/tests/visitors/op/atan.cpp | 4 +- src/core/tests/visitors/op/atanh.cpp | 4 +- src/core/tests/visitors/op/avg_pool.cpp | 46 +++--- src/core/tests/visitors/op/batch_norm.cpp | 48 +++---- src/core/tests/visitors/op/batch_to_space.cpp | 26 ++-- .../tests/visitors/op/binary_convolution.cpp | 23 ++- src/core/tests/visitors/op/binary_ops.hpp | 39 ++--- src/core/tests/visitors/op/broadcast.cpp | 44 +++--- src/core/tests/visitors/op/bucketize.cpp | 39 +++-- src/core/tests/visitors/op/ceiling.cpp | 4 +- src/core/tests/visitors/op/clamp.cpp | 24 ++-- src/core/tests/visitors/op/concat.cpp | 27 ++-- src/core/tests/visitors/op/constant.cpp | 24 ++-- src/core/tests/visitors/op/convert.cpp | 15 +- .../tests/visitors/op/convert_color_i420.cpp | 9 +- .../tests/visitors/op/convert_color_nv12.cpp | 8 +- src/core/tests/visitors/op/convert_like.cpp | 26 ++-- src/core/tests/visitors/op/convolution.cpp | 27 ++-- .../visitors/op/convolution_backprop.cpp | 67 ++++----- src/core/tests/visitors/op/cos.cpp | 4 +- src/core/tests/visitors/op/cosh.cpp | 4 +- .../tests/visitors/op/ctc_greedy_decoder.cpp | 22 +-- .../op/ctc_greedy_decoder_seq_len.cpp | 26 ++-- src/core/tests/visitors/op/ctc_loss.cpp | 35 +++-- src/core/tests/visitors/op/cum_sum.cpp | 42 +++--- .../visitors/op/deformable_convolution.cpp | 120 ++++++++-------- .../visitors/op/deformable_psroi_pooling.cpp | 75 +++++----- src/core/tests/visitors/op/depth_to_space.cpp | 26 ++-- .../tests/visitors/op/detection_output.cpp | 23 ++- src/core/tests/visitors/op/dft.cpp | 16 ++- src/core/tests/visitors/op/divide.cpp | 30 ++-- src/core/tests/visitors/op/einsum.cpp | 25 ++-- src/core/tests/visitors/op/elu.cpp | 26 ++-- .../visitors/op/embedding_segments_sum.cpp | 74 +++++----- .../visitors/op/embeddingbag_offsetssum.cpp | 56 ++++---- .../visitors/op/embeddingbag_packedsum.cpp | 38 ++--- src/core/tests/visitors/op/equal.cpp | 7 +- src/core/tests/visitors/op/erf.cpp | 4 +- src/core/tests/visitors/op/exp.cpp | 4 +- ...xperimental_detectron_detection_output.cpp | 27 ++-- ...erimental_detectron_generate_proposals.cpp | 27 ++-- ...imental_detectron_prior_grid_generator.cpp | 25 ++-- .../op/experimental_detectron_topkrois.cpp | 23 ++- .../tests/visitors/op/extractimagepatches.cpp | 27 ++-- src/core/tests/visitors/op/eye.cpp | 14 +- src/core/tests/visitors/op/fake_quantize.cpp | 34 ++--- src/core/tests/visitors/op/floor.cpp | 2 + src/core/tests/visitors/op/floor_mod.cpp | 7 +- src/core/tests/visitors/op/framework_node.cpp | 36 ++--- src/core/tests/visitors/op/gather.cpp | 53 ++++--- .../tests/visitors/op/gather_elements.cpp | 25 ++-- src/core/tests/visitors/op/gather_nd.cpp | 32 ++--- src/core/tests/visitors/op/gather_tree.cpp | 29 ++-- src/core/tests/visitors/op/gelu.cpp | 46 +++--- .../tests/visitors/op/generate_proposals.cpp | 27 ++-- src/core/tests/visitors/op/greater.cpp | 7 +- src/core/tests/visitors/op/greater_equal.cpp | 4 +- src/core/tests/visitors/op/grid_sample.cpp | 22 +-- src/core/tests/visitors/op/grn.cpp | 22 +-- src/core/tests/visitors/op/group_conv.cpp | 40 +++--- .../tests/visitors/op/group_normalization.cpp | 25 ++-- src/core/tests/visitors/op/gru_cell.cpp | 86 ++++++----- src/core/tests/visitors/op/gru_sequence.cpp | 61 ++++---- src/core/tests/visitors/op/hard_sigmoid.cpp | 26 ++-- src/core/tests/visitors/op/hsigmoid.cpp | 4 +- src/core/tests/visitors/op/hswish.cpp | 4 +- src/core/tests/visitors/op/idft.cpp | 24 ++-- src/core/tests/visitors/op/if.cpp | 48 +++---- src/core/tests/visitors/op/interpolate.cpp | 51 ++++--- src/core/tests/visitors/op/irdft.cpp | 16 ++- src/core/tests/visitors/op/is_finite.cpp | 5 +- src/core/tests/visitors/op/is_inf.cpp | 52 +++---- src/core/tests/visitors/op/is_nan.cpp | 3 + src/core/tests/visitors/op/less.cpp | 7 +- src/core/tests/visitors/op/less_equal.cpp | 4 +- src/core/tests/visitors/op/log.cpp | 6 +- src/core/tests/visitors/op/log_softmax.cpp | 26 ++-- src/core/tests/visitors/op/logical_and.cpp | 7 +- src/core/tests/visitors/op/logical_not.cpp | 4 +- src/core/tests/visitors/op/logical_or.cpp | 7 +- src/core/tests/visitors/op/logical_xor.cpp | 7 +- src/core/tests/visitors/op/lrn.cpp | 28 ++-- src/core/tests/visitors/op/lstm_cell.cpp | 134 +++++++++--------- src/core/tests/visitors/op/lstm_sequence.cpp | 116 ++++++++------- src/core/tests/visitors/op/matmul.cpp | 78 +++++----- src/core/tests/visitors/op/matrix_nms.cpp | 47 +++--- src/core/tests/visitors/op/max_pool.cpp | 49 ++++--- src/core/tests/visitors/op/maximum.cpp | 7 +- src/core/tests/visitors/op/minimum.cpp | 7 +- src/core/tests/visitors/op/mish.cpp | 19 ++- src/core/tests/visitors/op/mod.cpp | 7 +- src/core/tests/visitors/op/multiclass_nms.cpp | 83 ++++++----- src/core/tests/visitors/op/multiply.cpp | 7 +- src/core/tests/visitors/op/mvn.cpp | 38 +++-- src/core/tests/visitors/op/negative.cpp | 6 +- .../tests/visitors/op/non_max_suppression.cpp | 63 ++++---- src/core/tests/visitors/op/non_zero.cpp | 55 ++++--- src/core/tests/visitors/op/normalize_l2.cpp | 25 ++-- src/core/tests/visitors/op/not_equal.cpp | 7 +- src/core/tests/visitors/op/one_hot.cpp | 33 ++--- src/core/tests/visitors/op/pad.cpp | 28 ++-- src/core/tests/visitors/op/parameter.cpp | 21 ++- src/core/tests/visitors/op/power.cpp | 7 +- src/core/tests/visitors/op/prelu.cpp | 24 ++-- src/core/tests/visitors/op/prior_box.cpp | 61 ++++---- .../tests/visitors/op/prior_box_clustered.cpp | 38 ++--- src/core/tests/visitors/op/proposal.cpp | 48 +++---- src/core/tests/visitors/op/psroi_pooling.cpp | 42 +++--- src/core/tests/visitors/op/random_uniform.cpp | 28 ++-- src/core/tests/visitors/op/range.cpp | 28 ++-- src/core/tests/visitors/op/rdft.cpp | 16 ++- src/core/tests/visitors/op/read_value.cpp | 36 ++--- src/core/tests/visitors/op/reduce_l1.cpp | 2 + src/core/tests/visitors/op/reduce_l2.cpp | 4 +- .../tests/visitors/op/reduce_logical_and.cpp | 4 +- .../tests/visitors/op/reduce_logical_or.cpp | 4 +- src/core/tests/visitors/op/reduce_max.cpp | 4 +- src/core/tests/visitors/op/reduce_mean.cpp | 4 +- src/core/tests/visitors/op/reduce_min.cpp | 4 +- src/core/tests/visitors/op/reduce_ops.hpp | 36 +++-- src/core/tests/visitors/op/reduce_prod.cpp | 4 +- src/core/tests/visitors/op/reduce_sum.cpp | 4 +- src/core/tests/visitors/op/region_yolo.cpp | 42 +++--- src/core/tests/visitors/op/relu.cpp | 4 +- src/core/tests/visitors/op/reorg_yolo.cpp | 26 ++-- src/core/tests/visitors/op/reshape.cpp | 28 ++-- src/core/tests/visitors/op/result.cpp | 6 +- src/core/tests/visitors/op/reverse.cpp | 38 +++-- .../tests/visitors/op/reverse_sequence.cpp | 28 ++-- src/core/tests/visitors/op/rnn_cell.cpp | 71 +++++----- src/core/tests/visitors/op/rnn_sequence.cpp | 58 ++++---- src/core/tests/visitors/op/roi_pooling.cpp | 28 ++-- src/core/tests/visitors/op/roll.cpp | 27 ++-- src/core/tests/visitors/op/round.cpp | 32 ++--- .../visitors/op/scatter_elements_update.cpp | 10 +- .../tests/visitors/op/scatter_nd_update.cpp | 27 ++-- src/core/tests/visitors/op/scatter_update.cpp | 35 ++--- src/core/tests/visitors/op/select.cpp | 39 +++-- src/core/tests/visitors/op/selu.cpp | 26 ++-- src/core/tests/visitors/op/shape_of.cpp | 21 ++- .../tests/visitors/op/shuffle_channels.cpp | 17 +-- src/core/tests/visitors/op/sigmoid.cpp | 4 +- src/core/tests/visitors/op/sign.cpp | 4 +- src/core/tests/visitors/op/sin.cpp | 4 +- src/core/tests/visitors/op/sinh.cpp | 4 +- src/core/tests/visitors/op/slice.cpp | 44 +++--- src/core/tests/visitors/op/softmax.cpp | 26 ++-- src/core/tests/visitors/op/softplus.cpp | 4 +- src/core/tests/visitors/op/softsign.cpp | 4 +- src/core/tests/visitors/op/space_to_batch.cpp | 31 ++-- src/core/tests/visitors/op/space_to_depth.cpp | 28 ++-- src/core/tests/visitors/op/split.cpp | 35 +++-- src/core/tests/visitors/op/sqrt.cpp | 6 +- .../tests/visitors/op/squared_difference.cpp | 7 +- src/core/tests/visitors/op/squeeze.cpp | 6 +- src/core/tests/visitors/op/strided_slice.cpp | 48 +++---- src/core/tests/visitors/op/subtract.cpp | 7 +- src/core/tests/visitors/op/swish.cpp | 30 ++-- src/core/tests/visitors/op/tan.cpp | 4 +- src/core/tests/visitors/op/tanh.cpp | 20 +-- .../tests/visitors/op/tensor_iterator.cpp | 91 ++++++------ src/core/tests/visitors/op/tile.cpp | 25 ++-- src/core/tests/visitors/op/topk.cpp | 56 ++++---- src/core/tests/visitors/op/transpose.cpp | 26 ++-- src/core/tests/visitors/op/unary_ops.hpp | 22 +-- src/core/tests/visitors/op/unique.cpp | 43 +++--- src/core/tests/visitors/op/unsqueeze.cpp | 22 +-- src/core/tests/visitors/op/variadic_split.cpp | 27 ++-- src/core/tests/visitors/partial_shape.cpp | 52 ++++--- src/core/tests/visitors/user_op.cpp | 28 ++-- src/core/tests/visitors/value_map.cpp | 15 +- src/core/tests/visitors/visitors.cpp | 20 +++ .../tests/visitors/visitors.hpp} | 78 +++++----- 183 files changed, 2433 insertions(+), 2529 deletions(-) create mode 100644 src/core/tests/visitors/visitors.cpp rename src/{tests/test_utils/common_test_utils/include/common_test_utils/visitor.hpp => core/tests/visitors/visitors.hpp} (88%) diff --git a/src/core/tests/visitors/dimension.cpp b/src/core/tests/visitors/dimension.cpp index cb8794bd547..f0601ff5621 100644 --- a/src/core/tests/visitors/dimension.cpp +++ b/src/core/tests/visitors/dimension.cpp @@ -2,52 +2,45 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include + +#include "openvino/core/attribute_visitor.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; TEST(attributes, dimension) { - NodeBuilder builder; - AttributeVisitor& loader = builder.get_node_loader(); - AttributeVisitor& saver = builder.get_node_saver(); + ov::test::NodeBuilder builder; + ov::AttributeVisitor& loader = builder.get_node_loader(); + ov::AttributeVisitor& saver = builder.get_node_saver(); - Dimension dyn = Dimension(-1); + ov::Dimension dyn = ov::Dimension(-1); saver.on_attribute("dyn", dyn); - Dimension g_dyn; + ov::Dimension g_dyn; loader.on_attribute("dyn", g_dyn); EXPECT_EQ(dyn, g_dyn); - Dimension scalar = Dimension(10); + ov::Dimension scalar = ov::Dimension(10); saver.on_attribute("scalar", scalar); - Dimension g_scalar; + ov::Dimension g_scalar; loader.on_attribute("scalar", g_scalar); EXPECT_EQ(scalar, g_scalar); - Dimension boundaries1 = Dimension(2, 100); + ov::Dimension boundaries1 = ov::Dimension(2, 100); saver.on_attribute("boundaries1", boundaries1); - Dimension g_boundaries1; + ov::Dimension g_boundaries1; loader.on_attribute("boundaries1", g_boundaries1); EXPECT_EQ(boundaries1, g_boundaries1); - Dimension boundaries2 = Dimension(-1, 100); + ov::Dimension boundaries2 = ov::Dimension(-1, 100); saver.on_attribute("boundaries2", boundaries2); - Dimension g_boundaries2; + ov::Dimension g_boundaries2; loader.on_attribute("boundaries2", g_boundaries2); EXPECT_EQ(boundaries2, g_boundaries2); - Dimension boundaries3 = Dimension(5, -1); + ov::Dimension boundaries3 = ov::Dimension(5, -1); saver.on_attribute("boundaries3", boundaries3); - Dimension g_boundaries3; + ov::Dimension g_boundaries3; loader.on_attribute("boundaries3", g_boundaries3); EXPECT_EQ(boundaries3, g_boundaries3); } diff --git a/src/core/tests/visitors/op/abs.cpp b/src/core/tests/visitors/op/abs.cpp index 0c4c6515870..7c61f32ab13 100644 --- a/src/core/tests/visitors/op/abs.cpp +++ b/src/core/tests/visitors/op/abs.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/abs.hpp" + #include "unary_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Type, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/acos.cpp b/src/core/tests/visitors/op/acos.cpp index 74372bea031..99b6220bb00 100644 --- a/src/core/tests/visitors/op/acos.cpp +++ b/src/core/tests/visitors/op/acos.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/acos.hpp" + #include "unary_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Type, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/acosh.cpp b/src/core/tests/visitors/op/acosh.cpp index cfc513063e3..a4e7b03e0dc 100644 --- a/src/core/tests/visitors/op/acosh.cpp +++ b/src/core/tests/visitors/op/acosh.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/acosh.hpp" + #include "unary_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Type, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/adaptive_avg_pool.cpp b/src/core/tests/visitors/op/adaptive_avg_pool.cpp index ddd32ca6bbc..95620df9983 100644 --- a/src/core/tests/visitors/op/adaptive_avg_pool.cpp +++ b/src/core/tests/visitors/op/adaptive_avg_pool.cpp @@ -2,23 +2,21 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset8.hpp" +#include "openvino/op/adaptive_avg_pool.hpp" -using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +#include + +#include "openvino/op/constant.hpp" +#include "openvino/op/parameter.hpp" +#include "visitors/visitors.hpp" TEST(attributes, adaptive_avg_pool_op) { - NodeBuilder::get_ops().register_factory(); - const auto A = make_shared(element::f32, Shape{1, 3, 5, 4}); - const auto out_shape = op::Constant::create(element::i64, Shape{2}, {4, 3}); + ov::test::NodeBuilder::get_ops().register_factory(); + const auto A = std::make_shared(ov::element::f32, ov::Shape{1, 3, 5, 4}); + const auto out_shape = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{2}, {4, 3}); - const auto adaptive_pool = make_shared(A, out_shape); - NodeBuilder builder(adaptive_pool, {A, out_shape}); + const auto adaptive_pool = std::make_shared(A, out_shape); + ov::test::NodeBuilder builder(adaptive_pool, {A, out_shape}); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/adaptive_max_pool.cpp b/src/core/tests/visitors/op/adaptive_max_pool.cpp index 5a940740c8f..6479f71f5ea 100644 --- a/src/core/tests/visitors/op/adaptive_max_pool.cpp +++ b/src/core/tests/visitors/op/adaptive_max_pool.cpp @@ -2,24 +2,22 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset8.hpp" +#include "openvino/op/adaptive_max_pool.hpp" -using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +#include + +#include "openvino/op/constant.hpp" +#include "openvino/op/parameter.hpp" +#include "visitors/visitors.hpp" TEST(attributes, adaptive_max_pool_op) { - NodeBuilder::get_ops().register_factory(); - const auto A = make_shared(element::f32, Shape{1, 3, 5, 4}); - const auto out_shape = op::Constant::create(element::i64, Shape{2}, {4, 3}); + ov::test::NodeBuilder::get_ops().register_factory(); + const auto A = std::make_shared(ov::element::f32, ov::Shape{1, 3, 5, 4}); + const auto out_shape = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{2}, {4, 3}); - const auto adaptive_pool = make_shared(A, out_shape); - NodeBuilder builder(adaptive_pool, {A, out_shape}); - auto g_adaptive_pool = ov::as_type_ptr(builder.create()); + const auto adaptive_pool = std::make_shared(A, out_shape); + ov::test::NodeBuilder builder(adaptive_pool, {A, out_shape}); + auto g_adaptive_pool = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 1; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/add.cpp b/src/core/tests/visitors/op/add.cpp index c7fc4154191..31992673f14 100644 --- a/src/core/tests/visitors/op/add.cpp +++ b/src/core/tests/visitors/op/add.cpp @@ -2,9 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "binary_ops.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/add.hpp" -using Type = ::testing::Types>; +#include "binary_ops.hpp" + +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_with_auto_broadcast, BinaryOperatorVisitor, Type, BinaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/asin.cpp b/src/core/tests/visitors/op/asin.cpp index 1821604d39d..01221cfa7d8 100644 --- a/src/core/tests/visitors/op/asin.cpp +++ b/src/core/tests/visitors/op/asin.cpp @@ -2,7 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/asin.hpp" + #include "unary_ops.hpp" -using Type = ::testing::Types>; + +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Type, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/asinh.cpp b/src/core/tests/visitors/op/asinh.cpp index 96899cd62f7..2e46e0f7d1e 100644 --- a/src/core/tests/visitors/op/asinh.cpp +++ b/src/core/tests/visitors/op/asinh.cpp @@ -2,7 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/asinh.hpp" + #include "unary_ops.hpp" -using Type = ::testing::Types>; + +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Type, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/assign.cpp b/src/core/tests/visitors/op/assign.cpp index aab50712be2..9c0708f3534 100644 --- a/src/core/tests/visitors/op/assign.cpp +++ b/src/core/tests/visitors/op/assign.cpp @@ -2,25 +2,19 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset6.hpp" +#include -using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +#include "openvino/op/read_value.hpp" +#include "openvino/op/util/variable.hpp" +#include "visitors/visitors.hpp" TEST(attributes, assign_v3_op) { - NodeBuilder::get_ops().register_factory(); - const auto in = make_shared(element::f32, Shape{1}); - const string variable_id = "v0"; - const auto read_value = make_shared(in, variable_id); - const auto assign = make_shared(read_value, variable_id); - NodeBuilder builder(assign, {read_value}); + ov::test::NodeBuilder::get_ops().register_factory(); + const auto in = std::make_shared(ov::element::f32, ov::Shape{1}); + const std::string variable_id = "v0"; + const auto read_value = std::make_shared(in, variable_id); + const auto assign = std::make_shared(read_value, variable_id); + ov::test::NodeBuilder builder(assign, {read_value}); // attribute count const auto expected_attr_count = 1; @@ -28,12 +22,13 @@ TEST(attributes, assign_v3_op) { } TEST(attributes, assign_v6_op) { - NodeBuilder::get_ops().register_factory(); - const auto in = make_shared(element::f32, Shape{1}); - const auto variable = std::make_shared(VariableInfo{PartialShape::dynamic(), element::dynamic, "v0"}); - const auto read_value = make_shared(in, variable); - const auto assign = make_shared(read_value, variable); - NodeBuilder builder(assign, {read_value}); + ov::test::NodeBuilder::get_ops().register_factory(); + const auto in = std::make_shared(ov::element::f32, ov::Shape{1}); + const auto variable = std::make_shared( + ov::op::util::VariableInfo{ov::PartialShape::dynamic(), ov::element::dynamic, "v0"}); + const auto read_value = std::make_shared(in, variable); + const auto assign = std::make_shared(read_value, variable); + ov::test::NodeBuilder builder(assign, {read_value}); // attribute count const auto expected_attr_count = 1; diff --git a/src/core/tests/visitors/op/atan.cpp b/src/core/tests/visitors/op/atan.cpp index fb15313837f..8534847f71b 100644 --- a/src/core/tests/visitors/op/atan.cpp +++ b/src/core/tests/visitors/op/atan.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/atan.hpp" + #include "unary_ops.hpp" -using Types = ::testing::Types>; +using Types = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Types, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/atanh.cpp b/src/core/tests/visitors/op/atanh.cpp index c0bc3b7c6a8..3daf9b9d36e 100644 --- a/src/core/tests/visitors/op/atanh.cpp +++ b/src/core/tests/visitors/op/atanh.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/atanh.hpp" + #include "unary_ops.hpp" -using Types = ::testing::Types>; +using Types = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Types, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/avg_pool.cpp b/src/core/tests/visitors/op/avg_pool.cpp index a0a0d35b8a3..9f022b78bd1 100644 --- a/src/core/tests/visitors/op/avg_pool.cpp +++ b/src/core/tests/visitors/op/avg_pool.cpp @@ -2,21 +2,19 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset8.hpp" +#include "openvino/op/avg_pool.hpp" + +#include + +#include "openvino/op/parameter.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; TEST(attributes, avg_pool_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::f32, Shape{64, 3, 5}); + ov::test::NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::f32, Shape{64, 3, 5}); auto strides = Strides{2}; auto pads_begin = Shape{1}; @@ -27,13 +25,13 @@ TEST(attributes, avg_pool_op) { auto auto_pad = op::PadType::EXPLICIT; auto avg_pool = - make_shared(data, strides, pads_begin, pads_end, kernel, exclude_pad, rounding_mode, auto_pad); + make_shared(data, strides, pads_begin, pads_end, kernel, exclude_pad, rounding_mode, auto_pad); avg_pool->set_pads_begin(pads_begin); avg_pool->set_pads_end(pads_end); - NodeBuilder builder(avg_pool, {data}); - auto g_avg_pool = ov::as_type_ptr(builder.create()); + ov::test::NodeBuilder builder(avg_pool, {data}); + auto g_avg_pool = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_avg_pool->get_strides(), avg_pool->get_strides()); EXPECT_EQ(g_avg_pool->get_pads_begin(), avg_pool->get_pads_begin()); @@ -44,8 +42,8 @@ TEST(attributes, avg_pool_op) { } TEST(attributes, avg_pool_op_valid) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::f32, Shape{64, 3, 5}); + ov::test::NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::f32, Shape{64, 3, 5}); auto strides = Strides{2}; auto pads_begin = Shape{1}; @@ -56,10 +54,10 @@ TEST(attributes, avg_pool_op_valid) { auto auto_pad = op::PadType::VALID; auto avg_pool = - make_shared(data, strides, pads_begin, pads_end, kernel, exclude_pad, rounding_mode, auto_pad); + make_shared(data, strides, pads_begin, pads_end, kernel, exclude_pad, rounding_mode, auto_pad); - NodeBuilder builder(avg_pool, {data}); - auto g_avg_pool = ov::as_type_ptr(builder.create()); + ov::test::NodeBuilder builder(avg_pool, {data}); + auto g_avg_pool = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_avg_pool->get_strides(), avg_pool->get_strides()); EXPECT_EQ(g_avg_pool->get_pads_begin(), avg_pool->get_pads_begin()); @@ -70,8 +68,8 @@ TEST(attributes, avg_pool_op_valid) { } TEST(attributes, avg_pool_v8_op) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::i32, Shape{1, 3, 37, 37}); + ov::test::NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::i32, Shape{1, 3, 37, 37}); const auto strides = Strides{1, 1}; const auto pads_begin = Shape{1, 1}; @@ -82,9 +80,9 @@ TEST(attributes, avg_pool_v8_op) { const auto auto_pad = op::PadType::EXPLICIT; const auto avg_pool = - make_shared(data, strides, pads_begin, pads_end, kernel, exclude_pad, rounding_mode, auto_pad); - NodeBuilder builder(avg_pool, {data}); - auto g_avg_pool = ov::as_type_ptr(builder.create()); + make_shared(data, strides, pads_begin, pads_end, kernel, exclude_pad, rounding_mode, auto_pad); + ov::test::NodeBuilder builder(avg_pool, {data}); + auto g_avg_pool = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_avg_pool->get_strides(), avg_pool->get_strides()); EXPECT_EQ(g_avg_pool->get_pads_begin(), avg_pool->get_pads_begin()); diff --git a/src/core/tests/visitors/op/batch_norm.cpp b/src/core/tests/visitors/op/batch_norm.cpp index 1e55d4998b0..e66afd770ed 100644 --- a/src/core/tests/visitors/op/batch_norm.cpp +++ b/src/core/tests/visitors/op/batch_norm.cpp @@ -2,19 +2,17 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/batch_norm.hpp" + +#include + +#include "openvino/core/partial_shape.hpp" +#include "openvino/core/type/element_type.hpp" +#include "openvino/op/parameter.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; TEST(attributes, batch_norm_inference_op_v5) { PartialShape in_shape{1, 10}; @@ -22,16 +20,16 @@ TEST(attributes, batch_norm_inference_op_v5) { element::Type et = element::f32; double epsilon = 0.001; - NodeBuilder::get_ops().register_factory(); - auto data_batch = make_shared(et, in_shape); - auto gamma = make_shared(et, ch_shape); - auto beta = make_shared(et, ch_shape); - auto mean = make_shared(et, ch_shape); - auto var = make_shared(et, ch_shape); + test::NodeBuilder::get_ops().register_factory(); + auto data_batch = make_shared(et, in_shape); + auto gamma = make_shared(et, ch_shape); + auto beta = make_shared(et, ch_shape); + auto mean = make_shared(et, ch_shape); + auto var = make_shared(et, ch_shape); auto batch_norm = make_shared(data_batch, gamma, beta, mean, var, epsilon); const auto expected_attr_count = 1; - NodeBuilder builder(batch_norm, {data_batch, gamma, beta, mean, var}); + test::NodeBuilder builder(batch_norm, {data_batch, gamma, beta, mean, var}); EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); auto g_batch_norm = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_batch_norm->get_eps_value(), batch_norm->get_eps_value()); @@ -43,16 +41,16 @@ TEST(attributes, batch_norm_inference_op_v0) { element::Type et = element::f32; double epsilon = 0.001; - NodeBuilder::get_ops().register_factory(); - auto data_batch = make_shared(et, in_shape); - auto gamma = make_shared(et, ch_shape); - auto beta = make_shared(et, ch_shape); - auto mean = make_shared(et, ch_shape); - auto var = make_shared(et, ch_shape); + test::NodeBuilder::get_ops().register_factory(); + auto data_batch = make_shared(et, in_shape); + auto gamma = make_shared(et, ch_shape); + auto beta = make_shared(et, ch_shape); + auto mean = make_shared(et, ch_shape); + auto var = make_shared(et, ch_shape); auto batch_norm = make_shared(data_batch, gamma, beta, mean, var, epsilon); const auto expected_attr_count = 1; - NodeBuilder builder(batch_norm, {gamma, beta, data_batch, mean, var}); + test::NodeBuilder builder(batch_norm, {gamma, beta, data_batch, mean, var}); EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); auto g_batch_norm = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_batch_norm->get_eps_value(), batch_norm->get_eps_value()); diff --git a/src/core/tests/visitors/op/batch_to_space.cpp b/src/core/tests/visitors/op/batch_to_space.cpp index 8470f2ada3f..7bf599cd308 100644 --- a/src/core/tests/visitors/op/batch_to_space.cpp +++ b/src/core/tests/visitors/op/batch_to_space.cpp @@ -2,24 +2,26 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" +#include "openvino/op/batch_to_space.hpp" + +#include + +#include "openvino/op/constant.hpp" +#include "openvino/op/parameter.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; TEST(attributes, batch_to_space_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::f32, Shape{2, 128}); - auto block_shape = make_shared(element::i64, Shape{2}, vector{1, 2}); - auto crops_begin = make_shared(element::i64, Shape{2}, vector{0, 2}); - auto crops_end = make_shared(element::i64, Shape{2}, vector{0, 0}); + test::NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::f32, Shape{2, 128}); + auto block_shape = make_shared(element::i64, Shape{2}, vector{1, 2}); + auto crops_begin = make_shared(element::i64, Shape{2}, vector{0, 2}); + auto crops_end = make_shared(element::i64, Shape{2}, vector{0, 0}); auto batch2space = make_shared(data, block_shape, crops_begin, crops_end); - NodeBuilder builder(batch2space, {data}); + test::NodeBuilder builder(batch2space, {data}); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/binary_convolution.cpp b/src/core/tests/visitors/op/binary_convolution.cpp index 5fbe8e5f861..4805d869741 100644 --- a/src/core/tests/visitors/op/binary_convolution.cpp +++ b/src/core/tests/visitors/op/binary_convolution.cpp @@ -2,19 +2,16 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/binary_convolution.hpp" + +#include + +#include "openvino/op/convolution.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, bin_convolution) { NodeBuilder::get_ops().register_factory(); @@ -28,8 +25,8 @@ TEST(attributes, bin_convolution) { const float pad_value = 1.0f; const auto auto_pad = op::PadType::SAME_LOWER; - auto data_batch = make_shared(element::f32, data_batch_shape); - auto filters = make_shared(element::u1, filters_shape); + auto data_batch = make_shared(element::f32, data_batch_shape); + auto filters = make_shared(element::u1, filters_shape); auto conv = make_shared(data_batch, filters, diff --git a/src/core/tests/visitors/op/binary_ops.hpp b/src/core/tests/visitors/op/binary_ops.hpp index 63de8de720f..2e5df5880a8 100644 --- a/src/core/tests/visitors/op/binary_ops.hpp +++ b/src/core/tests/visitors/op/binary_ops.hpp @@ -4,14 +4,15 @@ #pragma once -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" +#include -template +#include "visitors/visitors.hpp" + +template class BinaryOperatorType { public: using op_type = T; - static constexpr ngraph::element::Type_t element_type = ELEMENT_TYPE; + static constexpr ov::element::Type_t element_type = ELEMENT_TYPE; }; template @@ -22,8 +23,8 @@ public: template static std::string GetName(int) { using OP_Type = typename T::op_type; - constexpr ngraph::element::Type precision(T::element_type); - const ngraph::Node::type_info_t typeinfo = OP_Type::get_type_info_static(); + constexpr ov::element::Type precision(T::element_type); + const ov::Node::type_info_t typeinfo = OP_Type::get_type_info_static(); return std::string{typeinfo.name} + "_" + precision.get_type_name(); } }; @@ -32,17 +33,17 @@ TYPED_TEST_SUITE_P(BinaryOperatorVisitor); TYPED_TEST_P(BinaryOperatorVisitor, Auto_Broadcast) { using OP_Type = typename TypeParam::op_type; - const ngraph::element::Type_t element_type = TypeParam::element_type; + const ov::element::Type_t element_type = TypeParam::element_type; - ngraph::test::NodeBuilder::get_ops().register_factory(); - const auto A = std::make_shared(element_type, ngraph::PartialShape{1, 2, 3}); - const auto B = std::make_shared(element_type, ngraph::PartialShape{3, 2, 1}); + ov::test::NodeBuilder::get_ops().register_factory(); + const auto A = std::make_shared(element_type, ov::PartialShape{1, 2, 3}); + const auto B = std::make_shared(element_type, ov::PartialShape{3, 2, 1}); - auto auto_broadcast = ngraph::op::AutoBroadcastType::NUMPY; + auto auto_broadcast = ov::op::AutoBroadcastType::NUMPY; const auto op_func = std::make_shared(A, B, auto_broadcast); - ngraph::test::NodeBuilder builder(op_func, {A, B}); - const auto g_op_func = ngraph::as_type_ptr(builder.create()); + ov::test::NodeBuilder builder(op_func, {A, B}); + const auto g_op_func = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 1; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); @@ -51,15 +52,15 @@ TYPED_TEST_P(BinaryOperatorVisitor, Auto_Broadcast) { TYPED_TEST_P(BinaryOperatorVisitor, No_Broadcast) { using OP_Type = typename TypeParam::op_type; - const ngraph::element::Type_t element_type = TypeParam::element_type; + const ov::element::Type_t element_type = TypeParam::element_type; - ngraph::test::NodeBuilder::get_ops().register_factory(); - const auto A = std::make_shared(element_type, ngraph::PartialShape{1, 2, 3}); - const auto B = std::make_shared(element_type, ngraph::PartialShape{1, 2, 3}); + ov::test::NodeBuilder::get_ops().register_factory(); + const auto A = std::make_shared(element_type, ov::PartialShape{1, 2, 3}); + const auto B = std::make_shared(element_type, ov::PartialShape{1, 2, 3}); const auto op_func = std::make_shared(A, B); - ngraph::test::NodeBuilder builder(op_func, {A, B}); - const auto g_op_func = ngraph::as_type_ptr(builder.create()); + ov::test::NodeBuilder builder(op_func, {A, B}); + const auto g_op_func = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 1; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/broadcast.cpp b/src/core/tests/visitors/op/broadcast.cpp index c83b88551a5..5abaee23579 100644 --- a/src/core/tests/visitors/op/broadcast.cpp +++ b/src/core/tests/visitors/op/broadcast.cpp @@ -2,55 +2,53 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" +#include "openvino/op/broadcast.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, broadcast_v1) { - NodeBuilder::get_ops().register_factory(); - const auto arg = make_shared(element::i64, Shape{1, 3, 1}); - const auto shape = make_shared(element::i64, Shape{3}); - const auto axes_mapping = make_shared(element::i64, Shape{3}); + NodeBuilder::get_ops().register_factory(); + const auto arg = make_shared(element::i64, Shape{1, 3, 1}); + const auto shape = make_shared(element::i64, Shape{3}); + const auto axes_mapping = make_shared(element::i64, Shape{3}); const auto broadcast_spec = ov::op::AutoBroadcastType::NONE; const auto broadcast_v3 = make_shared(arg, shape, axes_mapping, broadcast_spec); NodeBuilder builder(broadcast_v3, {arg, shape, axes_mapping}); - auto g_broadcast_v3 = ov::as_type_ptr(builder.create()); + auto g_broadcast_v3 = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_broadcast_v3->get_broadcast_spec().m_type, broadcast_spec); } TEST(attributes, broadcast_v3) { - NodeBuilder::get_ops().register_factory(); - const auto arg = make_shared(element::i64, Shape{1, 3, 1}); - const auto shape = make_shared(element::i64, Shape{3}); + NodeBuilder::get_ops().register_factory(); + const auto arg = make_shared(element::i64, Shape{1, 3, 1}); + const auto shape = make_shared(element::i64, Shape{3}); const auto broadcast_spec = op::BroadcastType::BIDIRECTIONAL; const auto broadcast_v3 = make_shared(arg, shape, broadcast_spec); NodeBuilder builder(broadcast_v3, {arg, shape}); - auto g_broadcast_v3 = ov::as_type_ptr(builder.create()); + auto g_broadcast_v3 = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_broadcast_v3->get_broadcast_spec(), broadcast_spec); } TEST(attributes, broadcast_v3_explicit) { - NodeBuilder::get_ops().register_factory(); - const auto arg = make_shared(element::i64, Shape{1, 3, 1}); - const auto shape = make_shared(element::i64, Shape{3}); - const auto axes_mapping = make_shared(element::i64, Shape{3}); + NodeBuilder::get_ops().register_factory(); + const auto arg = make_shared(element::i64, Shape{1, 3, 1}); + const auto shape = make_shared(element::i64, Shape{3}); + const auto axes_mapping = make_shared(element::i64, Shape{3}); const auto broadcast_spec = op::BroadcastType::EXPLICIT; const auto broadcast_v3 = make_shared(arg, shape, axes_mapping, broadcast_spec); NodeBuilder builder(broadcast_v3, {arg, shape, axes_mapping}); - auto g_broadcast_v3 = ov::as_type_ptr(builder.create()); + auto g_broadcast_v3 = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_broadcast_v3->get_broadcast_spec(), broadcast_spec); } diff --git a/src/core/tests/visitors/op/bucketize.cpp b/src/core/tests/visitors/op/bucketize.cpp index d0ac5de33f3..dbccd1bc1cd 100644 --- a/src/core/tests/visitors/op/bucketize.cpp +++ b/src/core/tests/visitors/op/bucketize.cpp @@ -2,44 +2,41 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/bucketize.hpp" + +#include + +#include "openvino/op/parameter.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, bucketize_v3_op_default_attributes) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::f32, Shape{2, 3, 4}); - auto buckets = make_shared(element::f32, Shape{5}); - auto bucketize = make_shared(data, buckets); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::f32, Shape{2, 3, 4}); + auto buckets = make_shared(element::f32, Shape{5}); + auto bucketize = make_shared(data, buckets); NodeBuilder builder(bucketize, {data, buckets}); - auto g_bucketize = ov::as_type_ptr(builder.create()); + auto g_bucketize = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_bucketize->get_output_type(), bucketize->get_output_type()); EXPECT_EQ(g_bucketize->get_with_right_bound(), bucketize->get_with_right_bound()); } TEST(attributes, bucketize_v3_op_custom_attributes) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::f32, Shape{2, 3, 4}); - auto buckets = make_shared(element::f32, Shape{5}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::f32, Shape{2, 3, 4}); + auto buckets = make_shared(element::f32, Shape{5}); element::Type output_type = element::i32; bool with_right_bound = false; - auto bucketize = make_shared(data, buckets, output_type, with_right_bound); + auto bucketize = make_shared(data, buckets, output_type, with_right_bound); NodeBuilder builder(bucketize, {data, buckets}); - auto g_bucketize = ov::as_type_ptr(builder.create()); + auto g_bucketize = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_bucketize->get_output_type(), bucketize->get_output_type()); EXPECT_EQ(g_bucketize->get_with_right_bound(), bucketize->get_with_right_bound()); diff --git a/src/core/tests/visitors/op/ceiling.cpp b/src/core/tests/visitors/op/ceiling.cpp index dd7d2c0658a..22f71b19344 100644 --- a/src/core/tests/visitors/op/ceiling.cpp +++ b/src/core/tests/visitors/op/ceiling.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/ceiling.hpp" + #include "unary_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Type, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/clamp.cpp b/src/core/tests/visitors/op/clamp.cpp index 655b628950d..8eb5f5b6d92 100644 --- a/src/core/tests/visitors/op/clamp.cpp +++ b/src/core/tests/visitors/op/clamp.cpp @@ -2,27 +2,27 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/clamp.hpp" + +#include + +#include "openvino/op/parameter.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, clamp_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::f32, Shape{2, 4}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::f32, Shape{2, 4}); double min = 0.4; double max = 5.6; - const auto clamp = make_shared(data, min, max); + const auto clamp = make_shared(data, min, max); NodeBuilder builder(clamp, {data}); - auto g_clamp = ov::as_type_ptr(builder.create()); + auto g_clamp = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 2; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/concat.cpp b/src/core/tests/visitors/op/concat.cpp index cbe94cba5bf..f30533d64d8 100644 --- a/src/core/tests/visitors/op/concat.cpp +++ b/src/core/tests/visitors/op/concat.cpp @@ -2,27 +2,26 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/concat.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, concat_op) { - NodeBuilder::get_ops().register_factory(); - auto input1 = make_shared(element::i64, Shape{1, 2, 3}); - auto input2 = make_shared(element::i64, Shape{1, 2, 3}); - auto input3 = make_shared(element::i64, Shape{1, 2, 3}); + NodeBuilder::get_ops().register_factory(); + auto input1 = make_shared(element::i64, Shape{1, 2, 3}); + auto input2 = make_shared(element::i64, Shape{1, 2, 3}); + auto input3 = make_shared(element::i64, Shape{1, 2, 3}); int64_t axis = 2; - auto concat = make_shared(ov::NodeVector{input1, input2, input3}, axis); + auto concat = make_shared(ov::NodeVector{input1, input2, input3}, axis); NodeBuilder builder(concat, {input1, input2, input3}); - auto g_concat = ov::as_type_ptr(builder.create()); + auto g_concat = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_concat->get_axis(), concat->get_axis()); } diff --git a/src/core/tests/visitors/op/constant.cpp b/src/core/tests/visitors/op/constant.cpp index ae177b9d2a2..8577187d678 100644 --- a/src/core/tests/visitors/op/constant.cpp +++ b/src/core/tests/visitors/op/constant.cpp @@ -2,20 +2,15 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" -#include "ngraph/runtime/host_tensor.hpp" +#include "openvino/op/constant.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, constant_op) { vector data{5.0f, 4.0f, 3.0f, 2.0f, 1.0f, 0.0f}; @@ -58,10 +53,9 @@ TEST(attributes, constant_op_identical_elements) { ASSERT_TRUE(g_k->get_all_data_elements_bitwise_identical()); } -OPENVINO_SUPPRESS_DEPRECATED_START TEST(attributes, constant_op_from_host_tensor_different_elements) { vector data{5, 4, 3, 2, 1, 0}; - auto tensor = std::make_shared(element::i64, Shape{2, 3}, &data[0]); + auto tensor = ov::Tensor(element::i64, Shape{2, 3}, &data[0]); auto k = make_shared(tensor); ASSERT_FALSE(k->get_all_data_elements_bitwise_identical()); NodeBuilder builder(k); @@ -77,7 +71,7 @@ TEST(attributes, constant_op_from_host_tensor_different_elements) { TEST(attributes, constant_op_from_host_tensor_identical_elements) { vector data{5, 5, 5, 5, 5, 5}; - auto tensor = std::make_shared(element::i64, Shape{2, 3}, &data[0]); + auto tensor = ov::Tensor(element::i64, Shape{2, 3}, &data[0]); auto k = make_shared(tensor); ASSERT_TRUE(k->get_all_data_elements_bitwise_identical()); NodeBuilder builder(k); diff --git a/src/core/tests/visitors/op/convert.cpp b/src/core/tests/visitors/op/convert.cpp index 6e144daa002..ccce36561e4 100644 --- a/src/core/tests/visitors/op/convert.cpp +++ b/src/core/tests/visitors/op/convert.cpp @@ -2,19 +2,20 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" +#include "openvino/op/convert.hpp" -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +#include + +#include "visitors/visitors.hpp" + +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, convert_op_v0) { using Convert = op::v0::Convert; NodeBuilder::get_ops().register_factory(); - auto data = std::make_shared(element::f32, Shape{2, 4}); + auto data = std::make_shared(element::f32, Shape{2, 4}); const element::Type destination_type = element::Type_t::i32; const auto convert = std::make_shared(data, destination_type); diff --git a/src/core/tests/visitors/op/convert_color_i420.cpp b/src/core/tests/visitors/op/convert_color_i420.cpp index 874bbb9c6b3..9cf7a8a62e2 100644 --- a/src/core/tests/visitors/op/convert_color_i420.cpp +++ b/src/core/tests/visitors/op/convert_color_i420.cpp @@ -2,16 +2,15 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/op/util/attr_types.hpp" +#include + #include "openvino/op/i420_to_bgr.hpp" #include "openvino/op/i420_to_rgb.hpp" +#include "visitors/visitors.hpp" using namespace std; using namespace ov; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using ov::test::NodeBuilder; TEST(attributes, convert_color_i420_rgb) { NodeBuilder::get_ops().register_factory(); diff --git a/src/core/tests/visitors/op/convert_color_nv12.cpp b/src/core/tests/visitors/op/convert_color_nv12.cpp index 35a8af6a067..084400bc01b 100644 --- a/src/core/tests/visitors/op/convert_color_nv12.cpp +++ b/src/core/tests/visitors/op/convert_color_nv12.cpp @@ -2,16 +2,16 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" +#include + #include "ngraph/op/util/attr_types.hpp" #include "openvino/op/nv12_to_bgr.hpp" #include "openvino/op/nv12_to_rgb.hpp" +#include "visitors/visitors.hpp" using namespace std; using namespace ov; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using ov::test::NodeBuilder; TEST(attributes, convert_color_nv12_rgb) { NodeBuilder::get_ops().register_factory(); diff --git a/src/core/tests/visitors/op/convert_like.cpp b/src/core/tests/visitors/op/convert_like.cpp index e8098552af6..d712408b167 100644 --- a/src/core/tests/visitors/op/convert_like.cpp +++ b/src/core/tests/visitors/op/convert_like.cpp @@ -2,25 +2,25 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/convert_like.hpp" + +#include + +#include "openvino/op/concat.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, convert_like_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::i64, Shape{1, 2, 3}); - auto like = make_shared(element::i64, Shape{1, 2, 3}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::i64, Shape{1, 2, 3}); + auto like = make_shared(element::i64, Shape{1, 2, 3}); - auto convertLike = make_shared(data, like); + auto convertLike = make_shared(data, like); NodeBuilder builder(convertLike, {data, like}); - auto g_convertLike = ov::as_type_ptr(builder.create()); + auto g_convertLike = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/convolution.cpp b/src/core/tests/visitors/op/convolution.cpp index 65c280d93f8..4262ff8a2a1 100644 --- a/src/core/tests/visitors/op/convolution.cpp +++ b/src/core/tests/visitors/op/convolution.cpp @@ -2,24 +2,21 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/convolution.hpp" + +#include + +#include "openvino/op/parameter.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, convolution) { NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::f32, Shape{1, 16, 124, 124}); - auto filters = make_shared(element::f32, Shape{2, 16, 3, 3}); + auto data = make_shared(element::f32, Shape{1, 16, 124, 124}); + auto filters = make_shared(element::f32, Shape{2, 16, 3, 3}); auto strides = Strides{1, 1}; auto pads_begin = CoordinateDiff{1, 2}; auto pads_end = CoordinateDiff{1, 2}; @@ -43,8 +40,8 @@ TEST(attributes, convolution) { TEST(attributes, convolution2) { NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::f32, Shape{1, 3, 227, 227}); - auto filters = make_shared(element::f32, Shape{96, 3, 227, 227}); + auto data = make_shared(element::f32, Shape{1, 3, 227, 227}); + auto filters = make_shared(element::f32, Shape{96, 3, 227, 227}); auto strides = Strides{4, 4}; auto pads_begin = CoordinateDiff{0, 0}; auto pads_end = CoordinateDiff{0, 0}; diff --git a/src/core/tests/visitors/op/convolution_backprop.cpp b/src/core/tests/visitors/op/convolution_backprop.cpp index bfc51319efa..652cebb4221 100644 --- a/src/core/tests/visitors/op/convolution_backprop.cpp +++ b/src/core/tests/visitors/op/convolution_backprop.cpp @@ -2,37 +2,32 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include + +#include "openvino/op/convolution.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, convolution_backprop_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::f32, Shape{1, 16, 124, 124}); - auto filters = make_shared(element::f32, Shape{16, 2, 3, 3}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::f32, Shape{1, 16, 124, 124}); + auto filters = make_shared(element::f32, Shape{16, 2, 3, 3}); auto strides = Strides{1, 1}; auto pads_begin = CoordinateDiff{1, 2}; auto pads_end = CoordinateDiff{1, 2}; auto dilations = Strides{1, 1}; - auto convolution = make_shared(data, - filters, - strides, - pads_begin, - pads_end, - dilations, - op::PadType::VALID); + auto convolution = make_shared(data, + filters, + strides, + pads_begin, + pads_end, + dilations, + op::PadType::VALID); NodeBuilder builder(convolution, {data, filters}); - auto g_convolution = ov::as_type_ptr(builder.create()); + auto g_convolution = ov::as_type_ptr(builder.create()); // attribute count const auto expected_attr_count = 6; @@ -46,10 +41,10 @@ TEST(attributes, convolution_backprop_op) { } TEST(attributes, convolution_backprop_output_shape_output_padding) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::f32, Shape{1, 16, 124, 124}); - const auto filter = make_shared(element::f32, Shape{16, 2, 3, 3}); - const auto output_shape = make_shared(element::i32, Shape{2}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::f32, Shape{1, 16, 124, 124}); + const auto filter = make_shared(element::f32, Shape{16, 2, 3, 3}); + const auto output_shape = make_shared(element::i32, Shape{2}); const auto strides = Strides{2, 1}; const auto pads_begin = CoordinateDiff{3, 4}; @@ -65,17 +60,17 @@ TEST(attributes, convolution_backprop_output_shape_output_padding) { op::PadType::NOTSET}; for (auto padType : allPadTypes) { - const auto convolution = make_shared(data, - filter, - output_shape, - strides, - pads_begin, - pads_end, - dilations, - padType, - output_padding); + const auto convolution = make_shared(data, + filter, + output_shape, + strides, + pads_begin, + pads_end, + dilations, + padType, + output_padding); NodeBuilder builder(convolution, {data, filter}); - const auto g_convolution = ov::as_type_ptr(builder.create()); + const auto g_convolution = ov::as_type_ptr(builder.create()); // attribute count const auto expected_attr_count = 6; diff --git a/src/core/tests/visitors/op/cos.cpp b/src/core/tests/visitors/op/cos.cpp index e119dd5e0d7..c6b1d6ed79f 100644 --- a/src/core/tests/visitors/op/cos.cpp +++ b/src/core/tests/visitors/op/cos.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/cos.hpp" + #include "unary_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Type, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/cosh.cpp b/src/core/tests/visitors/op/cosh.cpp index d153a6b9ff6..a4bcc31c26c 100644 --- a/src/core/tests/visitors/op/cosh.cpp +++ b/src/core/tests/visitors/op/cosh.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/cosh.hpp" + #include "unary_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Type, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/ctc_greedy_decoder.cpp b/src/core/tests/visitors/op/ctc_greedy_decoder.cpp index 172bb1dc41f..d5b226b2e37 100644 --- a/src/core/tests/visitors/op/ctc_greedy_decoder.cpp +++ b/src/core/tests/visitors/op/ctc_greedy_decoder.cpp @@ -2,25 +2,25 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/ctc_greedy_decoder.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, ctc_greedy_decoder_op) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); bool m_ctc_merge_repeated = false; - auto data = make_shared(element::f32, Shape{3, 1, 3}); - auto masks = make_shared(element::i32, Shape{3, 1}); + auto data = make_shared(element::f32, Shape{3, 1, 3}); + auto masks = make_shared(element::i32, Shape{3, 1}); auto decoder = make_shared(data, masks, m_ctc_merge_repeated); NodeBuilder builder(decoder, {data, masks}); - auto g_decoder = ov::as_type_ptr(builder.create()); + auto g_decoder = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_decoder->get_ctc_merge_repeated(), decoder->get_ctc_merge_repeated()); } diff --git a/src/core/tests/visitors/op/ctc_greedy_decoder_seq_len.cpp b/src/core/tests/visitors/op/ctc_greedy_decoder_seq_len.cpp index 5972de01458..5c3d8329242 100644 --- a/src/core/tests/visitors/op/ctc_greedy_decoder_seq_len.cpp +++ b/src/core/tests/visitors/op/ctc_greedy_decoder_seq_len.cpp @@ -2,27 +2,27 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset6.hpp" +#include "openvino/op/ctc_greedy_decoder_seq_len.hpp" + +#include + +#include "openvino/op/constant.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, ctc_greedy_decoder_seq_len_op) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); bool merge_repeated = false; - auto data = make_shared(element::f32, Shape{1, 3, 3}); - auto seq_len = make_shared(element::i32, Shape{1}); - auto blank_index = op::Constant::create(element::i32, Shape{}, {2}); + auto data = make_shared(element::f32, Shape{1, 3, 3}); + auto seq_len = make_shared(element::i32, Shape{1}); + auto blank_index = ov::op::v0::Constant::create(element::i32, Shape{}, {2}); auto decoder = make_shared(data, seq_len, blank_index, merge_repeated); NodeBuilder builder(decoder, {data, seq_len, blank_index}); - auto g_decoder = ov::as_type_ptr(builder.create()); + auto g_decoder = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_decoder->get_merge_repeated(), decoder->get_merge_repeated()); } diff --git a/src/core/tests/visitors/op/ctc_loss.cpp b/src/core/tests/visitors/op/ctc_loss.cpp index e01c93126a5..e328a05002b 100644 --- a/src/core/tests/visitors/op/ctc_loss.cpp +++ b/src/core/tests/visitors/op/ctc_loss.cpp @@ -2,32 +2,29 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/ctc_loss.hpp" + +#include + +#include "openvino/op/parameter.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, ctc_loss) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); - auto logits = make_shared(element::f32, Shape{10, 120, 28}); - auto logit_length = make_shared(element::i32, Shape{10}); - auto labels = make_shared(element::i32, Shape{10, 120}); - auto label_length = make_shared(element::i32, Shape{10}); - auto blank_index = make_shared(element::i32, Shape{}); + auto logits = make_shared(element::f32, Shape{10, 120, 28}); + auto logit_length = make_shared(element::i32, Shape{10}); + auto labels = make_shared(element::i32, Shape{10, 120}); + auto label_length = make_shared(element::i32, Shape{10}); + auto blank_index = make_shared(element::i32, Shape{}); - auto ctc_loss = make_shared(logits, logit_length, labels, label_length, blank_index); + auto ctc_loss = make_shared(logits, logit_length, labels, label_length, blank_index); NodeBuilder builder(ctc_loss, {logits, logit_length, labels, label_length, blank_index}); - auto g_ctc_loss = as_type_ptr(builder.create()); + auto g_ctc_loss = as_type_ptr(builder.create()); // attribute count const auto expected_attr_count = 3; diff --git a/src/core/tests/visitors/op/cum_sum.cpp b/src/core/tests/visitors/op/cum_sum.cpp index 8273eb70598..c702732878e 100644 --- a/src/core/tests/visitors/op/cum_sum.cpp +++ b/src/core/tests/visitors/op/cum_sum.cpp @@ -2,25 +2,25 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset3.hpp" +#include "openvino/op/cum_sum.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, cum_sum_op_default_attributes_no_axis_input) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); Shape shape{1, 4}; - auto A = make_shared(element::f32, shape); - auto cs = make_shared(A); + auto A = make_shared(element::f32, shape); + auto cs = make_shared(A); NodeBuilder builder(cs, {A}); - auto g_cs = ov::as_type_ptr(builder.create()); + auto g_cs = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 2; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); @@ -30,15 +30,15 @@ TEST(attributes, cum_sum_op_default_attributes_no_axis_input) { } TEST(attributes, cum_sum_op_default_attributes) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); Shape shape{1, 4}; - auto A = make_shared(element::f32, shape); - auto axis = make_shared(element::i32, Shape{1}); - auto cs = make_shared(A, axis); + auto A = make_shared(element::f32, shape); + auto axis = make_shared(element::i32, Shape{1}); + auto cs = make_shared(A, axis); NodeBuilder builder(cs, {A, axis}); - auto g_cs = ov::as_type_ptr(builder.create()); + auto g_cs = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 2; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); @@ -48,17 +48,17 @@ TEST(attributes, cum_sum_op_default_attributes) { } TEST(attributes, cum_sum_op_custom_attributes) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); Shape shape{1, 4}; - auto A = make_shared(element::f32, shape); - auto axis = make_shared(element::i32, Shape{1}); + auto A = make_shared(element::f32, shape); + auto axis = make_shared(element::i32, Shape{1}); bool exclusive = true; bool reverse = true; - auto cs = make_shared(A, axis, exclusive, reverse); + auto cs = make_shared(A, axis, exclusive, reverse); NodeBuilder builder(cs, {A, axis}); - auto g_cs = ov::as_type_ptr(builder.create()); + auto g_cs = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 2; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/deformable_convolution.cpp b/src/core/tests/visitors/op/deformable_convolution.cpp index f68d8cb2d87..951fa7e6635 100644 --- a/src/core/tests/visitors/op/deformable_convolution.cpp +++ b/src/core/tests/visitors/op/deformable_convolution.cpp @@ -2,32 +2,35 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset8.hpp" +#include "openvino/op/deformable_convolution.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, deformable_convolution_default_attributes) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); const Shape inputs_shape{1, 1, 5, 5}; - auto data = make_shared(element::f32, Shape{1, 1, 5, 5}); - auto filters = make_shared(element::f32, Shape{1, 1, 3, 3}); - auto offsets = make_shared(element::f32, Shape{1, 18, 3, 3}); + auto data = make_shared(element::f32, Shape{1, 1, 5, 5}); + auto filters = make_shared(element::f32, Shape{1, 1, 3, 3}); + auto offsets = make_shared(element::f32, Shape{1, 18, 3, 3}); auto strides = Strides{1, 1}; auto pads_begin = CoordinateDiff{0, 0}; auto pads_end = CoordinateDiff{0, 0}; auto dilations = Strides{1, 1}; - auto convolution = - make_shared(data, offsets, filters, strides, pads_begin, pads_end, dilations); + auto convolution = make_shared(data, + offsets, + filters, + strides, + pads_begin, + pads_end, + dilations); NodeBuilder builder(convolution, {data, offsets, filters}); - auto g_convolution = ov::as_type_ptr(builder.create()); + auto g_convolution = ov::as_type_ptr(builder.create()); // attribute count const auto expected_attr_count = 7; @@ -43,27 +46,27 @@ TEST(attributes, deformable_convolution_default_attributes) { } TEST(attributes, deformable_convolution_attributes) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); const Shape inputs_shape{1, 1, 5, 5}; - auto data = make_shared(element::f32, Shape{1, 2, 5, 5}); - auto filters = make_shared(element::f32, Shape{2, 1, 3, 3}); - auto offsets = make_shared(element::f32, Shape{1, 36, 5, 5}); + auto data = make_shared(element::f32, Shape{1, 2, 5, 5}); + auto filters = make_shared(element::f32, Shape{2, 1, 3, 3}); + auto offsets = make_shared(element::f32, Shape{1, 36, 5, 5}); auto strides = Strides{1, 1}; auto pads_begin = CoordinateDiff{0, 0}; auto pads_end = CoordinateDiff{0, 0}; auto dilations = Strides{1, 1}; - auto convolution = make_shared(data, - offsets, - filters, - strides, - pads_begin, - pads_end, - dilations, - op::PadType::SAME_LOWER, - 2, - 2); + auto convolution = make_shared(data, + offsets, + filters, + strides, + pads_begin, + pads_end, + dilations, + op::PadType::SAME_LOWER, + 2, + 2); NodeBuilder builder(convolution, {data, offsets, filters}); - auto g_convolution = ov::as_type_ptr(builder.create()); + auto g_convolution = ov::as_type_ptr(builder.create()); // attribute count const auto expected_attr_count = 7; @@ -79,19 +82,24 @@ TEST(attributes, deformable_convolution_attributes) { } TEST(attributes, deformable_convolution_v8_default_attributes) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); const Shape inputs_shape{1, 1, 5, 5}; - auto data = make_shared(element::f32, Shape{1, 1, 5, 5}); - auto filters = make_shared(element::f32, Shape{1, 1, 3, 3}); - auto offsets = make_shared(element::f32, Shape{1, 18, 3, 3}); + auto data = make_shared(element::f32, Shape{1, 1, 5, 5}); + auto filters = make_shared(element::f32, Shape{1, 1, 3, 3}); + auto offsets = make_shared(element::f32, Shape{1, 18, 3, 3}); auto strides = Strides{1, 1}; auto pads_begin = CoordinateDiff{0, 0}; auto pads_end = CoordinateDiff{0, 0}; auto dilations = Strides{1, 1}; - auto convolution = - make_shared(data, offsets, filters, strides, pads_begin, pads_end, dilations); + auto convolution = make_shared(data, + offsets, + filters, + strides, + pads_begin, + pads_end, + dilations); NodeBuilder builder(convolution, {data, offsets, filters}); - auto g_convolution = ov::as_type_ptr(builder.create()); + auto g_convolution = ov::as_type_ptr(builder.create()); // attribute count const auto expected_attr_count = 8; @@ -108,30 +116,30 @@ TEST(attributes, deformable_convolution_v8_default_attributes) { } TEST(attributes, deformable_convolution_v8_attributes) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); const Shape inputs_shape{1, 1, 5, 5}; - auto data = make_shared(element::f32, Shape{1, 2, 5, 5}); - auto filters = make_shared(element::f32, Shape{2, 1, 3, 3}); - auto offsets = make_shared(element::f32, Shape{1, 36, 5, 5}); - auto mask = make_shared(element::f32, Shape{1, 18, 5, 5}); + auto data = make_shared(element::f32, Shape{1, 2, 5, 5}); + auto filters = make_shared(element::f32, Shape{2, 1, 3, 3}); + auto offsets = make_shared(element::f32, Shape{1, 36, 5, 5}); + auto mask = make_shared(element::f32, Shape{1, 18, 5, 5}); auto strides = Strides{1, 1}; auto pads_begin = CoordinateDiff{0, 0}; auto pads_end = CoordinateDiff{0, 0}; auto dilations = Strides{1, 1}; - auto convolution = make_shared(data, - offsets, - filters, - mask, - strides, - pads_begin, - pads_end, - dilations, - op::PadType::SAME_LOWER, - 2, - 2, - true); + auto convolution = make_shared(data, + offsets, + filters, + mask, + strides, + pads_begin, + pads_end, + dilations, + op::PadType::SAME_LOWER, + 2, + 2, + true); NodeBuilder builder(convolution, {data, offsets, filters, mask}); - auto g_convolution = ov::as_type_ptr(builder.create()); + auto g_convolution = ov::as_type_ptr(builder.create()); // attribute count const auto expected_attr_count = 8; diff --git a/src/core/tests/visitors/op/deformable_psroi_pooling.cpp b/src/core/tests/visitors/op/deformable_psroi_pooling.cpp index 42400d987e6..5336772f8db 100644 --- a/src/core/tests/visitors/op/deformable_psroi_pooling.cpp +++ b/src/core/tests/visitors/op/deformable_psroi_pooling.cpp @@ -2,21 +2,20 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/deformable_psroi_pooling.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, deformable_psroi_pooling_op) { - NodeBuilder::get_ops().register_factory(); - auto input = make_shared(element::f32, Shape{2, 16, 67, 32}); - auto coords = make_shared(element::f32, Shape{300, 5}); + NodeBuilder::get_ops().register_factory(); + auto input = make_shared(element::f32, Shape{2, 16, 67, 32}); + auto coords = make_shared(element::f32, Shape{300, 5}); const int output_dim = 4; const float spatial_scale = 0.0625; @@ -27,18 +26,18 @@ TEST(attributes, deformable_psroi_pooling_op) { const float trans_std = 0.1f; const int part_size = 3; - auto op = make_shared(input, - coords, - output_dim, - spatial_scale, - group_size, - mode, - spatial_bins_x, - spatial_bins_y, - trans_std, - part_size); + auto op = make_shared(input, + coords, + output_dim, + spatial_scale, + group_size, + mode, + spatial_bins_x, + spatial_bins_y, + trans_std, + part_size); NodeBuilder builder(op, {input, coords}); - auto g_op = ov::as_type_ptr(builder.create()); + auto g_op = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_op->get_output_dim(), op->get_output_dim()); EXPECT_EQ(g_op->get_spatial_scale(), op->get_spatial_scale()); @@ -51,10 +50,10 @@ TEST(attributes, deformable_psroi_pooling_op) { } TEST(attributes, deformable_psroi_pooling_op2) { - NodeBuilder::get_ops().register_factory(); - auto input = make_shared(element::f32, Shape{2, 16, 67, 32}); - auto coords = make_shared(element::f32, Shape{300, 5}); - auto offset = make_shared(element::i64, Shape{300, 2, 2, 2}); + NodeBuilder::get_ops().register_factory(); + auto input = make_shared(element::f32, Shape{2, 16, 67, 32}); + auto coords = make_shared(element::f32, Shape{300, 5}); + auto offset = make_shared(element::i64, Shape{300, 2, 2, 2}); const int output_dim = 4; const float spatial_scale = 0.0625; @@ -65,19 +64,19 @@ TEST(attributes, deformable_psroi_pooling_op2) { const float trans_std = 0.1f; const int part_size = 3; - auto op = make_shared(input, - coords, - offset, - output_dim, - spatial_scale, - group_size, - mode, - spatial_bins_x, - spatial_bins_y, - trans_std, - part_size); + auto op = make_shared(input, + coords, + offset, + output_dim, + spatial_scale, + group_size, + mode, + spatial_bins_x, + spatial_bins_y, + trans_std, + part_size); NodeBuilder builder(op, {input, coords, offset}); - auto g_op = ov::as_type_ptr(builder.create()); + auto g_op = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_op->get_output_dim(), op->get_output_dim()); EXPECT_EQ(g_op->get_spatial_scale(), op->get_spatial_scale()); diff --git a/src/core/tests/visitors/op/depth_to_space.cpp b/src/core/tests/visitors/op/depth_to_space.cpp index 690148a64b9..815e8f7ec46 100644 --- a/src/core/tests/visitors/op/depth_to_space.cpp +++ b/src/core/tests/visitors/op/depth_to_space.cpp @@ -2,29 +2,25 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/depth_to_space.hpp" -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +#include + +#include "visitors/visitors.hpp" + +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, depth_to_space) { - NodeBuilder::get_ops().register_factory(); - auto data = std::make_shared(element::f32, Shape{1, 8, 2, 2}); + NodeBuilder::get_ops().register_factory(); + auto data = std::make_shared(element::f32, Shape{1, 8, 2, 2}); const auto block_size = 2; const auto mode = "blocks_first"; - const auto dts = std::make_shared(data, mode, block_size); + const auto dts = std::make_shared(data, mode, block_size); NodeBuilder builder(dts, {data}); - auto g_dts = ov::as_type_ptr(builder.create()); + auto g_dts = ov::as_type_ptr(builder.create()); // attribute count const auto expected_attr_count = 2; diff --git a/src/core/tests/visitors/op/detection_output.cpp b/src/core/tests/visitors/op/detection_output.cpp index 10d362021db..1a82a97fffe 100644 --- a/src/core/tests/visitors/op/detection_output.cpp +++ b/src/core/tests/visitors/op/detection_output.cpp @@ -4,20 +4,17 @@ #include "openvino/op/detection_output.hpp" -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" +#include + #include "openvino/op/util/attr_types.hpp" -#include "openvino/opsets/opset8.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using namespace ov::op; -using namespace ov::op::util; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; namespace { -void initialize_attributes(DetectionOutputBase::AttributesBase& attrs) { +void initialize_attributes(ov::op::util::DetectionOutputBase::AttributesBase& attrs) { attrs.background_label_id = 0; attrs.top_k = 1; attrs.variance_encoded_in_target = false; @@ -34,8 +31,8 @@ void initialize_attributes(DetectionOutputBase::AttributesBase& attrs) { attrs.input_width = 32; attrs.objectness_score = 0.73f; } -void is_equal_attrs(const DetectionOutputBase::AttributesBase& attrs1, - const DetectionOutputBase::AttributesBase& attrs2) { +void is_equal_attrs(const ov::op::util::DetectionOutputBase::AttributesBase& attrs1, + const ov::op::util::DetectionOutputBase::AttributesBase& attrs2) { EXPECT_EQ(attrs1.background_label_id, attrs2.background_label_id); EXPECT_EQ(attrs1.top_k, attrs2.top_k); EXPECT_EQ(attrs1.variance_encoded_in_target, attrs2.variance_encoded_in_target); @@ -95,9 +92,9 @@ TEST(attributes, detection_output_v8) { initialize_attributes(attrs); auto detection_output = - make_shared(box_logits, class_preds, proposals, aux_class_preds, aux_box_pred, attrs); + make_shared(box_logits, class_preds, proposals, aux_class_preds, aux_box_pred, attrs); NodeBuilder builder(detection_output, {box_logits, class_preds, proposals, aux_class_preds, aux_box_pred}); - auto g_detection_output = ov::as_type_ptr(builder.create()); + auto g_detection_output = ov::as_type_ptr(builder.create()); const auto do_attrs = detection_output->get_attrs(); const auto g_do_attrs = g_detection_output->get_attrs(); diff --git a/src/core/tests/visitors/op/dft.cpp b/src/core/tests/visitors/op/dft.cpp index 5547b13f259..a95e182c4b7 100644 --- a/src/core/tests/visitors/op/dft.cpp +++ b/src/core/tests/visitors/op/dft.cpp @@ -2,14 +2,16 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" +#include "openvino/op/dft.hpp" + +#include + +#include "openvino/op/constant.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, dft_op) { NodeBuilder::get_ops().register_factory(); @@ -27,7 +29,7 @@ TEST(attributes, dft_op) { TEST(attributes, dft_op_signal) { NodeBuilder::get_ops().register_factory(); auto data = make_shared(element::f32, Shape{2, 10, 10, 2}); - auto signal = op::Constant::create(element::Type_t::i64, Shape{1}, {20}); + auto signal = ov::op::v0::Constant::create(element::Type_t::i64, Shape{1}, {20}); auto axes = op::v0::Constant::create(element::i64, Shape{1}, {2}); auto dft = make_shared(data, axes, signal); diff --git a/src/core/tests/visitors/op/divide.cpp b/src/core/tests/visitors/op/divide.cpp index 88ba2617ef3..53c9d05113d 100644 --- a/src/core/tests/visitors/op/divide.cpp +++ b/src/core/tests/visitors/op/divide.cpp @@ -2,37 +2,27 @@ // SPDX-License-Identifier: Apache-2.0 // -/* -#include "binary_ops.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/divide.hpp" -using Type = ::testing::Types>; +#include -INSTANTIATE_TYPED_TEST_SUITE_P(visitor_with_auto_broadcast, BinaryOperatorVisitor, Type, BinaryOperatorTypeName); - -*/ -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, divide) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); - const auto in1 = make_shared(element::f32, Shape{2, 4}); - const auto in2 = make_shared(element::f32, Shape{2, 4}); + const auto in1 = make_shared(element::f32, Shape{2, 4}); + const auto in2 = make_shared(element::f32, Shape{2, 4}); const bool pythondiv = true; const op::AutoBroadcastSpec& auto_broadcast = op::AutoBroadcastSpec(op::AutoBroadcastType::NUMPY); - const auto divide = make_shared(in1, in2, pythondiv, auto_broadcast); + const auto divide = make_shared(in1, in2, pythondiv, auto_broadcast); NodeBuilder builder(divide, {in1, in2}); - auto g_divide = ov::as_type_ptr(builder.create()); + auto g_divide = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 2; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/einsum.cpp b/src/core/tests/visitors/op/einsum.cpp index 0edab149fc1..5540fa66605 100644 --- a/src/core/tests/visitors/op/einsum.cpp +++ b/src/core/tests/visitors/op/einsum.cpp @@ -2,24 +2,23 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset7.hpp" +#include "openvino/op/einsum.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, einsum_v7_op) { - NodeBuilder::get_ops().register_factory(); - auto input1 = make_shared(element::i32, Shape{2, 3}); - auto input2 = make_shared(element::i32, Shape{3, 4}); + NodeBuilder::get_ops().register_factory(); + auto input1 = make_shared(element::i32, Shape{2, 3}); + auto input2 = make_shared(element::i32, Shape{3, 4}); std::string equation = "ab,bc->ac"; - auto einsum = make_shared(OutputVector{input1, input2}, equation); + auto einsum = make_shared(OutputVector{input1, input2}, equation); NodeBuilder builder(einsum, {input1, input2}); - auto g_einsum = ov::as_type_ptr(builder.create()); + auto g_einsum = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_einsum->get_equation(), einsum->get_equation()); } diff --git a/src/core/tests/visitors/op/elu.cpp b/src/core/tests/visitors/op/elu.cpp index bf605da3de9..18a19b4dde7 100644 --- a/src/core/tests/visitors/op/elu.cpp +++ b/src/core/tests/visitors/op/elu.cpp @@ -2,29 +2,25 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/elu.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, elu_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::f32, Shape{2, 4}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::f32, Shape{2, 4}); double alpha = 0.1; - const auto elu = make_shared(data, alpha); + const auto elu = make_shared(data, alpha); NodeBuilder builder(elu, {data}); - auto g_elu = ov::as_type_ptr(builder.create()); + auto g_elu = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_elu->get_alpha(), elu->get_alpha()); } diff --git a/src/core/tests/visitors/op/embedding_segments_sum.cpp b/src/core/tests/visitors/op/embedding_segments_sum.cpp index a8f487aee15..12a6bfb6e89 100644 --- a/src/core/tests/visitors/op/embedding_segments_sum.cpp +++ b/src/core/tests/visitors/op/embedding_segments_sum.cpp @@ -2,68 +2,68 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset3.hpp" +#include "openvino/op/embedding_segments_sum.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(visitor_without_attribute, embedding_segments_sum_op) { - NodeBuilder::get_ops().register_factory(); - auto emb_table = make_shared(element::f32, Shape{5, 2, 3}); + NodeBuilder::get_ops().register_factory(); + auto emb_table = make_shared(element::f32, Shape{5, 2, 3}); - auto indices = make_shared(element::i64, Shape{4}); - auto segment_ids = make_shared(element::i64, Shape{4}); - auto num_segments = make_shared(element::i64, Shape{}); - auto per_sample_weights = make_shared(element::f32, Shape{4}); - auto default_index = make_shared(element::i64, Shape{}); + auto indices = make_shared(element::i64, Shape{4}); + auto segment_ids = make_shared(element::i64, Shape{4}); + auto num_segments = make_shared(element::i64, Shape{}); + auto per_sample_weights = make_shared(element::f32, Shape{4}); + auto default_index = make_shared(element::i64, Shape{}); - auto ess = make_shared(emb_table, - indices, - segment_ids, - num_segments, - default_index, - per_sample_weights); + auto ess = make_shared(emb_table, + indices, + segment_ids, + num_segments, + default_index, + per_sample_weights); NodeBuilder builder(ess, {emb_table, indices, segment_ids, num_segments, default_index, per_sample_weights}); - EXPECT_NO_THROW(auto g_ess = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_ess = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } TEST(visitor_without_attribute, embedding_segments_sum_op2) { - NodeBuilder::get_ops().register_factory(); - auto emb_table = make_shared(element::f32, Shape{5, 2, 3}); + NodeBuilder::get_ops().register_factory(); + auto emb_table = make_shared(element::f32, Shape{5, 2, 3}); - auto indices = make_shared(element::i64, Shape{4}); - auto segment_ids = make_shared(element::i64, Shape{4}); - auto num_segments = make_shared(element::i64, Shape{}); - auto default_index = make_shared(element::i64, Shape{}); + auto indices = make_shared(element::i64, Shape{4}); + auto segment_ids = make_shared(element::i64, Shape{4}); + auto num_segments = make_shared(element::i64, Shape{}); + auto default_index = make_shared(element::i64, Shape{}); - auto ess = make_shared(emb_table, indices, segment_ids, num_segments, default_index); + auto ess = + make_shared(emb_table, indices, segment_ids, num_segments, default_index); NodeBuilder builder(ess, {emb_table, indices, segment_ids, num_segments, default_index}); - EXPECT_NO_THROW(auto g_ess = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_ess = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } TEST(visitor_without_attribute, embedding_segments_sum_op3) { - NodeBuilder::get_ops().register_factory(); - auto emb_table = make_shared(element::f32, Shape{5, 2, 3}); + NodeBuilder::get_ops().register_factory(); + auto emb_table = make_shared(element::f32, Shape{5, 2, 3}); - auto indices = make_shared(element::i64, Shape{4}); - auto segment_ids = make_shared(element::i64, Shape{4}); - auto num_segments = make_shared(element::i64, Shape{}); + auto indices = make_shared(element::i64, Shape{4}); + auto segment_ids = make_shared(element::i64, Shape{4}); + auto num_segments = make_shared(element::i64, Shape{}); - auto ess = make_shared(emb_table, indices, segment_ids, num_segments); + auto ess = make_shared(emb_table, indices, segment_ids, num_segments); NodeBuilder builder(ess, {emb_table, indices, segment_ids, num_segments}); - EXPECT_NO_THROW(auto g_ess = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_ess = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/embeddingbag_offsetssum.cpp b/src/core/tests/visitors/op/embeddingbag_offsetssum.cpp index 9b9e69928af..8bf7876f53c 100644 --- a/src/core/tests/visitors/op/embeddingbag_offsetssum.cpp +++ b/src/core/tests/visitors/op/embeddingbag_offsetssum.cpp @@ -2,61 +2,59 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset3.hpp" +#include + +#include "openvino/op/embeddingbag_offsets_sum.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(visitor_without_attribute, embedding_bag_offsets_sum_op) { - NodeBuilder::get_ops().register_factory(); - auto emb_table = make_shared(element::f32, Shape{5, 2, 3}); + NodeBuilder::get_ops().register_factory(); + auto emb_table = make_shared(element::f32, Shape{5, 2, 3}); - auto indices = make_shared(element::i64, Shape{4}); - auto offsets = make_shared(element::i64, Shape{4}); - auto default_index = make_shared(element::i64, Shape{}); - auto per_sample_weights = make_shared(element::f32, Shape{4}); + auto indices = make_shared(element::i64, Shape{4}); + auto offsets = make_shared(element::i64, Shape{4}); + auto default_index = make_shared(element::i64, Shape{}); + auto per_sample_weights = make_shared(element::f32, Shape{4}); auto ebos = - make_shared(emb_table, indices, offsets, default_index, per_sample_weights); + make_shared(emb_table, indices, offsets, default_index, per_sample_weights); NodeBuilder builder(ebos, {emb_table, indices, offsets, default_index, per_sample_weights}); - EXPECT_NO_THROW(auto g_ebos = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_ebos = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } TEST(visitor_without_attribute, embedding_bag_offsets_sum_op2) { - NodeBuilder::get_ops().register_factory(); - auto emb_table = make_shared(element::f32, Shape{5, 2, 3}); + NodeBuilder::get_ops().register_factory(); + auto emb_table = make_shared(element::f32, Shape{5, 2, 3}); - auto indices = make_shared(element::i64, Shape{4}); - auto offsets = make_shared(element::i64, Shape{4}); - auto default_index = make_shared(element::i64, Shape{}); + auto indices = make_shared(element::i64, Shape{4}); + auto offsets = make_shared(element::i64, Shape{4}); + auto default_index = make_shared(element::i64, Shape{}); - auto ebos = make_shared(emb_table, indices, offsets, default_index); + auto ebos = make_shared(emb_table, indices, offsets, default_index); NodeBuilder builder(ebos, {emb_table, indices, offsets, default_index}); - EXPECT_NO_THROW(auto g_ebos = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_ebos = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } TEST(visitor_without_attribute, embedding_bag_offsets_sum_op3) { - NodeBuilder::get_ops().register_factory(); - auto emb_table = make_shared(element::f32, Shape{5, 2, 3}); + NodeBuilder::get_ops().register_factory(); + auto emb_table = make_shared(element::f32, Shape{5, 2, 3}); - auto indices = make_shared(element::i64, Shape{4}); - auto offsets = make_shared(element::i64, Shape{4}); + auto indices = make_shared(element::i64, Shape{4}); + auto offsets = make_shared(element::i64, Shape{4}); - auto ebos = make_shared(emb_table, indices, offsets); + auto ebos = make_shared(emb_table, indices, offsets); NodeBuilder builder(ebos, {emb_table, indices, offsets}); - EXPECT_NO_THROW(auto g_ebos = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_ebos = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/embeddingbag_packedsum.cpp b/src/core/tests/visitors/op/embeddingbag_packedsum.cpp index 688737fb351..44adcd15420 100644 --- a/src/core/tests/visitors/op/embeddingbag_packedsum.cpp +++ b/src/core/tests/visitors/op/embeddingbag_packedsum.cpp @@ -2,39 +2,39 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset3.hpp" +#include "openvino/op/embeddingbag_packedsum.hpp" + +#include + +#include "openvino/op/embeddingbag_offsets_sum.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(visitor_without_attribute, embedding_bag_packed_sum_op) { - NodeBuilder::get_ops().register_factory(); - auto emb_table = make_shared(element::f32, Shape{5, 2}); - auto indices = make_shared(element::i64, Shape{3, 4}); - auto per_sample_weights = make_shared(element::f32, Shape{3, 4}); + NodeBuilder::get_ops().register_factory(); + auto emb_table = make_shared(element::f32, Shape{5, 2}); + auto indices = make_shared(element::i64, Shape{3, 4}); + auto per_sample_weights = make_shared(element::f32, Shape{3, 4}); - auto ebps = make_shared(emb_table, indices, per_sample_weights); + auto ebps = make_shared(emb_table, indices, per_sample_weights); NodeBuilder builder(ebps, {emb_table, indices, per_sample_weights}); - EXPECT_NO_THROW(auto g_ebps = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_ebps = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } TEST(visitor_without_attribute, embedding_bag_packed_sum_op2) { - NodeBuilder::get_ops().register_factory(); - auto emb_table = make_shared(element::f32, Shape{5, 2}); - auto indices = make_shared(element::i64, Shape{3, 4}); + NodeBuilder::get_ops().register_factory(); + auto emb_table = make_shared(element::f32, Shape{5, 2}); + auto indices = make_shared(element::i64, Shape{3, 4}); - auto ebps = make_shared(emb_table, indices); + auto ebps = make_shared(emb_table, indices); NodeBuilder builder(ebps, {emb_table, indices}); - EXPECT_NO_THROW(auto g_ebps = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_ebps = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/equal.cpp b/src/core/tests/visitors/op/equal.cpp index 8f278aedd38..d72291c6011 100644 --- a/src/core/tests/visitors/op/equal.cpp +++ b/src/core/tests/visitors/op/equal.cpp @@ -2,9 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "binary_ops.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/equal.hpp" -using Type = ::testing::Types>; +#include "binary_ops.hpp" + +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_with_auto_broadcast, BinaryOperatorVisitor, Type, BinaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/erf.cpp b/src/core/tests/visitors/op/erf.cpp index 8a211c7e591..af988441200 100644 --- a/src/core/tests/visitors/op/erf.cpp +++ b/src/core/tests/visitors/op/erf.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/erf.hpp" + #include "unary_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_atrribute, UnaryOperatorVisitor, Type, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/exp.cpp b/src/core/tests/visitors/op/exp.cpp index 77ed3da5d27..1fdb479dd3b 100644 --- a/src/core/tests/visitors/op/exp.cpp +++ b/src/core/tests/visitors/op/exp.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/exp.hpp" + #include "unary_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_atrribute, UnaryOperatorVisitor, Type, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/experimental_detectron_detection_output.cpp b/src/core/tests/visitors/op/experimental_detectron_detection_output.cpp index e7a944bf93b..3a447fe9dbb 100644 --- a/src/core/tests/visitors/op/experimental_detectron_detection_output.cpp +++ b/src/core/tests/visitors/op/experimental_detectron_detection_output.cpp @@ -2,21 +2,20 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/experimental_detectron_detection_output.hpp" + +#include + #include -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset6.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; -using Attrs = opset6::ExperimentalDetectronDetectionOutput::Attributes; -using ExperimentalDetection = opset6::ExperimentalDetectronDetectionOutput; +using Attrs = ov::op::v6::ExperimentalDetectronDetectionOutput::Attributes; +using ExperimentalDetection = ov::op::v6::ExperimentalDetectronDetectionOutput; TEST(attributes, detectron_detection_output) { NodeBuilder::get_ops().register_factory(); @@ -31,10 +30,10 @@ TEST(attributes, detectron_detection_output) { attrs.post_nms_count = 2000; attrs.score_threshold = 0.05000000074505806f; - auto rois = std::make_shared(element::f32, Shape{1000, 4}); - auto deltas = std::make_shared(element::f32, Shape{1000, 324}); - auto scores = std::make_shared(element::f32, Shape{1000, 81}); - auto im_info = std::make_shared(element::f32, Shape{1, 3}); + auto rois = std::make_shared(element::f32, Shape{1000, 4}); + auto deltas = std::make_shared(element::f32, Shape{1000, 324}); + auto scores = std::make_shared(element::f32, Shape{1000, 81}); + auto im_info = std::make_shared(element::f32, Shape{1, 3}); auto detection = std::make_shared(rois, deltas, scores, im_info, attrs); diff --git a/src/core/tests/visitors/op/experimental_detectron_generate_proposals.cpp b/src/core/tests/visitors/op/experimental_detectron_generate_proposals.cpp index 8eea1febc11..28a5dd697fe 100644 --- a/src/core/tests/visitors/op/experimental_detectron_generate_proposals.cpp +++ b/src/core/tests/visitors/op/experimental_detectron_generate_proposals.cpp @@ -2,21 +2,20 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/experimental_detectron_generate_proposals.hpp" + +#include + #include -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset6.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; -using ExperimentalProposals = opset6::ExperimentalDetectronGenerateProposalsSingleImage; -using Attrs = opset6::ExperimentalDetectronGenerateProposalsSingleImage::Attributes; +using ExperimentalProposals = ov::op::v6::ExperimentalDetectronGenerateProposalsSingleImage; +using Attrs = ov::op::v6::ExperimentalDetectronGenerateProposalsSingleImage::Attributes; TEST(attributes, detectron_proposals) { NodeBuilder::get_ops().register_factory(); @@ -27,10 +26,10 @@ TEST(attributes, detectron_proposals) { attrs.post_nms_count = 1000; attrs.pre_nms_count = 1000; - auto im_info = std::make_shared(element::f32, Shape{3}); - auto anchors = std::make_shared(element::f32, Shape{201600, 4}); - auto deltas = std::make_shared(element::f32, Shape{12, 200, 336}); - auto scores = std::make_shared(element::f32, Shape{3, 200, 336}); + auto im_info = std::make_shared(element::f32, Shape{3}); + auto anchors = std::make_shared(element::f32, Shape{201600, 4}); + auto deltas = std::make_shared(element::f32, Shape{12, 200, 336}); + auto scores = std::make_shared(element::f32, Shape{3, 200, 336}); auto proposals = std::make_shared(im_info, anchors, deltas, scores, attrs); diff --git a/src/core/tests/visitors/op/experimental_detectron_prior_grid_generator.cpp b/src/core/tests/visitors/op/experimental_detectron_prior_grid_generator.cpp index e0496d9f719..51cf470560d 100644 --- a/src/core/tests/visitors/op/experimental_detectron_prior_grid_generator.cpp +++ b/src/core/tests/visitors/op/experimental_detectron_prior_grid_generator.cpp @@ -2,21 +2,20 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/experimental_detectron_prior_grid_generator.hpp" + +#include + #include -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset6.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; -using ExperimentalGenerator = opset6::ExperimentalDetectronPriorGridGenerator; -using Attrs = opset6::ExperimentalDetectronPriorGridGenerator::Attributes; +using ExperimentalGenerator = ov::op::v6::ExperimentalDetectronPriorGridGenerator; +using Attrs = ov::op::v6::ExperimentalDetectronPriorGridGenerator::Attributes; TEST(attributes, detectron_prior_grid_generator) { NodeBuilder::get_ops().register_factory(); @@ -28,9 +27,9 @@ TEST(attributes, detectron_prior_grid_generator) { attrs.stride_x = 64; attrs.stride_y = 64; - auto priors = std::make_shared(element::f32, Shape{3, 4}); - auto feature_map = std::make_shared(element::f32, Shape{1, 3, 100, 100}); - auto im_data = std::make_shared(element::f32, Shape{1, 3, 100, 200}); + auto priors = std::make_shared(element::f32, Shape{3, 4}); + auto feature_map = std::make_shared(element::f32, Shape{1, 3, 100, 100}); + auto im_data = std::make_shared(element::f32, Shape{1, 3, 100, 200}); auto proposals = std::make_shared(priors, feature_map, im_data, attrs); diff --git a/src/core/tests/visitors/op/experimental_detectron_topkrois.cpp b/src/core/tests/visitors/op/experimental_detectron_topkrois.cpp index 17095d6f1a5..785da973d99 100644 --- a/src/core/tests/visitors/op/experimental_detectron_topkrois.cpp +++ b/src/core/tests/visitors/op/experimental_detectron_topkrois.cpp @@ -2,26 +2,25 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset6.hpp" +#include "openvino/op/experimental_detectron_topkrois.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, experimental_detectron_topkrois_op) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); size_t num_rois = 1; - auto input_rois = std::make_shared(element::f32, Shape{2, 4}); - auto input_probs = std::make_shared(element::f32, Shape{2}); + auto input_rois = std::make_shared(element::f32, Shape{2, 4}); + auto input_probs = std::make_shared(element::f32, Shape{2}); auto topkrois = std::make_shared(input_rois, input_probs, num_rois); NodeBuilder builder(topkrois, {input_rois, input_probs}); - auto g_topkrois = ov::as_type_ptr(builder.create()); + auto g_topkrois = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_topkrois->get_max_rois(), topkrois->get_max_rois()); } diff --git a/src/core/tests/visitors/op/extractimagepatches.cpp b/src/core/tests/visitors/op/extractimagepatches.cpp index 10c51e756dc..1c977f94aeb 100644 --- a/src/core/tests/visitors/op/extractimagepatches.cpp +++ b/src/core/tests/visitors/op/extractimagepatches.cpp @@ -2,32 +2,29 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/extractimagepatches.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, extractimagepatches_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::i32, Shape{64, 3, 10, 10}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::i32, Shape{64, 3, 10, 10}); auto sizes = Shape{3, 3}; auto strides = Strides{5, 5}; auto rates = Shape{1, 1}; auto padtype_padding = ngraph::op::PadType::VALID; - auto extractimagepatches = make_shared(data, sizes, strides, rates, padtype_padding); + auto extractimagepatches = + make_shared(data, sizes, strides, rates, padtype_padding); NodeBuilder builder(extractimagepatches, {data}); - auto g_extractimagepatches = ov::as_type_ptr(builder.create()); + auto g_extractimagepatches = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 4; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/eye.cpp b/src/core/tests/visitors/op/eye.cpp index 16292f83538..7e500122939 100644 --- a/src/core/tests/visitors/op/eye.cpp +++ b/src/core/tests/visitors/op/eye.cpp @@ -2,16 +2,16 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "openvino/opsets/opset9.hpp" +#include "openvino/op/eye.hpp" + +#include + +#include "openvino/op/constant.hpp" +#include "visitors/visitors.hpp" using namespace std; using namespace ov; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using ov::test::NodeBuilder; TEST(attributes, eye_op) { NodeBuilder::get_ops().register_factory(); diff --git a/src/core/tests/visitors/op/fake_quantize.cpp b/src/core/tests/visitors/op/fake_quantize.cpp index da7090d8d45..3dc120a0736 100644 --- a/src/core/tests/visitors/op/fake_quantize.cpp +++ b/src/core/tests/visitors/op/fake_quantize.cpp @@ -2,35 +2,31 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/fake_quantize.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, fake_quantize_op) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::f32, Shape{1, 2, 3, 4}); - const auto input_low = make_shared(element::f32, Shape{}); - const auto input_high = make_shared(element::f32, Shape{}); - const auto output_low = make_shared(element::f32, Shape{}); - const auto output_high = make_shared(element::f32, Shape{}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::f32, Shape{1, 2, 3, 4}); + const auto input_low = make_shared(element::f32, Shape{}); + const auto input_high = make_shared(element::f32, Shape{}); + const auto output_low = make_shared(element::f32, Shape{}); + const auto output_high = make_shared(element::f32, Shape{}); auto levels = 5; auto auto_broadcast = op::AutoBroadcastType::NUMPY; const auto fake_quantize = - make_shared(data, input_low, input_high, output_low, output_high, levels, auto_broadcast); + make_shared(data, input_low, input_high, output_low, output_high, levels, auto_broadcast); NodeBuilder builder(fake_quantize, {data, input_low, input_high, output_low, output_high}); - auto g_fake_quantize = ov::as_type_ptr(builder.create()); + auto g_fake_quantize = ov::as_type_ptr(builder.create()); // attribute count const auto expected_attr_count = 2; diff --git a/src/core/tests/visitors/op/floor.cpp b/src/core/tests/visitors/op/floor.cpp index f7e55b4c164..454e3d82d6c 100644 --- a/src/core/tests/visitors/op/floor.cpp +++ b/src/core/tests/visitors/op/floor.cpp @@ -2,6 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/floor.hpp" + #include "unary_ops.hpp" using Types = ::testing::Types, diff --git a/src/core/tests/visitors/op/floor_mod.cpp b/src/core/tests/visitors/op/floor_mod.cpp index 395bee74fe4..5faafe0e091 100644 --- a/src/core/tests/visitors/op/floor_mod.cpp +++ b/src/core/tests/visitors/op/floor_mod.cpp @@ -2,9 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "binary_ops.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/floor_mod.hpp" -using Type = ::testing::Types>; +#include "binary_ops.hpp" + +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_with_auto_broadcast, BinaryOperatorVisitor, Type, BinaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/framework_node.cpp b/src/core/tests/visitors/op/framework_node.cpp index 0fba6b089b8..89e8f32a6a4 100644 --- a/src/core/tests/visitors/op/framework_node.cpp +++ b/src/core/tests/visitors/op/framework_node.cpp @@ -4,31 +4,31 @@ #include "openvino/op/util/framework_node.hpp" +#include + #include "common_test_utils/graph_comparator.hpp" -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "openvino/op/util/attr_types.hpp" -#include "openvino/opsets/opset10.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/multiply.hpp" +#include "openvino/op/parameter.hpp" +#include "visitors/visitors.hpp" using namespace std; using namespace ov; -using namespace ov::opset10; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using ov::test::NodeBuilder; TEST(attributes, framework_node_op) { NodeBuilder::get_ops().register_factory(); - auto X = make_shared(element::f32, Shape{1, 2, 2}); - auto Y = make_shared(element::f32, Shape{1, 2, 2}); - auto cond = make_shared(element::boolean, Shape{1}, true); - auto cond2 = make_shared(element::boolean, Shape{1}, false); - auto Xt = make_shared(element::f32, PartialShape::dynamic()); - auto Yt = make_shared(element::f32, PartialShape::dynamic()); - auto Xe = make_shared(element::f32, PartialShape::dynamic()); - auto Ye = make_shared(element::f32, PartialShape::dynamic()); - auto then_op = make_shared(Xt, Yt); - auto res0 = make_shared(then_op); - auto res1 = make_shared(Xe); + auto X = make_shared(element::f32, Shape{1, 2, 2}); + auto Y = make_shared(element::f32, Shape{1, 2, 2}); + auto cond = make_shared(element::boolean, Shape{1}, true); + auto cond2 = make_shared(element::boolean, Shape{1}, false); + auto Xt = make_shared(element::f32, PartialShape::dynamic()); + auto Yt = make_shared(element::f32, PartialShape::dynamic()); + auto Xe = make_shared(element::f32, PartialShape::dynamic()); + auto Ye = make_shared(element::f32, PartialShape::dynamic()); + auto then_op = make_shared(Xt, Yt); + auto res0 = make_shared(then_op); + auto res1 = make_shared(Xe); auto body1 = make_shared(OutputVector{res0}, ParameterVector{Xt, Yt}); auto body2 = make_shared(OutputVector{res1}, ParameterVector{Xe}); auto fn_op = make_shared(OutputVector{cond}, 0, 2); diff --git a/src/core/tests/visitors/op/gather.cpp b/src/core/tests/visitors/op/gather.cpp index e817c7dcf53..5593d58288d 100644 --- a/src/core/tests/visitors/op/gather.cpp +++ b/src/core/tests/visitors/op/gather.cpp @@ -2,55 +2,54 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset7.hpp" -#include "ngraph/opsets/opset8.hpp" +#include "openvino/op/gather.hpp" + +#include + +#include "openvino/op/constant.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, gather_v1_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::i32, Shape{2, 3, 4}); - auto indices = make_shared(element::i32, Shape{2}); - auto axis = make_shared(element::i32, Shape{}, 2); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::i32, Shape{2, 3, 4}); + auto indices = make_shared(element::i32, Shape{2}); + auto axis = make_shared(element::i32, Shape{}, 2); - auto gather = make_shared(data, indices, axis); + auto gather = make_shared(data, indices, axis); NodeBuilder builder(gather, {data, indices, axis}); - auto g_gather = ov::as_type_ptr(builder.create()); + auto g_gather = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_gather->get_batch_dims(), gather->get_batch_dims()); } TEST(attributes, gather_v7_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::i32, Shape{2, 3, 4}); - auto indices = make_shared(element::i32, Shape{2}); - auto axis = make_shared(element::i32, Shape{}, 2); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::i32, Shape{2, 3, 4}); + auto indices = make_shared(element::i32, Shape{2}); + auto axis = make_shared(element::i32, Shape{}, 2); int64_t batch_dims = 1; - auto gather = make_shared(data, indices, axis, batch_dims); + auto gather = make_shared(data, indices, axis, batch_dims); NodeBuilder builder(gather, {data, indices, axis}); - auto g_gather = ov::as_type_ptr(builder.create()); + auto g_gather = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_gather->get_batch_dims(), gather->get_batch_dims()); } TEST(attributes, gather_v8_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::i32, Shape{2, 3, 4}); - auto indices = make_shared(element::i32, Shape{2}); - auto axis = make_shared(element::i32, Shape{}, 2); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::i32, Shape{2, 3, 4}); + auto indices = make_shared(element::i32, Shape{2}); + auto axis = make_shared(element::i32, Shape{}, 2); int64_t batch_dims = 1; - auto gather = make_shared(data, indices, axis, batch_dims); + auto gather = make_shared(data, indices, axis, batch_dims); NodeBuilder builder(gather, {data, indices, axis}); - auto g_gather = ov::as_type_ptr(builder.create()); + auto g_gather = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_gather->get_batch_dims(), gather->get_batch_dims()); } diff --git a/src/core/tests/visitors/op/gather_elements.cpp b/src/core/tests/visitors/op/gather_elements.cpp index 3f728293530..6b0fb1d6707 100644 --- a/src/core/tests/visitors/op/gather_elements.cpp +++ b/src/core/tests/visitors/op/gather_elements.cpp @@ -2,26 +2,25 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset6.hpp" +#include "openvino/op/gather_elements.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, gather_elements_op) { - NodeBuilder::get_ops().register_factory(); - auto arg1 = make_shared(element::i32, PartialShape{3}); - auto arg2 = make_shared(element::i32, PartialShape{7}); + NodeBuilder::get_ops().register_factory(); + auto arg1 = make_shared(element::i32, PartialShape{3}); + auto arg2 = make_shared(element::i32, PartialShape{7}); int64_t axis = 0; - auto gather_el = make_shared(arg1, arg2, axis); + auto gather_el = make_shared(arg1, arg2, axis); NodeBuilder builder(gather_el, {arg1, arg2}); - auto g_gather_el = ov::as_type_ptr(builder.create()); + auto g_gather_el = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_gather_el->get_axis(), gather_el->get_axis()); } diff --git a/src/core/tests/visitors/op/gather_nd.cpp b/src/core/tests/visitors/op/gather_nd.cpp index 0cd1e92dcb8..4903a17579c 100644 --- a/src/core/tests/visitors/op/gather_nd.cpp +++ b/src/core/tests/visitors/op/gather_nd.cpp @@ -2,40 +2,38 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset5.hpp" -#include "ngraph/opsets/opset8.hpp" +#include "openvino/op/gather_nd.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, gather_nd_v5_op) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); int batch_dims = 1; - auto P = make_shared(element::f32, Shape{2, 3, 4}); - auto I = make_shared(element::i32, Shape{2, 1}); + auto P = make_shared(element::f32, Shape{2, 3, 4}); + auto I = make_shared(element::i32, Shape{2, 1}); auto G = make_shared(P, I, batch_dims); NodeBuilder builder(G, {P, I}); - auto g_G = ov::as_type_ptr(builder.create()); + auto g_G = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_G->get_batch_dims(), G->get_batch_dims()); } TEST(attributes, gather_nd_v8_op) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); int batch_dims = 1; - auto P = make_shared(element::f32, Shape{2, 3, 4}); - auto I = make_shared(element::i32, Shape{2, 1}); + auto P = make_shared(element::f32, Shape{2, 3, 4}); + auto I = make_shared(element::i32, Shape{2, 1}); auto G = make_shared(P, I, batch_dims); NodeBuilder builder(G, {P, I}); - auto g_G = ov::as_type_ptr(builder.create()); + auto g_G = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_G->get_batch_dims(), G->get_batch_dims()); } diff --git a/src/core/tests/visitors/op/gather_tree.cpp b/src/core/tests/visitors/op/gather_tree.cpp index ca1460d1175..f9f2649506c 100644 --- a/src/core/tests/visitors/op/gather_tree.cpp +++ b/src/core/tests/visitors/op/gather_tree.cpp @@ -2,27 +2,26 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/gather_tree.hpp" -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +#include + +#include "visitors/visitors.hpp" + +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, gather_tree_op) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); - auto step_ids = std::make_shared(element::f32, Shape{1, 2, 3}); - auto parent_idx = std::make_shared(element::f32, Shape{1, 2, 3}); - auto max_seq_len = std::make_shared(element::f32, Shape{2}); - auto end_token = std::make_shared(element::f32, Shape{}); + auto step_ids = std::make_shared(element::f32, Shape{1, 2, 3}); + auto parent_idx = std::make_shared(element::f32, Shape{1, 2, 3}); + auto max_seq_len = std::make_shared(element::f32, Shape{2}); + auto end_token = std::make_shared(element::f32, Shape{}); - auto gather_tree = std::make_shared(step_ids, parent_idx, max_seq_len, end_token); + auto gather_tree = std::make_shared(step_ids, parent_idx, max_seq_len, end_token); NodeBuilder builder(gather_tree, {step_ids, parent_idx, max_seq_len, end_token}); - EXPECT_NO_THROW(auto g_gather_tree = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_gather_tree = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/gelu.cpp b/src/core/tests/visitors/op/gelu.cpp index 3d64cfbcff5..a14b46dd178 100644 --- a/src/core/tests/visitors/op/gelu.cpp +++ b/src/core/tests/visitors/op/gelu.cpp @@ -2,53 +2,53 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset2.hpp" -#include "ngraph/opsets/opset7.hpp" +#include "openvino/op/gelu.hpp" + +#include + +#include "openvino/op/dft.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, gelu_op_erf) { - NodeBuilder::get_ops().register_factory(); - const auto data_input = make_shared(element::f32, Shape{1, 2, 3}); + NodeBuilder::get_ops().register_factory(); + const auto data_input = make_shared(element::f32, Shape{1, 2, 3}); const auto approximation_mode = op::GeluApproximationMode::ERF; - const auto gelu = make_shared(data_input, approximation_mode); + const auto gelu = make_shared(data_input, approximation_mode); NodeBuilder builder(gelu, {data_input}); - auto g_gelu = ov::as_type_ptr(builder.create()); + auto g_gelu = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_gelu->get_approximation_mode(), gelu->get_approximation_mode()); } TEST(attributes, gelu_op_tanh) { - NodeBuilder::get_ops().register_factory(); - const auto data_input = make_shared(element::f32, Shape{1, 2, 3}); + NodeBuilder::get_ops().register_factory(); + const auto data_input = make_shared(element::f32, Shape{1, 2, 3}); const auto approximation_mode = op::GeluApproximationMode::TANH; - const auto gelu = make_shared(data_input, approximation_mode); + const auto gelu = make_shared(data_input, approximation_mode); NodeBuilder builder(gelu, {data_input}); - auto g_gelu = ov::as_type_ptr(builder.create()); + auto g_gelu = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_gelu->get_approximation_mode(), gelu->get_approximation_mode()); } TEST(attributes, gelu_op) { - NodeBuilder::get_ops().register_factory(); - const auto data_input = make_shared(element::f32, Shape{1, 2, 3}); - const auto gelu = make_shared(data_input); + NodeBuilder::get_ops().register_factory(); + const auto data_input = make_shared(element::f32, Shape{1, 2, 3}); + const auto gelu = make_shared(data_input); NodeBuilder builder(gelu, {data_input}); - auto g_gelu = ov::as_type_ptr(builder.create()); + auto g_gelu = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_gelu->get_approximation_mode(), gelu->get_approximation_mode()); } TEST(attributes, gelu_v0_op) { - NodeBuilder::get_ops().register_factory(); - const auto data_input = make_shared(element::f32, Shape{1, 2, 3}); - const auto gelu = make_shared(data_input); + NodeBuilder::get_ops().register_factory(); + const auto data_input = make_shared(element::f32, Shape{1, 2, 3}); + const auto gelu = make_shared(data_input); NodeBuilder builder(gelu, {data_input}); const auto expected_attr_count = 0; EXPECT_NO_THROW(auto g_gelu = ov::as_type_ptr(builder.create())); diff --git a/src/core/tests/visitors/op/generate_proposals.cpp b/src/core/tests/visitors/op/generate_proposals.cpp index a0aacbca60e..99e42fd5681 100644 --- a/src/core/tests/visitors/op/generate_proposals.cpp +++ b/src/core/tests/visitors/op/generate_proposals.cpp @@ -2,21 +2,20 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/generate_proposals.hpp" + +#include + #include -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset9.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; -using GenerateProposals = opset9::GenerateProposals; -using Attrs = opset9::GenerateProposals::Attributes; +using GenerateProposals = ov::op::v9::GenerateProposals; +using Attrs = ov::op::v9::GenerateProposals::Attributes; TEST(attributes, generate_proposals) { NodeBuilder::get_ops().register_factory(); @@ -29,10 +28,10 @@ TEST(attributes, generate_proposals) { attrs.normalized = true; attrs.nms_eta = 1.0f; - auto im_info = std::make_shared(element::f32, Shape{1, 4}); - auto anchors = std::make_shared(element::f32, Shape{200, 336, 3, 4}); - auto deltas = std::make_shared(element::f32, Shape{1, 12, 200, 336}); - auto scores = std::make_shared(element::f32, Shape{1, 3, 200, 336}); + auto im_info = std::make_shared(element::f32, Shape{1, 4}); + auto anchors = std::make_shared(element::f32, Shape{200, 336, 3, 4}); + auto deltas = std::make_shared(element::f32, Shape{1, 12, 200, 336}); + auto scores = std::make_shared(element::f32, Shape{1, 3, 200, 336}); auto proposals = std::make_shared(im_info, anchors, deltas, scores, attrs); diff --git a/src/core/tests/visitors/op/greater.cpp b/src/core/tests/visitors/op/greater.cpp index c6e6b6b3419..1b8188662c0 100644 --- a/src/core/tests/visitors/op/greater.cpp +++ b/src/core/tests/visitors/op/greater.cpp @@ -2,9 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "binary_ops.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/greater.hpp" -using Type = ::testing::Types>; +#include "binary_ops.hpp" + +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_with_auto_broadcast, BinaryOperatorVisitor, Type, BinaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/greater_equal.cpp b/src/core/tests/visitors/op/greater_equal.cpp index 2989a4e4161..d279fc1eacb 100644 --- a/src/core/tests/visitors/op/greater_equal.cpp +++ b/src/core/tests/visitors/op/greater_equal.cpp @@ -3,8 +3,8 @@ // #include "binary_ops.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/greater_eq.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_with_auto_broadcast, BinaryOperatorVisitor, Type, BinaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/grid_sample.cpp b/src/core/tests/visitors/op/grid_sample.cpp index 14b5e7f87a4..51990456e42 100644 --- a/src/core/tests/visitors/op/grid_sample.cpp +++ b/src/core/tests/visitors/op/grid_sample.cpp @@ -2,24 +2,24 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "openvino/opsets/opset9.hpp" +#include "openvino/op/grid_sample.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; using namespace ov; -using ngraph::test::NodeBuilder; +using ov::test::NodeBuilder; TEST(attributes, grid_sample_defaults) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::f32, Shape{1, 3, 10, 10}); - const auto grid = make_shared(element::f32, Shape{1, 5, 5, 2}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::f32, Shape{1, 3, 10, 10}); + const auto grid = make_shared(element::f32, Shape{1, 5, 5, 2}); - const auto op = make_shared(data, grid, opset9::GridSample::Attributes{}); + const auto op = make_shared(data, grid, ov::op::v9::GridSample::Attributes{}); NodeBuilder builder(op, {data, grid}); - EXPECT_NO_THROW(auto g_op = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_op = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 3; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/grn.cpp b/src/core/tests/visitors/op/grn.cpp index ee289508b27..217f8758f73 100644 --- a/src/core/tests/visitors/op/grn.cpp +++ b/src/core/tests/visitors/op/grn.cpp @@ -2,25 +2,25 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/grn.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, grn_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::f32, Shape{2, 3, 4, 5}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::f32, Shape{2, 3, 4, 5}); float bias = 1.25f; - auto grn = make_shared(data, bias); + auto grn = make_shared(data, bias); NodeBuilder builder(grn, {data}); - auto g_grn = ov::as_type_ptr(builder.create()); + auto g_grn = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 1; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/group_conv.cpp b/src/core/tests/visitors/op/group_conv.cpp index 7eb1fc1fef0..1360540e193 100644 --- a/src/core/tests/visitors/op/group_conv.cpp +++ b/src/core/tests/visitors/op/group_conv.cpp @@ -2,29 +2,25 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/group_conv.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, group_conv_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::f32, Shape{1, 12, 224, 224}); - auto filters = make_shared(element::f32, Shape{4, 1, 3, 5, 5}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::f32, Shape{1, 12, 224, 224}); + auto filters = make_shared(element::f32, Shape{4, 1, 3, 5, 5}); auto strides = Strides{1, 1}; auto pads_begin = CoordinateDiff{1, 2}; auto pads_end = CoordinateDiff{1, 2}; auto dilations = Strides{1, 1}; - auto group_conv = make_shared(data, + auto group_conv = make_shared(data, filters, strides, pads_begin, @@ -32,7 +28,7 @@ TEST(attributes, group_conv_op) { dilations, op::PadType::VALID); NodeBuilder builder(group_conv, {data, filters}); - auto g_group_conv = ov::as_type_ptr(builder.create()); + auto g_group_conv = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_group_conv->get_strides(), group_conv->get_strides()); EXPECT_EQ(g_group_conv->get_pads_begin(), group_conv->get_pads_begin()); EXPECT_EQ(g_group_conv->get_pads_end(), group_conv->get_pads_end()); @@ -41,10 +37,10 @@ TEST(attributes, group_conv_op) { } TEST(attributes, group_conv_backprop_data_op) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::f32, Shape{1, 20, 224, 224}); - const auto filter = make_shared(element::f32, Shape{4, 5, 2, 3, 3}); - const auto output_shape = make_shared(element::i32, Shape{2}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::f32, Shape{1, 20, 224, 224}); + const auto filter = make_shared(element::f32, Shape{4, 5, 2, 3, 3}); + const auto output_shape = make_shared(element::i32, Shape{2}); const auto strides = Strides{2, 1}; const auto pads_begin = CoordinateDiff{3, 4}; @@ -53,7 +49,7 @@ TEST(attributes, group_conv_backprop_data_op) { const auto auto_pad = op::PadType::EXPLICIT; const auto output_padding = CoordinateDiff{3, 4}; - const auto gcbd = make_shared(data, + const auto gcbd = make_shared(data, filter, output_shape, strides, @@ -63,7 +59,7 @@ TEST(attributes, group_conv_backprop_data_op) { auto_pad, output_padding); NodeBuilder builder(gcbd, {data, filter}); - const auto g_gcbd = ov::as_type_ptr(builder.create()); + const auto g_gcbd = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_gcbd->get_strides(), gcbd->get_strides()); EXPECT_EQ(g_gcbd->get_pads_begin(), gcbd->get_pads_begin()); diff --git a/src/core/tests/visitors/op/group_normalization.cpp b/src/core/tests/visitors/op/group_normalization.cpp index 6d96de0d408..85649db407b 100644 --- a/src/core/tests/visitors/op/group_normalization.cpp +++ b/src/core/tests/visitors/op/group_normalization.cpp @@ -2,25 +2,26 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "openvino/opsets/opset12.hpp" +#include "openvino/op/group_normalization.hpp" + +#include + +#include "openvino/op/unique.hpp" +#include "visitors/visitors.hpp" using namespace std; using namespace ov; -using ngraph::test::NodeBuilder; +using ov::test::NodeBuilder; TEST(attributes, group_normalization) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::f32, Shape{1, 3, 10, 10}); - const auto scale = make_shared(element::f32, Shape{3}); - const auto bias = make_shared(element::f32, Shape{3}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::f32, Shape{1, 3, 10, 10}); + const auto scale = make_shared(element::f32, Shape{3}); + const auto bias = make_shared(element::f32, Shape{3}); - const auto op = make_shared(data, scale, bias, 3, 0.00001f); + const auto op = make_shared(data, scale, bias, 3, 0.00001f); NodeBuilder builder(op); - auto g_unique = ov::as_type_ptr(builder.create()); + auto g_unique = ov::as_type_ptr(builder.create()); constexpr auto expected_attr_count = 2; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/gru_cell.cpp b/src/core/tests/visitors/op/gru_cell.cpp index 418bc2c3dd6..83a748a6d58 100644 --- a/src/core/tests/visitors/op/gru_cell.cpp +++ b/src/core/tests/visitors/op/gru_cell.cpp @@ -2,44 +2,40 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/gru_cell.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, gru_cell_op) { - NodeBuilder::get_ops().register_factory(); - auto X = make_shared(element::f32, Shape{2, 3}); - auto W = make_shared(element::f32, Shape{9, 3}); - auto R = make_shared(element::f32, Shape{9, 3}); - const auto initial_hidden_state = make_shared(element::f32, Shape{2, 3}); + NodeBuilder::get_ops().register_factory(); + auto X = make_shared(element::f32, Shape{2, 3}); + auto W = make_shared(element::f32, Shape{9, 3}); + auto R = make_shared(element::f32, Shape{9, 3}); + const auto initial_hidden_state = make_shared(element::f32, Shape{2, 3}); const auto hidden_size = 3; const std::vector activations = {"tanh", "sigmoid"}; auto activations_alpha = std::vector{1.0, 1.5}; auto activations_beta = std::vector{2.0, 1.0}; const float clip = 0.5f; - const auto gru_cell = make_shared(X, - initial_hidden_state, - W, - R, - hidden_size, - activations, - activations_alpha, - activations_beta, - clip, - false); + const auto gru_cell = make_shared(X, + initial_hidden_state, + W, + R, + hidden_size, + activations, + activations_alpha, + activations_beta, + clip, + false); NodeBuilder builder(gru_cell, {X, initial_hidden_state, W, R}); - auto g_gru_cell = ov::as_type_ptr(builder.create()); + auto g_gru_cell = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_gru_cell->get_hidden_size(), gru_cell->get_hidden_size()); EXPECT_EQ(g_gru_cell->get_activations(), gru_cell->get_activations()); @@ -50,31 +46,31 @@ TEST(attributes, gru_cell_op) { } TEST(attributes, gru_cell_op2) { - NodeBuilder::get_ops().register_factory(); - auto X = make_shared(element::f32, Shape{2, 3}); - auto W = make_shared(element::f32, Shape{9, 3}); - auto R = make_shared(element::f32, Shape{9, 3}); - const auto initial_hidden_state = make_shared(element::f32, Shape{2, 3}); - auto B = make_shared(element::f32, Shape{9}); + NodeBuilder::get_ops().register_factory(); + auto X = make_shared(element::f32, Shape{2, 3}); + auto W = make_shared(element::f32, Shape{9, 3}); + auto R = make_shared(element::f32, Shape{9, 3}); + const auto initial_hidden_state = make_shared(element::f32, Shape{2, 3}); + auto B = make_shared(element::f32, Shape{9}); const auto hidden_size = 3; const std::vector activations = {"tanh", "sigmoid"}; auto activations_alpha = std::vector{1.0, 1.5}; auto activations_beta = std::vector{2.0, 1.0}; const float clip = 0.5f; - const auto gru_cell = make_shared(X, - initial_hidden_state, - W, - R, - B, - hidden_size, - activations, - activations_alpha, - activations_beta, - clip, - false); + const auto gru_cell = make_shared(X, + initial_hidden_state, + W, + R, + B, + hidden_size, + activations, + activations_alpha, + activations_beta, + clip, + false); NodeBuilder builder(gru_cell, {X, initial_hidden_state, W, R, B}); - auto g_gru_cell = ov::as_type_ptr(builder.create()); + auto g_gru_cell = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_gru_cell->get_hidden_size(), gru_cell->get_hidden_size()); EXPECT_EQ(g_gru_cell->get_activations(), gru_cell->get_activations()); diff --git a/src/core/tests/visitors/op/gru_sequence.cpp b/src/core/tests/visitors/op/gru_sequence.cpp index 6b6beaa1b19..9e4575da69d 100644 --- a/src/core/tests/visitors/op/gru_sequence.cpp +++ b/src/core/tests/visitors/op/gru_sequence.cpp @@ -2,22 +2,18 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/gru_sequence.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, gru_sequence_op) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); const size_t batch_size = 4; const size_t num_directions = 2; @@ -25,15 +21,16 @@ TEST(attributes, gru_sequence_op) { const size_t input_size = 16; const size_t hidden_size = 64; - const auto X = make_shared(element::f32, Shape{batch_size, seq_length, input_size}); + const auto X = make_shared(element::f32, Shape{batch_size, seq_length, input_size}); const auto initial_hidden_state = - make_shared(element::f32, Shape{batch_size, num_directions, hidden_size}); + make_shared(element::f32, Shape{batch_size, num_directions, hidden_size}); const auto initial_cell_state = - make_shared(element::f32, Shape{batch_size, num_directions, hidden_size}); - const auto sequence_lengths = make_shared(element::i32, Shape{batch_size}); - const auto W = make_shared(element::f32, Shape{num_directions, 3 * hidden_size, input_size}); - const auto R = make_shared(element::f32, Shape{num_directions, 3 * hidden_size, hidden_size}); - const auto B = make_shared(element::f32, Shape{num_directions, 3 * hidden_size}); + make_shared(element::f32, Shape{batch_size, num_directions, hidden_size}); + const auto sequence_lengths = make_shared(element::i32, Shape{batch_size}); + const auto W = make_shared(element::f32, Shape{num_directions, 3 * hidden_size, input_size}); + const auto R = + make_shared(element::f32, Shape{num_directions, 3 * hidden_size, hidden_size}); + const auto B = make_shared(element::f32, Shape{num_directions, 3 * hidden_size}); const auto gru_direction = op::RecurrentSequenceDirection::BIDIRECTIONAL; const std::vector activations_alpha = {1, 2}; @@ -41,20 +38,20 @@ TEST(attributes, gru_sequence_op) { const std::vector activations = {"tanh", "sigmoid"}; const float clip_threshold = 0.5f; - const auto gru_sequence = make_shared(X, - initial_hidden_state, - sequence_lengths, - W, - R, - B, - hidden_size, - gru_direction, - activations, - activations_alpha, - activations_beta, - clip_threshold); + const auto gru_sequence = make_shared(X, + initial_hidden_state, + sequence_lengths, + W, + R, + B, + hidden_size, + gru_direction, + activations, + activations_alpha, + activations_beta, + clip_threshold); NodeBuilder builder(gru_sequence, {X, initial_hidden_state, sequence_lengths, W, R, B}); - auto g_gru_sequence = ov::as_type_ptr(builder.create()); + auto g_gru_sequence = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_gru_sequence->get_hidden_size(), gru_sequence->get_hidden_size()); EXPECT_EQ(g_gru_sequence->get_activations(), gru_sequence->get_activations()); diff --git a/src/core/tests/visitors/op/hard_sigmoid.cpp b/src/core/tests/visitors/op/hard_sigmoid.cpp index 0136221cc3f..f151b675073 100644 --- a/src/core/tests/visitors/op/hard_sigmoid.cpp +++ b/src/core/tests/visitors/op/hard_sigmoid.cpp @@ -2,25 +2,25 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/hard_sigmoid.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, hardsigmoid_op) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::f32, Shape{2, 5}); - const auto alpha = make_shared(element::f32, Shape{}); - const auto beta = make_shared(element::f32, Shape{}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::f32, Shape{2, 5}); + const auto alpha = make_shared(element::f32, Shape{}); + const auto beta = make_shared(element::f32, Shape{}); - const auto hardsigmoid = make_shared(data, alpha, beta); + const auto hardsigmoid = make_shared(data, alpha, beta); NodeBuilder builder(hardsigmoid, {data, alpha, beta}); - EXPECT_NO_THROW(auto g_hardsigmoid = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_hardsigmoid = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/hsigmoid.cpp b/src/core/tests/visitors/op/hsigmoid.cpp index 911b9d372e1..f65ca854d58 100644 --- a/src/core/tests/visitors/op/hsigmoid.cpp +++ b/src/core/tests/visitors/op/hsigmoid.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/hsigmoid.hpp" + #include "unary_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_atrribute, UnaryOperatorVisitor, Type, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/hswish.cpp b/src/core/tests/visitors/op/hswish.cpp index 09cf01382b9..e65ffa4d45d 100644 --- a/src/core/tests/visitors/op/hswish.cpp +++ b/src/core/tests/visitors/op/hswish.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/hswish.hpp" + #include "unary_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_atrribute, UnaryOperatorVisitor, Type, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/idft.cpp b/src/core/tests/visitors/op/idft.cpp index 621b00a5446..55371d4d83b 100644 --- a/src/core/tests/visitors/op/idft.cpp +++ b/src/core/tests/visitors/op/idft.cpp @@ -2,19 +2,21 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" +#include "openvino/op/idft.hpp" + +#include + +#include "openvino/op/constant.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, idft_op) { NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::f32, Shape{2, 10, 10, 2}); - auto axes = op::Constant::create(element::Type_t::i64, Shape{1}, {2}); + auto data = make_shared(element::f32, Shape{2, 10, 10, 2}); + auto axes = ov::op::v0::Constant::create(element::Type_t::i64, Shape{1}, {2}); auto idft = make_shared(data, axes); NodeBuilder builder(idft, {data, axes}); @@ -26,9 +28,9 @@ TEST(attributes, idft_op) { TEST(attributes, idft_op_signal) { NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::f32, Shape{2, 10, 10, 2}); - auto axes = op::Constant::create(element::Type_t::i64, Shape{1}, {2}); - auto signal = op::Constant::create(element::Type_t::i64, Shape{1}, {20}); + auto data = make_shared(element::f32, Shape{2, 10, 10, 2}); + auto axes = ov::op::v0::Constant::create(element::Type_t::i64, Shape{1}, {2}); + auto signal = ov::op::v0::Constant::create(element::Type_t::i64, Shape{1}, {20}); auto idft = make_shared(data, axes, signal); NodeBuilder builder(idft, {data, axes, signal}); diff --git a/src/core/tests/visitors/op/if.cpp b/src/core/tests/visitors/op/if.cpp index 7020e890077..8a2ccddafe7 100644 --- a/src/core/tests/visitors/op/if.cpp +++ b/src/core/tests/visitors/op/if.cpp @@ -2,35 +2,35 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/if.hpp" + +#include + #include "common_test_utils/graph_comparator.hpp" -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset8.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/multiply.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using namespace ngraph::opset8; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, if_op) { - NodeBuilder::get_ops().register_factory(); - auto X = make_shared(element::f32, Shape{1, 2, 2}); - auto Y = make_shared(element::f32, Shape{1, 2, 2}); - auto cond = std::make_shared(element::boolean, Shape{1}, true); - auto cond2 = std::make_shared(element::boolean, Shape{1}, false); - auto Xt = make_shared(element::f32, PartialShape::dynamic()); - auto Yt = make_shared(element::f32, PartialShape::dynamic()); - auto Xe = make_shared(element::f32, PartialShape::dynamic()); - auto Ye = make_shared(element::f32, PartialShape::dynamic()); + NodeBuilder::get_ops().register_factory(); + auto X = make_shared(element::f32, Shape{1, 2, 2}); + auto Y = make_shared(element::f32, Shape{1, 2, 2}); + auto cond = std::make_shared(element::boolean, Shape{1}, true); + auto cond2 = std::make_shared(element::boolean, Shape{1}, false); + auto Xt = make_shared(element::f32, PartialShape::dynamic()); + auto Yt = make_shared(element::f32, PartialShape::dynamic()); + auto Xe = make_shared(element::f32, PartialShape::dynamic()); + auto Ye = make_shared(element::f32, PartialShape::dynamic()); auto then_op = std::make_shared(Xt, Yt); - auto res0 = make_shared(then_op); - auto res1 = make_shared(Xe); - auto then_body = make_shared(OutputVector{res0}, ParameterVector{Xt, Yt}); - auto else_body = make_shared(OutputVector{res1}, ParameterVector{Xe}); - auto if_op = make_shared(cond); + auto res0 = make_shared(then_op); + auto res1 = make_shared(Xe); + auto then_body = make_shared(OutputVector{res0}, ParameterVector{Xt, Yt}); + auto else_body = make_shared(OutputVector{res1}, ParameterVector{Xe}); + auto if_op = make_shared(cond); if_op->set_then_body(then_body); if_op->set_else_body(else_body); if_op->set_input(X, Xt, Xe); @@ -38,7 +38,7 @@ TEST(attributes, if_op) { if_op->set_output(res0, res1); if_op->validate_and_infer_types(); NodeBuilder builder(if_op); - auto g_if = ov::as_type_ptr(builder.create()); + auto g_if = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_if->get_input_descriptions(0), if_op->get_input_descriptions(0)); EXPECT_EQ(g_if->get_input_descriptions(1), if_op->get_input_descriptions(1)); EXPECT_EQ(g_if->get_output_descriptions(0), if_op->get_output_descriptions(0)); diff --git a/src/core/tests/visitors/op/interpolate.cpp b/src/core/tests/visitors/op/interpolate.cpp index 86ae630047f..60c2e5dac92 100644 --- a/src/core/tests/visitors/op/interpolate.cpp +++ b/src/core/tests/visitors/op/interpolate.cpp @@ -2,27 +2,24 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset11.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/interpolate.hpp" + +#include + +#include "openvino/op/constant.hpp" +#include "openvino/op/parameter.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, interpolate_op1) { - NodeBuilder::get_ops().register_factory(); - auto img = make_shared(element::f32, Shape{1, 3, 32, 32}); - auto out_shape = make_shared(element::i32, Shape{2}); + NodeBuilder::get_ops().register_factory(); + auto img = make_shared(element::f32, Shape{1, 3, 32, 32}); + auto out_shape = make_shared(element::i32, Shape{2}); - op::v0::InterpolateAttrs interp_atrs; + op::v0::Interpolate::Attributes interp_atrs; interp_atrs.axes = AxisSet{1, 2}; interp_atrs.mode = "cubic"; interp_atrs.align_corners = true; @@ -30,9 +27,9 @@ TEST(attributes, interpolate_op1) { interp_atrs.pads_begin = vector{0, 0}; interp_atrs.pads_end = vector{0, 0}; - auto interpolate = make_shared(img, out_shape, interp_atrs); + auto interpolate = make_shared(img, out_shape, interp_atrs); NodeBuilder builder(interpolate, {img, out_shape}); - auto g_interpolate = ov::as_type_ptr(builder.create()); + auto g_interpolate = ov::as_type_ptr(builder.create()); const auto i_attrs = interpolate->get_attrs(); const auto g_i_attrs = g_interpolate->get_attrs(); @@ -46,9 +43,9 @@ TEST(attributes, interpolate_op1) { } TEST(attributes, interpolate_op4) { - NodeBuilder::get_ops().register_factory(); - auto img = make_shared(element::f32, Shape{1, 3, 32, 32}); - auto out_shape = make_shared(element::i32, Shape{2}); + NodeBuilder::get_ops().register_factory(); + auto img = make_shared(element::f32, Shape{1, 3, 32, 32}); + auto out_shape = make_shared(element::i32, Shape{2}); auto scales = op::v0::Constant::create(element::f32, {1}, {1.0}); op::v4::Interpolate::InterpolateAttrs attrs; @@ -61,9 +58,9 @@ TEST(attributes, interpolate_op4) { attrs.antialias = true; attrs.cube_coeff = -0.75; - auto interpolate = make_shared(img, out_shape, scales, attrs); + auto interpolate = make_shared(img, out_shape, scales, attrs); NodeBuilder builder(interpolate, {img, out_shape, scales}); - auto g_interpolate = ov::as_type_ptr(builder.create()); + auto g_interpolate = ov::as_type_ptr(builder.create()); const auto i_attrs = interpolate->get_attrs(); const auto g_i_attrs = g_interpolate->get_attrs(); @@ -79,8 +76,8 @@ TEST(attributes, interpolate_op4) { } TEST(attributes, interpolate_op11) { - NodeBuilder::get_ops().register_factory(); - const auto img = make_shared(element::f32, Shape{1, 3, 32, 32}); + NodeBuilder::get_ops().register_factory(); + const auto img = make_shared(element::f32, Shape{1, 3, 32, 32}); const auto scales = op::v0::Constant::create(element::f32, {4}, {1.0, 1.0, 2.0, 2.0}); op::v11::Interpolate::InterpolateAttrs attrs; @@ -93,9 +90,9 @@ TEST(attributes, interpolate_op11) { attrs.antialias = true; attrs.cube_coeff = -0.75; - auto interpolate = make_shared(img, scales, attrs); + auto interpolate = make_shared(img, scales, attrs); NodeBuilder builder(interpolate, {img, scales}); - auto g_interpolate = ov::as_type_ptr(builder.create()); + auto g_interpolate = ov::as_type_ptr(builder.create()); const auto i_attrs = interpolate->get_attrs(); const auto g_i_attrs = g_interpolate->get_attrs(); diff --git a/src/core/tests/visitors/op/irdft.cpp b/src/core/tests/visitors/op/irdft.cpp index b44f504c91d..c5474d98738 100644 --- a/src/core/tests/visitors/op/irdft.cpp +++ b/src/core/tests/visitors/op/irdft.cpp @@ -2,14 +2,16 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" +#include "openvino/op/irdft.hpp" + +#include + +#include "openvino/op/constant.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, irdft_op) { NodeBuilder::get_ops().register_factory(); @@ -27,7 +29,7 @@ TEST(attributes, irdft_op) { TEST(attributes, irdft_op_signal) { NodeBuilder::get_ops().register_factory(); auto data = make_shared(element::f32, Shape{2, 10, 10, 2}); - auto signal = op::Constant::create(element::Type_t::i64, Shape{1}, {20}); + auto signal = op::v0::Constant::create(element::Type_t::i64, Shape{1}, {20}); auto axes = op::v0::Constant::create(element::i64, Shape{1}, {2}); auto irdft = make_shared(data, axes, signal); diff --git a/src/core/tests/visitors/op/is_finite.cpp b/src/core/tests/visitors/op/is_finite.cpp index 1b31e796093..ea8541dc6f4 100644 --- a/src/core/tests/visitors/op/is_finite.cpp +++ b/src/core/tests/visitors/op/is_finite.cpp @@ -2,9 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "openvino/opsets/opset10.hpp" +#include "openvino/op/is_finite.hpp" + #include "unary_ops.hpp" -using Types = ::testing::Types>; +using Types = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Types, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/is_inf.cpp b/src/core/tests/visitors/op/is_inf.cpp index 0a0018c999d..9f615f110c5 100644 --- a/src/core/tests/visitors/op/is_inf.cpp +++ b/src/core/tests/visitors/op/is_inf.cpp @@ -2,25 +2,25 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "openvino/opsets/opset10.hpp" +#include "openvino/op/is_inf.hpp" + +#include + +#include "openvino/op/parameter.hpp" +#include "visitors/visitors.hpp" using namespace std; using namespace ov; -using ngraph::test::NodeBuilder; -using namespace ov::opset10; +using ov::test::NodeBuilder; TEST(attributes, is_inf_defaults) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::f32, Shape{1, 3, 10, 10}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::f32, Shape{1, 3, 10, 10}); - const auto is_inf = make_shared(data); + const auto is_inf = make_shared(data); NodeBuilder builder(is_inf); - auto g_is_inf = ov::as_type_ptr(builder.create()); + auto g_is_inf = ov::as_type_ptr(builder.create()); const auto is_inf_attrs = is_inf->get_attributes(); const auto g_is_inf_attrs = g_is_inf->get_attributes(); @@ -30,15 +30,15 @@ TEST(attributes, is_inf_defaults) { } TEST(attributes, is_inf_positive_only) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::f32, Shape{1, 3, 10, 10}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::f32, Shape{1, 3, 10, 10}); - IsInf::Attributes attributes{}; + ov::op::v10::IsInf::Attributes attributes{}; attributes.detect_negative = false; - const auto is_inf = make_shared(data, attributes); + const auto is_inf = make_shared(data, attributes); NodeBuilder builder(is_inf); - auto g_is_inf = ov::as_type_ptr(builder.create()); + auto g_is_inf = ov::as_type_ptr(builder.create()); const auto is_inf_attrs = is_inf->get_attributes(); const auto g_is_inf_attrs = g_is_inf->get_attributes(); @@ -48,15 +48,15 @@ TEST(attributes, is_inf_positive_only) { } TEST(attributes, is_inf_negative_only) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::f32, Shape{1, 3, 10, 10}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::f32, Shape{1, 3, 10, 10}); - IsInf::Attributes attributes{}; + ov::op::v10::IsInf::Attributes attributes{}; attributes.detect_positive = false; - const auto is_inf = make_shared(data, attributes); + const auto is_inf = make_shared(data, attributes); NodeBuilder builder(is_inf); - auto g_is_inf = ov::as_type_ptr(builder.create()); + auto g_is_inf = ov::as_type_ptr(builder.create()); const auto is_inf_attrs = is_inf->get_attributes(); const auto g_is_inf_attrs = g_is_inf->get_attributes(); @@ -66,16 +66,16 @@ TEST(attributes, is_inf_negative_only) { } TEST(attributes, is_inf_detect_none) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::f32, Shape{1, 3, 10, 10}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::f32, Shape{1, 3, 10, 10}); - IsInf::Attributes attributes{}; + ov::op::v10::IsInf::Attributes attributes{}; attributes.detect_negative = false; attributes.detect_positive = false; - const auto is_inf = make_shared(data, attributes); + const auto is_inf = make_shared(data, attributes); NodeBuilder builder(is_inf); - auto g_is_inf = ov::as_type_ptr(builder.create()); + auto g_is_inf = ov::as_type_ptr(builder.create()); const auto is_inf_attrs = is_inf->get_attributes(); const auto g_is_inf_attrs = g_is_inf->get_attributes(); diff --git a/src/core/tests/visitors/op/is_nan.cpp b/src/core/tests/visitors/op/is_nan.cpp index 096d640ae8f..011ebaaf6aa 100644 --- a/src/core/tests/visitors/op/is_nan.cpp +++ b/src/core/tests/visitors/op/is_nan.cpp @@ -2,7 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/is_nan.hpp" + #include "unary_ops.hpp" + using Types = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Types, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/less.cpp b/src/core/tests/visitors/op/less.cpp index 2746cd01126..ec62df753db 100644 --- a/src/core/tests/visitors/op/less.cpp +++ b/src/core/tests/visitors/op/less.cpp @@ -2,9 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "binary_ops.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/less.hpp" -using Type = ::testing::Types>; +#include "binary_ops.hpp" + +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_with_auto_broadcast, BinaryOperatorVisitor, Type, BinaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/less_equal.cpp b/src/core/tests/visitors/op/less_equal.cpp index f98ead72925..11925c7a3db 100644 --- a/src/core/tests/visitors/op/less_equal.cpp +++ b/src/core/tests/visitors/op/less_equal.cpp @@ -3,8 +3,8 @@ // #include "binary_ops.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/less_eq.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_with_auto_broadcast, BinaryOperatorVisitor, Type, BinaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/log.cpp b/src/core/tests/visitors/op/log.cpp index 73a7fffcf94..34db467cc0e 100644 --- a/src/core/tests/visitors/op/log.cpp +++ b/src/core/tests/visitors/op/log.cpp @@ -2,9 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/log.hpp" + #include "unary_ops.hpp" -using Types = ::testing::Types, - UnaryOperatorType>; +using Types = ::testing::Types, + UnaryOperatorType>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Types, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/log_softmax.cpp b/src/core/tests/visitors/op/log_softmax.cpp index ebcc7f175e8..16f2caa0bd4 100644 --- a/src/core/tests/visitors/op/log_softmax.cpp +++ b/src/core/tests/visitors/op/log_softmax.cpp @@ -2,29 +2,25 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/log_softmax.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, logsoftmax_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::f32, Shape{3, 2, 3}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::f32, Shape{3, 2, 3}); int64_t axis = 2; - const auto logsoftmax = make_shared(data, axis); + const auto logsoftmax = make_shared(data, axis); NodeBuilder builder(logsoftmax, {data}); - auto g_logsoftmax = ov::as_type_ptr(builder.create()); + auto g_logsoftmax = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 1; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/logical_and.cpp b/src/core/tests/visitors/op/logical_and.cpp index 0091b68e8e9..6f52e0fc740 100644 --- a/src/core/tests/visitors/op/logical_and.cpp +++ b/src/core/tests/visitors/op/logical_and.cpp @@ -2,9 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "binary_ops.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/logical_and.hpp" -using Type = ::testing::Types>; +#include "binary_ops.hpp" + +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_with_auto_broadcast, BinaryOperatorVisitor, Type, BinaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/logical_not.cpp b/src/core/tests/visitors/op/logical_not.cpp index da6264335d9..02624852621 100644 --- a/src/core/tests/visitors/op/logical_not.cpp +++ b/src/core/tests/visitors/op/logical_not.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/logical_not.hpp" + #include "unary_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Type, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/logical_or.cpp b/src/core/tests/visitors/op/logical_or.cpp index 0c452df3284..49b1e2ed5d9 100644 --- a/src/core/tests/visitors/op/logical_or.cpp +++ b/src/core/tests/visitors/op/logical_or.cpp @@ -2,9 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "binary_ops.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/logical_or.hpp" -using Type = ::testing::Types>; +#include "binary_ops.hpp" + +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_with_auto_broadcast, BinaryOperatorVisitor, Type, BinaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/logical_xor.cpp b/src/core/tests/visitors/op/logical_xor.cpp index e76afa3cd30..5e3f701101c 100644 --- a/src/core/tests/visitors/op/logical_xor.cpp +++ b/src/core/tests/visitors/op/logical_xor.cpp @@ -2,9 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "binary_ops.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/logical_xor.hpp" -using Type = ::testing::Types>; +#include "binary_ops.hpp" + +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_with_auto_broadcast, BinaryOperatorVisitor, Type, BinaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/lrn.cpp b/src/core/tests/visitors/op/lrn.cpp index ab8f6ffa627..7a81f567ad6 100644 --- a/src/core/tests/visitors/op/lrn.cpp +++ b/src/core/tests/visitors/op/lrn.cpp @@ -2,33 +2,29 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/lrn.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, lrn_op) { - NodeBuilder::get_ops().register_factory(); - const auto arg = make_shared(element::f32, Shape{1, 2, 3, 4}); - const auto axes = make_shared(element::i32, Shape{2}); + NodeBuilder::get_ops().register_factory(); + const auto arg = make_shared(element::f32, Shape{1, 2, 3, 4}); + const auto axes = make_shared(element::i32, Shape{2}); const double alpha = 1.1; const double beta = 2.2; const double bias = 3.3; const size_t size = 4; - const auto lrn = make_shared(arg, axes, alpha, beta, bias, size); + const auto lrn = make_shared(arg, axes, alpha, beta, bias, size); NodeBuilder builder(lrn, {arg, axes}); - auto g_lrn = ov::as_type_ptr(builder.create()); + auto g_lrn = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_lrn->get_alpha(), lrn->get_alpha()); EXPECT_EQ(g_lrn->get_beta(), lrn->get_beta()); diff --git a/src/core/tests/visitors/op/lstm_cell.cpp b/src/core/tests/visitors/op/lstm_cell.cpp index daf6b7f96c4..5a6487007a7 100644 --- a/src/core/tests/visitors/op/lstm_cell.cpp +++ b/src/core/tests/visitors/op/lstm_cell.cpp @@ -2,28 +2,24 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/lstm_cell.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, lstm_cell_v0_op) { - NodeBuilder::get_ops().register_factory(); - auto X = make_shared(element::f32, Shape{2, 3}); - auto H = make_shared(element::f32, Shape{2, 3}); - auto W = make_shared(element::f32, Shape{12, 3}); - auto R = make_shared(element::f32, Shape{12, 3}); - const auto initial_hidden_state = make_shared(element::f32, Shape{2, 3}); - const auto initial_cell_state = make_shared(element::f32, Shape{2, 3}); + NodeBuilder::get_ops().register_factory(); + auto X = make_shared(element::f32, Shape{2, 3}); + auto H = make_shared(element::f32, Shape{2, 3}); + auto W = make_shared(element::f32, Shape{12, 3}); + auto R = make_shared(element::f32, Shape{12, 3}); + const auto initial_hidden_state = make_shared(element::f32, Shape{2, 3}); + const auto initial_cell_state = make_shared(element::f32, Shape{2, 3}); const auto hidden_size = 3; auto weights_format = ov::op::LSTMWeightsFormat::IFCO; @@ -32,20 +28,20 @@ TEST(attributes, lstm_cell_v0_op) { auto activations_beta = std::vector{2.0, 1.0}; const float clip = 0.5f; auto input_forget = false; - const auto lstm_cell = make_shared(X, - initial_hidden_state, - initial_cell_state, - W, - R, - hidden_size, - weights_format, - activations, - activations_alpha, - activations_beta, - clip, - input_forget); + const auto lstm_cell = make_shared(X, + initial_hidden_state, + initial_cell_state, + W, + R, + hidden_size, + weights_format, + activations, + activations_alpha, + activations_beta, + clip, + input_forget); NodeBuilder builder(lstm_cell, {X, initial_hidden_state, initial_cell_state, W, R}); - auto g_lstm_cell = ov::as_type_ptr(builder.create()); + auto g_lstm_cell = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_lstm_cell->get_hidden_size(), lstm_cell->get_hidden_size()); EXPECT_EQ(g_lstm_cell->get_activations(), lstm_cell->get_activations()); @@ -55,31 +51,31 @@ TEST(attributes, lstm_cell_v0_op) { } TEST(attributes, lstm_cell_v4_op) { - NodeBuilder::get_ops().register_factory(); - auto X = make_shared(element::f32, Shape{2, 3}); - auto H = make_shared(element::f32, Shape{2, 3}); - auto W = make_shared(element::f32, Shape{12, 3}); - auto R = make_shared(element::f32, Shape{12, 3}); - const auto initial_hidden_state = make_shared(element::f32, Shape{2, 3}); - const auto initial_cell_state = make_shared(element::f32, Shape{2, 3}); + NodeBuilder::get_ops().register_factory(); + auto X = make_shared(element::f32, Shape{2, 3}); + auto H = make_shared(element::f32, Shape{2, 3}); + auto W = make_shared(element::f32, Shape{12, 3}); + auto R = make_shared(element::f32, Shape{12, 3}); + const auto initial_hidden_state = make_shared(element::f32, Shape{2, 3}); + const auto initial_cell_state = make_shared(element::f32, Shape{2, 3}); const auto hidden_size = 3; const std::vector activations = {"tanh", "sigmoid", "tanh"}; auto activations_alpha = std::vector{1.0, 1.5}; auto activations_beta = std::vector{2.0, 1.0}; const float clip = 0.5f; - const auto lstm_cell = make_shared(X, - initial_hidden_state, - initial_cell_state, - W, - R, - hidden_size, - activations, - activations_alpha, - activations_beta, - clip); + const auto lstm_cell = make_shared(X, + initial_hidden_state, + initial_cell_state, + W, + R, + hidden_size, + activations, + activations_alpha, + activations_beta, + clip); NodeBuilder builder(lstm_cell, {X, initial_hidden_state, initial_cell_state, W, R}); - auto g_lstm_cell = ov::as_type_ptr(builder.create()); + auto g_lstm_cell = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_lstm_cell->get_hidden_size(), lstm_cell->get_hidden_size()); EXPECT_EQ(g_lstm_cell->get_activations(), lstm_cell->get_activations()); @@ -89,33 +85,33 @@ TEST(attributes, lstm_cell_v4_op) { } TEST(attributes, lstm_cell_v4_op2) { - NodeBuilder::get_ops().register_factory(); - auto X = make_shared(element::f32, Shape{2, 3}); - auto H = make_shared(element::f32, Shape{2, 3}); - auto W = make_shared(element::f32, Shape{12, 3}); - auto R = make_shared(element::f32, Shape{12, 3}); - const auto initial_hidden_state = make_shared(element::f32, Shape{2, 3}); - const auto initial_cell_state = make_shared(element::f32, Shape{2, 3}); - auto B = make_shared(element::f32, Shape{12}); + NodeBuilder::get_ops().register_factory(); + auto X = make_shared(element::f32, Shape{2, 3}); + auto H = make_shared(element::f32, Shape{2, 3}); + auto W = make_shared(element::f32, Shape{12, 3}); + auto R = make_shared(element::f32, Shape{12, 3}); + const auto initial_hidden_state = make_shared(element::f32, Shape{2, 3}); + const auto initial_cell_state = make_shared(element::f32, Shape{2, 3}); + auto B = make_shared(element::f32, Shape{12}); const auto hidden_size = 3; const std::vector activations = {"tanh", "sigmoid", "tanh"}; auto activations_alpha = std::vector{1.0, 1.5}; auto activations_beta = std::vector{2.0, 1.0}; const float clip = 0.5f; - const auto lstm_cell = make_shared(X, - initial_hidden_state, - initial_cell_state, - W, - R, - B, - hidden_size, - activations, - activations_alpha, - activations_beta, - clip); + const auto lstm_cell = make_shared(X, + initial_hidden_state, + initial_cell_state, + W, + R, + B, + hidden_size, + activations, + activations_alpha, + activations_beta, + clip); NodeBuilder builder(lstm_cell, {X, initial_hidden_state, initial_cell_state, W, R, B}); - auto g_lstm_cell = ov::as_type_ptr(builder.create()); + auto g_lstm_cell = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_lstm_cell->get_hidden_size(), lstm_cell->get_hidden_size()); EXPECT_EQ(g_lstm_cell->get_activations(), lstm_cell->get_activations()); diff --git a/src/core/tests/visitors/op/lstm_sequence.cpp b/src/core/tests/visitors/op/lstm_sequence.cpp index f33838f24af..a24cb7095cb 100644 --- a/src/core/tests/visitors/op/lstm_sequence.cpp +++ b/src/core/tests/visitors/op/lstm_sequence.cpp @@ -2,22 +2,18 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/lstm_sequence.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, lstm_sequence_op) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); const size_t batch_size = 4; const size_t num_directions = 2; @@ -25,15 +21,16 @@ TEST(attributes, lstm_sequence_op) { const size_t input_size = 16; const size_t hidden_size = 64; - const auto X = make_shared(element::f32, Shape{batch_size, seq_length, input_size}); + const auto X = make_shared(element::f32, Shape{batch_size, seq_length, input_size}); const auto initial_hidden_state = - make_shared(element::f32, Shape{batch_size, num_directions, hidden_size}); + make_shared(element::f32, Shape{batch_size, num_directions, hidden_size}); const auto initial_cell_state = - make_shared(element::f32, Shape{batch_size, num_directions, hidden_size}); - const auto sequence_lengths = make_shared(element::i32, Shape{batch_size}); - const auto W = make_shared(element::f32, Shape{num_directions, 4 * hidden_size, input_size}); - const auto R = make_shared(element::f32, Shape{num_directions, 4 * hidden_size, hidden_size}); - const auto B = make_shared(element::f32, Shape{num_directions, 4 * hidden_size}); + make_shared(element::f32, Shape{batch_size, num_directions, hidden_size}); + const auto sequence_lengths = make_shared(element::i32, Shape{batch_size}); + const auto W = make_shared(element::f32, Shape{num_directions, 4 * hidden_size, input_size}); + const auto R = + make_shared(element::f32, Shape{num_directions, 4 * hidden_size, hidden_size}); + const auto B = make_shared(element::f32, Shape{num_directions, 4 * hidden_size}); const auto lstm_direction = op::RecurrentSequenceDirection::BIDIRECTIONAL; const std::vector activations_alpha = {1, 2, 3}; @@ -41,21 +38,21 @@ TEST(attributes, lstm_sequence_op) { const std::vector activations = {"tanh", "sigmoid", "tanh"}; const float clip_threshold = 0.5f; - const auto lstm_sequence = make_shared(X, - initial_hidden_state, - initial_cell_state, - sequence_lengths, - W, - R, - B, - hidden_size, - lstm_direction, - activations_alpha, - activations_beta, - activations, - clip_threshold); + const auto lstm_sequence = make_shared(X, + initial_hidden_state, + initial_cell_state, + sequence_lengths, + W, + R, + B, + hidden_size, + lstm_direction, + activations_alpha, + activations_beta, + activations, + clip_threshold); NodeBuilder builder(lstm_sequence, {X, initial_hidden_state, initial_cell_state, sequence_lengths, W, R, B}); - auto g_lstm_sequence = ov::as_type_ptr(builder.create()); + auto g_lstm_sequence = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_lstm_sequence->get_hidden_size(), lstm_sequence->get_hidden_size()); EXPECT_EQ(g_lstm_sequence->get_activations(), lstm_sequence->get_activations()); @@ -66,7 +63,7 @@ TEST(attributes, lstm_sequence_op) { } TEST(attributes, lstm_sequence_v1_op) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); const size_t batch_size = 4; const size_t num_directions = 2; @@ -74,16 +71,17 @@ TEST(attributes, lstm_sequence_v1_op) { const size_t input_size = 16; const size_t hidden_size = 64; - const auto X = make_shared(element::f32, Shape{batch_size, seq_length, input_size}); + const auto X = make_shared(element::f32, Shape{batch_size, seq_length, input_size}); const auto initial_hidden_state = - make_shared(element::f32, Shape{batch_size, num_directions, hidden_size}); + make_shared(element::f32, Shape{batch_size, num_directions, hidden_size}); const auto initial_cell_state = - make_shared(element::f32, Shape{batch_size, num_directions, hidden_size}); - const auto sequence_lengths = make_shared(element::i32, Shape{batch_size}); - const auto W = make_shared(element::f32, Shape{num_directions, 4 * hidden_size, input_size}); - const auto R = make_shared(element::f32, Shape{num_directions, 4 * hidden_size, hidden_size}); - const auto B = make_shared(element::f32, Shape{num_directions, 4 * hidden_size}); - const auto P = make_shared(element::f32, Shape{num_directions, 3 * hidden_size}); + make_shared(element::f32, Shape{batch_size, num_directions, hidden_size}); + const auto sequence_lengths = make_shared(element::i32, Shape{batch_size}); + const auto W = make_shared(element::f32, Shape{num_directions, 4 * hidden_size, input_size}); + const auto R = + make_shared(element::f32, Shape{num_directions, 4 * hidden_size, hidden_size}); + const auto B = make_shared(element::f32, Shape{num_directions, 4 * hidden_size}); + const auto P = make_shared(element::f32, Shape{num_directions, 3 * hidden_size}); const auto lstm_direction = op::RecurrentSequenceDirection::BIDIRECTIONAL; const ov::op::LSTMWeightsFormat weights_format = ov::op::LSTMWeightsFormat::FICO; @@ -93,24 +91,24 @@ TEST(attributes, lstm_sequence_v1_op) { const float clip_threshold = 0.5f; const bool input_forget = true; - const auto lstm_sequence = make_shared(X, - initial_hidden_state, - initial_cell_state, - sequence_lengths, - W, - R, - B, - P, - hidden_size, - lstm_direction, - weights_format, - activations_alpha, - activations_beta, - activations, - clip_threshold, - input_forget); + const auto lstm_sequence = make_shared(X, + initial_hidden_state, + initial_cell_state, + sequence_lengths, + W, + R, + B, + P, + hidden_size, + lstm_direction, + weights_format, + activations_alpha, + activations_beta, + activations, + clip_threshold, + input_forget); NodeBuilder builder(lstm_sequence, {X, initial_hidden_state, initial_cell_state, sequence_lengths, W, R, B, P}); - auto g_lstm_sequence = ov::as_type_ptr(builder.create()); + auto g_lstm_sequence = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_lstm_sequence->get_hidden_size(), lstm_sequence->get_hidden_size()); EXPECT_EQ(g_lstm_sequence->get_activations(), lstm_sequence->get_activations()); diff --git a/src/core/tests/visitors/op/matmul.cpp b/src/core/tests/visitors/op/matmul.cpp index 83e87f5759f..2e496245be9 100644 --- a/src/core/tests/visitors/op/matmul.cpp +++ b/src/core/tests/visitors/op/matmul.cpp @@ -2,102 +2,98 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/matmul.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, matmul_op) { - NodeBuilder::get_ops().register_factory(); - auto A = make_shared(element::f32, Shape{0, 2}); - auto B = make_shared(element::f32, Shape{2, 0}); + NodeBuilder::get_ops().register_factory(); + auto A = make_shared(element::f32, Shape{0, 2}); + auto B = make_shared(element::f32, Shape{2, 0}); bool transpose_a = true; bool transpose_b = true; - auto matmul = make_shared(A, B, transpose_a, transpose_b); + auto matmul = make_shared(A, B, transpose_a, transpose_b); NodeBuilder builder(matmul, {A, B}); - auto g_matmul = ov::as_type_ptr(builder.create()); + auto g_matmul = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_matmul->get_transpose_a(), matmul->get_transpose_a()); EXPECT_EQ(g_matmul->get_transpose_b(), matmul->get_transpose_b()); } TEST(attributes, matmul_op2) { - NodeBuilder::get_ops().register_factory(); - auto A = make_shared(element::f32, Shape{10, 2}); - auto B = make_shared(element::f32, Shape{2, 1}); + NodeBuilder::get_ops().register_factory(); + auto A = make_shared(element::f32, Shape{10, 2}); + auto B = make_shared(element::f32, Shape{2, 1}); bool transpose_a = false; bool transpose_b = false; - auto matmul = make_shared(A, B, transpose_a, transpose_b); + auto matmul = make_shared(A, B, transpose_a, transpose_b); NodeBuilder builder(matmul, {A, B}); - auto g_matmul = ov::as_type_ptr(builder.create()); + auto g_matmul = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_matmul->get_transpose_a(), matmul->get_transpose_a()); EXPECT_EQ(g_matmul->get_transpose_b(), matmul->get_transpose_b()); } TEST(attributes, matmul_op3) { - NodeBuilder::get_ops().register_factory(); - auto A = make_shared(element::f32, Shape{2, 10}); - auto B = make_shared(element::f32, Shape{2, 1}); + NodeBuilder::get_ops().register_factory(); + auto A = make_shared(element::f32, Shape{2, 10}); + auto B = make_shared(element::f32, Shape{2, 1}); bool transpose_a = true; bool transpose_b = false; - auto matmul = make_shared(A, B, transpose_a, transpose_b); + auto matmul = make_shared(A, B, transpose_a, transpose_b); NodeBuilder builder(matmul, {A, B}); - auto g_matmul = ov::as_type_ptr(builder.create()); + auto g_matmul = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_matmul->get_transpose_a(), matmul->get_transpose_a()); EXPECT_EQ(g_matmul->get_transpose_b(), matmul->get_transpose_b()); } TEST(attributes, matmul_op4) { - NodeBuilder::get_ops().register_factory(); - auto A = make_shared(element::f32, Shape{2, 3, 2}); - auto B = make_shared(element::f32, Shape{3, 2, 2, 1}); + NodeBuilder::get_ops().register_factory(); + auto A = make_shared(element::f32, Shape{2, 3, 2}); + auto B = make_shared(element::f32, Shape{3, 2, 2, 1}); - auto matmul = make_shared(A, B); + auto matmul = make_shared(A, B); NodeBuilder builder(matmul, {A, B}); - auto g_matmul = ov::as_type_ptr(builder.create()); + auto g_matmul = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_matmul->get_transpose_a(), matmul->get_transpose_a()); EXPECT_EQ(g_matmul->get_transpose_b(), matmul->get_transpose_b()); } TEST(attributes, matmul_op5) { - NodeBuilder::get_ops().register_factory(); - auto A = make_shared(element::f32, Shape{2}); - auto B = make_shared(element::f32, Shape{2, 10}); + NodeBuilder::get_ops().register_factory(); + auto A = make_shared(element::f32, Shape{2}); + auto B = make_shared(element::f32, Shape{2, 10}); - auto matmul = make_shared(A, B); + auto matmul = make_shared(A, B); NodeBuilder builder(matmul, {A, B}); - auto g_matmul = ov::as_type_ptr(builder.create()); + auto g_matmul = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_matmul->get_transpose_a(), matmul->get_transpose_a()); EXPECT_EQ(g_matmul->get_transpose_b(), matmul->get_transpose_b()); } TEST(attributes, matmul_op6) { - NodeBuilder::get_ops().register_factory(); - auto A = make_shared(element::f32, Shape{1, 2048}); - auto B = make_shared(element::f32, Shape{2048, 1000}); + NodeBuilder::get_ops().register_factory(); + auto A = make_shared(element::f32, Shape{1, 2048}); + auto B = make_shared(element::f32, Shape{2048, 1000}); - auto matmul = make_shared(A, B); + auto matmul = make_shared(A, B); NodeBuilder builder(matmul, {A, B}); - auto g_matmul = ov::as_type_ptr(builder.create()); + auto g_matmul = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_matmul->get_transpose_a(), matmul->get_transpose_a()); EXPECT_EQ(g_matmul->get_transpose_b(), matmul->get_transpose_b()); diff --git a/src/core/tests/visitors/op/matrix_nms.cpp b/src/core/tests/visitors/op/matrix_nms.cpp index 1b11e5a0843..ccdd411ec5c 100644 --- a/src/core/tests/visitors/op/matrix_nms.cpp +++ b/src/core/tests/visitors/op/matrix_nms.cpp @@ -2,42 +2,37 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" -#include "ngraph/opsets/opset8.hpp" +#include "openvino/op/matrix_nms.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, matrix_nms_v8_op_custom_attributes) { - NodeBuilder::get_ops().register_factory(); - auto boxes = make_shared(element::f32, Shape{1, 1, 4}); - auto scores = make_shared(element::f32, Shape{1, 1, 1}); + NodeBuilder::get_ops().register_factory(); + auto boxes = make_shared(element::f32, Shape{1, 1, 4}); + auto scores = make_shared(element::f32, Shape{1, 1, 1}); - opset8::MatrixNms::Attributes attrs; - attrs.sort_result_type = opset8::MatrixNms::SortResultType::SCORE; - attrs.output_type = ngraph::element::i32; + ov::op::v8::MatrixNms::Attributes attrs; + attrs.sort_result_type = ov::op::v8::MatrixNms::SortResultType::SCORE; + attrs.output_type = ov::element::i32; attrs.nms_top_k = 100; attrs.keep_top_k = 10; attrs.sort_result_across_batch = true; attrs.score_threshold = 0.1f; attrs.background_class = 2; - attrs.decay_function = opset8::MatrixNms::DecayFunction::GAUSSIAN; + attrs.decay_function = ov::op::v8::MatrixNms::DecayFunction::GAUSSIAN; attrs.gaussian_sigma = 0.2f; attrs.post_threshold = 0.3f; attrs.normalized = false; - auto nms = make_shared(boxes, scores, attrs); + auto nms = make_shared(boxes, scores, attrs); NodeBuilder builder(nms, {boxes, scores}); - auto g_nms = ov::as_type_ptr(builder.create()); + auto g_nms = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 11; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); @@ -70,13 +65,13 @@ TEST(attributes, matrix_nms_v8_op_custom_attributes) { } TEST(attributes, matrix_nms_v8_op_default_attributes) { - NodeBuilder::get_ops().register_factory(); - auto boxes = make_shared(element::f32, Shape{1, 1, 4}); - auto scores = make_shared(element::f32, Shape{1, 1, 1}); + NodeBuilder::get_ops().register_factory(); + auto boxes = make_shared(element::f32, Shape{1, 1, 4}); + auto scores = make_shared(element::f32, Shape{1, 1, 1}); - auto nms = make_shared(boxes, scores, opset8::MatrixNms::Attributes()); + auto nms = make_shared(boxes, scores, ov::op::v8::MatrixNms::Attributes()); NodeBuilder builder(nms, {boxes, scores}); - auto g_nms = ov::as_type_ptr(builder.create()); + auto g_nms = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 11; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/max_pool.cpp b/src/core/tests/visitors/op/max_pool.cpp index c69be5dc67c..faa3e529e0c 100644 --- a/src/core/tests/visitors/op/max_pool.cpp +++ b/src/core/tests/visitors/op/max_pool.cpp @@ -2,21 +2,19 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset8.hpp" +#include "openvino/op/max_pool.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, max_pool_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::f32, Shape{64, 3, 5}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::f32, Shape{64, 3, 5}); auto strides = Strides{2}; auto pads_begin = Shape{1}; @@ -25,9 +23,10 @@ TEST(attributes, max_pool_op) { auto rounding_mode = op::RoundingType::FLOOR; auto auto_pad = op::PadType::EXPLICIT; - auto max_pool = make_shared(data, strides, pads_begin, pads_end, kernel, rounding_mode, auto_pad); + auto max_pool = + make_shared(data, strides, pads_begin, pads_end, kernel, rounding_mode, auto_pad); NodeBuilder builder(max_pool, {data}); - auto g_max_pool = ov::as_type_ptr(builder.create()); + auto g_max_pool = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_max_pool->get_strides(), max_pool->get_strides()); EXPECT_EQ(g_max_pool->get_pads_begin(), max_pool->get_pads_begin()); @@ -38,8 +37,8 @@ TEST(attributes, max_pool_op) { } TEST(attributes, max_pool_v8_op) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::i32, Shape{1, 3, 37, 37}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::i32, Shape{1, 3, 37, 37}); const auto strides = Strides{1, 1}; const auto dilations = Strides{1, 1}; @@ -50,17 +49,17 @@ TEST(attributes, max_pool_v8_op) { const auto auto_pad = op::PadType::EXPLICIT; const element::Type& index_element_type = element::i32; - const auto max_pool = make_shared(data, - strides, - dilations, - pads_begin, - pads_end, - kernel, - rounding_mode, - auto_pad, - index_element_type); + const auto max_pool = make_shared(data, + strides, + dilations, + pads_begin, + pads_end, + kernel, + rounding_mode, + auto_pad, + index_element_type); NodeBuilder builder(max_pool, {data}); - auto g_max_pool = ov::as_type_ptr(builder.create()); + auto g_max_pool = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_max_pool->get_strides(), max_pool->get_strides()); EXPECT_EQ(g_max_pool->get_dilations(), max_pool->get_dilations()); diff --git a/src/core/tests/visitors/op/maximum.cpp b/src/core/tests/visitors/op/maximum.cpp index 35448c42307..39a797cdc52 100644 --- a/src/core/tests/visitors/op/maximum.cpp +++ b/src/core/tests/visitors/op/maximum.cpp @@ -2,9 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "binary_ops.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/maximum.hpp" -using Type = ::testing::Types>; +#include "binary_ops.hpp" + +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_with_auto_broadcast, BinaryOperatorVisitor, Type, BinaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/minimum.cpp b/src/core/tests/visitors/op/minimum.cpp index edcac6e9c4c..ebb4a9fd97b 100644 --- a/src/core/tests/visitors/op/minimum.cpp +++ b/src/core/tests/visitors/op/minimum.cpp @@ -2,9 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "binary_ops.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/minimum.hpp" -using Type = ::testing::Types>; +#include "binary_ops.hpp" + +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_with_auto_broadcast, BinaryOperatorVisitor, Type, BinaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/mish.cpp b/src/core/tests/visitors/op/mish.cpp index 83627651aa5..31311dd339e 100644 --- a/src/core/tests/visitors/op/mish.cpp +++ b/src/core/tests/visitors/op/mish.cpp @@ -2,23 +2,22 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" +#include "openvino/op/mish.hpp" + #include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset4.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, mish_op) { - NodeBuilder::get_ops().register_factory(); - const auto A = make_shared(element::f32, Shape{5, 2}); + NodeBuilder::get_ops().register_factory(); + const auto A = make_shared(element::f32, Shape{5, 2}); - const auto mish = make_shared(A); + const auto mish = make_shared(A); NodeBuilder builder(mish, {A}); - EXPECT_NO_THROW(auto g_mish = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_mish = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/mod.cpp b/src/core/tests/visitors/op/mod.cpp index a9630652a5d..b9090054339 100644 --- a/src/core/tests/visitors/op/mod.cpp +++ b/src/core/tests/visitors/op/mod.cpp @@ -2,9 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "binary_ops.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/mod.hpp" -using Type = ::testing::Types>; +#include "binary_ops.hpp" + +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_with_auto_broadcast, BinaryOperatorVisitor, Type, BinaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/multiclass_nms.cpp b/src/core/tests/visitors/op/multiclass_nms.cpp index 6abdc232449..b743ddb8467 100644 --- a/src/core/tests/visitors/op/multiclass_nms.cpp +++ b/src/core/tests/visitors/op/multiclass_nms.cpp @@ -2,28 +2,25 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset8.hpp" -#include "ngraph/opsets/opset9.hpp" +#include "openvino/op/multiclass_nms.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, multiclass_nms_v8_op_custom_attributes) { - NodeBuilder::get_ops().register_factory(); - auto boxes = make_shared(element::f32, Shape{1, 1, 4}); - auto scores = make_shared(element::f32, Shape{1, 1, 1}); + NodeBuilder::get_ops().register_factory(); + auto boxes = make_shared(element::f32, Shape{1, 1, 4}); + auto scores = make_shared(element::f32, Shape{1, 1, 1}); - opset8::MulticlassNms::Attributes attrs; - attrs.sort_result_type = opset8::MulticlassNms::SortResultType::SCORE; + ov::op::v8::MulticlassNms::Attributes attrs; + attrs.sort_result_type = ov::op::v8::MulticlassNms::SortResultType::SCORE; attrs.sort_result_across_batch = true; - attrs.output_type = ngraph::element::i32; + attrs.output_type = ov::element::i32; attrs.nms_top_k = 100; attrs.keep_top_k = 10; attrs.iou_threshold = 0.1f; @@ -32,9 +29,9 @@ TEST(attributes, multiclass_nms_v8_op_custom_attributes) { attrs.nms_eta = 0.3f; attrs.normalized = false; - auto nms = make_shared(boxes, scores, attrs); + auto nms = make_shared(boxes, scores, attrs); NodeBuilder builder(nms, {boxes, scores}); - auto g_nms = ov::as_type_ptr(builder.create()); + auto g_nms = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 10; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); @@ -65,13 +62,13 @@ TEST(attributes, multiclass_nms_v8_op_custom_attributes) { } TEST(attributes, multiclass_nms_v8_op_default_attributes) { - NodeBuilder::get_ops().register_factory(); - auto boxes = make_shared(element::f32, Shape{1, 1, 4}); - auto scores = make_shared(element::f32, Shape{1, 1, 1}); + NodeBuilder::get_ops().register_factory(); + auto boxes = make_shared(element::f32, Shape{1, 1, 4}); + auto scores = make_shared(element::f32, Shape{1, 1, 1}); - auto nms = make_shared(boxes, scores, opset8::MulticlassNms::Attributes()); + auto nms = make_shared(boxes, scores, ov::op::v8::MulticlassNms::Attributes()); NodeBuilder builder(nms, {boxes, scores}); - auto g_nms = ov::as_type_ptr(builder.create()); + auto g_nms = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 10; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); @@ -91,15 +88,15 @@ TEST(attributes, multiclass_nms_v8_op_default_attributes) { } TEST(attributes, multiclass_nms_v9_op_custom_attributes) { - NodeBuilder::get_ops().register_factory(); - auto boxes = make_shared(element::f32, Shape{3, 2, 4}); - auto scores = make_shared(element::f32, Shape{3, 2}); - auto roisnum = make_shared(element::i32, Shape{2}); + NodeBuilder::get_ops().register_factory(); + auto boxes = make_shared(element::f32, Shape{3, 2, 4}); + auto scores = make_shared(element::f32, Shape{3, 2}); + auto roisnum = make_shared(element::i32, Shape{2}); - opset9::MulticlassNms::Attributes attrs; - attrs.sort_result_type = opset9::MulticlassNms::SortResultType::SCORE; + ov::op::v9::MulticlassNms::Attributes attrs; + attrs.sort_result_type = ov::op::v9::MulticlassNms::SortResultType::SCORE; attrs.sort_result_across_batch = true; - attrs.output_type = ngraph::element::i32; + attrs.output_type = ov::element::i32; attrs.nms_top_k = 100; attrs.keep_top_k = 10; attrs.iou_threshold = 0.1f; @@ -108,9 +105,9 @@ TEST(attributes, multiclass_nms_v9_op_custom_attributes) { attrs.nms_eta = 0.3f; attrs.normalized = false; - auto nms = make_shared(boxes, scores, roisnum, attrs); + auto nms = make_shared(boxes, scores, roisnum, attrs); NodeBuilder builder(nms, {boxes, scores, roisnum}); - auto g_nms = ov::as_type_ptr(builder.create()); + auto g_nms = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 10; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); @@ -141,14 +138,14 @@ TEST(attributes, multiclass_nms_v9_op_custom_attributes) { } TEST(attributes, multiclass_nms_v9_op_default_attributes) { - NodeBuilder::get_ops().register_factory(); - auto boxes = make_shared(element::f32, Shape{3, 2, 4}); - auto scores = make_shared(element::f32, Shape{3, 2}); - auto roisnum = make_shared(element::i32, Shape{2}); + NodeBuilder::get_ops().register_factory(); + auto boxes = make_shared(element::f32, Shape{3, 2, 4}); + auto scores = make_shared(element::f32, Shape{3, 2}); + auto roisnum = make_shared(element::i32, Shape{2}); - auto nms = make_shared(boxes, scores, roisnum, opset9::MulticlassNms::Attributes()); + auto nms = make_shared(boxes, scores, roisnum, ov::op::v9::MulticlassNms::Attributes()); NodeBuilder builder(nms, {boxes, scores, roisnum}); - auto g_nms = ov::as_type_ptr(builder.create()); + auto g_nms = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 10; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); @@ -168,13 +165,13 @@ TEST(attributes, multiclass_nms_v9_op_default_attributes) { } TEST(attributes, multiclass_nms_v9_op_default_attributes2) { - NodeBuilder::get_ops().register_factory(); - auto boxes = make_shared(element::f32, Shape{3, 2, 4}); - auto scores = make_shared(element::f32, Shape{3, 3, 2}); + NodeBuilder::get_ops().register_factory(); + auto boxes = make_shared(element::f32, Shape{3, 2, 4}); + auto scores = make_shared(element::f32, Shape{3, 3, 2}); - auto nms = make_shared(boxes, scores, opset9::MulticlassNms::Attributes()); + auto nms = make_shared(boxes, scores, ov::op::v9::MulticlassNms::Attributes()); NodeBuilder builder(nms, {boxes, scores}); - auto g_nms = ov::as_type_ptr(builder.create()); + auto g_nms = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 10; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/multiply.cpp b/src/core/tests/visitors/op/multiply.cpp index 387fe6ecba5..62a26383412 100644 --- a/src/core/tests/visitors/op/multiply.cpp +++ b/src/core/tests/visitors/op/multiply.cpp @@ -2,9 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "binary_ops.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/multiply.hpp" -using Type = ::testing::Types>; +#include "binary_ops.hpp" + +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_with_auto_broadcast, BinaryOperatorVisitor, Type, BinaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/mvn.cpp b/src/core/tests/visitors/op/mvn.cpp index b513b30fec0..93e3336a39c 100644 --- a/src/core/tests/visitors/op/mvn.cpp +++ b/src/core/tests/visitors/op/mvn.cpp @@ -2,31 +2,27 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" -#include "ngraph/opsets/opset6.hpp" +#include "openvino/op/mvn.hpp" + +#include + +#include "openvino/op/constant.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, mvn_v1_op) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::i32, Shape{2, 3, 4, 5}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::i32, Shape{2, 3, 4, 5}); const auto axes = AxisSet{0, 1}; - const auto op = make_shared(data, true, false, 0.1); + const auto op = make_shared(data, true, false, 0.1); op->set_reduction_axes(axes); NodeBuilder builder(op, {data}); - const auto g_op = ov::as_type_ptr(builder.create()); + const auto g_op = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 4; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); @@ -37,14 +33,14 @@ TEST(attributes, mvn_v1_op) { } TEST(attributes, mvn_v6_op) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::i32, Shape{2, 3, 4, 5}); - auto axes = ngraph::opset6::Constant::create(ngraph::element::i64, ngraph::Shape{2}, {2, 3}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::i32, Shape{2, 3, 4, 5}); + auto axes = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{2}, {2, 3}); - const auto op = make_shared(data, axes, false, 0.1f, op::MVNEpsMode::INSIDE_SQRT); + const auto op = make_shared(data, axes, false, 0.1f, op::MVNEpsMode::INSIDE_SQRT); NodeBuilder builder(op, {data, axes}); - const auto g_op = ov::as_type_ptr(builder.create()); + const auto g_op = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 3; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/negative.cpp b/src/core/tests/visitors/op/negative.cpp index 83d7bd1c405..57d254db7bd 100644 --- a/src/core/tests/visitors/op/negative.cpp +++ b/src/core/tests/visitors/op/negative.cpp @@ -2,9 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/negative.hpp" + #include "unary_ops.hpp" -using Types = ::testing::Types, - UnaryOperatorType>; +using Types = ::testing::Types, + UnaryOperatorType>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Types, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/non_max_suppression.cpp b/src/core/tests/visitors/op/non_max_suppression.cpp index 419670b01b3..a3188a8d467 100644 --- a/src/core/tests/visitors/op/non_max_suppression.cpp +++ b/src/core/tests/visitors/op/non_max_suppression.cpp @@ -2,61 +2,58 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/non_max_suppression.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, non_max_suppression_op_custom_attributes) { - NodeBuilder::get_ops().register_factory(); - auto boxes = make_shared(element::f32, Shape{1, 1, 4}); - auto scores = make_shared(element::f32, Shape{1, 1, 1}); + NodeBuilder::get_ops().register_factory(); + auto boxes = make_shared(element::f32, Shape{1, 1, 4}); + auto scores = make_shared(element::f32, Shape{1, 1, 1}); - auto box_encoding = opset1::NonMaxSuppression::BoxEncodingType::CENTER; + auto box_encoding = ov::op::v1::NonMaxSuppression::BoxEncodingType::CENTER; bool sort_result_descending = false; - auto nms = make_shared(boxes, scores, box_encoding, sort_result_descending); + auto nms = make_shared(boxes, scores, box_encoding, sort_result_descending); NodeBuilder builder(nms, {boxes, scores}); - auto g_nms = ov::as_type_ptr(builder.create()); + auto g_nms = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_nms->get_box_encoding(), nms->get_box_encoding()); EXPECT_EQ(g_nms->get_sort_result_descending(), nms->get_sort_result_descending()); } TEST(attributes, non_max_suppression_op_default_attributes) { - NodeBuilder::get_ops().register_factory(); - auto boxes = make_shared(element::f32, Shape{1, 1, 4}); - auto scores = make_shared(element::f32, Shape{1, 1, 1}); + NodeBuilder::get_ops().register_factory(); + auto boxes = make_shared(element::f32, Shape{1, 1, 4}); + auto scores = make_shared(element::f32, Shape{1, 1, 1}); - auto nms = make_shared(boxes, scores); + auto nms = make_shared(boxes, scores); NodeBuilder builder(nms, {boxes, scores}); - auto g_nms = ov::as_type_ptr(builder.create()); + auto g_nms = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_nms->get_box_encoding(), nms->get_box_encoding()); EXPECT_EQ(g_nms->get_sort_result_descending(), nms->get_sort_result_descending()); } TEST(attributes, non_max_suppression_v3_op_custom_attributes) { - NodeBuilder::get_ops().register_factory(); - auto boxes = make_shared(element::f32, Shape{1, 1, 4}); - auto scores = make_shared(element::f32, Shape{1, 1, 1}); + NodeBuilder::get_ops().register_factory(); + auto boxes = make_shared(element::f32, Shape{1, 1, 4}); + auto scores = make_shared(element::f32, Shape{1, 1, 1}); - auto box_encoding = opset3::NonMaxSuppression::BoxEncodingType::CENTER; + auto box_encoding = ov::op::v3::NonMaxSuppression::BoxEncodingType::CENTER; bool sort_result_descending = false; element::Type output_type = element::i32; - auto nms = make_shared(boxes, scores, box_encoding, sort_result_descending, output_type); + auto nms = + make_shared(boxes, scores, box_encoding, sort_result_descending, output_type); NodeBuilder builder(nms, {boxes, scores}); - auto g_nms = ov::as_type_ptr(builder.create()); + auto g_nms = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_nms->get_box_encoding(), nms->get_box_encoding()); EXPECT_EQ(g_nms->get_sort_result_descending(), nms->get_sort_result_descending()); @@ -64,13 +61,13 @@ TEST(attributes, non_max_suppression_v3_op_custom_attributes) { } TEST(attributes, non_max_suppression_v3_op_default_attributes) { - NodeBuilder::get_ops().register_factory(); - auto boxes = make_shared(element::f32, Shape{1, 1, 4}); - auto scores = make_shared(element::f32, Shape{1, 1, 1}); + NodeBuilder::get_ops().register_factory(); + auto boxes = make_shared(element::f32, Shape{1, 1, 4}); + auto scores = make_shared(element::f32, Shape{1, 1, 1}); - auto nms = make_shared(boxes, scores); + auto nms = make_shared(boxes, scores); NodeBuilder builder(nms, {boxes, scores}); - auto g_nms = ov::as_type_ptr(builder.create()); + auto g_nms = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_nms->get_box_encoding(), nms->get_box_encoding()); EXPECT_EQ(g_nms->get_sort_result_descending(), nms->get_sort_result_descending()); diff --git a/src/core/tests/visitors/op/non_zero.cpp b/src/core/tests/visitors/op/non_zero.cpp index fe502dffad8..1956202fc93 100644 --- a/src/core/tests/visitors/op/non_zero.cpp +++ b/src/core/tests/visitors/op/non_zero.cpp @@ -2,24 +2,23 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset3.hpp" +#include "openvino/op/non_zero.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, non_zero_op_default) { - NodeBuilder::get_ops().register_factory(); - const auto data_node = make_shared(element::f32, Shape{1}); - const auto non_zero = make_shared(data_node); + NodeBuilder::get_ops().register_factory(); + const auto data_node = make_shared(element::f32, Shape{1}); + const auto non_zero = make_shared(data_node); NodeBuilder builder(non_zero, {data_node}); - EXPECT_NO_THROW(auto g_non_zero = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_non_zero = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 1; @@ -28,12 +27,12 @@ TEST(attributes, non_zero_op_default) { } TEST(attributes, non_zero_op_i32) { - NodeBuilder::get_ops().register_factory(); - const auto data_node = make_shared(element::f32, Shape{1}); - const auto non_zero = make_shared(data_node, element::i32); + NodeBuilder::get_ops().register_factory(); + const auto data_node = make_shared(element::f32, Shape{1}); + const auto non_zero = make_shared(data_node, element::i32); NodeBuilder builder(non_zero, {data_node}); - EXPECT_NO_THROW(auto g_non_zero = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_non_zero = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 1; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); @@ -41,12 +40,12 @@ TEST(attributes, non_zero_op_i32) { } TEST(attributes, non_zero_op_i32_string) { - NodeBuilder::get_ops().register_factory(); - const auto data_node = make_shared(element::f32, Shape{1}); - const auto non_zero = make_shared(data_node, "i32"); + NodeBuilder::get_ops().register_factory(); + const auto data_node = make_shared(element::f32, Shape{1}); + const auto non_zero = make_shared(data_node, "i32"); NodeBuilder builder(non_zero, {data_node}); - EXPECT_NO_THROW(auto g_non_zero = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_non_zero = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 1; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); @@ -54,12 +53,12 @@ TEST(attributes, non_zero_op_i32_string) { } TEST(attributes, non_zero_op_i64) { - NodeBuilder::get_ops().register_factory(); - const auto data_node = make_shared(element::f32, Shape{1}); - const auto non_zero = make_shared(data_node, element::i64); + NodeBuilder::get_ops().register_factory(); + const auto data_node = make_shared(element::f32, Shape{1}); + const auto non_zero = make_shared(data_node, element::i64); NodeBuilder builder(non_zero, {data_node}); - EXPECT_NO_THROW(auto g_non_zero = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_non_zero = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 1; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); @@ -67,12 +66,12 @@ TEST(attributes, non_zero_op_i64) { } TEST(attributes, non_zero_op_i64_string) { - NodeBuilder::get_ops().register_factory(); - const auto data_node = make_shared(element::f32, Shape{1}); - const auto non_zero = make_shared(data_node, "i64"); + NodeBuilder::get_ops().register_factory(); + const auto data_node = make_shared(element::f32, Shape{1}); + const auto non_zero = make_shared(data_node, "i64"); NodeBuilder builder(non_zero, {data_node}); - EXPECT_NO_THROW(auto g_non_zero = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_non_zero = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 1; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/normalize_l2.cpp b/src/core/tests/visitors/op/normalize_l2.cpp index 0391144ed23..ad8fb2d181a 100644 --- a/src/core/tests/visitors/op/normalize_l2.cpp +++ b/src/core/tests/visitors/op/normalize_l2.cpp @@ -2,24 +2,25 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/normalize_l2.hpp" + +#include + +#include "openvino/op/constant.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; +using ov::test::NodeBuilder; void static test_normalize_l2_attributes(float eps, op::EpsMode eps_mode) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::i32, Shape{2, 3, 4}); - const auto axes = make_shared(element::i32, Shape{}, vector{1}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::i32, Shape{2, 3, 4}); + const auto axes = make_shared(element::i32, Shape{}, vector{1}); - auto normalize_l2 = make_shared(data, axes, eps, eps_mode); + auto normalize_l2 = make_shared(data, axes, eps, eps_mode); NodeBuilder builder(normalize_l2, {data, axes}); - auto g_normalize_l2 = ov::as_type_ptr(builder.create()); + auto g_normalize_l2 = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 2; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/not_equal.cpp b/src/core/tests/visitors/op/not_equal.cpp index 079c6206a61..60413eb99aa 100644 --- a/src/core/tests/visitors/op/not_equal.cpp +++ b/src/core/tests/visitors/op/not_equal.cpp @@ -2,9 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "binary_ops.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/not_equal.hpp" -using Type = ::testing::Types>; +#include "binary_ops.hpp" + +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_with_auto_broadcast, BinaryOperatorVisitor, Type, BinaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/one_hot.cpp b/src/core/tests/visitors/op/one_hot.cpp index abff11b9bb0..a50fccc50e2 100644 --- a/src/core/tests/visitors/op/one_hot.cpp +++ b/src/core/tests/visitors/op/one_hot.cpp @@ -2,32 +2,29 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/one_hot.hpp" + +#include + +#include "openvino/op/constant.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, one_hot_op) { - NodeBuilder::get_ops().register_factory(); - auto indices = make_shared(element::i64, Shape{1, 3, 2, 3}); - auto depth = op::Constant::create(element::i64, Shape{}, {4}); - auto on_value = op::Constant::create(element::f32, Shape{}, {1.0f}); - auto off_value = op::Constant::create(element::f32, Shape{}, {0.0f}); + NodeBuilder::get_ops().register_factory(); + auto indices = make_shared(element::i64, Shape{1, 3, 2, 3}); + auto depth = ov::op::v0::Constant::create(element::i64, Shape{}, {4}); + auto on_value = ov::op::v0::Constant::create(element::f32, Shape{}, {1.0f}); + auto off_value = ov::op::v0::Constant::create(element::f32, Shape{}, {0.0f}); int64_t axis = 3; - auto one_hot = make_shared(indices, depth, on_value, off_value, axis); + auto one_hot = make_shared(indices, depth, on_value, off_value, axis); NodeBuilder builder(one_hot, {indices, depth, on_value, off_value}); - auto g_one_hot = ov::as_type_ptr(builder.create()); + auto g_one_hot = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_one_hot->get_axis(), one_hot->get_axis()); } diff --git a/src/core/tests/visitors/op/pad.cpp b/src/core/tests/visitors/op/pad.cpp index 2a000193bf1..01fe3ee5657 100644 --- a/src/core/tests/visitors/op/pad.cpp +++ b/src/core/tests/visitors/op/pad.cpp @@ -2,15 +2,15 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" +#include "openvino/op/pad.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; template class PadAttrVisitorTest : public testing::Test {}; @@ -19,9 +19,9 @@ TYPED_TEST_SUITE_P(PadAttrVisitorTest); TYPED_TEST_P(PadAttrVisitorTest, pad_basic) { NodeBuilder::get_ops().register_factory(); - auto arg = make_shared(element::f32, Shape{1, 2, 3}); - auto pads_begin = make_shared(element::i64, Shape{1}); - auto pads_end = make_shared(element::i64, Shape{1}); + auto arg = make_shared(element::f32, Shape{1, 2, 3}); + auto pads_begin = make_shared(element::i64, Shape{1}); + auto pads_end = make_shared(element::i64, Shape{1}); auto pad_mode = op::PadMode::EDGE; @@ -36,10 +36,10 @@ TYPED_TEST_P(PadAttrVisitorTest, pad_basic) { TYPED_TEST_P(PadAttrVisitorTest, pad_const_mode) { NodeBuilder::get_ops().register_factory(); - auto arg = make_shared(element::f32, Shape{1, 2, 3}); - auto pads_begin = make_shared(element::i64, Shape{1}); - auto pads_end = make_shared(element::i64, Shape{1}); - auto pad_value = make_shared(element::f32, Shape{}); + auto arg = make_shared(element::f32, Shape{1, 2, 3}); + auto pads_begin = make_shared(element::i64, Shape{1}); + auto pads_end = make_shared(element::i64, Shape{1}); + auto pad_value = make_shared(element::f32, Shape{}); auto pad_mode = op::PadMode::CONSTANT; diff --git a/src/core/tests/visitors/op/parameter.cpp b/src/core/tests/visitors/op/parameter.cpp index 0d183520df1..c1e0563192c 100644 --- a/src/core/tests/visitors/op/parameter.cpp +++ b/src/core/tests/visitors/op/parameter.cpp @@ -2,24 +2,19 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include -using namespace ngraph; -using ngraph::test::NodeBuilder; +#include "visitors/visitors.hpp" + +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, parameter_op) { - NodeBuilder::get_ops().register_factory(); - auto parameter = std::make_shared(element::f32, PartialShape{Dimension{1}, Dimension{4}}); + NodeBuilder::get_ops().register_factory(); + auto parameter = std::make_shared(element::f32, PartialShape{Dimension{1}, Dimension{4}}); NodeBuilder builder(parameter); - auto g_parameter = ov::as_type_ptr(builder.create()); + auto g_parameter = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 2; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/power.cpp b/src/core/tests/visitors/op/power.cpp index db13d5051a6..09a1da711bc 100644 --- a/src/core/tests/visitors/op/power.cpp +++ b/src/core/tests/visitors/op/power.cpp @@ -2,9 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "binary_ops.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/power.hpp" -using Type = ::testing::Types>; +#include "binary_ops.hpp" + +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_with_auto_broadcast, BinaryOperatorVisitor, Type, BinaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/prelu.cpp b/src/core/tests/visitors/op/prelu.cpp index 2f72a8c3e3f..83bab0886aa 100644 --- a/src/core/tests/visitors/op/prelu.cpp +++ b/src/core/tests/visitors/op/prelu.cpp @@ -2,24 +2,24 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/prelu.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, prelu_op) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::f32, Shape{1, 2, 1, 2}); - const auto slope = make_shared(element::f32, Shape{5}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::f32, Shape{1, 2, 1, 2}); + const auto slope = make_shared(element::f32, Shape{5}); - const auto prelu = make_shared(data, slope); + const auto prelu = make_shared(data, slope); NodeBuilder builder(prelu, {data, slope}); - EXPECT_NO_THROW(auto g_prelu = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_prelu = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/prior_box.cpp b/src/core/tests/visitors/op/prior_box.cpp index 57dfe10d236..8d0b26760d3 100644 --- a/src/core/tests/visitors/op/prior_box.cpp +++ b/src/core/tests/visitors/op/prior_box.cpp @@ -2,26 +2,21 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" -#include "ngraph/opsets/opset8.hpp" -#include "ngraph_functions/builders.hpp" +#include "openvino/op/prior_box.hpp" + +#include + +#include "openvino/op/shape_of.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, prior_box_op) { - NodeBuilder::get_ops().register_factory(); - const auto layer_shape = make_shared(element::i64, Shape{2}); - const auto image_shape = make_shared(element::i64, Shape{2}); + NodeBuilder::get_ops().register_factory(); + const auto layer_shape = make_shared(element::i64, Shape{2}); + const auto image_shape = make_shared(element::i64, Shape{2}); op::v0::PriorBox::Attributes attrs; attrs.min_size = vector{16.f, 32.f}; @@ -37,9 +32,9 @@ TEST(attributes, prior_box_op) { attrs.variance = vector{2.22f, 3.14f}; attrs.scale_all_sizes = true; - auto prior_box = make_shared(layer_shape, image_shape, attrs); + auto prior_box = make_shared(layer_shape, image_shape, attrs); NodeBuilder builder(prior_box, {layer_shape, image_shape}); - auto g_prior_box = ov::as_type_ptr(builder.create()); + auto g_prior_box = ov::as_type_ptr(builder.create()); const auto prior_box_attrs = prior_box->get_attrs(); const auto g_prior_box_attrs = g_prior_box->get_attrs(); @@ -62,9 +57,9 @@ TEST(attributes, prior_box_op) { } TEST(attributes, prior_box_op2) { - NodeBuilder::get_ops().register_factory(); - const auto layer_shape = make_shared(element::i64, Shape{2}); - const auto image_shape = make_shared(element::i64, Shape{2}); + NodeBuilder::get_ops().register_factory(); + const auto layer_shape = make_shared(element::i64, Shape{2}); + const auto image_shape = make_shared(element::i64, Shape{2}); op::v0::PriorBox::Attributes attrs; attrs.min_size = vector{0.1f, 0.141421f}; @@ -80,9 +75,9 @@ TEST(attributes, prior_box_op2) { attrs.variance = vector{0.1f, 0.1f, 0.2f, 0.2f}; attrs.scale_all_sizes = false; - auto prior_box = make_shared(layer_shape, image_shape, attrs); + auto prior_box = make_shared(layer_shape, image_shape, attrs); NodeBuilder builder(prior_box, {layer_shape, image_shape}); - auto g_prior_box = ov::as_type_ptr(builder.create()); + auto g_prior_box = ov::as_type_ptr(builder.create()); const auto prior_box_attrs = prior_box->get_attrs(); const auto g_prior_box_attrs = g_prior_box->get_attrs(); @@ -105,9 +100,9 @@ TEST(attributes, prior_box_op2) { } TEST(attributes, prior_box_v8_op) { - NodeBuilder::get_ops().register_factory(); - const auto layer_shape = make_shared(element::i64, Shape{2}); - const auto image_shape = make_shared(element::i64, Shape{2}); + NodeBuilder::get_ops().register_factory(); + const auto layer_shape = make_shared(element::i64, Shape{2}); + const auto image_shape = make_shared(element::i64, Shape{2}); op::v8::PriorBox::Attributes attrs; attrs.min_size = vector{16.f, 32.f}; @@ -124,9 +119,9 @@ TEST(attributes, prior_box_v8_op) { attrs.scale_all_sizes = true; attrs.min_max_aspect_ratios_order = false; - auto prior_box = make_shared(layer_shape, image_shape, attrs); + auto prior_box = make_shared(layer_shape, image_shape, attrs); NodeBuilder builder(prior_box, {layer_shape, image_shape}); - auto g_prior_box = ov::as_type_ptr(builder.create()); + auto g_prior_box = ov::as_type_ptr(builder.create()); const auto prior_box_attrs = prior_box->get_attrs(); const auto g_prior_box_attrs = g_prior_box->get_attrs(); @@ -150,13 +145,13 @@ TEST(attributes, prior_box_v8_op) { } TEST(attributes, prior_box_v8_op2) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); ov::ParameterVector params{std::make_shared(ov::element::i32, ov::Shape{128, 128}), std::make_shared(ov::element::i32, ov::Shape{32, 32})}; - auto shape_of_1 = std::make_shared(params[0]); - auto shape_of_2 = std::make_shared(params[1]); + auto shape_of_1 = std::make_shared(params[0]); + auto shape_of_2 = std::make_shared(params[1]); op::v8::PriorBox::Attributes attrs; attrs.min_size = vector{16.f, 32.f}; @@ -173,9 +168,9 @@ TEST(attributes, prior_box_v8_op2) { attrs.scale_all_sizes = true; attrs.min_max_aspect_ratios_order = false; - auto prior_box = make_shared(shape_of_1, shape_of_2, attrs); + auto prior_box = make_shared(shape_of_1, shape_of_2, attrs); NodeBuilder builder(prior_box, {shape_of_1, shape_of_2}); - auto g_prior_box = ov::as_type_ptr(builder.create()); + auto g_prior_box = ov::as_type_ptr(builder.create()); const auto prior_box_attrs = prior_box->get_attrs(); const auto g_prior_box_attrs = g_prior_box->get_attrs(); diff --git a/src/core/tests/visitors/op/prior_box_clustered.cpp b/src/core/tests/visitors/op/prior_box_clustered.cpp index 397093aabbc..9dd511302f4 100644 --- a/src/core/tests/visitors/op/prior_box_clustered.cpp +++ b/src/core/tests/visitors/op/prior_box_clustered.cpp @@ -2,22 +2,22 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/prior_box_clustered.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, prior_box_clustered_op) { - NodeBuilder::get_ops().register_factory(); - const auto layer_shape = make_shared(element::i64, Shape{2}); - const auto image_shape = make_shared(element::i64, Shape{2}); + NodeBuilder::get_ops().register_factory(); + const auto layer_shape = make_shared(element::i64, Shape{2}); + const auto image_shape = make_shared(element::i64, Shape{2}); - op::PriorBoxClusteredAttrs attrs; + ov::op::v0::PriorBoxClustered::Attributes attrs; attrs.heights = {2.0f, 3.0f}; attrs.widths = {2.0f, 3.0f}; attrs.clip = true; @@ -27,9 +27,9 @@ TEST(attributes, prior_box_clustered_op) { attrs.offset = 0.0f; attrs.variances = {0.1f}; - auto pbc = make_shared(layer_shape, image_shape, attrs); + auto pbc = make_shared(layer_shape, image_shape, attrs); NodeBuilder builder(pbc, {layer_shape, image_shape}); - auto g_pbc = ov::as_type_ptr(builder.create()); + auto g_pbc = ov::as_type_ptr(builder.create()); const auto pbc_attrs = pbc->get_attrs(); const auto g_pbc_attrs = g_pbc->get_attrs(); const auto expected_attr_count = 8; @@ -47,11 +47,11 @@ TEST(attributes, prior_box_clustered_op) { } TEST(attributes, prior_box_clustered_op2) { - NodeBuilder::get_ops().register_factory(); - const auto layer_shape = make_shared(element::i64, Shape{2}); - const auto image_shape = make_shared(element::i64, Shape{2}); + NodeBuilder::get_ops().register_factory(); + const auto layer_shape = make_shared(element::i64, Shape{2}); + const auto image_shape = make_shared(element::i64, Shape{2}); - op::PriorBoxClusteredAttrs attrs; + ov::op::v0::PriorBoxClustered::Attributes attrs; attrs.heights = {44.0f, 10.0f, 30.0f, 19.0f, 94.0f, 32.0f, 61.0f, 53.0f, 17.0f}; attrs.widths = {86.0f, 13.0f, 57.0f, 39.0f, 68.0f, 34.0f, 142.0f, 50.0f, 23.0f}; attrs.clip = false; @@ -61,9 +61,9 @@ TEST(attributes, prior_box_clustered_op2) { attrs.offset = 0.5f; attrs.variances = {0.1f, 0.1f, 0.2f, 0.2f}; - auto pbc = make_shared(layer_shape, image_shape, attrs); + auto pbc = make_shared(layer_shape, image_shape, attrs); NodeBuilder builder(pbc, {layer_shape, image_shape}); - auto g_pbc = ov::as_type_ptr(builder.create()); + auto g_pbc = ov::as_type_ptr(builder.create()); const auto pbc_attrs = pbc->get_attrs(); const auto g_pbc_attrs = g_pbc->get_attrs(); const auto expected_attr_count = 8; diff --git a/src/core/tests/visitors/op/proposal.cpp b/src/core/tests/visitors/op/proposal.cpp index 41cdff7c9aa..8c4c4a7f7ed 100644 --- a/src/core/tests/visitors/op/proposal.cpp +++ b/src/core/tests/visitors/op/proposal.cpp @@ -2,27 +2,23 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/proposal.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, proposal_op) { - NodeBuilder::get_ops().register_factory(); - const auto class_probs = make_shared(element::f32, Shape{1024, 2, 128, 128}); - const auto class_logits = make_shared(element::f32, Shape{1024, 4, 128, 128}); - const auto image_shape = make_shared(element::f32, Shape{4}); + NodeBuilder::get_ops().register_factory(); + const auto class_probs = make_shared(element::f32, Shape{1024, 2, 128, 128}); + const auto class_logits = make_shared(element::f32, Shape{1024, 4, 128, 128}); + const auto image_shape = make_shared(element::f32, Shape{4}); - op::ProposalAttrs attrs; + ov::op::v0::Proposal::Attributes attrs; attrs.base_size = 224; attrs.pre_nms_topn = 100; attrs.post_nms_topn = 110; @@ -36,11 +32,11 @@ TEST(attributes, proposal_op) { attrs.normalize = false; attrs.box_size_scale = 2.f; attrs.box_coordinate_scale = 4.55f; - attrs.framework = string{"nGraph"}; + attrs.framework = string{"ov"}; - auto proposal = make_shared(class_probs, class_logits, image_shape, attrs); + auto proposal = make_shared(class_probs, class_logits, image_shape, attrs); NodeBuilder builder(proposal, {class_probs, class_logits, image_shape}); - auto g_proposal = ov::as_type_ptr(builder.create()); + auto g_proposal = ov::as_type_ptr(builder.create()); const auto proposal_attrs = proposal->get_attrs(); const auto g_proposal_attrs = g_proposal->get_attrs(); @@ -62,12 +58,12 @@ TEST(attributes, proposal_op) { } TEST(attributes, proposal_op2) { - NodeBuilder::get_ops().register_factory(); - const auto class_probs = make_shared(element::f32, Shape{1, 12, 34, 62}); - const auto class_logits = make_shared(element::f32, Shape{1, 24, 34, 62}); - const auto image_shape = make_shared(element::f32, Shape{3}); + NodeBuilder::get_ops().register_factory(); + const auto class_probs = make_shared(element::f32, Shape{1, 12, 34, 62}); + const auto class_logits = make_shared(element::f32, Shape{1, 24, 34, 62}); + const auto image_shape = make_shared(element::f32, Shape{3}); - op::ProposalAttrs attrs; + ov::op::v0::Proposal::Attributes attrs; attrs.base_size = 16; attrs.pre_nms_topn = 6000; attrs.post_nms_topn = 200; @@ -77,9 +73,9 @@ TEST(attributes, proposal_op2) { attrs.ratio = vector{2.669f}; attrs.scale = vector{4.0f, 6.0f, 9.0f, 16.0f, 24.0f, 32.0f}; - auto proposal = make_shared(class_probs, class_logits, image_shape, attrs); + auto proposal = make_shared(class_probs, class_logits, image_shape, attrs); NodeBuilder builder(proposal, {class_probs, class_logits, image_shape}); - auto g_proposal = ov::as_type_ptr(builder.create()); + auto g_proposal = ov::as_type_ptr(builder.create()); const auto proposal_attrs = proposal->get_attrs(); const auto g_proposal_attrs = g_proposal->get_attrs(); diff --git a/src/core/tests/visitors/op/psroi_pooling.cpp b/src/core/tests/visitors/op/psroi_pooling.cpp index 111ba4cdae0..136cb879447 100644 --- a/src/core/tests/visitors/op/psroi_pooling.cpp +++ b/src/core/tests/visitors/op/psroi_pooling.cpp @@ -2,24 +2,20 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/psroi_pooling.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, psroi_pooling_op) { - NodeBuilder::get_ops().register_factory(); - auto input = make_shared(element::f32, Shape{1, 1024, 63, 38}); - auto coords = make_shared(element::f32, Shape{300, 5}); + NodeBuilder::get_ops().register_factory(); + auto input = make_shared(element::f32, Shape{1, 1024, 63, 38}); + auto coords = make_shared(element::f32, Shape{300, 5}); const int64_t output_dim = 64; const int64_t group_size = 4; @@ -28,16 +24,16 @@ TEST(attributes, psroi_pooling_op) { int spatial_bins_y = 1; string mode = "average"; - auto psroi_pool = make_shared(input, - coords, - output_dim, - group_size, - spatial_scale, - spatial_bins_x, - spatial_bins_y, - mode); + auto psroi_pool = make_shared(input, + coords, + output_dim, + group_size, + spatial_scale, + spatial_bins_x, + spatial_bins_y, + mode); NodeBuilder builder(psroi_pool, {input, coords}); - auto g_psroi_pool = ov::as_type_ptr(builder.create()); + auto g_psroi_pool = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_psroi_pool->get_output_dim(), psroi_pool->get_output_dim()); EXPECT_EQ(g_psroi_pool->get_group_size(), psroi_pool->get_group_size()); diff --git a/src/core/tests/visitors/op/random_uniform.cpp b/src/core/tests/visitors/op/random_uniform.cpp index 6677a6d85e2..b38574f3bf7 100644 --- a/src/core/tests/visitors/op/random_uniform.cpp +++ b/src/core/tests/visitors/op/random_uniform.cpp @@ -2,27 +2,27 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset8.hpp" +#include "openvino/op/random_uniform.hpp" + +#include + +#include "openvino/op/constant.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, random_uniform_op) { - NodeBuilder::get_ops().register_factory(); - auto out_shape = make_shared(element::i64, Shape{3}, vector{3, 2, 4}); - auto min_val = make_shared(element::f32, Shape{}, 0); - auto max_val = make_shared(element::f32, Shape{}, 1); + NodeBuilder::get_ops().register_factory(); + auto out_shape = make_shared(element::i64, Shape{3}, vector{3, 2, 4}); + auto min_val = make_shared(element::f32, Shape{}, 0); + auto max_val = make_shared(element::f32, Shape{}, 1); const auto random_uniform = - make_shared(out_shape, min_val, max_val, element::Type_t::f32, 150, 10); + make_shared(out_shape, min_val, max_val, element::Type_t::f32, 150, 10); NodeBuilder builder(random_uniform, {out_shape, min_val, max_val}); - auto g_random_uniform = ov::as_type_ptr(builder.create()); + auto g_random_uniform = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 3; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/range.cpp b/src/core/tests/visitors/op/range.cpp index 2da4e585a75..4d8d889881f 100644 --- a/src/core/tests/visitors/op/range.cpp +++ b/src/core/tests/visitors/op/range.cpp @@ -2,28 +2,26 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset4.hpp" +#include "openvino/op/range.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, range_op) { - NodeBuilder::get_ops().register_factory(); - auto start = make_shared(element::i64, Shape{}); - auto stop = make_shared(element::i64, Shape{}); - auto step = make_shared(element::i64, Shape{}); + NodeBuilder::get_ops().register_factory(); + auto start = make_shared(element::i64, Shape{}); + auto stop = make_shared(element::i64, Shape{}); + auto step = make_shared(element::i64, Shape{}); auto output_type = element::f32; - auto range = make_shared(start, stop, step, output_type); + auto range = make_shared(start, stop, step, output_type); NodeBuilder builder(range, {start, stop, step}); - auto g_range = ov::as_type_ptr(builder.create()); + auto g_range = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_range->get_output_type(), range->get_output_type()); } diff --git a/src/core/tests/visitors/op/rdft.cpp b/src/core/tests/visitors/op/rdft.cpp index f287a660ef8..3a614f818fc 100644 --- a/src/core/tests/visitors/op/rdft.cpp +++ b/src/core/tests/visitors/op/rdft.cpp @@ -2,14 +2,16 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" +#include "openvino/op/rdft.hpp" + +#include + +#include "openvino/op/constant.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, rdft_op) { NodeBuilder::get_ops().register_factory(); @@ -27,7 +29,7 @@ TEST(attributes, rdft_op) { TEST(attributes, rdft_op_signal) { NodeBuilder::get_ops().register_factory(); auto data = make_shared(element::f32, Shape{2, 10, 10}); - auto signal = op::Constant::create(element::Type_t::i64, Shape{1}, {20}); + auto signal = op::v0::Constant::create(element::Type_t::i64, Shape{1}, {20}); auto axes = op::v0::Constant::create(element::i64, Shape{1}, {2}); auto rdft = make_shared(data, axes, signal); diff --git a/src/core/tests/visitors/op/read_value.cpp b/src/core/tests/visitors/op/read_value.cpp index 844cc05c640..e1dbe4aedcb 100644 --- a/src/core/tests/visitors/op/read_value.cpp +++ b/src/core/tests/visitors/op/read_value.cpp @@ -2,25 +2,24 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset6.hpp" +#include "openvino/op/read_value.hpp" + +#include + +#include "openvino/op/util/variable.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, readvalue_v3_op) { - NodeBuilder::get_ops().register_factory(); - const auto in = make_shared(element::f32, Shape{1}); + NodeBuilder::get_ops().register_factory(); + const auto in = make_shared(element::f32, Shape{1}); const string variable_id = "v0"; - const auto read_value = make_shared(in, variable_id); + const auto read_value = make_shared(in, variable_id); NodeBuilder builder(read_value, {in}); - EXPECT_NO_THROW(auto g_read_value = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_read_value = ov::as_type_ptr(builder.create())); // attribute count const auto expected_attr_count = 1; @@ -28,12 +27,13 @@ TEST(attributes, readvalue_v3_op) { } TEST(attributes, readvalue_v6_op) { - NodeBuilder::get_ops().register_factory(); - const auto in = make_shared(element::f32, Shape{1}); - const auto variable = std::make_shared(VariableInfo{PartialShape::dynamic(), element::dynamic, "v0"}); - const auto read_value = make_shared(in, variable); + NodeBuilder::get_ops().register_factory(); + const auto in = make_shared(element::f32, Shape{1}); + const auto variable = std::make_shared( + ov::op::util::VariableInfo{PartialShape::dynamic(), element::dynamic, "v0"}); + const auto read_value = make_shared(in, variable); NodeBuilder builder(read_value, {in}); - EXPECT_NO_THROW(auto g_read_value = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_read_value = ov::as_type_ptr(builder.create())); // attribute count const auto expected_attr_count = 1; diff --git a/src/core/tests/visitors/op/reduce_l1.cpp b/src/core/tests/visitors/op/reduce_l1.cpp index bcd10c0b15d..3e7ce5a6cc3 100644 --- a/src/core/tests/visitors/op/reduce_l1.cpp +++ b/src/core/tests/visitors/op/reduce_l1.cpp @@ -2,6 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/reduce_l1.hpp" + #include "reduce_ops.hpp" using Type = ::testing::Types>; diff --git a/src/core/tests/visitors/op/reduce_l2.cpp b/src/core/tests/visitors/op/reduce_l2.cpp index 66e727bed99..f693ed58668 100644 --- a/src/core/tests/visitors/op/reduce_l2.cpp +++ b/src/core/tests/visitors/op/reduce_l2.cpp @@ -2,7 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/reduce_l2.hpp" + #include "reduce_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(attributes_reduce_op, ReduceOperatorVisitor, Type, ReduceOperatorTypeName); diff --git a/src/core/tests/visitors/op/reduce_logical_and.cpp b/src/core/tests/visitors/op/reduce_logical_and.cpp index 1a4e70b46bf..11bcf1860fb 100644 --- a/src/core/tests/visitors/op/reduce_logical_and.cpp +++ b/src/core/tests/visitors/op/reduce_logical_and.cpp @@ -2,7 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/reduce_logical_and.hpp" + #include "reduce_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(attributes_reduce_op, ReduceOperatorVisitor, Type, ReduceOperatorTypeName); diff --git a/src/core/tests/visitors/op/reduce_logical_or.cpp b/src/core/tests/visitors/op/reduce_logical_or.cpp index 6c38665f7b4..87a655eebc7 100644 --- a/src/core/tests/visitors/op/reduce_logical_or.cpp +++ b/src/core/tests/visitors/op/reduce_logical_or.cpp @@ -2,7 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/reduce_logical_or.hpp" + #include "reduce_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(attributes_reduce_op, ReduceOperatorVisitor, Type, ReduceOperatorTypeName); diff --git a/src/core/tests/visitors/op/reduce_max.cpp b/src/core/tests/visitors/op/reduce_max.cpp index bab9991fc52..acfe1224cce 100644 --- a/src/core/tests/visitors/op/reduce_max.cpp +++ b/src/core/tests/visitors/op/reduce_max.cpp @@ -2,7 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/reduce_max.hpp" + #include "reduce_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(attributes_reduce_op, ReduceOperatorVisitor, Type, ReduceOperatorTypeName); diff --git a/src/core/tests/visitors/op/reduce_mean.cpp b/src/core/tests/visitors/op/reduce_mean.cpp index 3bbc63ca504..7c4021c147c 100644 --- a/src/core/tests/visitors/op/reduce_mean.cpp +++ b/src/core/tests/visitors/op/reduce_mean.cpp @@ -2,7 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/reduce_mean.hpp" + #include "reduce_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(attributes_reduce_op, ReduceOperatorVisitor, Type, ReduceOperatorTypeName); diff --git a/src/core/tests/visitors/op/reduce_min.cpp b/src/core/tests/visitors/op/reduce_min.cpp index 044e4c7a9f2..951bd65e9c3 100644 --- a/src/core/tests/visitors/op/reduce_min.cpp +++ b/src/core/tests/visitors/op/reduce_min.cpp @@ -2,7 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/reduce_min.hpp" + #include "reduce_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(attributes_reduce_op, ReduceOperatorVisitor, Type, ReduceOperatorTypeName); diff --git a/src/core/tests/visitors/op/reduce_ops.hpp b/src/core/tests/visitors/op/reduce_ops.hpp index 19184bcd661..722414c10d0 100644 --- a/src/core/tests/visitors/op/reduce_ops.hpp +++ b/src/core/tests/visitors/op/reduce_ops.hpp @@ -2,21 +2,19 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; -template +template class ReduceOperatorType { public: using op_type = T; - static constexpr ngraph::element::Type_t element_type = ELEMENT_TYPE; + static constexpr ov::element::Type_t element_type = ELEMENT_TYPE; }; template @@ -27,8 +25,8 @@ public: template static std::string GetName(int) { using OP_Type = typename T::op_type; - constexpr ngraph::element::Type precision(T::element_type); - const ngraph::Node::type_info_t typeinfo = OP_Type::get_type_info_static(); + constexpr ov::element::Type precision(T::element_type); + const ov::Node::type_info_t typeinfo = OP_Type::get_type_info_static(); return std::string{typeinfo.name} + "_" + precision.get_type_name(); } }; @@ -39,16 +37,16 @@ TYPED_TEST_P(ReduceOperatorVisitor, keep_dims_3D) { using OP_Type = typename TypeParam::op_type; Shape in_shape{3, 4, 5}; - const ngraph::element::Type_t in_et = TypeParam::element_type; + const ov::element::Type_t in_et = TypeParam::element_type; Shape axes_shape{2}; element::Type axes_et = element::i64; bool keep_dims = true; - ngraph::test::NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(in_et, in_shape); - const auto reduction_axes = make_shared(axes_et, axes_shape); + ov::test::NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(in_et, in_shape); + const auto reduction_axes = make_shared(axes_et, axes_shape); const auto reduce_op = make_shared(data, reduction_axes, keep_dims); NodeBuilder builder(reduce_op, {data, reduction_axes}); @@ -62,16 +60,16 @@ TYPED_TEST_P(ReduceOperatorVisitor, do_not_keep_dims_3D) { using OP_Type = typename TypeParam::op_type; Shape in_shape{3, 4, 5}; - const ngraph::element::Type_t in_et = TypeParam::element_type; + const ov::element::Type_t in_et = TypeParam::element_type; Shape axes_shape{2}; element::Type axes_et = element::i64; bool keep_dims = false; - ngraph::test::NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(in_et, in_shape); - const auto reduction_axes = make_shared(axes_et, axes_shape); + ov::test::NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(in_et, in_shape); + const auto reduction_axes = make_shared(axes_et, axes_shape); const auto reduce_op = make_shared(data, reduction_axes, keep_dims); NodeBuilder builder(reduce_op, {data, reduction_axes}); diff --git a/src/core/tests/visitors/op/reduce_prod.cpp b/src/core/tests/visitors/op/reduce_prod.cpp index 364d3620e81..bd8206f447c 100644 --- a/src/core/tests/visitors/op/reduce_prod.cpp +++ b/src/core/tests/visitors/op/reduce_prod.cpp @@ -2,7 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/reduce_prod.hpp" + #include "reduce_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(attributes_reduce_op, ReduceOperatorVisitor, Type, ReduceOperatorTypeName); diff --git a/src/core/tests/visitors/op/reduce_sum.cpp b/src/core/tests/visitors/op/reduce_sum.cpp index 8e21656b265..11b4b6e902c 100644 --- a/src/core/tests/visitors/op/reduce_sum.cpp +++ b/src/core/tests/visitors/op/reduce_sum.cpp @@ -2,7 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/reduce_sum.hpp" + #include "reduce_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(attributes_reduce_op, ReduceOperatorVisitor, Type, ReduceOperatorTypeName); diff --git a/src/core/tests/visitors/op/region_yolo.cpp b/src/core/tests/visitors/op/region_yolo.cpp index edc9c7395c5..7d5666a2d2a 100644 --- a/src/core/tests/visitors/op/region_yolo.cpp +++ b/src/core/tests/visitors/op/region_yolo.cpp @@ -2,23 +2,19 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/region_yolo.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, region_yolo_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::f32, Shape{1, 255, 26, 26}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::f32, Shape{1, 255, 26, 26}); size_t num_coords = 4; size_t num_classes = 1; @@ -29,17 +25,17 @@ TEST(attributes, region_yolo_op) { auto end_axis = 3; auto anchors = std::vector{10, 14, 23, 27, 37, 58, 81, 82, 135, 169, 344, 319}; - auto region_yolo = make_shared(data, - num_coords, - num_classes, - num_regions, - do_softmax, - mask, - axis, - end_axis, - anchors); + auto region_yolo = make_shared(data, + num_coords, + num_classes, + num_regions, + do_softmax, + mask, + axis, + end_axis, + anchors); NodeBuilder builder(region_yolo, {data}); - auto g_region_yolo = ov::as_type_ptr(builder.create()); + auto g_region_yolo = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_region_yolo->get_num_coords(), region_yolo->get_num_coords()); EXPECT_EQ(g_region_yolo->get_num_classes(), region_yolo->get_num_classes()); diff --git a/src/core/tests/visitors/op/relu.cpp b/src/core/tests/visitors/op/relu.cpp index 20d76a71160..3d145097cb1 100644 --- a/src/core/tests/visitors/op/relu.cpp +++ b/src/core/tests/visitors/op/relu.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/relu.hpp" + #include "unary_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_atrribute, UnaryOperatorVisitor, Type, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/reorg_yolo.cpp b/src/core/tests/visitors/op/reorg_yolo.cpp index 47016b122a1..28cee023bae 100644 --- a/src/core/tests/visitors/op/reorg_yolo.cpp +++ b/src/core/tests/visitors/op/reorg_yolo.cpp @@ -2,23 +2,19 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/reorg_yolo.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, reorg_yolo_op_stride) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::i32, Shape{1, 64, 26, 26}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::i32, Shape{1, 64, 26, 26}); const auto op = make_shared(data, 2); NodeBuilder builder(op, {data}); @@ -28,8 +24,8 @@ TEST(attributes, reorg_yolo_op_stride) { } TEST(attributes, reorg_yolo_op_strides) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::i32, Shape{1, 64, 26, 26}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::i32, Shape{1, 64, 26, 26}); const auto op = make_shared(data, Strides{2}); NodeBuilder builder(op, {data}); diff --git a/src/core/tests/visitors/op/reshape.cpp b/src/core/tests/visitors/op/reshape.cpp index c8c59fc7b57..cfd7903fac9 100644 --- a/src/core/tests/visitors/op/reshape.cpp +++ b/src/core/tests/visitors/op/reshape.cpp @@ -2,30 +2,26 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/reshape.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, reshape_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::i32, Shape{2, 3, 4}); - auto pattern = make_shared(element::i32, Shape{2}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::i32, Shape{2, 3, 4}); + auto pattern = make_shared(element::i32, Shape{2}); bool special_zero = true; - auto reshape = make_shared(data, pattern, special_zero); + auto reshape = make_shared(data, pattern, special_zero); NodeBuilder builder(reshape, {data, pattern}); - auto g_reshape = ov::as_type_ptr(builder.create()); + auto g_reshape = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 1; diff --git a/src/core/tests/visitors/op/result.cpp b/src/core/tests/visitors/op/result.cpp index 3aff5e2487e..e58394937f1 100644 --- a/src/core/tests/visitors/op/result.cpp +++ b/src/core/tests/visitors/op/result.cpp @@ -2,9 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/result.hpp" + #include "unary_ops.hpp" -using Types = ::testing::Types, - UnaryOperatorType>; +using Types = ::testing::Types, + UnaryOperatorType>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Types, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/reverse.cpp b/src/core/tests/visitors/op/reverse.cpp index ec5db4c27e8..f91ee9c40c3 100644 --- a/src/core/tests/visitors/op/reverse.cpp +++ b/src/core/tests/visitors/op/reverse.cpp @@ -2,42 +2,38 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/reverse.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, reverse_op_enum_mode) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::i32, Shape{200}); - auto reversed_axes = make_shared(element::i32, Shape{200}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::i32, Shape{200}); + auto reversed_axes = make_shared(element::i32, Shape{200}); - auto reverse = make_shared(data, reversed_axes, opset1::Reverse::Mode::INDEX); + auto reverse = make_shared(data, reversed_axes, ov::op::v1::Reverse::Mode::INDEX); NodeBuilder builder(reverse, {data, reversed_axes}); - auto g_reverse = ov::as_type_ptr(builder.create()); + auto g_reverse = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_reverse->get_mode(), reverse->get_mode()); } TEST(attributes, reverse_op_string_mode) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::i32, Shape{200}); - auto reversed_axes = make_shared(element::i32, Shape{200}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::i32, Shape{200}); + auto reversed_axes = make_shared(element::i32, Shape{200}); std::string mode = "index"; - auto reverse = make_shared(data, reversed_axes, mode); + auto reverse = make_shared(data, reversed_axes, mode); NodeBuilder builder(reverse, {data, reversed_axes}); - auto g_reverse = ov::as_type_ptr(builder.create()); + auto g_reverse = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_reverse->get_mode(), reverse->get_mode()); } diff --git a/src/core/tests/visitors/op/reverse_sequence.cpp b/src/core/tests/visitors/op/reverse_sequence.cpp index 39f8d98c0cc..145a111a401 100644 --- a/src/core/tests/visitors/op/reverse_sequence.cpp +++ b/src/core/tests/visitors/op/reverse_sequence.cpp @@ -2,35 +2,31 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/reverse_sequence.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, reverse_sequence_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::i32, Shape{2, 3, 4, 2}); - auto seq_indices = make_shared(element::i32, Shape{4}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::i32, Shape{2, 3, 4, 2}); + auto seq_indices = make_shared(element::i32, Shape{4}); auto batch_axis = 2; auto seq_axis = 1; - auto reverse_sequence = make_shared(data, seq_indices, batch_axis, seq_axis); + auto reverse_sequence = make_shared(data, seq_indices, batch_axis, seq_axis); NodeBuilder builder(reverse_sequence, {data, seq_indices}); const auto expected_attr_count = 2; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); - auto g_reverse_sequence = ov::as_type_ptr(builder.create()); + auto g_reverse_sequence = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_reverse_sequence->get_origin_batch_axis(), reverse_sequence->get_origin_batch_axis()); EXPECT_EQ(g_reverse_sequence->get_origin_sequence_axis(), reverse_sequence->get_origin_sequence_axis()); diff --git a/src/core/tests/visitors/op/rnn_cell.cpp b/src/core/tests/visitors/op/rnn_cell.cpp index c5a5a239369..3ca15fdadf1 100644 --- a/src/core/tests/visitors/op/rnn_cell.cpp +++ b/src/core/tests/visitors/op/rnn_cell.cpp @@ -2,26 +2,22 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/rnn_cell.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, rnn_cell_op_custom_attributes) { - NodeBuilder::get_ops().register_factory(); - auto X = make_shared(element::f32, Shape{2, 3}); - auto H = make_shared(element::f32, Shape{2, 3}); - auto W = make_shared(element::f32, Shape{3, 3}); - auto R = make_shared(element::f32, Shape{3, 3}); + NodeBuilder::get_ops().register_factory(); + auto X = make_shared(element::f32, Shape{2, 3}); + auto H = make_shared(element::f32, Shape{2, 3}); + auto W = make_shared(element::f32, Shape{3, 3}); + auto R = make_shared(element::f32, Shape{3, 3}); const size_t hidden_size = 3; auto activations = std::vector{"sigmoid", "tanh"}; @@ -29,11 +25,18 @@ TEST(attributes, rnn_cell_op_custom_attributes) { auto activations_beta = std::vector{2.0, 1.0}; float clip = 1.0; - auto rnn_cell = - make_shared(X, H, W, R, hidden_size, activations, activations_alpha, activations_beta, clip); + auto rnn_cell = make_shared(X, + H, + W, + R, + hidden_size, + activations, + activations_alpha, + activations_beta, + clip); NodeBuilder builder(rnn_cell, {X, H, W, R}); - auto g_rnn_cell = ov::as_type_ptr(builder.create()); + auto g_rnn_cell = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_rnn_cell->get_hidden_size(), rnn_cell->get_hidden_size()); EXPECT_EQ(g_rnn_cell->get_clip(), rnn_cell->get_clip()); @@ -43,18 +46,18 @@ TEST(attributes, rnn_cell_op_custom_attributes) { } TEST(attributes, rnn_cell_op_default_attributes) { - NodeBuilder::get_ops().register_factory(); - auto X = make_shared(element::f32, Shape{2, 3}); - auto H = make_shared(element::f32, Shape{2, 3}); - auto W = make_shared(element::f32, Shape{3, 3}); - auto R = make_shared(element::f32, Shape{3, 3}); + NodeBuilder::get_ops().register_factory(); + auto X = make_shared(element::f32, Shape{2, 3}); + auto H = make_shared(element::f32, Shape{2, 3}); + auto W = make_shared(element::f32, Shape{3, 3}); + auto R = make_shared(element::f32, Shape{3, 3}); const size_t hidden_size = 3; - auto rnn_cell = make_shared(X, H, W, R, hidden_size); + auto rnn_cell = make_shared(X, H, W, R, hidden_size); NodeBuilder builder(rnn_cell, {X, H, W, R}); - auto g_rnn_cell = ov::as_type_ptr(builder.create()); + auto g_rnn_cell = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_rnn_cell->get_hidden_size(), rnn_cell->get_hidden_size()); EXPECT_EQ(g_rnn_cell->get_clip(), rnn_cell->get_clip()); @@ -64,19 +67,19 @@ TEST(attributes, rnn_cell_op_default_attributes) { } TEST(attributes, rnn_cell_op_default_attributes2) { - NodeBuilder::get_ops().register_factory(); - auto X = make_shared(element::f32, Shape{2, 3}); - auto H = make_shared(element::f32, Shape{2, 3}); - auto W = make_shared(element::f32, Shape{3, 3}); - auto R = make_shared(element::f32, Shape{3, 3}); - auto B = make_shared(element::f32, Shape{3}); + NodeBuilder::get_ops().register_factory(); + auto X = make_shared(element::f32, Shape{2, 3}); + auto H = make_shared(element::f32, Shape{2, 3}); + auto W = make_shared(element::f32, Shape{3, 3}); + auto R = make_shared(element::f32, Shape{3, 3}); + auto B = make_shared(element::f32, Shape{3}); const size_t hidden_size = 3; - auto rnn_cell = make_shared(X, H, W, R, B, hidden_size); + auto rnn_cell = make_shared(X, H, W, R, B, hidden_size); NodeBuilder builder(rnn_cell, {X, H, W, R, B}); - auto g_rnn_cell = ov::as_type_ptr(builder.create()); + auto g_rnn_cell = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_rnn_cell->get_hidden_size(), rnn_cell->get_hidden_size()); EXPECT_EQ(g_rnn_cell->get_clip(), rnn_cell->get_clip()); diff --git a/src/core/tests/visitors/op/rnn_sequence.cpp b/src/core/tests/visitors/op/rnn_sequence.cpp index 419a17abf34..a1fc53aa62d 100644 --- a/src/core/tests/visitors/op/rnn_sequence.cpp +++ b/src/core/tests/visitors/op/rnn_sequence.cpp @@ -2,22 +2,18 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/rnn_sequence.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, rnn_sequence_op) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); const size_t batch_size = 4; const size_t num_directions = 2; @@ -25,13 +21,13 @@ TEST(attributes, rnn_sequence_op) { const size_t input_size = 16; const size_t hidden_size = 64; - const auto X = make_shared(element::f32, Shape{batch_size, seq_length, input_size}); + const auto X = make_shared(element::f32, Shape{batch_size, seq_length, input_size}); const auto initial_hidden_state = - make_shared(element::f32, Shape{batch_size, num_directions, hidden_size}); - const auto sequence_lengths = make_shared(element::i32, Shape{batch_size}); - const auto W = make_shared(element::f32, Shape{num_directions, hidden_size, input_size}); - const auto R = make_shared(element::f32, Shape{num_directions, hidden_size, hidden_size}); - const auto B = make_shared(element::f32, Shape{num_directions, hidden_size}); + make_shared(element::f32, Shape{batch_size, num_directions, hidden_size}); + const auto sequence_lengths = make_shared(element::i32, Shape{batch_size}); + const auto W = make_shared(element::f32, Shape{num_directions, hidden_size, input_size}); + const auto R = make_shared(element::f32, Shape{num_directions, hidden_size, hidden_size}); + const auto B = make_shared(element::f32, Shape{num_directions, hidden_size}); const auto rnn_direction = op::RecurrentSequenceDirection::BIDIRECTIONAL; const std::vector activations_alpha = {1, 2, 3}; @@ -39,20 +35,20 @@ TEST(attributes, rnn_sequence_op) { const std::vector activations = {"tanh", "sigmoid", "tanh"}; const float clip_threshold = 0.5f; - const auto rnn_sequence = make_shared(X, - initial_hidden_state, - sequence_lengths, - W, - R, - B, - hidden_size, - rnn_direction, - activations, - activations_alpha, - activations_beta, - clip_threshold); + const auto rnn_sequence = make_shared(X, + initial_hidden_state, + sequence_lengths, + W, + R, + B, + hidden_size, + rnn_direction, + activations, + activations_alpha, + activations_beta, + clip_threshold); NodeBuilder builder(rnn_sequence, {X, initial_hidden_state, sequence_lengths, W, R, B}); - auto g_rnn_sequence = ov::as_type_ptr(builder.create()); + auto g_rnn_sequence = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_rnn_sequence->get_hidden_size(), rnn_sequence->get_hidden_size()); EXPECT_EQ(g_rnn_sequence->get_activations(), rnn_sequence->get_activations()); diff --git a/src/core/tests/visitors/op/roi_pooling.cpp b/src/core/tests/visitors/op/roi_pooling.cpp index d68cc7f6ffc..ccdf42ab2b4 100644 --- a/src/core/tests/visitors/op/roi_pooling.cpp +++ b/src/core/tests/visitors/op/roi_pooling.cpp @@ -2,28 +2,24 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/roi_pooling.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, roi_pooling_op) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::f32, Shape{2, 3, 4, 5}); - const auto coords = make_shared(element::f32, Shape{2, 5}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::f32, Shape{2, 3, 4, 5}); + const auto coords = make_shared(element::f32, Shape{2, 5}); - const auto op = make_shared(data, coords, Shape{5, 5}, 0.123f, "bilinear"); + const auto op = make_shared(data, coords, Shape{5, 5}, 0.123f, "bilinear"); NodeBuilder builder(op, {data, coords}); - const auto g_op = ov::as_type_ptr(builder.create()); + const auto g_op = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_op->get_output_roi(), op->get_output_roi()); EXPECT_EQ(g_op->get_spatial_scale(), op->get_spatial_scale()); diff --git a/src/core/tests/visitors/op/roll.cpp b/src/core/tests/visitors/op/roll.cpp index d7bedaccf52..2a63d3e146e 100644 --- a/src/core/tests/visitors/op/roll.cpp +++ b/src/core/tests/visitors/op/roll.cpp @@ -2,25 +2,26 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset7.hpp" +#include "openvino/op/roll.hpp" + +#include + +#include "openvino/op/constant.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, roll_op) { - NodeBuilder::get_ops().register_factory(); - const auto A = make_shared(element::f32, Shape{4, 3}); - const auto B = make_shared(element::i32, Shape{3}); - const auto C = make_shared(element::i32, Shape{3}); + NodeBuilder::get_ops().register_factory(); + const auto A = make_shared(element::f32, Shape{4, 3}); + const auto B = make_shared(element::i32, Shape{3}); + const auto C = make_shared(element::i32, Shape{3}); - const auto roll = make_shared(A, B, C); + const auto roll = make_shared(A, B, C); NodeBuilder builder(roll, {A, B, C}); - EXPECT_NO_THROW(auto g_roll = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_roll = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/round.cpp b/src/core/tests/visitors/op/round.cpp index 64c02ac8612..b738e885daf 100644 --- a/src/core/tests/visitors/op/round.cpp +++ b/src/core/tests/visitors/op/round.cpp @@ -2,34 +2,30 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/round.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; -void static test_mode(opset5::Round::RoundMode mode) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::f32, Shape{200}); - auto round = make_shared(data, mode); +void static test_mode(ov::op::v5::Round::RoundMode mode) { + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::f32, Shape{200}); + auto round = make_shared(data, mode); NodeBuilder builder(round, {data}); - auto g_round = ov::as_type_ptr(builder.create()); + auto g_round = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_round->get_mode(), round->get_mode()); } TEST(attributes, round_op_enum_mode_half_to_even) { - test_mode(opset5::Round::RoundMode::HALF_TO_EVEN); + test_mode(ov::op::v5::Round::RoundMode::HALF_TO_EVEN); } TEST(attributes, round_op_enum_mode_half_away_from_zero) { - test_mode(opset5::Round::RoundMode::HALF_AWAY_FROM_ZERO); + test_mode(ov::op::v5::Round::RoundMode::HALF_AWAY_FROM_ZERO); } diff --git a/src/core/tests/visitors/op/scatter_elements_update.cpp b/src/core/tests/visitors/op/scatter_elements_update.cpp index c59e40f5a18..9b97d10d56a 100644 --- a/src/core/tests/visitors/op/scatter_elements_update.cpp +++ b/src/core/tests/visitors/op/scatter_elements_update.cpp @@ -4,14 +4,12 @@ #include "openvino/op/scatter_elements_update.hpp" -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" +#include + +#include "visitors/visitors.hpp" using namespace ov; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using ov::test::NodeBuilder; TEST(attributes, scatter_elements_update) { NodeBuilder::get_ops().register_factory(); diff --git a/src/core/tests/visitors/op/scatter_nd_update.cpp b/src/core/tests/visitors/op/scatter_nd_update.cpp index d319f2a18c9..7a0c5bf0b52 100644 --- a/src/core/tests/visitors/op/scatter_nd_update.cpp +++ b/src/core/tests/visitors/op/scatter_nd_update.cpp @@ -2,26 +2,25 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset4.hpp" +#include "openvino/op/scatter_nd_update.hpp" -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +#include + +#include "visitors/visitors.hpp" + +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, scatter_nd_update) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); - auto data = std::make_shared(element::f32, Shape{1000, 256, 10, 15}); - auto indices = std::make_shared(element::i32, Shape{25, 125, 3}); - auto updates = std::make_shared(element::f32, Shape{25, 125, 15}); + auto data = std::make_shared(element::f32, Shape{1000, 256, 10, 15}); + auto indices = std::make_shared(element::i32, Shape{25, 125, 3}); + auto updates = std::make_shared(element::f32, Shape{25, 125, 15}); - auto scatter = std::make_shared(data, indices, updates); + auto scatter = std::make_shared(data, indices, updates); NodeBuilder builder(scatter, {data, indices, updates}); - EXPECT_NO_THROW(auto g_scatter = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_scatter = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/scatter_update.cpp b/src/core/tests/visitors/op/scatter_update.cpp index 9bd75b63423..118539a19c7 100644 --- a/src/core/tests/visitors/op/scatter_update.cpp +++ b/src/core/tests/visitors/op/scatter_update.cpp @@ -2,35 +2,30 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/scatter_update.hpp" + +#include + +#include "openvino/op/constant.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, scatter_update_op) { - using namespace opset3; - - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); Shape ref_shape{2, 3, 4}; Shape indices_shape{2, 1}; Shape updates_shape{2, 2, 1, 4}; - auto R = make_shared(element::i8, ref_shape); - auto I = make_shared(element::i16, indices_shape); - auto U = make_shared(element::i8, updates_shape); - auto A = op::Constant::create(element::i16, Shape{}, {1}); - auto op = make_shared(R, I, U, A); + auto R = make_shared(element::i8, ref_shape); + auto I = make_shared(element::i16, indices_shape); + auto U = make_shared(element::i8, updates_shape); + auto A = ov::op::v0::Constant::create(element::i16, Shape{}, {1}); + auto op = make_shared(R, I, U, A); NodeBuilder builder(op, {R, I, U, A}); - EXPECT_NO_THROW(auto g_op = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_op = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; diff --git a/src/core/tests/visitors/op/select.cpp b/src/core/tests/visitors/op/select.cpp index 27cc0207176..7a66efa1a31 100644 --- a/src/core/tests/visitors/op/select.cpp +++ b/src/core/tests/visitors/op/select.cpp @@ -2,48 +2,47 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/select.hpp" -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +#include + +#include "visitors/visitors.hpp" + +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, select_fp32) { - NodeBuilder::get_ops().register_factory(); - auto in_cond = std::make_shared(element::boolean, Shape{3, 2}); - auto in_then = std::make_shared(element::f32, Shape{3, 2}); - auto in_else = std::make_shared(element::f32, Shape{3, 2}); + NodeBuilder::get_ops().register_factory(); + auto in_cond = std::make_shared(element::boolean, Shape{3, 2}); + auto in_then = std::make_shared(element::f32, Shape{3, 2}); + auto in_else = std::make_shared(element::f32, Shape{3, 2}); auto auto_broadcast = op::AutoBroadcastType::NUMPY; - auto select = std::make_shared(in_cond, in_then, in_else, auto_broadcast); + auto select = std::make_shared(in_cond, in_then, in_else, auto_broadcast); NodeBuilder builder(select, {in_cond, in_then, in_else}); const auto expected_attr_count = 1; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); - auto g_select = ov::as_type_ptr(builder.create()); + auto g_select = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_select->get_autob(), select->get_autob()); } TEST(attributes, select_i32) { - NodeBuilder::get_ops().register_factory(); - auto in_cond = std::make_shared(element::boolean, Shape{3, 2}); - auto in_then = std::make_shared(element::i32, Shape{3, 2}); - auto in_else = std::make_shared(element::i32, Shape{3, 2}); + NodeBuilder::get_ops().register_factory(); + auto in_cond = std::make_shared(element::boolean, Shape{3, 2}); + auto in_then = std::make_shared(element::i32, Shape{3, 2}); + auto in_else = std::make_shared(element::i32, Shape{3, 2}); auto auto_broadcast = op::AutoBroadcastType::NUMPY; - auto select = std::make_shared(in_cond, in_then, in_else, auto_broadcast); + auto select = std::make_shared(in_cond, in_then, in_else, auto_broadcast); NodeBuilder builder(select, {in_cond, in_then, in_else}); const auto expected_attr_count = 1; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); - auto g_select = ov::as_type_ptr(builder.create()); + auto g_select = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_select->get_autob(), select->get_autob()); } diff --git a/src/core/tests/visitors/op/selu.cpp b/src/core/tests/visitors/op/selu.cpp index 96ff4dbee96..8e6d1cbd3d3 100644 --- a/src/core/tests/visitors/op/selu.cpp +++ b/src/core/tests/visitors/op/selu.cpp @@ -2,27 +2,27 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/selu.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, selu_op) { - NodeBuilder::get_ops().register_factory(); - const auto data_input = make_shared(element::f32, Shape{1, 2, 3}); - const auto alpha = make_shared(element::f32, Shape{1}); - const auto lambda = make_shared(element::f32, Shape{1}); + NodeBuilder::get_ops().register_factory(); + const auto data_input = make_shared(element::f32, Shape{1, 2, 3}); + const auto alpha = make_shared(element::f32, Shape{1}); + const auto lambda = make_shared(element::f32, Shape{1}); - const auto op = make_shared(data_input, alpha, lambda); + const auto op = make_shared(data_input, alpha, lambda); NodeBuilder builder(op, {data_input, alpha, lambda}); const auto expected_attr_count = 0; - EXPECT_NO_THROW(auto g_op = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_op = ov::as_type_ptr(builder.create())); EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } diff --git a/src/core/tests/visitors/op/shape_of.cpp b/src/core/tests/visitors/op/shape_of.cpp index f0144136f73..acec5987684 100644 --- a/src/core/tests/visitors/op/shape_of.cpp +++ b/src/core/tests/visitors/op/shape_of.cpp @@ -2,22 +2,19 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/shape_of.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, shapeof_op1) { NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::i32, Shape{2, 3, 4}); + auto data = make_shared(element::i32, Shape{2, 3, 4}); auto shapeof = make_shared(data); NodeBuilder builder(shapeof, {data}); auto g_shapeof = ov::as_type_ptr(builder.create()); @@ -28,7 +25,7 @@ TEST(attributes, shapeof_op1) { TEST(attributes, shapeof_op3) { NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::i32, Shape{2, 3, 4}); + auto data = make_shared(element::i32, Shape{2, 3, 4}); auto shapeof = make_shared(data, element::Type_t::i64); NodeBuilder builder(shapeof, {data}); auto g_shapeof = ov::as_type_ptr(builder.create()); diff --git a/src/core/tests/visitors/op/shuffle_channels.cpp b/src/core/tests/visitors/op/shuffle_channels.cpp index 3116ec74ef9..1f833875829 100644 --- a/src/core/tests/visitors/op/shuffle_channels.cpp +++ b/src/core/tests/visitors/op/shuffle_channels.cpp @@ -2,20 +2,21 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/opsets/opset3.hpp" +#include "openvino/op/shuffle_channels.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, shuffle_channels_op) { - using ShuffleChannels = opset3::ShuffleChannels; + using ShuffleChannels = ov::op::v0::ShuffleChannels; NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::i32, Shape{2, 64, 16, 16}); + auto data = make_shared(element::i32, Shape{2, 64, 16, 16}); auto axis = 1; auto groups = 2; auto shuffle_channels = make_shared(data, axis, groups); diff --git a/src/core/tests/visitors/op/sigmoid.cpp b/src/core/tests/visitors/op/sigmoid.cpp index d4ea5434678..605c93e8788 100644 --- a/src/core/tests/visitors/op/sigmoid.cpp +++ b/src/core/tests/visitors/op/sigmoid.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/sigmoid.hpp" + #include "unary_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_atrribute, UnaryOperatorVisitor, Type, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/sign.cpp b/src/core/tests/visitors/op/sign.cpp index 4cae2596aa3..1983229c2b8 100644 --- a/src/core/tests/visitors/op/sign.cpp +++ b/src/core/tests/visitors/op/sign.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/sign.hpp" + #include "unary_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Type, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/sin.cpp b/src/core/tests/visitors/op/sin.cpp index 27749f5ec60..c6a83ba4f6f 100644 --- a/src/core/tests/visitors/op/sin.cpp +++ b/src/core/tests/visitors/op/sin.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/sin.hpp" + #include "unary_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Type, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/sinh.cpp b/src/core/tests/visitors/op/sinh.cpp index 325f067fdfa..ecfd07e9c66 100644 --- a/src/core/tests/visitors/op/sinh.cpp +++ b/src/core/tests/visitors/op/sinh.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/sinh.hpp" + #include "unary_ops.hpp" -using Type = ::testing::Types>; +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Type, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/slice.cpp b/src/core/tests/visitors/op/slice.cpp index 08d91af8122..25ef680b3ff 100644 --- a/src/core/tests/visitors/op/slice.cpp +++ b/src/core/tests/visitors/op/slice.cpp @@ -2,42 +2,42 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset8.hpp" +#include "openvino/op/slice.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, slice_op_no_axes) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::f32, Shape{1, 3, 5, 4}); - const auto start = make_shared(element::i32, Shape{4}); - const auto stop = make_shared(element::i32, Shape{4}); - const auto step = make_shared(element::i32, Shape{4}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::f32, Shape{1, 3, 5, 4}); + const auto start = make_shared(element::i32, Shape{4}); + const auto stop = make_shared(element::i32, Shape{4}); + const auto step = make_shared(element::i32, Shape{4}); - const auto op = make_shared(data, start, stop, step); + const auto op = make_shared(data, start, stop, step); NodeBuilder builder(op, {data, start, stop, step}); - EXPECT_NO_THROW(auto g_op = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_op = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } TEST(attributes, slice_op_with_axes) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::f32, Shape{1, 3, 5, 4}); - const auto start = make_shared(element::i32, Shape{4}); - const auto stop = make_shared(element::i32, Shape{4}); - const auto step = make_shared(element::i32, Shape{4}); - const auto axes = make_shared(element::i32, Shape{4}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::f32, Shape{1, 3, 5, 4}); + const auto start = make_shared(element::i32, Shape{4}); + const auto stop = make_shared(element::i32, Shape{4}); + const auto step = make_shared(element::i32, Shape{4}); + const auto axes = make_shared(element::i32, Shape{4}); - const auto op = make_shared(data, start, stop, step, axes); + const auto op = make_shared(data, start, stop, step, axes); NodeBuilder builder(op, {data, start, stop, step, axes}); - EXPECT_NO_THROW(auto g_op = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_op = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/softmax.cpp b/src/core/tests/visitors/op/softmax.cpp index 13a420381b8..39fc341fd18 100644 --- a/src/core/tests/visitors/op/softmax.cpp +++ b/src/core/tests/visitors/op/softmax.cpp @@ -2,27 +2,23 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/softmax.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, softmax_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::i32, Shape{200}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::i32, Shape{200}); auto axis = 0; - auto softmax = make_shared(data, axis); + auto softmax = make_shared(data, axis); NodeBuilder builder(softmax, {data}); - auto g_softmax = ov::as_type_ptr(builder.create()); + auto g_softmax = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_softmax->get_axis(), softmax->get_axis()); } diff --git a/src/core/tests/visitors/op/softplus.cpp b/src/core/tests/visitors/op/softplus.cpp index 80b83f6ed53..ed39f497ec7 100644 --- a/src/core/tests/visitors/op/softplus.cpp +++ b/src/core/tests/visitors/op/softplus.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/softplus.hpp" + #include "unary_ops.hpp" -using Types = ::testing::Types>; +using Types = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_atrribute, UnaryOperatorVisitor, Types, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/softsign.cpp b/src/core/tests/visitors/op/softsign.cpp index 1fb45c66b30..47d18f72855 100644 --- a/src/core/tests/visitors/op/softsign.cpp +++ b/src/core/tests/visitors/op/softsign.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/softsign.hpp" + #include "unary_ops.hpp" -using Types = ::testing::Types>; +using Types = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_atrribute, UnaryOperatorVisitor, Types, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/space_to_batch.cpp b/src/core/tests/visitors/op/space_to_batch.cpp index c7f50f2ab9b..aa61c07f531 100644 --- a/src/core/tests/visitors/op/space_to_batch.cpp +++ b/src/core/tests/visitors/op/space_to_batch.cpp @@ -2,28 +2,27 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset2.hpp" +#include "openvino/op/space_to_batch.hpp" + +#include + +#include "openvino/op/constant.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, space_to_batch_op) { - using namespace opset2; - - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::f32, Shape{2, 128}); - auto block_shape = make_shared(element::i64, Shape{2}, vector{1, 5}); - auto pads_begin = make_shared(element::i64, Shape{2}, vector{0, 2}); - auto pads_end = make_shared(element::i64, Shape{2}, vector{0, 0}); - auto op = make_shared(data, block_shape, pads_begin, pads_end); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::f32, Shape{2, 128}); + auto block_shape = make_shared(element::i64, Shape{2}, vector{1, 5}); + auto pads_begin = make_shared(element::i64, Shape{2}, vector{0, 2}); + auto pads_end = make_shared(element::i64, Shape{2}, vector{0, 0}); + auto op = make_shared(data, block_shape, pads_begin, pads_end); NodeBuilder builder(op, {data, block_shape, pads_begin, pads_end}); - EXPECT_NO_THROW(auto g_op = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_op = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/space_to_depth.cpp b/src/core/tests/visitors/op/space_to_depth.cpp index 1ea812f0441..2ee783ed9e6 100644 --- a/src/core/tests/visitors/op/space_to_depth.cpp +++ b/src/core/tests/visitors/op/space_to_depth.cpp @@ -2,30 +2,26 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/space_to_depth.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, space_to_depth_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::i32, Shape{2, 3, 50, 50}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::i32, Shape{2, 3, 50, 50}); auto block_size = 2; - auto mode = opset1::SpaceToDepth::SpaceToDepthMode::BLOCKS_FIRST; + auto mode = ov::op::v0::SpaceToDepth::SpaceToDepthMode::BLOCKS_FIRST; - auto space_to_depth = make_shared(data, mode, block_size); + auto space_to_depth = make_shared(data, mode, block_size); NodeBuilder builder(space_to_depth, {data}); - auto g_space_to_depth = ov::as_type_ptr(builder.create()); + auto g_space_to_depth = ov::as_type_ptr(builder.create()); // attribute count const auto expected_attr_count = 2; diff --git a/src/core/tests/visitors/op/split.cpp b/src/core/tests/visitors/op/split.cpp index 5f0925b15bb..e2c8cd86f95 100644 --- a/src/core/tests/visitors/op/split.cpp +++ b/src/core/tests/visitors/op/split.cpp @@ -2,37 +2,36 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/split.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, split_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::i32, Shape{200}); - auto axis = make_shared(element::i32, Shape{}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::i32, Shape{200}); + auto axis = make_shared(element::i32, Shape{}); auto num_splits = 2; - auto split = make_shared(data, axis, num_splits); + auto split = make_shared(data, axis, num_splits); NodeBuilder builder(split, {data, axis}); - auto g_split = ov::as_type_ptr(builder.create()); + auto g_split = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_split->get_num_splits(), split->get_num_splits()); } TEST(attributes, split_op2) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::i32, Shape{300}); - auto axis = make_shared(element::i32, Shape{}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::i32, Shape{300}); + auto axis = make_shared(element::i32, Shape{}); auto num_splits = 3; - auto split = make_shared(data, axis, num_splits); + auto split = make_shared(data, axis, num_splits); NodeBuilder builder(split, {data, axis}); - auto g_split = ov::as_type_ptr(builder.create()); + auto g_split = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_split->get_num_splits(), split->get_num_splits()); } diff --git a/src/core/tests/visitors/op/sqrt.cpp b/src/core/tests/visitors/op/sqrt.cpp index 6a3da9a89ae..8e3910dadef 100644 --- a/src/core/tests/visitors/op/sqrt.cpp +++ b/src/core/tests/visitors/op/sqrt.cpp @@ -2,9 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/sqrt.hpp" + #include "unary_ops.hpp" -using Types = ::testing::Types, - UnaryOperatorType>; +using Types = ::testing::Types, + UnaryOperatorType>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Types, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/squared_difference.cpp b/src/core/tests/visitors/op/squared_difference.cpp index cdc461f22e3..322311dfb79 100644 --- a/src/core/tests/visitors/op/squared_difference.cpp +++ b/src/core/tests/visitors/op/squared_difference.cpp @@ -2,9 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "binary_ops.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/squared_difference.hpp" -using Type = ::testing::Types>; +#include "binary_ops.hpp" + +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_with_auto_broadcast, BinaryOperatorVisitor, Type, BinaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/squeeze.cpp b/src/core/tests/visitors/op/squeeze.cpp index 043e4a92806..c9d99e755b2 100644 --- a/src/core/tests/visitors/op/squeeze.cpp +++ b/src/core/tests/visitors/op/squeeze.cpp @@ -2,9 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/squeeze.hpp" + #include "unary_ops.hpp" -using Types = ::testing::Types, - UnaryOperatorType>; +using Types = ::testing::Types, + UnaryOperatorType>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Types, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/strided_slice.cpp b/src/core/tests/visitors/op/strided_slice.cpp index 38112b979d5..804a2e97394 100644 --- a/src/core/tests/visitors/op/strided_slice.cpp +++ b/src/core/tests/visitors/op/strided_slice.cpp @@ -2,26 +2,22 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/strided_slice.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, strided_slice_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::i32, Shape{2, 3, 4, 5}); - auto begin = make_shared(element::i32, Shape{2}); - auto end = make_shared(element::i32, Shape{2}); - auto stride = make_shared(element::i32, Shape{2}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::i32, Shape{2, 3, 4, 5}); + auto begin = make_shared(element::i32, Shape{2}); + auto end = make_shared(element::i32, Shape{2}); + auto stride = make_shared(element::i32, Shape{2}); auto begin_mask = std::vector{0, 0}; auto end_mask = std::vector{0, 0}; @@ -29,17 +25,17 @@ TEST(attributes, strided_slice_op) { auto shrink_axis_mask = std::vector{0, 0}; auto ellipsis_mask = std::vector{0, 0}; - auto strided_slice = make_shared(data, - begin, - end, - stride, - begin_mask, - end_mask, - new_axis_mask, - shrink_axis_mask, - ellipsis_mask); + auto strided_slice = make_shared(data, + begin, + end, + stride, + begin_mask, + end_mask, + new_axis_mask, + shrink_axis_mask, + ellipsis_mask); NodeBuilder builder(strided_slice, {data, begin, end, stride}); - auto g_strided_slice = ov::as_type_ptr(builder.create()); + auto g_strided_slice = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_strided_slice->get_begin_mask(), strided_slice->get_begin_mask()); EXPECT_EQ(g_strided_slice->get_end_mask(), strided_slice->get_end_mask()); diff --git a/src/core/tests/visitors/op/subtract.cpp b/src/core/tests/visitors/op/subtract.cpp index 0713f9b1bea..beacaf7f465 100644 --- a/src/core/tests/visitors/op/subtract.cpp +++ b/src/core/tests/visitors/op/subtract.cpp @@ -2,9 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "binary_ops.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/subtract.hpp" -using Type = ::testing::Types>; +#include "binary_ops.hpp" + +using Type = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_with_auto_broadcast, BinaryOperatorVisitor, Type, BinaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/swish.cpp b/src/core/tests/visitors/op/swish.cpp index a116728e288..318f4330356 100644 --- a/src/core/tests/visitors/op/swish.cpp +++ b/src/core/tests/visitors/op/swish.cpp @@ -2,34 +2,36 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/opsets/opset4.hpp" +#include "openvino/op/swish.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, swish_op) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::f32, Shape{1, 2, 3}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::f32, Shape{1, 2, 3}); - const auto op = make_shared(data); + const auto op = make_shared(data); NodeBuilder builder(op, {data}); - EXPECT_NO_THROW(auto g_op = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_op = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } TEST(attributes, swish_op2) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::f32, Shape{1, 2, 3}); - const auto beta = make_shared(element::f32, Shape{}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::f32, Shape{1, 2, 3}); + const auto beta = make_shared(element::f32, Shape{}); - const auto op = make_shared(data, beta); + const auto op = make_shared(data, beta); NodeBuilder builder(op, {data, beta}); - EXPECT_NO_THROW(auto g_op = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_op = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/tan.cpp b/src/core/tests/visitors/op/tan.cpp index fd330ee25cb..d066a1b62fc 100644 --- a/src/core/tests/visitors/op/tan.cpp +++ b/src/core/tests/visitors/op/tan.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/tan.hpp" + #include "unary_ops.hpp" -using Types = ::testing::Types>; +using Types = ::testing::Types>; INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Types, UnaryOperatorTypeName); diff --git a/src/core/tests/visitors/op/tanh.cpp b/src/core/tests/visitors/op/tanh.cpp index 4cf94794ebd..ba5ad6e5a18 100644 --- a/src/core/tests/visitors/op/tanh.cpp +++ b/src/core/tests/visitors/op/tanh.cpp @@ -2,20 +2,20 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/tanh.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, tanh_op) { - NodeBuilder::get_ops().register_factory(); - const auto data_node = make_shared(element::f32, Shape{1}); - const auto tanh = make_shared(data_node); + NodeBuilder::get_ops().register_factory(); + const auto data_node = make_shared(element::f32, Shape{1}); + const auto tanh = make_shared(data_node); const NodeBuilder builder(tanh); const auto tanh_attr_number = 0; diff --git a/src/core/tests/visitors/op/tensor_iterator.cpp b/src/core/tests/visitors/op/tensor_iterator.cpp index d13de6169e8..062a15fbf9a 100644 --- a/src/core/tests/visitors/op/tensor_iterator.cpp +++ b/src/core/tests/visitors/op/tensor_iterator.cpp @@ -2,18 +2,19 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" +#include "openvino/op/tensor_iterator.hpp" + +#include + #include "ngraph/builder/reshape.hpp" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/add.hpp" +#include "openvino/op/lstm_cell.hpp" +#include "openvino/op/multiply.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, tensor_iterator_lstm) { // That which we iterate over @@ -22,33 +23,33 @@ TEST(attributes, tensor_iterator_lstm) { const size_t I = 8; // Input size const size_t H = 32; // Hidden size - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); - auto SENT = make_shared(element::f32, Shape{N, L, I}); + auto SENT = make_shared(element::f32, Shape{N, L, I}); - auto H_init = make_shared(element::f32, Shape{N, 1, H}); - auto C_init = make_shared(element::f32, Shape{N, 1, H}); + auto H_init = make_shared(element::f32, Shape{N, 1, H}); + auto C_init = make_shared(element::f32, Shape{N, 1, H}); - auto W = make_shared(element::f32, Shape{4 * H, I}); - auto R = make_shared(element::f32, Shape{4 * H, H}); - auto H_t = make_shared(element::f32, Shape{N, 1, H}); - auto C_t = make_shared(element::f32, Shape{N, 1, H}); + auto W = make_shared(element::f32, Shape{4 * H, I}); + auto R = make_shared(element::f32, Shape{4 * H, H}); + auto H_t = make_shared(element::f32, Shape{N, 1, H}); + auto C_t = make_shared(element::f32, Shape{N, 1, H}); // Body - auto X = make_shared(element::f32, Shape{N, 1, I}); - auto W_body = make_shared(element::f32, Shape{4 * H, I}); - auto R_body = make_shared(element::f32, Shape{4 * H, H}); - auto LSTM_cell = make_shared(builder::opset1::reshape(X, Shape{N, I}), - builder::opset1::reshape(H_t, Shape{N, H}), - builder::opset1::reshape(C_t, Shape{N, H}), - W_body, - R_body, - H); - auto H_o = builder::opset1::reshape(LSTM_cell->output(0), Shape{N, 1, H}); - auto C_o = builder::opset1::reshape(LSTM_cell->output(1), Shape{N, 1, H}); + auto X = make_shared(element::f32, Shape{N, 1, I}); + auto W_body = make_shared(element::f32, Shape{4 * H, I}); + auto R_body = make_shared(element::f32, Shape{4 * H, H}); + auto LSTM_cell = make_shared(ngraph::builder::opset1::reshape(X, Shape{N, I}), + ngraph::builder::opset1::reshape(H_t, Shape{N, H}), + ngraph::builder::opset1::reshape(C_t, Shape{N, H}), + W_body, + R_body, + H); + auto H_o = ngraph::builder::opset1::reshape(LSTM_cell->output(0), Shape{N, 1, H}); + auto C_o = ngraph::builder::opset1::reshape(LSTM_cell->output(1), Shape{N, 1, H}); auto body = make_shared(OutputVector{H_o, C_o}, ParameterVector{X, H_t, C_t, W_body, R_body}); - auto tensor_iterator = make_shared(); + auto tensor_iterator = make_shared(); tensor_iterator->set_body(body); // start=0, stride=1, part_size=1, end=39, axis=1 tensor_iterator->set_sliced_input(X, SENT, 0, 1, 1, -1, 1); @@ -67,23 +68,23 @@ TEST(attributes, tensor_iterator_lstm) { } TEST(attributes, tensor_iterator_2_slice_inputs_part_size_2) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); // That which we iterate over - auto X = make_shared(element::f32, Shape{32, 40, 10}); - auto Y = make_shared(element::f32, Shape{32, 40, 10}); - auto M = make_shared(element::f32, Shape{32, 2, 10}); + auto X = make_shared(element::f32, Shape{32, 40, 10}); + auto Y = make_shared(element::f32, Shape{32, 40, 10}); + auto M = make_shared(element::f32, Shape{32, 2, 10}); // Set up the cell body, a function from (Xi, Yi) -> (Zo) // Body parameters - auto Xi = make_shared(element::f32, Shape{32, 2, 10}); - auto Yi = make_shared(element::f32, Shape{32, 2, 10}); - auto M_body = make_shared(element::f32, Shape{32, 2, 10}); + auto Xi = make_shared(element::f32, Shape{32, 2, 10}); + auto Yi = make_shared(element::f32, Shape{32, 2, 10}); + auto M_body = make_shared(element::f32, Shape{32, 2, 10}); // Body auto Zo = std::make_shared(std::make_shared(Xi, Yi), M_body); auto body = make_shared(OutputVector{Zo}, ParameterVector{Xi, Yi, M_body}); - auto tensor_iterator = make_shared(); + auto tensor_iterator = make_shared(); tensor_iterator->set_body(body); // The Xi are the elements of Xseq @@ -103,23 +104,23 @@ TEST(attributes, tensor_iterator_2_slice_inputs_part_size_2) { } TEST(attributes, tensor_iterator_2_slice_inputs_part_size_2_dynamic) { - NodeBuilder::get_ops().register_factory(); + NodeBuilder::get_ops().register_factory(); // That which we iterate over - auto X = make_shared(element::f32, Shape{32, 40, 10}); - auto Y = make_shared(element::f32, Shape{32, 40, 10}); - auto M = make_shared(element::f32, Shape{32, 2, 10}); + auto X = make_shared(element::f32, Shape{32, 40, 10}); + auto Y = make_shared(element::f32, Shape{32, 40, 10}); + auto M = make_shared(element::f32, Shape{32, 2, 10}); // Set up the cell body, a function from (Xi, Yi) -> (Zo) // Body parameters - auto Xi = make_shared(element::f32, PartialShape::dynamic()); - auto Yi = make_shared(element::f32, PartialShape::dynamic()); - auto M_body = make_shared(element::f32, PartialShape::dynamic()); + auto Xi = make_shared(element::f32, PartialShape::dynamic()); + auto Yi = make_shared(element::f32, PartialShape::dynamic()); + auto M_body = make_shared(element::f32, PartialShape::dynamic()); // Body auto Zo = std::make_shared(std::make_shared(Xi, Yi), M_body); auto body = make_shared(OutputVector{Zo}, ParameterVector{Xi, Yi, M_body}); - auto tensor_iterator = make_shared(); + auto tensor_iterator = make_shared(); tensor_iterator->set_body(body); // The Xi are the elements of Xseq // start=0, stride=2, part_size=2, end=38, axis=1 diff --git a/src/core/tests/visitors/op/tile.cpp b/src/core/tests/visitors/op/tile.cpp index 6240a46cd4d..f41beb3871e 100644 --- a/src/core/tests/visitors/op/tile.cpp +++ b/src/core/tests/visitors/op/tile.cpp @@ -2,24 +2,25 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/tile.hpp" + +#include + +#include "openvino/op/constant.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, tile_op) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::f32, Shape{1, 2, 3, 4}); - const auto repeats = make_shared(element::i64, Shape{4}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::f32, Shape{1, 2, 3, 4}); + const auto repeats = make_shared(element::i64, Shape{4}); - const auto tile = make_shared(data, repeats); + const auto tile = make_shared(data, repeats); NodeBuilder builder(tile, {data, repeats}); - EXPECT_NO_THROW(auto g_tile = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_tile = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/topk.cpp b/src/core/tests/visitors/op/topk.cpp index 7c31301c0d7..09a281934dd 100644 --- a/src/core/tests/visitors/op/topk.cpp +++ b/src/core/tests/visitors/op/topk.cpp @@ -2,32 +2,28 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "openvino/openvino.hpp" -#include "openvino/opsets/opset11.hpp" +#include "openvino/op/topk.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, topk_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::i32, Shape{2, 3, 4, 5}); - auto k = make_shared(element::i32, Shape{}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::i32, Shape{2, 3, 4, 5}); + auto k = make_shared(element::i32, Shape{}); auto axis = 0; - auto mode = opset1::TopK::Mode::MAX; - auto sort_type = opset1::TopK::SortType::SORT_VALUES; + auto mode = ov::op::v1::TopK::Mode::MAX; + auto sort_type = ov::op::v1::TopK::SortType::SORT_VALUES; - auto topk = make_shared(data, k, axis, mode, sort_type); + auto topk = make_shared(data, k, axis, mode, sort_type); NodeBuilder builder(topk, {data, k}); - auto g_topk = ov::as_type_ptr(builder.create()); + auto g_topk = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_topk->get_axis(), topk->get_axis()); EXPECT_EQ(g_topk->get_mode(), topk->get_mode()); @@ -36,17 +32,17 @@ TEST(attributes, topk_op) { } TEST(attributes, topk_v3_op) { - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::i32, Shape{2, 3, 4, 5}); - auto k = make_shared(element::i32, Shape{}); + NodeBuilder::get_ops().register_factory(); + auto data = make_shared(element::i32, Shape{2, 3, 4, 5}); + auto k = make_shared(element::i32, Shape{}); auto axis = 0; - auto mode = opset3::TopK::Mode::MAX; - auto sort_type = opset3::TopK::SortType::SORT_VALUES; + auto mode = ov::op::v3::TopK::Mode::MAX; + auto sort_type = ov::op::v3::TopK::SortType::SORT_VALUES; - auto topk = make_shared(data, k, axis, mode, sort_type); + auto topk = make_shared(data, k, axis, mode, sort_type); NodeBuilder builder(topk, {data, k}); - auto g_topk = ov::as_type_ptr(builder.create()); + auto g_topk = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_topk->get_axis(), topk->get_axis()); EXPECT_EQ(g_topk->get_mode(), topk->get_mode()); @@ -55,9 +51,9 @@ TEST(attributes, topk_v3_op) { } TEST(attributes, topk_v11_op) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::i32, Shape{2, 1, 3, 7}); - const auto k = make_shared(element::i32, Shape{}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::i32, Shape{2, 1, 3, 7}); + const auto k = make_shared(element::i32, Shape{}); const auto axis = 0; const auto mode = ov::op::v11::TopK::Mode::MAX; @@ -65,9 +61,9 @@ TEST(attributes, topk_v11_op) { const auto idx_type = ov::element::i32; const auto stable = true; - const auto topk = make_shared(data, k, axis, mode, sort_type, idx_type, stable); + const auto topk = make_shared(data, k, axis, mode, sort_type, idx_type, stable); NodeBuilder builder(topk, {data, k}); - const auto g_topk = ov::as_type_ptr(builder.create()); + const auto g_topk = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_topk->get_axis(), topk->get_axis()); EXPECT_EQ(g_topk->get_mode(), topk->get_mode()); diff --git a/src/core/tests/visitors/op/transpose.cpp b/src/core/tests/visitors/op/transpose.cpp index f42ee0da78b..5de912b8977 100644 --- a/src/core/tests/visitors/op/transpose.cpp +++ b/src/core/tests/visitors/op/transpose.cpp @@ -2,27 +2,25 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/transpose.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, transpose_op) { - using namespace opset1; + NodeBuilder::get_ops().register_factory(); + const auto data_input = make_shared(element::f32, Shape{1, 2, 3}); + const auto axes_order_input = make_shared(element::i32, Shape{3}); - NodeBuilder::get_ops().register_factory(); - const auto data_input = make_shared(element::f32, Shape{1, 2, 3}); - const auto axes_order_input = make_shared(element::i32, Shape{3}); - - const auto op = make_shared(data_input, axes_order_input); + const auto op = make_shared(data_input, axes_order_input); NodeBuilder builder(op, {data_input, axes_order_input}); - EXPECT_NO_THROW(auto g_op = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_op = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/unary_ops.hpp b/src/core/tests/visitors/op/unary_ops.hpp index 29a001567a7..ae2217512e7 100644 --- a/src/core/tests/visitors/op/unary_ops.hpp +++ b/src/core/tests/visitors/op/unary_ops.hpp @@ -4,14 +4,16 @@ #pragma once -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" +#include -template +#include "openvino/op/parameter.hpp" +#include "visitors/visitors.hpp" + +template class UnaryOperatorType { public: using op_type = T; - static constexpr ngraph::element::Type_t element_type = ELEMENT_TYPE; + static constexpr ov::element::Type_t element_type = ELEMENT_TYPE; }; template class UnaryOperatorVisitor : public testing::Test {}; @@ -21,8 +23,8 @@ public: template static std::string GetName(int) { using OP_Type = typename T::op_type; - constexpr ngraph::element::Type precision(T::element_type); - const ngraph::Node::type_info_t typeinfo = OP_Type::get_type_info_static(); + constexpr ov::element::Type precision(T::element_type); + const ov::Node::type_info_t typeinfo = OP_Type::get_type_info_static(); return std::string{typeinfo.name} + "_" + precision.get_type_name(); } }; @@ -31,13 +33,13 @@ TYPED_TEST_SUITE_P(UnaryOperatorVisitor); TYPED_TEST_P(UnaryOperatorVisitor, No_Attribute_4D) { using OP_Type = typename TypeParam::op_type; - const ngraph::element::Type_t element_type = TypeParam::element_type; + const ov::element::Type_t element_type = TypeParam::element_type; - ngraph::test::NodeBuilder::get_ops().register_factory(); - const auto A = std::make_shared(element_type, ngraph::PartialShape{2, 2, 2, 2}); + ov::test::NodeBuilder::get_ops().register_factory(); + const auto A = std::make_shared(element_type, ov::PartialShape{2, 2, 2, 2}); const auto op_func = std::make_shared(A); - ngraph::test::NodeBuilder builder(op_func, {A}); + ov::test::NodeBuilder builder(op_func, {A}); EXPECT_NO_THROW(auto g_op_func = ov::as_type_ptr(builder.create())); diff --git a/src/core/tests/visitors/op/unique.cpp b/src/core/tests/visitors/op/unique.cpp index ef7d1eefbc3..4af983e830d 100644 --- a/src/core/tests/visitors/op/unique.cpp +++ b/src/core/tests/visitors/op/unique.cpp @@ -2,24 +2,25 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "openvino/opsets/opset10.hpp" +#include "openvino/op/unique.hpp" + +#include + +#include "openvino/op/parameter.hpp" +#include "visitors/visitors.hpp" using namespace std; using namespace ov; -using ngraph::test::NodeBuilder; +using ov::test::NodeBuilder; TEST(attributes, unique_default_attributes) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::f32, Shape{1, 3, 10, 10}); - const auto grid = make_shared(element::f32, Shape{1, 5, 5, 2}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::f32, Shape{1, 3, 10, 10}); + const auto grid = make_shared(element::f32, Shape{1, 5, 5, 2}); - const auto op = make_shared(data); + const auto op = make_shared(data); NodeBuilder builder(op); - auto g_unique = ov::as_type_ptr(builder.create()); + auto g_unique = ov::as_type_ptr(builder.create()); constexpr auto expected_attr_count = 3; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); @@ -30,13 +31,13 @@ TEST(attributes, unique_default_attributes) { } TEST(attributes, unique_sorted_false) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::f32, Shape{1, 3, 10, 10}); - const auto grid = make_shared(element::f32, Shape{1, 5, 5, 2}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::f32, Shape{1, 3, 10, 10}); + const auto grid = make_shared(element::f32, Shape{1, 5, 5, 2}); - const auto op = make_shared(data, false); + const auto op = make_shared(data, false); NodeBuilder builder(op); - auto g_unique = ov::as_type_ptr(builder.create()); + auto g_unique = ov::as_type_ptr(builder.create()); constexpr auto expected_attr_count = 3; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); @@ -47,13 +48,13 @@ TEST(attributes, unique_sorted_false) { } TEST(attributes, unique_index_et_non_default) { - NodeBuilder::get_ops().register_factory(); - const auto data = make_shared(element::f32, Shape{1, 3, 10, 10}); - const auto grid = make_shared(element::f32, Shape{1, 5, 5, 2}); + NodeBuilder::get_ops().register_factory(); + const auto data = make_shared(element::f32, Shape{1, 3, 10, 10}); + const auto grid = make_shared(element::f32, Shape{1, 5, 5, 2}); - const auto op = make_shared(data, true, element::i32, element::i32); + const auto op = make_shared(data, true, element::i32, element::i32); NodeBuilder builder(op); - auto g_unique = ov::as_type_ptr(builder.create()); + auto g_unique = ov::as_type_ptr(builder.create()); constexpr auto expected_attr_count = 3; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/unsqueeze.cpp b/src/core/tests/visitors/op/unsqueeze.cpp index 5a9097efac8..e138636a1ac 100644 --- a/src/core/tests/visitors/op/unsqueeze.cpp +++ b/src/core/tests/visitors/op/unsqueeze.cpp @@ -2,23 +2,23 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/unsqueeze.hpp" + +#include + +#include "openvino/op/constant.hpp" +#include "openvino/op/parameter.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, unsqueeze_op) { - using namespace opset1; - NodeBuilder::get_ops().register_factory(); - auto param = make_shared(element::f32, Shape{4, 1, 4, 1, 8}); - auto axes = make_shared(element::u64, Shape{2}, vector{1, 2}); + auto param = make_shared(element::f32, Shape{4, 1, 4, 1, 8}); + auto axes = make_shared(element::u64, Shape{2}, vector{1, 2}); auto op = make_shared(param, axes); NodeBuilder builder(op, {param, axes}); diff --git a/src/core/tests/visitors/op/variadic_split.cpp b/src/core/tests/visitors/op/variadic_split.cpp index a85840e2fa9..9b1b1d0e5d2 100644 --- a/src/core/tests/visitors/op/variadic_split.cpp +++ b/src/core/tests/visitors/op/variadic_split.cpp @@ -2,28 +2,25 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" +#include "openvino/op/variadic_split.hpp" + +#include + +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; +using ov::test::NodeBuilder; TEST(attributes, variadic_split_op) { - using namespace opset1; - NodeBuilder::get_ops().register_factory(); - auto data = make_shared(element::i32, Shape{200}); - auto axis = make_shared(element::i32, Shape{1}); - auto split_lengths = make_shared(element::i32, Shape{1}); + auto data = make_shared(element::i32, Shape{200}); + auto axis = make_shared(element::i32, Shape{1}); + auto split_lengths = make_shared(element::i32, Shape{1}); - auto split = make_shared(data, axis, split_lengths); + auto split = make_shared(data, axis, split_lengths); NodeBuilder builder(split, {data, axis, split_lengths}); - EXPECT_NO_THROW(auto g_split = ov::as_type_ptr(builder.create())); + EXPECT_NO_THROW(auto g_split = ov::as_type_ptr(builder.create())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/partial_shape.cpp b/src/core/tests/visitors/partial_shape.cpp index c661dce16bf..bccb400fa05 100644 --- a/src/core/tests/visitors/partial_shape.cpp +++ b/src/core/tests/visitors/partial_shape.cpp @@ -2,64 +2,60 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include + +#include "openvino/core/attribute_visitor.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; TEST(attributes, partial_shape) { - NodeBuilder builder; - AttributeVisitor& loader = builder.get_node_loader(); - AttributeVisitor& saver = builder.get_node_saver(); + ov::test::NodeBuilder builder; + ov::AttributeVisitor& loader = builder.get_node_loader(); + ov::AttributeVisitor& saver = builder.get_node_saver(); - PartialShape dyn = PartialShape::dynamic(); + ov::PartialShape dyn = ov::PartialShape::dynamic(); saver.on_attribute("dyn", dyn); - PartialShape g_dyn; + ov::PartialShape g_dyn; loader.on_attribute("dyn", g_dyn); EXPECT_EQ(dyn, g_dyn); - PartialShape scalar{}; + ov::PartialShape scalar{}; saver.on_attribute("scalar", scalar); - PartialShape g_scalar; + ov::PartialShape g_scalar; loader.on_attribute("scalar", g_scalar); EXPECT_EQ(scalar, g_scalar); - PartialShape dyn_vector{Dimension::dynamic()}; + ov::PartialShape dyn_vector{ov::Dimension::dynamic()}; saver.on_attribute("dyn_vector", dyn_vector); - PartialShape g_dyn_vector; + ov::PartialShape g_dyn_vector; loader.on_attribute("dyn_vector", g_dyn_vector); EXPECT_EQ(dyn_vector, g_dyn_vector); - PartialShape stat_vector{7}; + ov::PartialShape stat_vector{7}; saver.on_attribute("stat_vector", stat_vector); - PartialShape g_stat_vector; + ov::PartialShape g_stat_vector; loader.on_attribute("stat_vector", g_stat_vector); EXPECT_EQ(stat_vector, g_stat_vector); - PartialShape general{7, Dimension::dynamic(), 2, Dimension::dynamic(), 4}; + ov::PartialShape general{7, ov::Dimension::dynamic(), 2, ov::Dimension::dynamic(), 4}; saver.on_attribute("general", general); - PartialShape g_general; + ov::PartialShape g_general; loader.on_attribute("general", g_general); EXPECT_EQ(general, g_general); - PartialShape shape_with_boundaries{Dimension(2, 20)}; + ov::PartialShape shape_with_boundaries{ov::Dimension(2, 20)}; saver.on_attribute("shape_with_boundaries", shape_with_boundaries); - PartialShape g_shape_with_boundaries; + ov::PartialShape g_shape_with_boundaries; loader.on_attribute("shape_with_boundaries", g_shape_with_boundaries); EXPECT_EQ(shape_with_boundaries, g_shape_with_boundaries); - PartialShape shape_with_undefined_boundaries{Dimension(10, -1), Dimension(-1, 100), Dimension::dynamic(), 4}; + ov::PartialShape shape_with_undefined_boundaries{ov::Dimension(10, -1), + ov::Dimension(-1, 100), + ov::Dimension::dynamic(), + 4}; saver.on_attribute("shape_with_undefined_boundaries", shape_with_undefined_boundaries); - PartialShape g_shape_with_undefined_boundaries; + ov::PartialShape g_shape_with_undefined_boundaries; loader.on_attribute("shape_with_undefined_boundaries", g_shape_with_undefined_boundaries); EXPECT_EQ(shape_with_undefined_boundaries, g_shape_with_undefined_boundaries); } diff --git a/src/core/tests/visitors/user_op.cpp b/src/core/tests/visitors/user_op.cpp index 5e323c928f6..d195a6e2e08 100644 --- a/src/core/tests/visitors/user_op.cpp +++ b/src/core/tests/visitors/user_op.cpp @@ -2,19 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" +#include + +#include "openvino/op/op.hpp" +#include "visitors/visitors.hpp" using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +using namespace ov; enum class TuringModel { XL400, XL1200 }; @@ -68,7 +62,7 @@ protected: // Given a Turing machine program and data, return scalar 1 if the program would // complete, 1 if it would not. -class Oracle : public op::Op { +class Oracle : public ov::op::Op { public: Oracle(const Output& program, const Output& data, @@ -358,10 +352,10 @@ protected: }; TEST(attributes, user_op) { - NodeBuilder::get_ops().register_factory(); - auto program = make_shared(element::i32, Shape{200}); - auto data = make_shared(element::i32, Shape{200}); - auto result = make_shared(data); + ov::test::NodeBuilder::get_ops().register_factory(); + auto program = make_shared(element::i32, Shape{200}); + auto data = make_shared(element::i32, Shape{200}); + auto result = make_shared(data); auto oracle = make_shared(program, data, TuringModel::XL1200, @@ -397,7 +391,7 @@ TEST(attributes, user_op) { NodeVector{program, result, data}, ParameterVector{data, data, program}, ResultVector{result}); - NodeBuilder builder; + ov::test::NodeBuilder builder; AttributeVisitor& saver = builder.get_node_saver(); AttributeVisitor& loader = builder.get_node_loader(); loader.register_node(program, "program"); diff --git a/src/core/tests/visitors/value_map.cpp b/src/core/tests/visitors/value_map.cpp index 4dadc17f54f..c3efb95b0f4 100644 --- a/src/core/tests/visitors/value_map.cpp +++ b/src/core/tests/visitors/value_map.cpp @@ -2,22 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "common_test_utils/visitor.hpp" #include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "ngraph/op/util/attr_types.hpp" -#include "ngraph/opsets/opset1.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/opsets/opset5.hpp" - -using namespace std; -using namespace ngraph; -using ngraph::test::NodeBuilder; -using ngraph::test::ValueMap; +#include "visitors/visitors.hpp" TEST(attributes, value_map) { - ValueMap value_map; + ov::test::ValueMap value_map; bool a = true; int8_t b = 2; value_map.insert("a", a); diff --git a/src/core/tests/visitors/visitors.cpp b/src/core/tests/visitors/visitors.cpp new file mode 100644 index 00000000000..4c55c7fa5a6 --- /dev/null +++ b/src/core/tests/visitors/visitors.cpp @@ -0,0 +1,20 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "visitors.hpp" + +#include "openvino/op/ops.hpp" + +OPENVINO_SUPPRESS_DEPRECATED_START +ngraph::FactoryRegistry& ov::test::NodeBuilder::get_ops() { + static ngraph::FactoryRegistry registry = [] { + ngraph::FactoryRegistry registry; +#define _OPENVINO_OP_REG(NAME, NAMESPACE) registry.register_factory(); +#include "op_version_tbl.hpp" +#undef _OPENVINO_OP_REG + return registry; + }(); + return registry; +} +OPENVINO_SUPPRESS_DEPRECATED_END diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/visitor.hpp b/src/core/tests/visitors/visitors.hpp similarity index 88% rename from src/tests/test_utils/common_test_utils/include/common_test_utils/visitor.hpp rename to src/core/tests/visitors/visitors.hpp index 783c8574bcb..4cd336ae9da 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/visitor.hpp +++ b/src/core/tests/visitors/visitors.hpp @@ -4,19 +4,20 @@ #pragma once +#include #include #include #include -#include "openvino/core/attribute_visitor.hpp" #include "ngraph/factory.hpp" -#include "openvino/op/util/framework_node.hpp" -#include "openvino/op/ops.hpp" +#include "ngraph/runtime/aligned_buffer.hpp" +#include "openvino/core/attribute_visitor.hpp" #include "openvino/core/deprecated.hpp" -#include "openvino/op/ops.hpp" +#include "openvino/op/util/framework_node.hpp" +#include "openvino/op/util/sub_graph_base.hpp" +#include "openvino/op/util/variable.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { +namespace ov { namespace test { class ValueHolder { template @@ -119,12 +120,15 @@ public: virtual operator ov::Dimension&() { OPENVINO_THROW("Invalid type access"); } - virtual operator std::shared_ptr&() { + virtual operator std::shared_ptr&() { OPENVINO_THROW("Invalid type access"); } virtual operator ov::op::util::FrameworkNodeAttrs&() { OPENVINO_THROW("Invalid type access"); } + virtual operator ov::Tensor&() { + OPENVINO_THROW("Invalid type access"); + } uint64_t get_index() { return m_index; } @@ -213,27 +217,30 @@ public: } void on_adapter(const std::string& name, ValueAccessor& adapter) override { - if (auto a = ::ov::as_type<::ov::AttributeAdapter>>( - &adapter)) { + OPENVINO_SUPPRESS_DEPRECATED_START + if (auto a = ::ov::as_type<::ov::AttributeAdapter>>(&adapter)) { auto& data = m_values.get(name); data->read(a->get()->get_ptr(), a->get()->size()); - } else if (auto a = ov::as_type>>>(&adapter)) { + } else if (auto a = ov::as_type< + ov::AttributeAdapter>>>( + &adapter)) { a->set(m_values.get>>(name)); - } else if (auto a = ov::as_type>>>(&adapter)) { + } else if (auto a = ov::as_type< + ov::AttributeAdapter>>>( + &adapter)) { a->set(m_values.get>>(name)); } else if (auto a = ov::as_type>(&adapter)) { a->set(m_values.get(name)); } else if (auto a = ov::as_type>(&adapter)) { a->set(m_values.get(name)); - } else if (auto a = ov::as_type>>(&adapter)) { - a->set(m_values.get>(name)); + } else if (auto a = ov::as_type>>(&adapter)) { + a->set(m_values.get>(name)); } else if (auto a = ov::as_type>(&adapter)) { a->set(m_values.get(name)); } else { OPENVINO_THROW("Attribute \"", name, "\" cannot be unmarshalled"); } + OPENVINO_SUPPRESS_DEPRECATED_END } // The remaining adapter methods fall back on the void adapter if not implemented void on_adapter(const std::string& name, ValueAccessor& adapter) override { @@ -283,8 +290,10 @@ public: adapter.set(m_values.get>(name)); } void on_adapter(const std::string& name, ValueAccessor& adapter) override { + OPENVINO_SUPPRESS_DEPRECATED_START HostTensorPtr& data = m_values.get(name); data->read(adapter.get_ptr(), adapter.size()); + OPENVINO_SUPPRESS_DEPRECATED_END } protected: @@ -300,28 +309,31 @@ public: } void on_adapter(const std::string& name, ValueAccessor& adapter) override { - if (auto a = ::ov::as_type<::ov::AttributeAdapter>>( - &adapter)) { + OPENVINO_SUPPRESS_DEPRECATED_START + if (auto a = ::ov::as_type<::ov::AttributeAdapter>>(&adapter)) { HostTensorPtr data = std::make_shared(element::u8, Shape{a->get()->size()}); data->write(a->get()->get_ptr(), a->get()->size()); m_values.insert(name, data); - } else if (auto a = ov::as_type>>>(&adapter)) { + } else if (auto a = ov::as_type< + ov::AttributeAdapter>>>( + &adapter)) { m_values.insert_vector(name, a->get()); - } else if (auto a = ov::as_type>>>(&adapter)) { + } else if (auto a = ov::as_type< + ov::AttributeAdapter>>>( + &adapter)) { m_values.insert_vector(name, a->get()); } else if (auto a = ov::as_type>(&adapter)) { m_values.insert_vector(name, a->get()); } else if (auto a = ov::as_type>(&adapter)) { m_values.insert(name, a->get()); - } else if (auto a = ov::as_type>>(&adapter)) { + } else if (auto a = ov::as_type>>(&adapter)) { m_values.insert(name, a->get()); } else if (auto a = ov::as_type>(&adapter)) { m_values.insert(name, a->get()); } else { OPENVINO_THROW("Attribute \"", name, "\" cannot be marshalled"); } + OPENVINO_SUPPRESS_DEPRECATED_END } // The remaining adapter methods fall back on the void adapter if not implemented void on_adapter(const std::string& name, ValueAccessor& adapter) override { @@ -371,8 +383,8 @@ public: m_values.insert_vector(name, adapter.get()); } void on_adapter(const std::string& name, ValueAccessor& adapter) override { - HostTensorPtr data = std::make_shared(element::u8, Shape{adapter.size()}); - data->write(adapter.get_ptr(), adapter.size()); + ov::Tensor data(element::u8, Shape{adapter.size()}); + std::memcpy(data.data(), adapter.get_ptr(), adapter.size()); m_values.insert(name, data); } @@ -414,22 +426,14 @@ public: AttributeVisitor& get_node_loader() { return *this; } - static FactoryRegistry& get_ops() { - static FactoryRegistry registry = [] { - FactoryRegistry registry; -#define _OPENVINO_OP_REG(NAME, NAMESPACE) registry.register_factory(); -#include "op_version_tbl.hpp" -#undef _OPENVINO_OP_REG - return registry; - }(); - return registry; - } + OPENVINO_SUPPRESS_DEPRECATED_START + static ngraph::FactoryRegistry& get_ops(); + OPENVINO_SUPPRESS_DEPRECATED_END protected: Node::type_info_t m_node_type_info; SerializeAttributeVisitor m_serializer; ov::OutputVector m_inputs; -}; +}; // namespace test } // namespace test -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace ov