diff --git a/src/core/tests/CMakeLists.txt b/src/core/tests/CMakeLists.txt index 0c5a7681ad3e97..22f5e215f23668 100644 --- a/src/core/tests/CMakeLists.txt +++ b/src/core/tests/CMakeLists.txt @@ -270,6 +270,7 @@ set(SRC visitors/dimension.cpp visitors/user_op.cpp visitors/value_map.cpp + visitors/op/abs.cpp visitors/op/acos.cpp visitors/op/acosh.cpp visitors/op/adaptive_avg_pool.cpp @@ -288,6 +289,7 @@ set(SRC visitors/op/bucketize.cpp visitors/op/ceiling.cpp visitors/op/clamp.cpp + visitors/op/concat.cpp visitors/op/constant.cpp visitors/op/convert.cpp visitors/op/convert_color_i420.cpp @@ -380,6 +382,7 @@ set(SRC visitors/op/proposal.cpp visitors/op/psroi_pooling.cpp visitors/op/random_uniform.cpp + visitors/op/range.cpp visitors/op/rdft.cpp visitors/op/read_value.cpp visitors/op/reduce_l1.cpp @@ -430,6 +433,7 @@ set(SRC visitors/op/tan.cpp visitors/op/tanh.cpp visitors/op/tensor_iterator.cpp + visitors/op/tile.cpp visitors/op/topk.cpp visitors/op/transpose.cpp visitors/op/unsqueeze.cpp diff --git a/src/core/tests/visitors/op/abs.cpp b/src/core/tests/visitors/op/abs.cpp new file mode 100644 index 00000000000000..d391b087dce1c4 --- /dev/null +++ b/src/core/tests/visitors/op/abs.cpp @@ -0,0 +1,9 @@ +// Copyright (C) 2018-2022 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "unary_ops.hpp" + +using Type = ::testing::Types>; + +INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Type, UnaryOperatorTypeName); \ No newline at end of file diff --git a/src/core/tests/visitors/op/adaptive_avg_pool.cpp b/src/core/tests/visitors/op/adaptive_avg_pool.cpp index 79d878e77b5201..139946beb70cd0 100644 --- a/src/core/tests/visitors/op/adaptive_avg_pool.cpp +++ b/src/core/tests/visitors/op/adaptive_avg_pool.cpp @@ -18,7 +18,7 @@ TEST(attributes, adaptive_avg_pool_op) { const auto out_shape = op::Constant::create(element::i64, Shape{2}, {4, 3}); const auto adaptive_pool = make_shared(A, out_shape); - NodeBuilder builder(adaptive_pool); + 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 8d6140b00400ac..3c7860fc812c08 100644 --- a/src/core/tests/visitors/op/adaptive_max_pool.cpp +++ b/src/core/tests/visitors/op/adaptive_max_pool.cpp @@ -18,7 +18,7 @@ TEST(attributes, adaptive_max_pool_op) { const auto out_shape = op::Constant::create(element::i64, Shape{2}, {4, 3}); const auto adaptive_pool = make_shared(A, out_shape); - NodeBuilder builder(adaptive_pool); + NodeBuilder builder(adaptive_pool, {A, out_shape}); auto g_adaptive_pool = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 1; diff --git a/src/core/tests/visitors/op/assign.cpp b/src/core/tests/visitors/op/assign.cpp index cca991228ae529..bd65f6dac2800f 100644 --- a/src/core/tests/visitors/op/assign.cpp +++ b/src/core/tests/visitors/op/assign.cpp @@ -20,7 +20,7 @@ TEST(attributes, assign_v3_op) { 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); + NodeBuilder builder(assign, {read_value}); // attribute count const auto expected_attr_count = 1; @@ -33,7 +33,7 @@ TEST(attributes, assign_v6_op) { 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); + NodeBuilder builder(assign, {read_value}); // attribute count const auto expected_attr_count = 1; diff --git a/src/core/tests/visitors/op/avg_pool.cpp b/src/core/tests/visitors/op/avg_pool.cpp index 13db240b47b7b8..25787eadb1ee18 100644 --- a/src/core/tests/visitors/op/avg_pool.cpp +++ b/src/core/tests/visitors/op/avg_pool.cpp @@ -29,7 +29,7 @@ TEST(attributes, avg_pool_op) { auto avg_pool = make_shared(data, strides, pads_begin, pads_end, kernel, exclude_pad, rounding_mode, auto_pad); - NodeBuilder builder(avg_pool); + 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()); @@ -54,7 +54,7 @@ TEST(attributes, avg_pool_v8_op) { const auto avg_pool = make_shared(data, strides, pads_begin, pads_end, kernel, exclude_pad, rounding_mode, auto_pad); - NodeBuilder builder(avg_pool); + 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()); diff --git a/src/core/tests/visitors/op/batch_norm.cpp b/src/core/tests/visitors/op/batch_norm.cpp index 688beaa1005743..12a75de8201e73 100644 --- a/src/core/tests/visitors/op/batch_norm.cpp +++ b/src/core/tests/visitors/op/batch_norm.cpp @@ -16,34 +16,44 @@ using namespace ngraph; using ngraph::test::NodeBuilder; using ngraph::test::ValueMap; -template -class BatchNormAttrTest : public ::testing::Test {}; - -TYPED_TEST_SUITE_P(BatchNormAttrTest); - -TYPED_TEST_P(BatchNormAttrTest, batch_norm_inference_op) { +TEST(attributes, batch_norm_inference_op_v5) { PartialShape in_shape{1, 10}; PartialShape ch_shape{in_shape[1]}; element::Type et = element::f32; double epsilon = 0.001; - NodeBuilder::get_ops().register_factory(); + 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); + auto batch_norm = make_shared(data_batch, gamma, beta, mean, var, epsilon); const auto expected_attr_count = 1; - NodeBuilder builder(batch_norm); + 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()); + auto g_batch_norm = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_batch_norm->get_eps_value(), batch_norm->get_eps_value()); } -REGISTER_TYPED_TEST_SUITE_P(BatchNormAttrTest, batch_norm_inference_op); +TEST(attributes, batch_norm_inference_op_v0) { + PartialShape in_shape{1, 10}; + PartialShape ch_shape{in_shape[1]}; + element::Type et = element::f32; + double epsilon = 0.001; -using Types = ::testing::Types; + 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); -INSTANTIATE_TYPED_TEST_SUITE_P(attributes, BatchNormAttrTest, Types); + const auto expected_attr_count = 1; + 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 0948aa9659d166..2b5aee787a80e1 100644 --- a/src/core/tests/visitors/op/batch_to_space.cpp +++ b/src/core/tests/visitors/op/batch_to_space.cpp @@ -19,7 +19,7 @@ TEST(attributes, batch_to_space_op) { 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); + 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 8c860cd4383972..de9511134c367c 100644 --- a/src/core/tests/visitors/op/binary_convolution.cpp +++ b/src/core/tests/visitors/op/binary_convolution.cpp @@ -40,7 +40,7 @@ TEST(attributes, bin_convolution) { mode, pad_value, auto_pad); - NodeBuilder builder(conv); + NodeBuilder builder(conv, {data_batch, filters}); auto g_convolution = ov::as_type_ptr(builder.create()); // attribute count diff --git a/src/core/tests/visitors/op/binary_ops.hpp b/src/core/tests/visitors/op/binary_ops.hpp index 5cf2a00c2942c5..b705005da330ca 100644 --- a/src/core/tests/visitors/op/binary_ops.hpp +++ b/src/core/tests/visitors/op/binary_ops.hpp @@ -49,7 +49,7 @@ TYPED_TEST_P(BinaryOperatorVisitor, Auto_Broadcast) auto auto_broadcast = ngraph::op::AutoBroadcastType::NUMPY; const auto op_func = std::make_shared(A, B, auto_broadcast); - ngraph::test::NodeBuilder builder(op_func); + ngraph::test::NodeBuilder builder(op_func, {A, B}); const auto g_op_func = ngraph::as_type_ptr(builder.create()); const auto expected_attr_count = 1; @@ -57,4 +57,24 @@ TYPED_TEST_P(BinaryOperatorVisitor, Auto_Broadcast) EXPECT_EQ(op_func->get_autob(), g_op_func->get_autob()); } -REGISTER_TYPED_TEST_SUITE_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; + + 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}); + + 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()); + + const auto expected_attr_count = 1; + EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); + EXPECT_EQ(op_func->get_autob(), g_op_func->get_autob()); +} + +REGISTER_TYPED_TEST_SUITE_P(BinaryOperatorVisitor, Auto_Broadcast, No_Broadcast); diff --git a/src/core/tests/visitors/op/broadcast.cpp b/src/core/tests/visitors/op/broadcast.cpp index 14f9f1a1802a85..7c3647ae3d6231 100644 --- a/src/core/tests/visitors/op/broadcast.cpp +++ b/src/core/tests/visitors/op/broadcast.cpp @@ -7,8 +7,6 @@ #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 "util/visitor.hpp" using namespace std; @@ -16,6 +14,20 @@ using namespace ngraph; using ngraph::test::NodeBuilder; using ngraph::test::ValueMap; +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}); + 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()); + + 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}); @@ -23,7 +35,21 @@ TEST(attributes, broadcast_v3) { const auto broadcast_spec = op::BroadcastType::BIDIRECTIONAL; const auto broadcast_v3 = make_shared(arg, shape, broadcast_spec); - NodeBuilder builder(broadcast_v3); + NodeBuilder builder(broadcast_v3, {arg, shape}); + 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}); + 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()); 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 bfe6b212a562f9..f10796dac82798 100644 --- a/src/core/tests/visitors/op/bucketize.cpp +++ b/src/core/tests/visitors/op/bucketize.cpp @@ -21,7 +21,7 @@ TEST(attributes, bucketize_v3_op_default_attributes) { 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); + NodeBuilder builder(bucketize, {data, buckets}); auto g_bucketize = ov::as_type_ptr(builder.create()); @@ -37,7 +37,7 @@ TEST(attributes, bucketize_v3_op_custom_attributes) { bool with_right_bound = false; auto bucketize = make_shared(data, buckets, output_type, with_right_bound); - NodeBuilder builder(bucketize); + NodeBuilder builder(bucketize, {data, buckets}); auto g_bucketize = ov::as_type_ptr(builder.create()); diff --git a/src/core/tests/visitors/op/clamp.cpp b/src/core/tests/visitors/op/clamp.cpp index d13dcb69db658f..3e7434b2aefb25 100644 --- a/src/core/tests/visitors/op/clamp.cpp +++ b/src/core/tests/visitors/op/clamp.cpp @@ -21,7 +21,7 @@ TEST(attributes, clamp_op) { double max = 5.6; const auto clamp = make_shared(data, min, max); - NodeBuilder builder(clamp); + NodeBuilder builder(clamp, {data}); auto g_clamp = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 2; diff --git a/src/core/tests/visitors/op/concat.cpp b/src/core/tests/visitors/op/concat.cpp new file mode 100644 index 00000000000000..31e3ff54ac2c59 --- /dev/null +++ b/src/core/tests/visitors/op/concat.cpp @@ -0,0 +1,28 @@ +// Copyright (C) 2018-2022 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "gtest/gtest.h" +#include "ngraph/ngraph.hpp" +#include "ngraph/op/util/attr_types.hpp" +#include "ngraph/opsets/opset1.hpp" +#include "util/visitor.hpp" + +using namespace std; +using namespace ngraph; +using ngraph::test::NodeBuilder; +using ngraph::test::ValueMap; + +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}); + int64_t axis = 2; + + 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()); + + EXPECT_EQ(g_concat->get_axis(), concat->get_axis()); +} diff --git a/src/core/tests/visitors/op/convert.cpp b/src/core/tests/visitors/op/convert.cpp index 4db6df7f5677cb..366da8fbae2d3a 100644 --- a/src/core/tests/visitors/op/convert.cpp +++ b/src/core/tests/visitors/op/convert.cpp @@ -18,7 +18,7 @@ TEST(attributes, convert_op_v0) { const element::Type destination_type = element::Type_t::i32; const auto convert = std::make_shared(data, destination_type); - NodeBuilder builder(convert); + NodeBuilder builder(convert, {data}); // attribute count const auto expected_attr_count = 1; diff --git a/src/core/tests/visitors/op/convert_color_i420.cpp b/src/core/tests/visitors/op/convert_color_i420.cpp index fa04e29e6bc421..08c05ec1d48906 100644 --- a/src/core/tests/visitors/op/convert_color_i420.cpp +++ b/src/core/tests/visitors/op/convert_color_i420.cpp @@ -17,7 +17,9 @@ TEST(attributes, convert_color_i420_rgb) { NodeBuilder::get_ops().register_factory(); auto data = make_shared(element::u8, Shape{3, 720, 640, 1}); auto convert_color = make_shared(data); - NodeBuilder builder(convert_color); + NodeBuilder builder(convert_color, {data}); + EXPECT_NO_THROW(auto g_concat = ov::as_type_ptr(builder.create())); + const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } @@ -26,7 +28,9 @@ TEST(attributes, convert_color_i420_bgr) { NodeBuilder::get_ops().register_factory(); auto data = make_shared(element::u8, Shape{3, 720, 640, 1}); auto convert_color = make_shared(data); - NodeBuilder builder(convert_color); + NodeBuilder builder(convert_color, {data}); + EXPECT_NO_THROW(auto g_concat = ov::as_type_ptr(builder.create())); + const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } @@ -37,7 +41,9 @@ TEST(attributes, convert_color_i420_rgb_3planes) { auto data2 = make_shared(element::u8, Shape{3, 240, 320, 1}); auto data3 = make_shared(element::u8, Shape{3, 240, 320, 1}); auto convert_color = make_shared(data1, data2, data3); - NodeBuilder builder(convert_color); + NodeBuilder builder(convert_color, {data1, data2, data3}); + EXPECT_NO_THROW(auto g_concat = ov::as_type_ptr(builder.create())); + const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } @@ -48,7 +54,9 @@ TEST(attributes, convert_color_i420_bgr_3planes) { auto data2 = make_shared(element::u8, Shape{3, 240, 320, 1}); auto data3 = make_shared(element::u8, Shape{3, 240, 320, 1}); auto convert_color = make_shared(data1, data2, data3); - NodeBuilder builder(convert_color); + NodeBuilder builder(convert_color, {data1, data2, data3}); + EXPECT_NO_THROW(auto g_concat = 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/convert_color_nv12.cpp b/src/core/tests/visitors/op/convert_color_nv12.cpp index ddb8457132799e..fd15ed787aa055 100644 --- a/src/core/tests/visitors/op/convert_color_nv12.cpp +++ b/src/core/tests/visitors/op/convert_color_nv12.cpp @@ -17,7 +17,9 @@ TEST(attributes, convert_color_nv12_rgb) { NodeBuilder::get_ops().register_factory(); auto data = make_shared(element::u8, Shape{3, 720, 640, 1}); auto convert_color = make_shared(data); - NodeBuilder builder(convert_color); + NodeBuilder builder(convert_color, {data}); + EXPECT_NO_THROW(auto g_concat = ov::as_type_ptr(builder.create())); + const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } @@ -26,7 +28,9 @@ TEST(attributes, convert_color_nv12_bgr) { NodeBuilder::get_ops().register_factory(); auto data = make_shared(element::u8, Shape{3, 720, 640, 1}); auto convert_color = make_shared(data); - NodeBuilder builder(convert_color); + NodeBuilder builder(convert_color, {data}); + EXPECT_NO_THROW(auto g_concat = ov::as_type_ptr(builder.create())); + const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } @@ -36,7 +40,9 @@ TEST(attributes, convert_color_nv12_rgb_2planes) { auto data1 = make_shared(element::u8, Shape{3, 480, 640, 1}); auto data2 = make_shared(element::u8, Shape{3, 240, 320, 2}); auto convert_color = make_shared(data1, data2); - NodeBuilder builder(convert_color); + NodeBuilder builder(convert_color, {data1, data2}); + EXPECT_NO_THROW(auto g_concat = ov::as_type_ptr(builder.create())); + const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } @@ -46,7 +52,9 @@ TEST(attributes, convert_color_nv12_bgr_2planes) { auto data1 = make_shared(element::u8, Shape{3, 480, 640, 1}); auto data2 = make_shared(element::u8, Shape{3, 240, 320, 2}); auto convert_color = make_shared(data1, data2); - NodeBuilder builder(convert_color); + NodeBuilder builder(convert_color, {data1, data2}); + EXPECT_NO_THROW(auto g_concat = 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 54c47b0cdc8ac4..ff3faede15b379 100644 --- a/src/core/tests/visitors/op/convolution.cpp +++ b/src/core/tests/visitors/op/convolution.cpp @@ -27,7 +27,7 @@ TEST(attributes, convolution) { auto convolution = make_shared(data, filters, strides, pads_begin, pads_end, dilations, op::PadType::VALID); - NodeBuilder builder(convolution); + NodeBuilder builder(convolution, {data, filters}); auto g_convolution = ov::as_type_ptr(builder.create()); // attribute count @@ -40,3 +40,27 @@ TEST(attributes, convolution) { EXPECT_EQ(g_convolution->get_dilations(), convolution->get_dilations()); EXPECT_EQ(g_convolution->get_auto_pad(), convolution->get_auto_pad()); } + +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 strides = Strides{4, 4}; + auto pads_begin = CoordinateDiff{0, 0}; + auto pads_end = CoordinateDiff{0, 0}; + auto dilations = Strides{1, 1}; + 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()); + + // attribute count + const auto expected_attr_count = 5; + EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); + + EXPECT_EQ(g_convolution->get_strides(), convolution->get_strides()); + EXPECT_EQ(g_convolution->get_pads_begin(), convolution->get_pads_begin()); + EXPECT_EQ(g_convolution->get_pads_end(), convolution->get_pads_end()); + EXPECT_EQ(g_convolution->get_dilations(), convolution->get_dilations()); + EXPECT_EQ(g_convolution->get_auto_pad(), convolution->get_auto_pad()); +} \ No newline at end of file diff --git a/src/core/tests/visitors/op/convolution_backprop.cpp b/src/core/tests/visitors/op/convolution_backprop.cpp index 42f06764e4f232..d0f43580946363 100644 --- a/src/core/tests/visitors/op/convolution_backprop.cpp +++ b/src/core/tests/visitors/op/convolution_backprop.cpp @@ -31,7 +31,7 @@ TEST(attributes, convolution_backprop_op) { pads_end, dilations, op::PadType::VALID); - NodeBuilder builder(convolution); + NodeBuilder builder(convolution, {data, filters}); auto g_convolution = ov::as_type_ptr(builder.create()); // attribute count @@ -74,7 +74,7 @@ TEST(attributes, convolution_backprop_output_shape_output_padding) { dilations, padType, output_padding); - NodeBuilder builder(convolution); + NodeBuilder builder(convolution, {data, filter}); const auto g_convolution = ov::as_type_ptr(builder.create()); // attribute count diff --git a/src/core/tests/visitors/op/ctc_greedy_decoder.cpp b/src/core/tests/visitors/op/ctc_greedy_decoder.cpp index 7bcc81764331f3..84971a80713464 100644 --- a/src/core/tests/visitors/op/ctc_greedy_decoder.cpp +++ b/src/core/tests/visitors/op/ctc_greedy_decoder.cpp @@ -19,7 +19,7 @@ TEST(attributes, ctc_greedy_decoder_op) { auto masks = make_shared(element::i32, Shape{3, 1}); auto decoder = make_shared(data, masks, m_ctc_merge_repeated); - NodeBuilder builder(decoder); + NodeBuilder builder(decoder, {data, masks}); 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 aaf04b2a392707..b6e05305f4f21a 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 @@ -21,7 +21,7 @@ TEST(attributes, ctc_greedy_decoder_seq_len_op) { auto blank_index = op::Constant::create(element::i32, Shape{}, {2}); auto decoder = make_shared(data, seq_len, blank_index, merge_repeated); - NodeBuilder builder(decoder); + NodeBuilder builder(decoder, {data, seq_len, blank_index}); 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 e496eb4572e449..6a09c4cdc25eff 100644 --- a/src/core/tests/visitors/op/ctc_loss.cpp +++ b/src/core/tests/visitors/op/ctc_loss.cpp @@ -26,7 +26,7 @@ TEST(attributes, ctc_loss) { auto blank_index = make_shared(element::i32, Shape{}); auto ctc_loss = make_shared(logits, logit_length, labels, label_length, blank_index); - NodeBuilder builder(ctc_loss); + NodeBuilder builder(ctc_loss, {logits, logit_length, labels, label_length, blank_index}); auto g_ctc_loss = as_type_ptr(builder.create()); // attribute count diff --git a/src/core/tests/visitors/op/cum_sum.cpp b/src/core/tests/visitors/op/cum_sum.cpp index 296e8bcb8c73ce..9675b87105a385 100644 --- a/src/core/tests/visitors/op/cum_sum.cpp +++ b/src/core/tests/visitors/op/cum_sum.cpp @@ -19,7 +19,7 @@ TEST(attributes, cum_sum_op_default_attributes_no_axis_input) { auto A = make_shared(element::f32, shape); auto cs = make_shared(A); - NodeBuilder builder(cs); + NodeBuilder builder(cs, {A}); auto g_cs = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 2; @@ -37,7 +37,7 @@ TEST(attributes, cum_sum_op_default_attributes) { auto axis = make_shared(element::i32, Shape{1}); auto cs = make_shared(A, axis); - NodeBuilder builder(cs); + NodeBuilder builder(cs, {A, axis}); auto g_cs = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 2; @@ -57,7 +57,7 @@ TEST(attributes, cum_sum_op_custom_attributes) { bool reverse = true; auto cs = make_shared(A, axis, exclusive, reverse); - NodeBuilder builder(cs); + NodeBuilder builder(cs, {A, axis}); auto g_cs = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 2; diff --git a/src/core/tests/visitors/op/deformable_convolution.cpp b/src/core/tests/visitors/op/deformable_convolution.cpp index 8aeefdafece991..03ecb0c0a22866 100644 --- a/src/core/tests/visitors/op/deformable_convolution.cpp +++ b/src/core/tests/visitors/op/deformable_convolution.cpp @@ -26,7 +26,7 @@ TEST(attributes, deformable_convolution_default_attributes) { auto dilations = Strides{1, 1}; auto convolution = make_shared(data, offsets, filters, strides, pads_begin, pads_end, dilations); - NodeBuilder builder(convolution); + NodeBuilder builder(convolution, {data, offsets, filters}); auto g_convolution = ov::as_type_ptr(builder.create()); // attribute count @@ -62,7 +62,7 @@ TEST(attributes, deformable_convolution_attributes) { op::PadType::SAME_LOWER, 2, 2); - NodeBuilder builder(convolution); + NodeBuilder builder(convolution, {data, offsets, filters}); auto g_convolution = ov::as_type_ptr(builder.create()); // attribute count @@ -90,7 +90,7 @@ TEST(attributes, deformable_convolution_v8_default_attributes) { auto dilations = Strides{1, 1}; auto convolution = make_shared(data, offsets, filters, strides, pads_begin, pads_end, dilations); - NodeBuilder builder(convolution); + NodeBuilder builder(convolution, {data, offsets, filters}); auto g_convolution = ov::as_type_ptr(builder.create()); // attribute count @@ -130,7 +130,7 @@ TEST(attributes, deformable_convolution_v8_attributes) { 2, 2, true); - NodeBuilder builder(convolution); + NodeBuilder builder(convolution, {data, offsets, filters, mask}); auto g_convolution = ov::as_type_ptr(builder.create()); // attribute count @@ -145,4 +145,4 @@ TEST(attributes, deformable_convolution_v8_attributes) { EXPECT_EQ(g_convolution->get_group(), convolution->get_group()); EXPECT_EQ(g_convolution->get_deformable_group(), convolution->get_deformable_group()); EXPECT_EQ(g_convolution->get_bilinear_interpolation_pad(), convolution->get_bilinear_interpolation_pad()); -} \ No newline at end of file +} diff --git a/src/core/tests/visitors/op/deformable_psroi_pooling.cpp b/src/core/tests/visitors/op/deformable_psroi_pooling.cpp index 8c30289c9bc875..b9b6189c07bfe8 100644 --- a/src/core/tests/visitors/op/deformable_psroi_pooling.cpp +++ b/src/core/tests/visitors/op/deformable_psroi_pooling.cpp @@ -37,7 +37,7 @@ TEST(attributes, deformable_psroi_pooling_op) { spatial_bins_y, trans_std, part_size); - NodeBuilder builder(op); + NodeBuilder builder(op, {input, coords}); auto g_op = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_op->get_output_dim(), op->get_output_dim()); diff --git a/src/core/tests/visitors/op/depth_to_space.cpp b/src/core/tests/visitors/op/depth_to_space.cpp index 5a020fd674d5be..0f9eaa821f7f05 100644 --- a/src/core/tests/visitors/op/depth_to_space.cpp +++ b/src/core/tests/visitors/op/depth_to_space.cpp @@ -23,7 +23,7 @@ TEST(attributes, depth_to_space) { const auto mode = "blocks_first"; const auto dts = std::make_shared(data, mode, block_size); - NodeBuilder builder(dts); + NodeBuilder builder(dts, {data}); auto g_dts = ov::as_type_ptr(builder.create()); // attribute count diff --git a/src/core/tests/visitors/op/detection_output.cpp b/src/core/tests/visitors/op/detection_output.cpp index 312595778721c1..9d45e68093b1eb 100644 --- a/src/core/tests/visitors/op/detection_output.cpp +++ b/src/core/tests/visitors/op/detection_output.cpp @@ -66,7 +66,7 @@ TEST(attributes, detection_output_op) { auto detection_output = make_shared(box_logits, class_preds, proposals, aux_class_preds, aux_box_pred, attrs); - NodeBuilder builder(detection_output); + 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()); const auto do_attrs = detection_output->get_attrs(); @@ -90,7 +90,7 @@ TEST(attributes, detection_output_v8) { auto detection_output = make_shared(box_logits, class_preds, proposals, aux_class_preds, aux_box_pred, attrs); - NodeBuilder builder(detection_output); + 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()); const auto do_attrs = detection_output->get_attrs(); diff --git a/src/core/tests/visitors/op/dft.cpp b/src/core/tests/visitors/op/dft.cpp index 0df3ab460c5b1e..41de05c460ab6d 100644 --- a/src/core/tests/visitors/op/dft.cpp +++ b/src/core/tests/visitors/op/dft.cpp @@ -17,8 +17,9 @@ TEST(attributes, dft_op) { auto axes = op::v0::Constant::create(element::i64, Shape{1}, {2}); auto dft = make_shared(data, axes); - NodeBuilder builder(dft); + NodeBuilder builder(dft, {data, axes}); const auto expected_attr_count = 0; + EXPECT_NO_THROW(auto g_dft = ov::as_type_ptr(builder.create())); EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } @@ -30,8 +31,9 @@ TEST(attributes, dft_op_signal) { auto axes = op::v0::Constant::create(element::i64, Shape{1}, {2}); auto dft = make_shared(data, axes, signal); - NodeBuilder builder(dft); - const auto expected_attr_count = 0; + NodeBuilder builder(dft, {data, axes, signal}); + EXPECT_NO_THROW(auto g_dft = ov::as_type_ptr(builder.create())); + const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } \ No newline at end of file diff --git a/src/core/tests/visitors/op/divide.cpp b/src/core/tests/visitors/op/divide.cpp index 3c4b9c3bfec2e0..a81e0b0d90f83f 100644 --- a/src/core/tests/visitors/op/divide.cpp +++ b/src/core/tests/visitors/op/divide.cpp @@ -31,7 +31,7 @@ TEST(attributes, divide) { const op::AutoBroadcastSpec& auto_broadcast = op::AutoBroadcastSpec(op::AutoBroadcastType::NUMPY); const auto divide = make_shared(in1, in2, pythondiv, auto_broadcast); - NodeBuilder builder(divide); + NodeBuilder builder(divide, {in1, in2}); auto g_divide = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 2; diff --git a/src/core/tests/visitors/op/einsum.cpp b/src/core/tests/visitors/op/einsum.cpp index 69ba0b75ffdda1..3ac948183c8b0f 100644 --- a/src/core/tests/visitors/op/einsum.cpp +++ b/src/core/tests/visitors/op/einsum.cpp @@ -19,7 +19,7 @@ TEST(attributes, einsum_v7_op) { auto input2 = make_shared(element::i32, Shape{3, 4}); std::string equation = "ab,bc->ac"; auto einsum = make_shared(OutputVector{input1, input2}, equation); - NodeBuilder builder(einsum); + NodeBuilder builder(einsum, {input1, input2}); 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 00d6a912b17e82..31b5d5f3df9267 100644 --- a/src/core/tests/visitors/op/elu.cpp +++ b/src/core/tests/visitors/op/elu.cpp @@ -23,7 +23,7 @@ TEST(attributes, elu_op) { double alpha = 0.1; const auto elu = make_shared(data, alpha); - NodeBuilder builder(elu); + NodeBuilder builder(elu, {data}); 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 5f905ad67b1311..c74a9483418b5f 100644 --- a/src/core/tests/visitors/op/embedding_segments_sum.cpp +++ b/src/core/tests/visitors/op/embedding_segments_sum.cpp @@ -29,7 +29,8 @@ TEST(visitor_without_attribute, embedding_segments_sum_op) { num_segments, default_index, per_sample_weights); - NodeBuilder builder(ess); + 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())); 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 aea48f5749400d..343717af285d46 100644 --- a/src/core/tests/visitors/op/embeddingbag_offsetssum.cpp +++ b/src/core/tests/visitors/op/embeddingbag_offsetssum.cpp @@ -24,7 +24,8 @@ TEST(visitor_without_attribute, embedding_bag_offsets_sum_op) { auto ebos = make_shared(emb_table, indices, offsets, default_index, per_sample_weights); - NodeBuilder builder(ebos); + NodeBuilder builder(ebos, {emb_table, indices, offsets, default_index, per_sample_weights}); + 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 9a1fd956d5e4c8..0b1fddb8372ef9 100644 --- a/src/core/tests/visitors/op/embeddingbag_packedsum.cpp +++ b/src/core/tests/visitors/op/embeddingbag_packedsum.cpp @@ -19,8 +19,9 @@ TEST(visitor_without_attribute, embedding_bag_packed_sum_op) { auto indices = make_shared(element::i64, Shape{3, 4}); auto per_sample_weights = make_shared(element::f32, Shape{3, 4}); - auto ebos = make_shared(emb_table, indices, per_sample_weights); - NodeBuilder builder(ebos); + 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())); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); 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 1150a998c5a7ea..67a7ce3fcedb1d 100644 --- a/src/core/tests/visitors/op/experimental_detectron_detection_output.cpp +++ b/src/core/tests/visitors/op/experimental_detectron_detection_output.cpp @@ -38,7 +38,7 @@ TEST(attributes, detectron_detection_output) { auto detection = std::make_shared(rois, deltas, scores, im_info, attrs); - NodeBuilder builder(detection); + NodeBuilder builder(detection, {rois, deltas, scores, im_info}); auto g_detection = ov::as_type_ptr(builder.create()); 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 1d95c8f1f88d82..5f44dcdaec0b44 100644 --- a/src/core/tests/visitors/op/experimental_detectron_generate_proposals.cpp +++ b/src/core/tests/visitors/op/experimental_detectron_generate_proposals.cpp @@ -34,7 +34,7 @@ TEST(attributes, detectron_proposals) { auto proposals = std::make_shared(im_info, anchors, deltas, scores, attrs); - NodeBuilder builder(proposals); + NodeBuilder builder(proposals, {im_info, anchors, deltas, scores}); auto g_proposals = ov::as_type_ptr(builder.create()); 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 2ce0ac4d9c639f..38751f34e3bb60 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 @@ -34,7 +34,7 @@ TEST(attributes, detectron_prior_grid_generator) { auto proposals = std::make_shared(priors, feature_map, im_data, attrs); - NodeBuilder builder(proposals); + NodeBuilder builder(proposals, {priors, feature_map, im_data}); auto g_proposals = ov::as_type_ptr(builder.create()); diff --git a/src/core/tests/visitors/op/experimental_detectron_topkrois.cpp b/src/core/tests/visitors/op/experimental_detectron_topkrois.cpp index 6073bcbe47ef7d..5c362a1617231b 100644 --- a/src/core/tests/visitors/op/experimental_detectron_topkrois.cpp +++ b/src/core/tests/visitors/op/experimental_detectron_topkrois.cpp @@ -20,7 +20,7 @@ TEST(attributes, experimental_detectron_topkrois_op) { auto input_probs = std::make_shared(element::f32, Shape{2}); auto topkrois = std::make_shared(input_rois, input_probs, num_rois); - NodeBuilder builder(topkrois); + NodeBuilder builder(topkrois, {input_rois, input_probs}); 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 14b4c9b54111d4..ad447cb439cbd8 100644 --- a/src/core/tests/visitors/op/extractimagepatches.cpp +++ b/src/core/tests/visitors/op/extractimagepatches.cpp @@ -26,7 +26,7 @@ TEST(attributes, extractimagepatches_op) { auto padtype_padding = ngraph::op::PadType::VALID; auto extractimagepatches = make_shared(data, sizes, strides, rates, padtype_padding); - NodeBuilder builder(extractimagepatches); + NodeBuilder builder(extractimagepatches, {data}); auto g_extractimagepatches = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 4; diff --git a/src/core/tests/visitors/op/eye.cpp b/src/core/tests/visitors/op/eye.cpp index dfe7e135fad892..05e14f328740dd 100644 --- a/src/core/tests/visitors/op/eye.cpp +++ b/src/core/tests/visitors/op/eye.cpp @@ -20,7 +20,7 @@ TEST(attributes, eye_op) { auto diagonal_index = make_shared(element::i32, Shape{}, 0); const auto eye = make_shared(num_rows, num_columns, diagonal_index, element::Type_t::u8); - NodeBuilder builder(eye); + NodeBuilder builder(eye, {num_rows, num_columns, diagonal_index}); auto g_eye = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 1; @@ -36,7 +36,7 @@ TEST(attributes, eye_batch_shape_op) { auto batch_shape = make_shared(element::i32, Shape{3}, std::vector{1, 2, 3}); const auto eye = make_shared(num_rows, num_columns, diagonal_index, batch_shape, element::Type_t::i32); - NodeBuilder builder(eye); + NodeBuilder builder(eye, {num_rows, num_columns, diagonal_index, batch_shape}); auto g_eye = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 1; diff --git a/src/core/tests/visitors/op/fake_quantize.cpp b/src/core/tests/visitors/op/fake_quantize.cpp index 248b8b625967ef..9bba16d0cc248d 100644 --- a/src/core/tests/visitors/op/fake_quantize.cpp +++ b/src/core/tests/visitors/op/fake_quantize.cpp @@ -29,7 +29,7 @@ TEST(attributes, fake_quantize_op) { const auto fake_quantize = make_shared(data, input_low, input_high, output_low, output_high, levels, auto_broadcast); - NodeBuilder builder(fake_quantize); + NodeBuilder builder(fake_quantize, {data, input_low, input_high, output_low, output_high}); auto g_fake_quantize = ov::as_type_ptr(builder.create()); // attribute count diff --git a/src/core/tests/visitors/op/gather.cpp b/src/core/tests/visitors/op/gather.cpp index 699d18bd6c54a3..efe4a48a6b7c24 100644 --- a/src/core/tests/visitors/op/gather.cpp +++ b/src/core/tests/visitors/op/gather.cpp @@ -14,6 +14,19 @@ using namespace ngraph; using ngraph::test::NodeBuilder; using ngraph::test::ValueMap; +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); + + auto gather = make_shared(data, indices, axis); + NodeBuilder builder(gather, {data, indices, axis}); + 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}); @@ -22,7 +35,7 @@ TEST(attributes, gather_v7_op) { int64_t batch_dims = 1; auto gather = make_shared(data, indices, axis, batch_dims); - NodeBuilder builder(gather); + NodeBuilder builder(gather, {data, indices, axis}); auto g_gather = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_gather->get_batch_dims(), gather->get_batch_dims()); @@ -36,7 +49,7 @@ TEST(attributes, gather_v8_op) { int64_t batch_dims = 1; auto gather = make_shared(data, indices, axis, batch_dims); - NodeBuilder builder(gather); + NodeBuilder builder(gather, {data, indices, axis}); 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 79e16e46dca906..64ef22c9c93a05 100644 --- a/src/core/tests/visitors/op/gather_elements.cpp +++ b/src/core/tests/visitors/op/gather_elements.cpp @@ -20,7 +20,7 @@ TEST(attributes, gather_elements_op) { int64_t axis = 0; auto gather_el = make_shared(arg1, arg2, axis); - NodeBuilder builder(gather_el); + NodeBuilder builder(gather_el, {arg1, arg2}); 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 1384d00805022c..a26beb3012927f 100644 --- a/src/core/tests/visitors/op/gather_nd.cpp +++ b/src/core/tests/visitors/op/gather_nd.cpp @@ -21,7 +21,7 @@ TEST(attributes, gather_nd_v5_op) { auto I = make_shared(element::i32, Shape{2, 1}); auto G = make_shared(P, I, batch_dims); - NodeBuilder builder(G); + NodeBuilder builder(G, {P, I}); auto g_G = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_G->get_batch_dims(), G->get_batch_dims()); @@ -34,7 +34,7 @@ TEST(attributes, gather_nd_v8_op) { auto I = make_shared(element::i32, Shape{2, 1}); auto G = make_shared(P, I, batch_dims); - NodeBuilder builder(G); + NodeBuilder builder(G, {P, I}); 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 94b7ee08f23cf9..c3fa5a85e6c51b 100644 --- a/src/core/tests/visitors/op/gather_tree.cpp +++ b/src/core/tests/visitors/op/gather_tree.cpp @@ -21,7 +21,8 @@ TEST(attributes, gather_tree_op) { auto end_token = std::make_shared(element::f32, Shape{}); auto gather_tree = std::make_shared(step_ids, parent_idx, max_seq_len, end_token); - NodeBuilder builder(gather_tree); + 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())); 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 de901f679e0226..537f4af02606df 100644 --- a/src/core/tests/visitors/op/gelu.cpp +++ b/src/core/tests/visitors/op/gelu.cpp @@ -5,6 +5,7 @@ #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 "util/visitor.hpp" @@ -12,13 +13,45 @@ using namespace std; using namespace ngraph; using ngraph::test::NodeBuilder; -TEST(attributes, gelu_op) { +TEST(attributes, gelu_op_erf) { 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); - NodeBuilder builder(gelu); + NodeBuilder builder(gelu, {data_input}); 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}); + const auto approximation_mode = op::GeluApproximationMode::TANH; + const auto gelu = make_shared(data_input, approximation_mode); + NodeBuilder builder(gelu, {data_input}); + 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 builder(gelu, {data_input}); + 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 builder(gelu, {data_input}); + const auto expected_attr_count = 0; + EXPECT_NO_THROW(auto g_gelu = ov::as_type_ptr(builder.create())); + + EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); +} diff --git a/src/core/tests/visitors/op/generate_proposals.cpp b/src/core/tests/visitors/op/generate_proposals.cpp index e4c65b9cad0fdf..9ff3f28302c8c9 100644 --- a/src/core/tests/visitors/op/generate_proposals.cpp +++ b/src/core/tests/visitors/op/generate_proposals.cpp @@ -36,7 +36,7 @@ TEST(attributes, generate_proposals) { auto proposals = std::make_shared(im_info, anchors, deltas, scores, attrs); - NodeBuilder builder(proposals); + NodeBuilder builder(proposals, {im_info, anchors, deltas, scores}); auto g_proposals = ov::as_type_ptr(builder.create()); diff --git a/src/core/tests/visitors/op/grid_sample.cpp b/src/core/tests/visitors/op/grid_sample.cpp index ab9576ae27d6e6..c879cccde1d360 100644 --- a/src/core/tests/visitors/op/grid_sample.cpp +++ b/src/core/tests/visitors/op/grid_sample.cpp @@ -18,7 +18,8 @@ TEST(attributes, grid_sample_defaults) { const auto grid = make_shared(element::f32, Shape{1, 5, 5, 2}); const auto op = make_shared(data, grid, opset9::GridSample::Attributes{}); - NodeBuilder builder(op); + NodeBuilder builder(op, {data, grid}); + 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 dd384f74a0d743..a9d11e92d1c11a 100644 --- a/src/core/tests/visitors/op/grn.cpp +++ b/src/core/tests/visitors/op/grn.cpp @@ -19,7 +19,7 @@ TEST(attributes, grn_op) { float bias = 1.25f; auto grn = make_shared(data, bias); - NodeBuilder builder(grn); + NodeBuilder builder(grn, {data}); auto g_grn = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 1; diff --git a/src/core/tests/visitors/op/group_conv.cpp b/src/core/tests/visitors/op/group_conv.cpp index 297f82d76b6a63..40461df577ade8 100644 --- a/src/core/tests/visitors/op/group_conv.cpp +++ b/src/core/tests/visitors/op/group_conv.cpp @@ -31,7 +31,7 @@ TEST(attributes, group_conv_op) { pads_end, dilations, op::PadType::VALID); - NodeBuilder builder(group_conv); + NodeBuilder builder(group_conv, {data, filters}); 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()); @@ -62,7 +62,7 @@ TEST(attributes, group_conv_backprop_data_op) { dilations, auto_pad, output_padding); - NodeBuilder builder(gcbd); + NodeBuilder builder(gcbd, {data, filter}); const auto g_gcbd = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_gcbd->get_strides(), gcbd->get_strides()); diff --git a/src/core/tests/visitors/op/gru_cell.cpp b/src/core/tests/visitors/op/gru_cell.cpp index 6beb07edb34fca..f0d12bc1ffafd3 100644 --- a/src/core/tests/visitors/op/gru_cell.cpp +++ b/src/core/tests/visitors/op/gru_cell.cpp @@ -39,7 +39,7 @@ TEST(attributes, gru_cell_op) { activations_beta, clip, false); - NodeBuilder builder(gru_cell); + NodeBuilder builder(gru_cell, {X, initial_hidden_state, W, R}); auto g_gru_cell = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_gru_cell->get_hidden_size(), gru_cell->get_hidden_size()); diff --git a/src/core/tests/visitors/op/gru_sequence.cpp b/src/core/tests/visitors/op/gru_sequence.cpp index 96ff5d7c6a05b2..492b636a08a042 100644 --- a/src/core/tests/visitors/op/gru_sequence.cpp +++ b/src/core/tests/visitors/op/gru_sequence.cpp @@ -53,7 +53,7 @@ TEST(attributes, gru_sequence_op) { activations_alpha, activations_beta, clip_threshold); - NodeBuilder builder(gru_sequence); + NodeBuilder builder(gru_sequence, {X, initial_hidden_state, sequence_lengths, W, R, B}); auto g_gru_sequence = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_gru_sequence->get_hidden_size(), gru_sequence->get_hidden_size()); diff --git a/src/core/tests/visitors/op/hard_sigmoid.cpp b/src/core/tests/visitors/op/hard_sigmoid.cpp index 1ec299e7a0117a..4f66ffa6bde4e5 100644 --- a/src/core/tests/visitors/op/hard_sigmoid.cpp +++ b/src/core/tests/visitors/op/hard_sigmoid.cpp @@ -19,7 +19,8 @@ TEST(attributes, hardsigmoid_op) { const auto beta = make_shared(element::f32, Shape{}); const auto hardsigmoid = make_shared(data, alpha, beta); - NodeBuilder builder(hardsigmoid); + NodeBuilder builder(hardsigmoid, {data, alpha, beta}); + 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/idft.cpp b/src/core/tests/visitors/op/idft.cpp index fe336d6cd6a6b6..15f05fb49238ed 100644 --- a/src/core/tests/visitors/op/idft.cpp +++ b/src/core/tests/visitors/op/idft.cpp @@ -17,9 +17,10 @@ TEST(attributes, idft_op) { auto axes = op::Constant::create(element::Type_t::i64, Shape{1}, {2}); auto idft = make_shared(data, axes); - NodeBuilder builder(idft); - const auto expected_attr_count = 0; + NodeBuilder builder(idft, {data, axes}); + EXPECT_NO_THROW(auto g_idft = ov::as_type_ptr(builder.create())); + const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } @@ -30,8 +31,9 @@ TEST(attributes, idft_op_signal) { auto signal = op::Constant::create(element::Type_t::i64, Shape{1}, {20}); auto idft = make_shared(data, axes, signal); - NodeBuilder builder(idft); - const auto expected_attr_count = 0; + NodeBuilder builder(idft, {data, axes, signal}); + EXPECT_NO_THROW(auto g_idft = ov::as_type_ptr(builder.create())); + const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } \ No newline at end of file diff --git a/src/core/tests/visitors/op/interpolate.cpp b/src/core/tests/visitors/op/interpolate.cpp index 8e95d0497dcaaf..266f40c215c585 100644 --- a/src/core/tests/visitors/op/interpolate.cpp +++ b/src/core/tests/visitors/op/interpolate.cpp @@ -30,7 +30,7 @@ TEST(attributes, interpolate_op1) { interp_atrs.pads_end = vector{0, 0}; auto interpolate = make_shared(img, out_shape, interp_atrs); - NodeBuilder builder(interpolate); + NodeBuilder builder(interpolate, {img, out_shape}); auto g_interpolate = ov::as_type_ptr(builder.create()); const auto i_attrs = interpolate->get_attrs(); @@ -61,7 +61,7 @@ TEST(attributes, interpolate_op4) { attrs.cube_coeff = -0.75; auto interpolate = make_shared(img, out_shape, scales, attrs); - NodeBuilder builder(interpolate); + NodeBuilder builder(interpolate, {img, out_shape, scales}); auto g_interpolate = ov::as_type_ptr(builder.create()); const auto i_attrs = interpolate->get_attrs(); diff --git a/src/core/tests/visitors/op/irdft.cpp b/src/core/tests/visitors/op/irdft.cpp index b9f444df9757cf..4ca223ec2459d3 100644 --- a/src/core/tests/visitors/op/irdft.cpp +++ b/src/core/tests/visitors/op/irdft.cpp @@ -17,9 +17,10 @@ TEST(attributes, irdft_op) { auto axes = op::v0::Constant::create(element::i64, Shape{1}, {2}); auto irdft = make_shared(data, axes); - NodeBuilder builder(irdft); - const auto expected_attr_count = 0; + NodeBuilder builder(irdft, {data, axes}); + EXPECT_NO_THROW(auto g_irdft = ov::as_type_ptr(builder.create())); + const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } @@ -30,8 +31,9 @@ TEST(attributes, irdft_op_signal) { auto axes = op::v0::Constant::create(element::i64, Shape{1}, {2}); auto irdft = make_shared(data, axes, signal); - NodeBuilder builder(irdft); - const auto expected_attr_count = 0; + NodeBuilder builder(irdft, {data, axes, signal}); + EXPECT_NO_THROW(auto g_irdft = ov::as_type_ptr(builder.create())); + const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } \ No newline at end of file diff --git a/src/core/tests/visitors/op/log_softmax.cpp b/src/core/tests/visitors/op/log_softmax.cpp index 69d563fedd7853..a5d73e94a8c521 100644 --- a/src/core/tests/visitors/op/log_softmax.cpp +++ b/src/core/tests/visitors/op/log_softmax.cpp @@ -23,7 +23,7 @@ TEST(attributes, logsoftmax_op) { int64_t axis = 2; const auto logsoftmax = make_shared(data, axis); - NodeBuilder builder(logsoftmax); + NodeBuilder builder(logsoftmax, {data}); auto g_logsoftmax = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 1; diff --git a/src/core/tests/visitors/op/lrn.cpp b/src/core/tests/visitors/op/lrn.cpp index ff0d232ae11b88..15a648a0ee62d4 100644 --- a/src/core/tests/visitors/op/lrn.cpp +++ b/src/core/tests/visitors/op/lrn.cpp @@ -27,7 +27,7 @@ TEST(attributes, lrn_op) { const size_t size = 4; const auto lrn = make_shared(arg, axes, alpha, beta, bias, size); - NodeBuilder builder(lrn); + NodeBuilder builder(lrn, {arg, axes}); auto g_lrn = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_lrn->get_alpha(), lrn->get_alpha()); diff --git a/src/core/tests/visitors/op/lstm_cell.cpp b/src/core/tests/visitors/op/lstm_cell.cpp index 9d2b9d00ab8462..c572ac5cb7dc4f 100644 --- a/src/core/tests/visitors/op/lstm_cell.cpp +++ b/src/core/tests/visitors/op/lstm_cell.cpp @@ -16,7 +16,45 @@ using namespace ngraph; using ngraph::test::NodeBuilder; using ngraph::test::ValueMap; -TEST(attributes, lstm_cell_op) { +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}); + + const auto hidden_size = 3; + auto weights_format = ov::op::LSTMWeightsFormat::IFCO; + 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; + 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); + NodeBuilder builder(lstm_cell, {X, initial_hidden_state, initial_cell_state, W, R}); + 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()); + EXPECT_EQ(g_lstm_cell->get_activations_alpha(), lstm_cell->get_activations_alpha()); + EXPECT_EQ(g_lstm_cell->get_activations_beta(), lstm_cell->get_activations_beta()); + EXPECT_EQ(g_lstm_cell->get_clip(), lstm_cell->get_clip()); +} + +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}); @@ -40,7 +78,7 @@ TEST(attributes, lstm_cell_op) { activations_alpha, activations_beta, clip); - NodeBuilder builder(lstm_cell); + NodeBuilder builder(lstm_cell, {X, initial_hidden_state, initial_cell_state, W, R}); auto g_lstm_cell = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_lstm_cell->get_hidden_size(), lstm_cell->get_hidden_size()); diff --git a/src/core/tests/visitors/op/lstm_sequence.cpp b/src/core/tests/visitors/op/lstm_sequence.cpp index d445b1a1d80ef4..24bf369280fab5 100644 --- a/src/core/tests/visitors/op/lstm_sequence.cpp +++ b/src/core/tests/visitors/op/lstm_sequence.cpp @@ -54,7 +54,7 @@ TEST(attributes, lstm_sequence_op) { activations_beta, activations, clip_threshold); - NodeBuilder builder(lstm_sequence); + 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()); EXPECT_EQ(g_lstm_sequence->get_hidden_size(), lstm_sequence->get_hidden_size()); @@ -109,7 +109,7 @@ TEST(attributes, lstm_sequence_v1_op) { activations, clip_threshold, input_forget); - NodeBuilder builder(lstm_sequence); + 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()); EXPECT_EQ(g_lstm_sequence->get_hidden_size(), lstm_sequence->get_hidden_size()); diff --git a/src/core/tests/visitors/op/matmul.cpp b/src/core/tests/visitors/op/matmul.cpp index 03c181ea912e7b..7e47c06b3a76df 100644 --- a/src/core/tests/visitors/op/matmul.cpp +++ b/src/core/tests/visitors/op/matmul.cpp @@ -25,7 +25,78 @@ TEST(attributes, matmul_op) { bool transpose_b = true; auto matmul = make_shared(A, B, transpose_a, transpose_b); - NodeBuilder builder(matmul); + NodeBuilder builder(matmul, {A, B}); + 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}); + + bool transpose_a = false; + bool transpose_b = false; + + auto matmul = make_shared(A, B, transpose_a, transpose_b); + NodeBuilder builder(matmul, {A, B}); + 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}); + + bool transpose_a = true; + bool transpose_b = false; + + auto matmul = make_shared(A, B, transpose_a, transpose_b); + NodeBuilder builder(matmul, {A, B}); + 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}); + + auto matmul = make_shared(A, B); + NodeBuilder builder(matmul, {A, B}); + 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}); + + auto matmul = make_shared(A, B); + NodeBuilder builder(matmul, {A, B}); + 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}); + + auto matmul = make_shared(A, B); + NodeBuilder builder(matmul, {A, B}); auto g_matmul = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_matmul->get_transpose_a(), matmul->get_transpose_a()); diff --git a/src/core/tests/visitors/op/matrix_nms.cpp b/src/core/tests/visitors/op/matrix_nms.cpp index 9455ba048ba143..4aabfb397b037d 100644 --- a/src/core/tests/visitors/op/matrix_nms.cpp +++ b/src/core/tests/visitors/op/matrix_nms.cpp @@ -36,7 +36,7 @@ TEST(attributes, matrix_nms_v8_op_custom_attributes) { attrs.normalized = false; auto nms = make_shared(boxes, scores, attrs); - NodeBuilder builder(nms); + NodeBuilder builder(nms, {boxes, scores}); 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); @@ -75,7 +75,7 @@ TEST(attributes, matrix_nms_v8_op_default_attributes) { auto scores = make_shared(element::f32, Shape{1, 1, 1}); auto nms = make_shared(boxes, scores, opset8::MatrixNms::Attributes()); - NodeBuilder builder(nms); + NodeBuilder builder(nms, {boxes, scores}); 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 d94a59eb66694d..7a32c321013221 100644 --- a/src/core/tests/visitors/op/max_pool.cpp +++ b/src/core/tests/visitors/op/max_pool.cpp @@ -26,7 +26,7 @@ TEST(attributes, max_pool_op) { auto auto_pad = op::PadType::EXPLICIT; auto max_pool = make_shared(data, strides, pads_begin, pads_end, kernel, rounding_mode, auto_pad); - NodeBuilder builder(max_pool); + NodeBuilder builder(max_pool, {data}); auto g_max_pool = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_max_pool->get_strides(), max_pool->get_strides()); @@ -59,7 +59,7 @@ TEST(attributes, max_pool_v8_op) { rounding_mode, auto_pad, index_element_type); - NodeBuilder builder(max_pool); + NodeBuilder builder(max_pool, {data}); auto g_max_pool = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_max_pool->get_strides(), max_pool->get_strides()); diff --git a/src/core/tests/visitors/op/mish.cpp b/src/core/tests/visitors/op/mish.cpp index 3c934a90b28ba4..aa2690e0c4c841 100644 --- a/src/core/tests/visitors/op/mish.cpp +++ b/src/core/tests/visitors/op/mish.cpp @@ -17,7 +17,8 @@ TEST(attributes, mish_op) { const auto A = make_shared(element::f32, Shape{5, 2}); const auto mish = make_shared(A); - NodeBuilder builder(mish); + NodeBuilder builder(mish, {A}); + 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/multiclass_nms.cpp b/src/core/tests/visitors/op/multiclass_nms.cpp index 5e8d7eccfd1771..70d3a21b1efe11 100644 --- a/src/core/tests/visitors/op/multiclass_nms.cpp +++ b/src/core/tests/visitors/op/multiclass_nms.cpp @@ -33,7 +33,7 @@ TEST(attributes, multiclass_nms_v8_op_custom_attributes) { attrs.normalized = false; auto nms = make_shared(boxes, scores, attrs); - NodeBuilder builder(nms); + NodeBuilder builder(nms, {boxes, scores}); 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); @@ -70,7 +70,7 @@ TEST(attributes, multiclass_nms_v8_op_default_attributes) { auto scores = make_shared(element::f32, Shape{1, 1, 1}); auto nms = make_shared(boxes, scores, opset8::MulticlassNms::Attributes()); - NodeBuilder builder(nms); + NodeBuilder builder(nms, {boxes, scores}); 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); @@ -109,7 +109,7 @@ TEST(attributes, multiclass_nms_v9_op_custom_attributes) { attrs.normalized = false; auto nms = make_shared(boxes, scores, roisnum, attrs); - NodeBuilder builder(nms); + NodeBuilder builder(nms, {boxes, scores, roisnum}); 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); @@ -147,7 +147,7 @@ TEST(attributes, multiclass_nms_v9_op_default_attributes) { auto roisnum = make_shared(element::i32, Shape{2}); auto nms = make_shared(boxes, scores, roisnum, opset9::MulticlassNms::Attributes()); - NodeBuilder builder(nms); + NodeBuilder builder(nms, {boxes, scores, roisnum}); 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/mvn.cpp b/src/core/tests/visitors/op/mvn.cpp index 330441b4616e7a..0ce70af67d7f40 100644 --- a/src/core/tests/visitors/op/mvn.cpp +++ b/src/core/tests/visitors/op/mvn.cpp @@ -25,7 +25,7 @@ TEST(attributes, mvn_v1_op) { const auto op = make_shared(data, true, false, 0.1); op->set_reduction_axes(axes); - NodeBuilder builder(op); + NodeBuilder builder(op, {data}); const auto g_op = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 4; @@ -43,7 +43,7 @@ TEST(attributes, mvn_v6_op) { const auto op = make_shared(data, axes, false, 0.1, op::MVNEpsMode::INSIDE_SQRT); - NodeBuilder builder(op); + NodeBuilder builder(op, {data, axes}); const auto g_op = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 3; diff --git a/src/core/tests/visitors/op/non_max_suppression.cpp b/src/core/tests/visitors/op/non_max_suppression.cpp index c88dba8bc57431..77691def669762 100644 --- a/src/core/tests/visitors/op/non_max_suppression.cpp +++ b/src/core/tests/visitors/op/non_max_suppression.cpp @@ -25,7 +25,7 @@ TEST(attributes, non_max_suppression_op_custom_attributes) { bool sort_result_descending = false; auto nms = make_shared(boxes, scores, box_encoding, sort_result_descending); - NodeBuilder builder(nms); + NodeBuilder builder(nms, {boxes, scores}); auto g_nms = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_nms->get_box_encoding(), nms->get_box_encoding()); @@ -38,7 +38,7 @@ TEST(attributes, non_max_suppression_op_default_attributes) { auto scores = make_shared(element::f32, Shape{1, 1, 1}); auto nms = make_shared(boxes, scores); - NodeBuilder builder(nms); + NodeBuilder builder(nms, {boxes, scores}); auto g_nms = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_nms->get_box_encoding(), nms->get_box_encoding()); @@ -55,7 +55,7 @@ TEST(attributes, non_max_suppression_v3_op_custom_attributes) { element::Type output_type = element::i32; auto nms = make_shared(boxes, scores, box_encoding, sort_result_descending, output_type); - NodeBuilder builder(nms); + NodeBuilder builder(nms, {boxes, scores}); auto g_nms = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_nms->get_box_encoding(), nms->get_box_encoding()); @@ -69,7 +69,7 @@ TEST(attributes, non_max_suppression_v3_op_default_attributes) { auto scores = make_shared(element::f32, Shape{1, 1, 1}); auto nms = make_shared(boxes, scores); - NodeBuilder builder(nms); + NodeBuilder builder(nms, {boxes, scores}); auto g_nms = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_nms->get_box_encoding(), nms->get_box_encoding()); diff --git a/src/core/tests/visitors/op/non_zero.cpp b/src/core/tests/visitors/op/non_zero.cpp index 1f264e560140d6..8f8a5fa2becc07 100644 --- a/src/core/tests/visitors/op/non_zero.cpp +++ b/src/core/tests/visitors/op/non_zero.cpp @@ -18,7 +18,9 @@ TEST(attributes, non_zero_op_default) { const auto data_node = make_shared(element::f32, Shape{1}); const auto non_zero = make_shared(data_node); - NodeBuilder builder(non_zero); + NodeBuilder builder(non_zero, {data_node}); + 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); @@ -30,7 +32,8 @@ TEST(attributes, non_zero_op_i32) { const auto data_node = make_shared(element::f32, Shape{1}); const auto non_zero = make_shared(data_node, element::i32); - NodeBuilder builder(non_zero); + NodeBuilder builder(non_zero, {data_node}); + 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); @@ -42,7 +45,8 @@ TEST(attributes, non_zero_op_i32_string) { const auto data_node = make_shared(element::f32, Shape{1}); const auto non_zero = make_shared(data_node, "i32"); - NodeBuilder builder(non_zero); + NodeBuilder builder(non_zero, {data_node}); + 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,7 +58,8 @@ TEST(attributes, non_zero_op_i64) { const auto data_node = make_shared(element::f32, Shape{1}); const auto non_zero = make_shared(data_node, element::i64); - NodeBuilder builder(non_zero); + NodeBuilder builder(non_zero, {data_node}); + 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); @@ -66,7 +71,8 @@ TEST(attributes, non_zero_op_i64_string) { const auto data_node = make_shared(element::f32, Shape{1}); const auto non_zero = make_shared(data_node, "i64"); - NodeBuilder builder(non_zero); + NodeBuilder builder(non_zero, {data_node}); + 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 239415e00cb480..0b9c6cb9be91db 100644 --- a/src/core/tests/visitors/op/normalize_l2.cpp +++ b/src/core/tests/visitors/op/normalize_l2.cpp @@ -18,7 +18,7 @@ void static test_normalize_l2_attributes(float eps, op::EpsMode eps_mode) { const auto axes = make_shared(element::i32, Shape{}, vector{1}); auto normalize_l2 = make_shared(data, axes, eps, eps_mode); - NodeBuilder builder(normalize_l2); + NodeBuilder builder(normalize_l2, {data, axes}); auto g_normalize_l2 = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 2; diff --git a/src/core/tests/visitors/op/one_hot.cpp b/src/core/tests/visitors/op/one_hot.cpp index 91beec2a7f9389..339245dad8904f 100644 --- a/src/core/tests/visitors/op/one_hot.cpp +++ b/src/core/tests/visitors/op/one_hot.cpp @@ -26,7 +26,7 @@ TEST(attributes, one_hot_op) { int64_t axis = 3; auto one_hot = make_shared(indices, depth, on_value, off_value, axis); - NodeBuilder builder(one_hot); + NodeBuilder builder(one_hot, {indices, depth, on_value, off_value}); 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 960fdacdc690be..7272dffe98d03c 100644 --- a/src/core/tests/visitors/op/pad.cpp +++ b/src/core/tests/visitors/op/pad.cpp @@ -25,8 +25,28 @@ TEST(attributes, pad_op) { auto pad_mode = op::PadMode::EDGE; auto pad = make_shared(arg, pads_begin, pads_end, pad_mode); - NodeBuilder builder(pad); + NodeBuilder builder(pad, {arg, pads_begin, pads_end}); auto g_pad = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_pad->get_pad_mode(), pad->get_pad_mode()); + EXPECT_EQ(g_pad->get_pads_begin(), pad->get_pads_begin()); + EXPECT_EQ(g_pad->get_pads_end(), pad->get_pads_end()); +} + +TEST(attributes, pad_op2) { + 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 pad_mode = op::PadMode::CONSTANT; + + auto pad = make_shared(arg, pads_begin, pads_end, pad_value, pad_mode); + NodeBuilder builder(pad, {arg, pads_begin, pads_end, pad_value}); + auto g_pad = ov::as_type_ptr(builder.create()); + + EXPECT_EQ(g_pad->get_pad_mode(), pad->get_pad_mode()); + EXPECT_EQ(g_pad->get_pads_begin(), pad->get_pads_begin()); + EXPECT_EQ(g_pad->get_pads_end(), pad->get_pads_end()); } diff --git a/src/core/tests/visitors/op/prelu.cpp b/src/core/tests/visitors/op/prelu.cpp index 9f5b03f49108ca..2fd4eb1ccea49a 100644 --- a/src/core/tests/visitors/op/prelu.cpp +++ b/src/core/tests/visitors/op/prelu.cpp @@ -18,7 +18,8 @@ TEST(attributes, prelu_op) { const auto slope = make_shared(element::f32, Shape{5}); const auto prelu = make_shared(data, slope); - NodeBuilder builder(prelu); + NodeBuilder builder(prelu, {data, slope}); + 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 83246fdbb857f1..502309064cea5c 100644 --- a/src/core/tests/visitors/op/prior_box.cpp +++ b/src/core/tests/visitors/op/prior_box.cpp @@ -37,7 +37,7 @@ TEST(attributes, prior_box_op) { attrs.scale_all_sizes = true; auto prior_box = make_shared(layer_shape, image_shape, attrs); - NodeBuilder builder(prior_box); + NodeBuilder builder(prior_box, {layer_shape, image_shape}); auto g_prior_box = ov::as_type_ptr(builder.create()); const auto prior_box_attrs = prior_box->get_attrs(); @@ -57,6 +57,50 @@ TEST(attributes, prior_box_op) { EXPECT_EQ(g_prior_box_attrs.offset, prior_box_attrs.offset); EXPECT_EQ(g_prior_box_attrs.variance, prior_box_attrs.variance); EXPECT_EQ(g_prior_box_attrs.scale_all_sizes, prior_box_attrs.scale_all_sizes); + EXPECT_EQ(g_prior_box->has_evaluate(), prior_box->has_evaluate()); +} + +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}); + + op::v0::PriorBox::Attributes attrs; + attrs.min_size = vector{0.1f, 0.141421f}; + attrs.max_size = vector{}; + attrs.aspect_ratio = vector{2.0f, 0.5f}; + attrs.density = vector{}; + attrs.fixed_ratio = vector{}; + attrs.fixed_size = vector{}; + attrs.clip = false; + attrs.flip = false; + attrs.step = 0.03333333f; + attrs.offset = 0.5f; + 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); + NodeBuilder builder(prior_box, {layer_shape, image_shape}); + 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(); + + const auto expected_attr_count = 12; + EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); + EXPECT_EQ(g_prior_box_attrs.min_size, prior_box_attrs.min_size); + EXPECT_EQ(g_prior_box_attrs.max_size, prior_box_attrs.max_size); + EXPECT_EQ(g_prior_box_attrs.aspect_ratio, prior_box_attrs.aspect_ratio); + EXPECT_EQ(g_prior_box_attrs.density, prior_box_attrs.density); + EXPECT_EQ(g_prior_box_attrs.fixed_ratio, prior_box_attrs.fixed_ratio); + EXPECT_EQ(g_prior_box_attrs.fixed_size, prior_box_attrs.fixed_size); + EXPECT_EQ(g_prior_box_attrs.clip, prior_box_attrs.clip); + EXPECT_EQ(g_prior_box_attrs.flip, prior_box_attrs.flip); + EXPECT_EQ(g_prior_box_attrs.step, prior_box_attrs.step); + EXPECT_EQ(g_prior_box_attrs.offset, prior_box_attrs.offset); + EXPECT_EQ(g_prior_box_attrs.variance, prior_box_attrs.variance); + EXPECT_EQ(g_prior_box_attrs.scale_all_sizes, prior_box_attrs.scale_all_sizes); + EXPECT_EQ(g_prior_box->has_evaluate(), prior_box->has_evaluate()); } TEST(attributes, prior_box_v8_op) { @@ -80,7 +124,7 @@ TEST(attributes, prior_box_v8_op) { attrs.min_max_aspect_ratios_order = false; auto prior_box = make_shared(layer_shape, image_shape, attrs); - NodeBuilder builder(prior_box); + NodeBuilder builder(prior_box, {layer_shape, image_shape}); auto g_prior_box = ov::as_type_ptr(builder.create()); const auto prior_box_attrs = prior_box->get_attrs(); @@ -101,4 +145,5 @@ TEST(attributes, prior_box_v8_op) { EXPECT_EQ(g_prior_box_attrs.variance, prior_box_attrs.variance); EXPECT_EQ(g_prior_box_attrs.scale_all_sizes, prior_box_attrs.scale_all_sizes); EXPECT_EQ(g_prior_box_attrs.min_max_aspect_ratios_order, prior_box_attrs.min_max_aspect_ratios_order); + EXPECT_EQ(g_prior_box->has_evaluate(), prior_box->has_evaluate()); } diff --git a/src/core/tests/visitors/op/prior_box_clustered.cpp b/src/core/tests/visitors/op/prior_box_clustered.cpp index f497bdd985e066..de1fe6b8af6095 100644 --- a/src/core/tests/visitors/op/prior_box_clustered.cpp +++ b/src/core/tests/visitors/op/prior_box_clustered.cpp @@ -28,7 +28,7 @@ TEST(attributes, prior_box_clustered_op) { attrs.variances = {0.1f}; auto pbc = make_shared(layer_shape, image_shape, attrs); - NodeBuilder builder(pbc); + NodeBuilder builder(pbc, {layer_shape, image_shape}); 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(); @@ -43,4 +43,39 @@ TEST(attributes, prior_box_clustered_op) { EXPECT_EQ(g_pbc_attrs.step, pbc_attrs.step); EXPECT_EQ(g_pbc_attrs.offset, pbc_attrs.offset); EXPECT_EQ(g_pbc_attrs.variances, pbc_attrs.variances); + EXPECT_EQ(g_pbc->has_evaluate(), pbc->has_evaluate()); +} + +TEST(attributes, prior_box_clustered_op2) { + NodeBuilder::get_ops().register_factory(); + const auto layer_shape = make_shared(element::i64, Shape{32, 32}); + const auto image_shape = make_shared(element::i64, Shape{300, 300}); + + op::PriorBoxClusteredAttrs attrs; + attrs.heights = {44.0f, 10.0f, 30.0f, 19.0f, 94.0f, 32.0f, 61.0f, 53.0f, 17.0}; + attrs.widths = {86.0f, 13.0f, 57.0f, 39.0f, 68.0f, 34.0f, 142.0f, 50.0f, 23.0}; + attrs.clip = false; + attrs.step_widths = 0.0f; + attrs.step_heights = 0.0f; + attrs.step = 16.0f; + attrs.offset = 0.5f; + attrs.variances = {0.1f, 0.1f, 0.2f, 0.2}; + + 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()); + const auto pbc_attrs = pbc->get_attrs(); + const auto g_pbc_attrs = g_pbc->get_attrs(); + const auto expected_attr_count = 8; + + EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); + EXPECT_EQ(g_pbc_attrs.heights, pbc_attrs.heights); + EXPECT_EQ(g_pbc_attrs.widths, pbc_attrs.widths); + EXPECT_EQ(g_pbc_attrs.clip, pbc_attrs.clip); + EXPECT_EQ(g_pbc_attrs.step_widths, pbc_attrs.step_widths); + EXPECT_EQ(g_pbc_attrs.step_heights, pbc_attrs.step_heights); + EXPECT_EQ(g_pbc_attrs.step, pbc_attrs.step); + EXPECT_EQ(g_pbc_attrs.offset, pbc_attrs.offset); + EXPECT_EQ(g_pbc_attrs.variances, pbc_attrs.variances); + EXPECT_EQ(g_pbc->has_evaluate(), pbc->has_evaluate()); } diff --git a/src/core/tests/visitors/op/proposal.cpp b/src/core/tests/visitors/op/proposal.cpp index 12e9eafaa10b29..affe77429e3337 100644 --- a/src/core/tests/visitors/op/proposal.cpp +++ b/src/core/tests/visitors/op/proposal.cpp @@ -39,7 +39,46 @@ TEST(attributes, proposal_op) { attrs.framework = string{"nGraph"}; auto proposal = make_shared(class_probs, class_logits, image_shape, attrs); - NodeBuilder builder(proposal); + NodeBuilder builder(proposal, {class_probs, class_logits, image_shape}); + 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(); + + EXPECT_EQ(g_proposal_attrs.base_size, proposal_attrs.base_size); + EXPECT_EQ(g_proposal_attrs.pre_nms_topn, proposal_attrs.pre_nms_topn); + EXPECT_EQ(g_proposal_attrs.post_nms_topn, proposal_attrs.post_nms_topn); + EXPECT_EQ(g_proposal_attrs.nms_thresh, proposal_attrs.nms_thresh); + EXPECT_EQ(g_proposal_attrs.feat_stride, proposal_attrs.feat_stride); + EXPECT_EQ(g_proposal_attrs.min_size, proposal_attrs.min_size); + EXPECT_EQ(g_proposal_attrs.ratio, proposal_attrs.ratio); + EXPECT_EQ(g_proposal_attrs.scale, proposal_attrs.scale); + EXPECT_EQ(g_proposal_attrs.clip_before_nms, proposal_attrs.clip_before_nms); + EXPECT_EQ(g_proposal_attrs.clip_after_nms, proposal_attrs.clip_after_nms); + EXPECT_EQ(g_proposal_attrs.normalize, proposal_attrs.normalize); + EXPECT_EQ(g_proposal_attrs.box_size_scale, proposal_attrs.box_size_scale); + EXPECT_EQ(g_proposal_attrs.box_coordinate_scale, proposal_attrs.box_coordinate_scale); + EXPECT_EQ(g_proposal_attrs.framework, proposal_attrs.framework); +} + +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}); + + op::ProposalAttrs attrs; + attrs.base_size = 16; + attrs.pre_nms_topn = 6000; + attrs.post_nms_topn = 200; + attrs.nms_thresh = 0.6f; + attrs.feat_stride = 16; + attrs.min_size = 16; + 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); + NodeBuilder builder(proposal, {class_probs, class_logits, image_shape}); auto g_proposal = ov::as_type_ptr(builder.create()); const auto proposal_attrs = proposal->get_attrs(); diff --git a/src/core/tests/visitors/op/psroi_pooling.cpp b/src/core/tests/visitors/op/psroi_pooling.cpp index a668489e19e9c5..f03d8163dccc7d 100644 --- a/src/core/tests/visitors/op/psroi_pooling.cpp +++ b/src/core/tests/visitors/op/psroi_pooling.cpp @@ -36,7 +36,7 @@ TEST(attributes, psroi_pooling_op) { spatial_bins_x, spatial_bins_y, mode); - NodeBuilder builder(psroi_pool); + NodeBuilder builder(psroi_pool, {input, coords}); auto g_psroi_pool = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_psroi_pool->get_output_dim(), psroi_pool->get_output_dim()); diff --git a/src/core/tests/visitors/op/random_uniform.cpp b/src/core/tests/visitors/op/random_uniform.cpp index 2a3a0a20f9c1af..cb20e9a6bb4d41 100644 --- a/src/core/tests/visitors/op/random_uniform.cpp +++ b/src/core/tests/visitors/op/random_uniform.cpp @@ -21,7 +21,7 @@ TEST(attributes, random_uniform_op) { const auto random_uniform = make_shared(out_shape, min_val, max_val, element::Type_t::f32, 150, 10); - NodeBuilder builder(random_uniform); + NodeBuilder builder(random_uniform, {out_shape, min_val, max_val}); auto g_random_uniform = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 3; diff --git a/src/core/tests/visitors/op/range.cpp b/src/core/tests/visitors/op/range.cpp new file mode 100644 index 00000000000000..efd282eba718c2 --- /dev/null +++ b/src/core/tests/visitors/op/range.cpp @@ -0,0 +1,29 @@ +// Copyright (C) 2018-2022 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#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 "util/visitor.hpp" + +using namespace std; +using namespace ngraph; +using ngraph::test::NodeBuilder; +using ngraph::test::ValueMap; + +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{}); + auto output_type = element::f32; + + auto range = make_shared(start, stop, step, output_type); + NodeBuilder builder(range, {start, stop, step}); + 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 f1f283452cf303..07871935f371cb 100644 --- a/src/core/tests/visitors/op/rdft.cpp +++ b/src/core/tests/visitors/op/rdft.cpp @@ -17,9 +17,10 @@ TEST(attributes, rdft_op) { auto axes = op::v0::Constant::create(element::i64, Shape{1}, {2}); auto rdft = make_shared(data, axes); - NodeBuilder builder(rdft); - const auto expected_attr_count = 0; + NodeBuilder builder(rdft, {data, axes}); + EXPECT_NO_THROW(auto g_rdft = ov::as_type_ptr(builder.create())); + const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } @@ -30,8 +31,9 @@ TEST(attributes, rdft_op_signal) { auto axes = op::v0::Constant::create(element::i64, Shape{1}, {2}); auto rdft = make_shared(data, axes, signal); - NodeBuilder builder(rdft); - const auto expected_attr_count = 0; + NodeBuilder builder(rdft, {data, axes, signal}); + EXPECT_NO_THROW(auto g_rdft = ov::as_type_ptr(builder.create())); + const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } \ No newline at end of file diff --git a/src/core/tests/visitors/op/read_value.cpp b/src/core/tests/visitors/op/read_value.cpp index ace7a0550bfbb5..4f12e573163b72 100644 --- a/src/core/tests/visitors/op/read_value.cpp +++ b/src/core/tests/visitors/op/read_value.cpp @@ -19,7 +19,8 @@ TEST(attributes, readvalue_v3_op) { const auto in = make_shared(element::f32, Shape{1}); const string variable_id = "v0"; const auto read_value = make_shared(in, variable_id); - NodeBuilder builder(read_value); + NodeBuilder builder(read_value, {in}); + EXPECT_NO_THROW(auto g_read_value = ov::as_type_ptr(builder.create())); // attribute count const auto expected_attr_count = 1; @@ -31,7 +32,8 @@ TEST(attributes, readvalue_v6_op) { 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 builder(read_value); + NodeBuilder builder(read_value, {in}); + 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_ops.hpp b/src/core/tests/visitors/op/reduce_ops.hpp index 97ef8ab472db94..4249e182b7ea7f 100644 --- a/src/core/tests/visitors/op/reduce_ops.hpp +++ b/src/core/tests/visitors/op/reduce_ops.hpp @@ -59,7 +59,7 @@ TYPED_TEST_P(ReduceOperatorVisitor, keep_dims_3D) 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); + NodeBuilder builder(reduce_op, {data, reduction_axes}); const auto expected_attr_count = 1; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); auto g_reduce_op = as_type_ptr(builder.create()); @@ -83,7 +83,7 @@ TYPED_TEST_P(ReduceOperatorVisitor, do_not_keep_dims_3D) 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); + NodeBuilder builder(reduce_op, {data, reduction_axes}); const auto expected_attr_count = 1; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); auto g_reduce_op = ov::as_type_ptr(builder.create()); diff --git a/src/core/tests/visitors/op/region_yolo.cpp b/src/core/tests/visitors/op/region_yolo.cpp index 61fbe9927ca11e..0369ff211afd82 100644 --- a/src/core/tests/visitors/op/region_yolo.cpp +++ b/src/core/tests/visitors/op/region_yolo.cpp @@ -38,7 +38,7 @@ TEST(attributes, region_yolo_op) { axis, end_axis, anchors); - NodeBuilder builder(region_yolo); + NodeBuilder builder(region_yolo, {data}); auto g_region_yolo = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_region_yolo->get_num_coords(), region_yolo->get_num_coords()); diff --git a/src/core/tests/visitors/op/reorg_yolo.cpp b/src/core/tests/visitors/op/reorg_yolo.cpp index 9e599a0dd0d72d..3e870872b52635 100644 --- a/src/core/tests/visitors/op/reorg_yolo.cpp +++ b/src/core/tests/visitors/op/reorg_yolo.cpp @@ -21,7 +21,7 @@ TEST(attributes, reorg_yolo_op_stride) { const auto data = make_shared(element::i32, Shape{1, 64, 26, 26}); const auto op = make_shared(data, 2); - NodeBuilder builder(op); + NodeBuilder builder(op, {data}); const auto g_op = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_op->get_strides(), op->get_strides()); @@ -32,7 +32,7 @@ TEST(attributes, reorg_yolo_op_strides) { const auto data = make_shared(element::i32, Shape{1, 64, 26, 26}); const auto op = make_shared(data, Strides{2}); - NodeBuilder builder(op); + NodeBuilder builder(op, {data}); const auto g_op = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_op->get_strides(), op->get_strides()); diff --git a/src/core/tests/visitors/op/reshape.cpp b/src/core/tests/visitors/op/reshape.cpp index 831c091dd438df..b74c967e8e06ad 100644 --- a/src/core/tests/visitors/op/reshape.cpp +++ b/src/core/tests/visitors/op/reshape.cpp @@ -24,7 +24,7 @@ TEST(attributes, reshape_op) { bool special_zero = true; auto reshape = make_shared(data, pattern, special_zero); - NodeBuilder builder(reshape); + NodeBuilder builder(reshape, {data, pattern}); auto g_reshape = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 1; diff --git a/src/core/tests/visitors/op/reverse.cpp b/src/core/tests/visitors/op/reverse.cpp index aebbcdc6f0e930..0ec0935c597d1e 100644 --- a/src/core/tests/visitors/op/reverse.cpp +++ b/src/core/tests/visitors/op/reverse.cpp @@ -22,7 +22,7 @@ TEST(attributes, reverse_op_enum_mode) { auto reversed_axes = make_shared(element::i32, Shape{200}); auto reverse = make_shared(data, reversed_axes, opset1::Reverse::Mode::INDEX); - NodeBuilder builder(reverse); + NodeBuilder builder(reverse, {data, reversed_axes}); auto g_reverse = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_reverse->get_mode(), reverse->get_mode()); @@ -36,7 +36,7 @@ TEST(attributes, reverse_op_string_mode) { std::string mode = "index"; auto reverse = make_shared(data, reversed_axes, mode); - NodeBuilder builder(reverse); + NodeBuilder builder(reverse, {data, reversed_axes}); 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 1b2bff8c21bc24..f4fa91e83d6bf5 100644 --- a/src/core/tests/visitors/op/reverse_sequence.cpp +++ b/src/core/tests/visitors/op/reverse_sequence.cpp @@ -26,7 +26,7 @@ TEST(attributes, reverse_sequence_op) { auto reverse_sequence = make_shared(data, seq_indices, batch_axis, seq_axis); - NodeBuilder builder(reverse_sequence); + NodeBuilder builder(reverse_sequence, {data, seq_indices}); const auto expected_attr_count = 2; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/rnn_cell.cpp b/src/core/tests/visitors/op/rnn_cell.cpp index d360e6960feab9..1a44fcd9fa0f76 100644 --- a/src/core/tests/visitors/op/rnn_cell.cpp +++ b/src/core/tests/visitors/op/rnn_cell.cpp @@ -32,7 +32,7 @@ TEST(attributes, rnn_cell_op_custom_attributes) { auto rnn_cell = make_shared(X, H, W, R, hidden_size, activations, activations_alpha, activations_beta, clip); - NodeBuilder builder(rnn_cell); + NodeBuilder builder(rnn_cell, {X, H, W, R}); auto g_rnn_cell = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_rnn_cell->get_hidden_size(), rnn_cell->get_hidden_size()); @@ -53,7 +53,7 @@ TEST(attributes, rnn_cell_op_default_attributes) { auto rnn_cell = make_shared(X, H, W, R, hidden_size); - NodeBuilder builder(rnn_cell); + NodeBuilder builder(rnn_cell, {X, H, W, R}); auto g_rnn_cell = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_rnn_cell->get_hidden_size(), rnn_cell->get_hidden_size()); diff --git a/src/core/tests/visitors/op/rnn_sequence.cpp b/src/core/tests/visitors/op/rnn_sequence.cpp index 96f0dfa2ab9997..98b5ee758e30e7 100644 --- a/src/core/tests/visitors/op/rnn_sequence.cpp +++ b/src/core/tests/visitors/op/rnn_sequence.cpp @@ -51,7 +51,7 @@ TEST(attributes, rnn_sequence_op) { activations_alpha, activations_beta, clip_threshold); - NodeBuilder builder(rnn_sequence); + NodeBuilder builder(rnn_sequence, {X, initial_hidden_state, sequence_lengths, W, R, B}); auto g_rnn_sequence = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_rnn_sequence->get_hidden_size(), rnn_sequence->get_hidden_size()); diff --git a/src/core/tests/visitors/op/roi_pooling.cpp b/src/core/tests/visitors/op/roi_pooling.cpp index 8b1f00c43b5fd2..d09163840f53e1 100644 --- a/src/core/tests/visitors/op/roi_pooling.cpp +++ b/src/core/tests/visitors/op/roi_pooling.cpp @@ -22,7 +22,7 @@ TEST(attributes, roi_pooling_op) { const auto coords = make_shared(element::f32, Shape{2, 5}); const auto op = make_shared(data, coords, Shape{5, 5}, 0.123, "bilinear"); - NodeBuilder builder(op); + NodeBuilder builder(op, {data, coords}); const auto g_op = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_op->get_output_size(), op->get_output_size()); diff --git a/src/core/tests/visitors/op/roll.cpp b/src/core/tests/visitors/op/roll.cpp index 6ce11fcaed0d28..0b45b163778f1a 100644 --- a/src/core/tests/visitors/op/roll.cpp +++ b/src/core/tests/visitors/op/roll.cpp @@ -19,7 +19,8 @@ TEST(attributes, roll_op) { const auto C = make_shared(element::i32, Shape{3}); const auto roll = make_shared(A, B, C); - NodeBuilder builder(roll); + NodeBuilder builder(roll, {A, B, C}); + 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 65a23c14cac413..04292073d0599a 100644 --- a/src/core/tests/visitors/op/round.cpp +++ b/src/core/tests/visitors/op/round.cpp @@ -20,7 +20,7 @@ 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); - NodeBuilder builder(round); + NodeBuilder builder(round, {data}); auto g_round = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_round->get_mode(), round->get_mode()); diff --git a/src/core/tests/visitors/op/scatter_elements_update.cpp b/src/core/tests/visitors/op/scatter_elements_update.cpp index 56cc37cc6a3531..f3516b1a5a1db7 100644 --- a/src/core/tests/visitors/op/scatter_elements_update.cpp +++ b/src/core/tests/visitors/op/scatter_elements_update.cpp @@ -21,7 +21,7 @@ TEST(attributes, scatter_elements_update) { auto axis = std::make_shared(element::i16, Shape{}); auto scatter = std::make_shared(data, indices, updates, axis); - NodeBuilder builder(scatter); + NodeBuilder builder(scatter, {data, indices, updates, axis}); 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 61ea28ac5e1d94..f722bd69c64fe8 100644 --- a/src/core/tests/visitors/op/scatter_update.cpp +++ b/src/core/tests/visitors/op/scatter_update.cpp @@ -29,7 +29,7 @@ TEST(attributes, scatter_update_op) { auto A = op::Constant::create(element::i16, Shape{}, {1}); auto op = make_shared(R, I, U, A); - NodeBuilder builder(op); + NodeBuilder builder(op, {R, I, U, A}); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); diff --git a/src/core/tests/visitors/op/select.cpp b/src/core/tests/visitors/op/select.cpp index 90dbb202b4971c..b0ac89e4d32393 100644 --- a/src/core/tests/visitors/op/select.cpp +++ b/src/core/tests/visitors/op/select.cpp @@ -12,7 +12,7 @@ using namespace ngraph; using ngraph::test::NodeBuilder; using ngraph::test::ValueMap; -TEST(attributes, select) { +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}); @@ -21,7 +21,25 @@ TEST(attributes, select) { auto auto_broadcast = op::AutoBroadcastType::NUMPY; auto select = std::make_shared(in_cond, in_then, in_else, auto_broadcast); - NodeBuilder builder(select); + 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()); + 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}); + + auto auto_broadcast = op::AutoBroadcastType::NUMPY; + + 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); diff --git a/src/core/tests/visitors/op/selu.cpp b/src/core/tests/visitors/op/selu.cpp index e9b82973e1e974..0b7a53f8b356ea 100644 --- a/src/core/tests/visitors/op/selu.cpp +++ b/src/core/tests/visitors/op/selu.cpp @@ -20,8 +20,9 @@ TEST(attributes, selu_op) { const auto op = make_shared(data_input, alpha, lambda); - NodeBuilder builder(op); + 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_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 b147cc9fbc0f26..bdce53c369b5f1 100644 --- a/src/core/tests/visitors/op/shape_of.cpp +++ b/src/core/tests/visitors/op/shape_of.cpp @@ -19,7 +19,7 @@ TEST(attributes, shapeof_op1) { NodeBuilder::get_ops().register_factory(); auto data = make_shared(element::i32, Shape{2, 3, 4}); auto shapeof = make_shared(data); - NodeBuilder builder(shapeof); + NodeBuilder builder(shapeof, {data}); auto g_shapeof = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 0; @@ -30,7 +30,7 @@ TEST(attributes, shapeof_op3) { NodeBuilder::get_ops().register_factory(); auto data = make_shared(element::i32, Shape{2, 3, 4}); auto shapeof = make_shared(data, element::Type_t::i64); - NodeBuilder builder(shapeof); + NodeBuilder builder(shapeof, {data}); auto g_shapeof = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 1; diff --git a/src/core/tests/visitors/op/shuffle_channels.cpp b/src/core/tests/visitors/op/shuffle_channels.cpp index c85a888f950d03..d3b787345acd44 100644 --- a/src/core/tests/visitors/op/shuffle_channels.cpp +++ b/src/core/tests/visitors/op/shuffle_channels.cpp @@ -19,7 +19,7 @@ TEST(attributes, shuffle_channels_op) { auto axis = 1; auto groups = 2; auto shuffle_channels = make_shared(data, axis, groups); - NodeBuilder builder(shuffle_channels); + NodeBuilder builder(shuffle_channels, {data}); auto g_shuffle_channels = ov::as_type_ptr(builder.create()); const auto expected_attr_count = 2; diff --git a/src/core/tests/visitors/op/slice.cpp b/src/core/tests/visitors/op/slice.cpp index 651560b8f1803a..dd667b14c68b35 100644 --- a/src/core/tests/visitors/op/slice.cpp +++ b/src/core/tests/visitors/op/slice.cpp @@ -20,7 +20,7 @@ TEST(attributes, slice_op_no_axes) { const auto step = make_shared(element::i32, Shape{4}); const auto op = make_shared(data, start, stop, step); - NodeBuilder builder(op); + NodeBuilder builder(op, {data, start, stop, step}); const auto expected_attr_count = 0; EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); @@ -35,7 +35,7 @@ TEST(attributes, slice_op_with_axes) { const auto axes = make_shared(element::i32, Shape{4}); const auto op = make_shared(data, start, stop, step, axes); - NodeBuilder builder(op); + NodeBuilder builder(op, {data, start, stop, step, axes}); 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 ba2785df0237fb..05e34eefbd2a98 100644 --- a/src/core/tests/visitors/op/softmax.cpp +++ b/src/core/tests/visitors/op/softmax.cpp @@ -21,7 +21,7 @@ TEST(attributes, softmax_op) { auto data = make_shared(element::i32, Shape{200}); auto axis = 0; auto softmax = make_shared(data, axis); - NodeBuilder builder(softmax); + NodeBuilder builder(softmax, {data}); 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/space_to_batch.cpp b/src/core/tests/visitors/op/space_to_batch.cpp index 3f251059cde94f..7623bd9f4c9b77 100644 --- a/src/core/tests/visitors/op/space_to_batch.cpp +++ b/src/core/tests/visitors/op/space_to_batch.cpp @@ -22,7 +22,8 @@ TEST(attributes, space_to_batch_op) { 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); + NodeBuilder builder(op, {data, block_shape, pads_begin, pads_end}); + 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 98912fec3218d5..36d9025972d51f 100644 --- a/src/core/tests/visitors/op/space_to_depth.cpp +++ b/src/core/tests/visitors/op/space_to_depth.cpp @@ -24,7 +24,7 @@ TEST(attributes, space_to_depth_op) { auto mode = opset1::SpaceToDepth::SpaceToDepthMode::BLOCKS_FIRST; auto space_to_depth = make_shared(data, mode, block_size); - NodeBuilder builder(space_to_depth); + NodeBuilder builder(space_to_depth, {data}); auto g_space_to_depth = ov::as_type_ptr(builder.create()); // attribute count diff --git a/src/core/tests/visitors/op/split.cpp b/src/core/tests/visitors/op/split.cpp index df2ca57404eb2c..ed0bc87febdfa2 100644 --- a/src/core/tests/visitors/op/split.cpp +++ b/src/core/tests/visitors/op/split.cpp @@ -6,9 +6,6 @@ #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 "util/visitor.hpp" using namespace std; @@ -22,7 +19,19 @@ TEST(attributes, split_op) { auto axis = make_shared(element::i32, Shape{}); auto num_splits = 2; auto split = make_shared(data, axis, num_splits); - NodeBuilder builder(split); + NodeBuilder builder(split, {data, axis}); + 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{}); + auto num_splits = 3; + auto split = make_shared(data, axis, num_splits); + NodeBuilder builder(split, {data, axis}); 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/strided_slice.cpp b/src/core/tests/visitors/op/strided_slice.cpp index f06c1b48a8b84a..774759f1b88ef1 100644 --- a/src/core/tests/visitors/op/strided_slice.cpp +++ b/src/core/tests/visitors/op/strided_slice.cpp @@ -38,7 +38,7 @@ TEST(attributes, strided_slice_op) { new_axis_mask, shrink_axis_mask, ellipsis_mask); - NodeBuilder builder(strided_slice); + NodeBuilder builder(strided_slice, {data, begin, end, stride}); auto g_strided_slice = ov::as_type_ptr(builder.create()); EXPECT_EQ(g_strided_slice->get_begin_mask(), strided_slice->get_begin_mask()); diff --git a/src/core/tests/visitors/op/tile.cpp b/src/core/tests/visitors/op/tile.cpp new file mode 100644 index 00000000000000..462b864acf5652 --- /dev/null +++ b/src/core/tests/visitors/op/tile.cpp @@ -0,0 +1,26 @@ +// Copyright (C) 2018-2022 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "gtest/gtest.h" +#include "ngraph/ngraph.hpp" +#include "ngraph/op/util/attr_types.hpp" +#include "ngraph/opsets/opset1.hpp" +#include "util/visitor.hpp" + +using namespace std; +using namespace ngraph; +using ngraph::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}); + + const auto tile = make_shared(data, repeats); + NodeBuilder builder(tile, {data, repeats}); + 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 9ce6a5cffdd2f0..249b4a0a8ee473 100644 --- a/src/core/tests/visitors/op/topk.cpp +++ b/src/core/tests/visitors/op/topk.cpp @@ -26,10 +26,30 @@ TEST(attributes, topk_op) { auto sort_type = opset1::TopK::SortType::SORT_VALUES; auto topk = make_shared(data, k, axis, mode, sort_type); - NodeBuilder builder(topk); + NodeBuilder builder(topk, {data, k}); 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()); EXPECT_EQ(g_topk->get_sort_type(), topk->get_sort_type()); + EXPECT_EQ(g_topk->get_index_element_type(), topk->get_index_element_type()); +} + +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{}); + + auto axis = 0; + auto mode = opset3::TopK::Mode::MAX; + auto sort_type = opset3::TopK::SortType::SORT_VALUES; + + auto topk = make_shared(data, k, axis, mode, sort_type); + NodeBuilder builder(topk, {data, k}); + 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()); + EXPECT_EQ(g_topk->get_sort_type(), topk->get_sort_type()); + EXPECT_EQ(g_topk->get_index_element_type(), topk->get_index_element_type()); } diff --git a/src/core/tests/visitors/op/transpose.cpp b/src/core/tests/visitors/op/transpose.cpp index 3f326d42dc8b86..d1b63ce3e3b1d6 100644 --- a/src/core/tests/visitors/op/transpose.cpp +++ b/src/core/tests/visitors/op/transpose.cpp @@ -21,8 +21,9 @@ TEST(attributes, transpose_op) { const auto op = make_shared(data_input, axes_order_input); - NodeBuilder builder(op); - const auto expected_attr_count = 0; + NodeBuilder builder(op, {data_input, axes_order_input}); + 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 eda54d1f3de160..d420867c7748b9 100644 --- a/src/core/tests/visitors/op/unary_ops.hpp +++ b/src/core/tests/visitors/op/unary_ops.hpp @@ -37,7 +37,10 @@ TYPED_TEST_P(UnaryOperatorVisitor, No_Attribute_4D) { const auto A = std::make_shared(element_type, ngraph::PartialShape{2, 2, 2, 2}); const auto op_func = std::make_shared(A); - ngraph::test::NodeBuilder builder(op_func); + ngraph::test::NodeBuilder builder(op_func, {A}); + + EXPECT_NO_THROW(auto g_op_func = 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/unsqueeze.cpp b/src/core/tests/visitors/op/unsqueeze.cpp index 3625260f757ca6..2343313f69109c 100644 --- a/src/core/tests/visitors/op/unsqueeze.cpp +++ b/src/core/tests/visitors/op/unsqueeze.cpp @@ -15,12 +15,15 @@ using ngraph::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 op = make_shared(param, axes); - NodeBuilder builder(op); - const auto expected_attr_count = 0; + NodeBuilder builder(op, {param, axes}); + 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/variadic_split.cpp b/src/core/tests/visitors/op/variadic_split.cpp index 9e9b4ed41f886a..179e63e5079e0f 100644 --- a/src/core/tests/visitors/op/variadic_split.cpp +++ b/src/core/tests/visitors/op/variadic_split.cpp @@ -22,8 +22,9 @@ TEST(attributes, variadic_split_op) { auto split_lengths = make_shared(element::i32, Shape{1}); auto split = make_shared(data, axis, split_lengths); - NodeBuilder builder(split); - const auto expected_attr_count = 0; + NodeBuilder builder(split, {data, axis, split_lengths}); + 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/frontends/ir/tests/frontend_test_basic.cpp b/src/frontends/ir/tests/frontend_test_basic.cpp index ea7679187c8fc4..269ed0b658fda7 100644 --- a/src/frontends/ir/tests/frontend_test_basic.cpp +++ b/src/frontends/ir/tests/frontend_test_basic.cpp @@ -5,6 +5,7 @@ #include "frontend_test.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset3.hpp" +#include "openvino/opsets/opset6.hpp" class IRFrontendTests : public ::testing::Test, public IRFrontendTestsImpl { protected: @@ -957,3 +958,347 @@ TEST_F(IRFrontendTests, wrong_opset) { ASSERT_THROW(model = core.read_model(testModel, ov::Tensor()), ov::Exception); ASSERT_FALSE(!!model); } + +TEST_F(IRFrontendTests, extension_proposal_network) { + // the Proposal with 2 inputs was initially marked as "extension" operation but later was added to opset + // the test checks that IR reader properly instantiate the "extension" Proposal as "opset6" Proposal + std::string xmlModel = R"V0G0N( + + + + + + + 1 + 12 + 34 + 62 + + + + + + + + 1 + 24 + 34 + 62 + + + + + + + + 3 + + + + + + + + 1 + 12 + 34 + 62 + + + 1 + 24 + 34 + 62 + + + 3 + + + + + 1000 + 5 + + + 1000 + + + + + + + 200 + 5 + + + + + + + + + + + + )V0G0N"; + + std::vector buffer(12, 0); + float* floatBuffer = reinterpret_cast(buffer.data()); + floatBuffer[0] = 0; + floatBuffer[1] = 0; + floatBuffer[2] = 0; + + createTemporalModelFile(xmlModel, buffer); + std::shared_ptr model; + + ASSERT_NO_THROW(model = core.read_model(xmlFileName, binFileName)); + ASSERT_TRUE(!!model); + + for (auto op : model->get_ordered_ops()) { + if (op->get_friendly_name() == "proposal" && + op->get_type_info() == ov::opset6::Proposal::get_type_info_static()) { + return; + } + } + FAIL() << "Custom proposal layer is not an opset6 operation."; +} + +TEST_F(IRFrontendTests, model_with_tensor_names_with_spaces) { + std::string testModel = R"V0G0N( + + + + + + + 1 + 4 + 512 + + + + + + + + 1 + 4 + 512 + + + + + + + + 1 + 4 + 512 + + + 1 + 4 + 512 + + + + + 1 + 4 + 512 + + + + + + + 1 + 4 + 512 + + + + + + + + + + + )V0G0N"; + + std::shared_ptr model; + + ASSERT_NO_THROW(model = core.read_model(testModel, ov::Tensor())); + ASSERT_TRUE(!!model); + + auto outputs = model->outputs(); + EXPECT_EQ(outputs.size(), 1); + auto names = outputs.at(0).get_names(); + EXPECT_EQ(names.size(), 1); + auto it = names.find("output 0([1 4 512])"); + EXPECT_NE(it, names.end()); +} + +TEST_F(IRFrontendTests, model_with_tensor_names_add_output) { + std::string testModel = R"V0G0N( + + + + + + + 1 + 4 + 512 + + + + + + + + 1 + 4 + 512 + + + + + + + + 1 + 4 + 512 + + + 1 + 4 + 512 + + + + + 1 + 4 + 512 + + + + + + + 1 + 4 + 512 + + + + + 1 + 4 + 512 + + + + + + + + + + 1 + 4 + 512 + + + + + + + + + + +)V0G0N"; + + std::shared_ptr model; + std::string tensor_name = "output add"; + + ASSERT_NO_THROW(model = core.read_model(testModel, ov::Tensor())); + ASSERT_TRUE(!!model); + + model->add_output(tensor_name); + auto outputs = model->outputs(); + EXPECT_EQ(outputs.size(), 2); + auto names = outputs.at(1).get_names(); + EXPECT_EQ(names.size(), 1); + auto it = names.find(tensor_name); + EXPECT_NE(it, names.end()); +} + +TEST_F(IRFrontendTests, name_with_comma) { + std::string testModel = R"V0G0N( + + + + + + + 1 + 3 + 22 + 22 + + + + + + + 1 + 3 + 22 + 22 + + + + + 1 + 3 + 22 + 22 + + + + + + + 1 + 3 + 22 + 22 + + + + + + + + + +)V0G0N"; + + std::shared_ptr model; + std::string tensor_name = "relu,t"; + + ASSERT_NO_THROW(model = core.read_model(testModel, ov::Tensor())); + ASSERT_TRUE(!!model); + + model->add_output(tensor_name); + auto outputs = model->outputs(); + EXPECT_EQ(outputs.size(), 1); + auto names = outputs.at(0).get_names(); + auto it = names.find(tensor_name); + EXPECT_NE(it, names.end()); +} diff --git a/src/frontends/ir/tests/tensor_iterator_deserialization.cpp b/src/frontends/ir/tests/tensor_iterator_deserialization.cpp index db26b73850e04b..74bfdd3f81a3a8 100644 --- a/src/frontends/ir/tests/tensor_iterator_deserialization.cpp +++ b/src/frontends/ir/tests/tensor_iterator_deserialization.cpp @@ -250,3 +250,1197 @@ TEST_F(IRFrontendTestsTensorIterator, tensor_iterator_slised_input) { const auto res = fc.compare(model, modelRef); EXPECT_TRUE(res.valid) << res.message; } + +TEST_F(IRFrontendTestsTensorIterator, loop1) { + std::string xmlModel = R"V0G0N( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + 1 + + + + + 1 + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 1 + 1 + 1 + + + + + + + + + + + + + + +)V0G0N"; + + std::vector buffer(8, 0); + int64_t* int64Buffer = reinterpret_cast(buffer.data()); + int64Buffer[0] = 0; + + createTemporalModelFile(xmlModel, buffer); + std::shared_ptr model; + + ASSERT_NO_THROW(model = core.read_model(xmlFileName, binFileName)); + ASSERT_TRUE(!!model); +} + +TEST_F(IRFrontendTestsTensorIterator, loop2) { + std::string xmlModel = R"V0G0N( + + + + + + + 1 + + + + + + + + + + + + + + 1 + 2 + + + + + + + 1 + + + + 1 + 2 + + + + + 1 + 2 + + + 3 + 1 + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 2 + + + + + + + + 1 + 2 + + + + + + + 1 + 2 + + + 1 + 2 + + + + + 1 + 2 + + + + + + + 1 + 2 + + + + + + + + 1 + + + + + + + 1 + 2 + + + 1 + + + + + 3 + 1 + 2 + + + + + + + 3 + 1 + 2 + + + + + + + + + + + + + + + + + + + 1 + 2 + + + + + + + 3 + 1 + 2 + + + + + + + + + + + + +)V0G0N"; + + std::vector buffer(8, 0); + float* floatBuffer = reinterpret_cast(buffer.data()); + floatBuffer[0] = 0; + floatBuffer[1] = 0; + + createTemporalModelFile(xmlModel, buffer); + std::shared_ptr model; + + ASSERT_NO_THROW(model = core.read_model(xmlFileName, binFileName)); + ASSERT_TRUE(!!model); +} + +TEST_F(IRFrontendTestsTensorIterator, loop_external_port1_is_not_connected) { + std::string xmlModel = R"V0G0N( + + + + + + + 1 + + + + + + + + + + + + + + 1 + 2 + + + + + + + 1 + + + + 1 + 2 + + + + + 1 + 2 + + + 3 + 1 + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 2 + + + + + + + + 1 + 2 + + + + + + + 1 + 2 + + + 1 + 2 + + + + + 1 + 2 + + + + + + + 1 + 2 + + + + + + + + 1 + + + + + + + 1 + 2 + + + 1 + + + + + 3 + 1 + 2 + + + + + + + 3 + 1 + 2 + + + + + + + + + + + + + + + + + + + 1 + 2 + + + + + + + 3 + 1 + 2 + + + + + + + + + + + + +)V0G0N"; + + std::vector buffer(8, 0); + float* floatBuffer = reinterpret_cast(buffer.data()); + floatBuffer[0] = 0; + floatBuffer[1] = 0; + + createTemporalModelFile(xmlModel, buffer); + std::shared_ptr model; + + ASSERT_NO_THROW(model = core.read_model(xmlFileName, binFileName)); + ASSERT_TRUE(!!model); +} + +TEST_F(IRFrontendTestsTensorIterator, tensor_iterator_resnet_opset4) { + std::string xmlModel = R"V0G0N( + + + + + + + 16 + 1 + 512 + + + + + + + + 1 + 512 + + + + + + + + 1 + 512 + + + + + + + 16 + 1 + 512 + + + 1 + 512 + + + 1 + 512 + + + + + 16 + 1 + 512 + + + 1 + 512 + + + 1 + 512 + + + + + + + + + + + + + + + + + + + + + 1 + 1 + 512 + + + + + + + + 2 + + + + + + + + 1 + 1 + 512 + + + 2 + + + + + 1 + 512 + + + + + + + + 1 + 512 + + + + + + + + 1 + 512 + + + + + + + + 2048 + 512 + + + + + + + + 2048 + 512 + + + + + + + + 2048 + + + + + + + + 1 + 512 + + + 1 + 512 + + + 1 + 512 + + + 2048 + 512 + + + 2048 + 512 + + + 2048 + + + + + 1 + 512 + + + 1 + 512 + + + + + + + 1 + 512 + + + + + + + 1 + 512 + + + + + + + + 3 + + + + + + + + 1 + 512 + + + 3 + + + + + 1 + 1 + 512 + + + + + + + 1 + 1 + 512 + + + + + + + + + + + + + + + + + + + + + + + + + 16 + 1 + 512 + + + + + + + 1 + 512 + + + + + + + 1 + 512 + + + + + + + + + + + + + + )V0G0N"; + + std::vector buffer(8396840, 0); + int64_t* int64Buffer = reinterpret_cast(buffer.data()); + int64Buffer[0] = 1; + int64Buffer[1] = 512; + + int64Buffer[1049602] = 1; + int64Buffer[1049603] = 1; + int64Buffer[1049604] = 512; + + createTemporalModelFile(xmlModel, buffer); + std::shared_ptr model; + + ASSERT_NO_THROW(model = core.read_model(xmlFileName, binFileName)); + ASSERT_TRUE(!!model); +} + +TEST_F(IRFrontendTestsTensorIterator, tensor_iterator_negative_stride_opset4) { + std::string xmlModel = R"V0G0N( + + + + + + + 1 + 25 + 512 + + + + + + + + 1 + 256 + + + + + + + + 1 + 256 + + + + + + + 1 + 25 + 512 + + + 1 + 256 + + + 1 + 256 + + + + + 1 + 25 + 256 + + + + + + + + + + + + + + + + + + + 1 + 1 + 512 + + + + + + + + 2 + + + + + + + + 1 + 1 + 512 + + + 2 + + + + + 1 + 512 + + + + + + + + 1 + 256 + + + + + + + + 1 + 256 + + + + + + + + 1024 + 512 + + + + + + + + 1024 + 256 + + + + + + + + 1024 + + + + + + + + 1 + 512 + + + 1 + 256 + + + 1 + 256 + + + 1024 + 512 + + + 1024 + 256 + + + 1024 + + + + + 1 + 256 + + + 1 + 256 + + + + + + + 1 + 256 + + + + + + + 1 + 256 + + + + + + + + 3 + + + + + + + + 1 + 256 + + + 3 + + + + + 1 + 1 + 256 + + + + + + + 1 + 1 + 256 + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 25 + 256 + + + + + + + + + + + + )V0G0N"; + + std::vector buffer(3149864, 0); + int64_t* int64Buffer = reinterpret_cast(buffer.data()); + int64Buffer[0] = 1; + int64Buffer[1] = 512; + + int64Buffer[393730] = 1; + int64Buffer[393731] = 1; + int64Buffer[393732] = 256; + + createTemporalModelFile(xmlModel, buffer); + std::shared_ptr model; + + ASSERT_NO_THROW(model = core.read_model(xmlFileName, binFileName)); + ASSERT_TRUE(!!model); +} diff --git a/src/tests/functional/inference_engine/CMakeLists.txt b/src/tests/functional/inference_engine/CMakeLists.txt index d303e8408b53b9..60a5f2acc5d958 100644 --- a/src/tests/functional/inference_engine/CMakeLists.txt +++ b/src/tests/functional/inference_engine/CMakeLists.txt @@ -92,7 +92,6 @@ ie_faster_build(${TARGET_NAME} file(GLOB_RECURSE legacy_tests "${CMAKE_CURRENT_SOURCE_DIR}/transformations/legacy/*.cpp" # CVS-55385 - "${CMAKE_CURRENT_SOURCE_DIR}/ngraph_reader/*.cpp" # CVS-55365 "${CMAKE_CURRENT_SOURCE_DIR}/cnn_network/cnn_ngraph_impl_tests.cpp" # CVS-55375 ) diff --git a/src/tests/functional/inference_engine/ngraph_reader/abs_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/abs_tests.cpp deleted file mode 100644 index c7441e61268bed..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/abs_tests.cpp +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -#include -#include -#include - -class FakeAbs : public ngraph::op::Op { -public: - OPENVINO_OP("Abs", "experimental"); - - FakeAbs() = default; - FakeAbs(const ngraph::Output& arg): ngraph::op::Op({arg}) { - constructor_validate_and_infer_types(); - } - void validate_and_infer_types() override { - set_output_type(0, get_input_element_type(0), get_input_partial_shape(0)); - } - std::shared_ptr clone_with_new_inputs(const ngraph::OutputVector& new_args) const override { - return std::make_shared(new_args.at(0)); - } - bool visit_attributes(ngraph::AttributeVisitor&) override { - return true; - } -}; - -class AbsFakeExtension: public InferenceEngine::IExtension { -public: - void GetVersion(const InferenceEngine::Version*& versionInfo) const noexcept override {} - void Unload() noexcept override {} - - std::map getOpSets() override{ - std::map opsets; - ngraph::OpSet opset; - opset.insert(); - opsets[FakeAbs::get_type_info_static().version_id] = opset; - return opsets; - } -}; - -TEST_F(NGraphReaderTests, ReadAbsFromCustomOpsetNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - - Core ie; - ie.AddExtension(std::make_shared()); - Blob::Ptr weights; - - auto network = ie.ReadNetwork(model, weights); - auto nGraph = network.getFunction(); - bool genericNodeExists = false; - const std::string type = "Abs"; - for (auto op : nGraph->get_ops()) { - if (type == op->get_type_info().name) - genericNodeExists = true; - } - ASSERT_TRUE(genericNodeExists); -} - -TEST_F(NGraphReaderTests, ReadAbsNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/acos_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/acos_tests.cpp deleted file mode 100644 index 82a05ab0fdb0af..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/acos_tests.cpp +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include - -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadAcosNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/add_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/add_tests.cpp deleted file mode 100644 index 7c90eeb53687ba..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/add_tests.cpp +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include - -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadAddBcastNetwork) { - std::string model = R"V0G0N( - - - - - - - 3 - 4 - 5 - - - - - - - - 5 - - - - - - - - 3 - - - - - - - - 5 - - - 3 - - - - - 1 - 1 - 5 - - - - - - - 3 - 4 - 5 - - - 1 - 1 - 5 - - - - - 3 - 4 - 5 - - - - - - - 3 - 4 - 5 - - - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 3 - 4 - 5 - - - - - - - 5 - - - - - - - 3 - - - - - - - - - - - 5 - - - 3 - - - - - 1 - 1 - 5 - - - - - - - - 3 - 4 - 5 - - - 1 - 1 - 5 - - - - - 3 - 4 - 5 - - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV7, 24, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - data[0] = 1; - data[1] = 1; - data[2] = 5; - }); -} - -TEST_F(NGraphReaderTests, ReadAddNetwork) { - std::string model = R"V0G0N( - - - - - - - 3 - 4 - 5 - - - - - - - - 3 - 4 - 5 - - - - - - - 3 - 4 - 5 - - - 3 - 4 - 5 - - - - - 3 - 4 - 5 - - - - - - - 3 - 4 - 5 - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 3 - 4 - 5 - - - - - - - 3 - 4 - 5 - - - - - - - - 3 - 4 - 5 - - - 3 - 4 - 5 - - - - - 3 - 4 - 5 - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV7, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/asin_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/asin_tests.cpp deleted file mode 100644 index bcf6f95ef2d082..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/asin_tests.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadAsinNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/atan_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/atan_tests.cpp deleted file mode 100644 index c0866dae4f7a3c..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/atan_tests.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadAtanNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/batch_norm_inference_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/batch_norm_inference_tests.cpp deleted file mode 100644 index ae4ece6b8c64e2..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/batch_norm_inference_tests.cpp +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, DISABLED_ReadBatchNormInferenceNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 3 - 3 - 1 - 1 - - - - - - - - 1 - 3 - 22 - 22 - - - 3 - 3 - 1 - 1 - - - - - 1 - 3 - 22 - 22 - - - - - - - - 3 - - - - - - - - 3 - - - - - - - - 3 - - - - - - - - 3 - - - - - - - - 1 - 3 - 22 - 22 - - - 3 - - - 3 - - - 3 - - - 3 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 139840); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/binary_convolution_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/binary_convolution_tests.cpp deleted file mode 100644 index a918de4da89ef3..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/binary_convolution_tests.cpp +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadBinaryConvolutionNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 28 - 28 - - - - - - - - 64 - 64 - 1 - 1 - - - - - - - - 1 - 64 - 28 - 28 - - - 64 - 64 - 1 - 1 - - - - - 1 - 64 - 28 - 28 - - - - - - - 1 - 64 - 28 - 28 - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 64 - 28 - 28 - - - - - - - - 1 - 64 - 28 - 28 - - - - - 1 - 64 - 28 - 28 - - - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 1288); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/broadcast_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/broadcast_tests.cpp deleted file mode 100644 index 522255dced03eb..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/broadcast_tests.cpp +++ /dev/null @@ -1,769 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ConvertBroadcastToTiles1) { - std::string model = R"V0G0N( - - - - - - - 112 - 1 - - - - - - - - 4 - - - - - - - 112 - 1 - - - 4 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 112 - 1 - - - - - - - 4 - - - - - - - - - - - 112 - 1 - - - 4 - - - - - 1 - 1 - 112 - 1 - - - - - - - - 1 - 1 - 112 - 1 - - - - - 1 - 1 - 112 - 112 - - - - - - - - 1 - 1 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 6422528, [](Blob::Ptr& weights) { - auto * broadcast1_shape = reinterpret_cast(weights->buffer().as() + 256); - broadcast1_shape[0] = 1; - broadcast1_shape[1] = 64; - broadcast1_shape[2] = 112; - broadcast1_shape[3] = 112; - }); -} - -TEST_F(NGraphReaderTests, ConvertBroadcastToTiles2) { - std::string model = R"V0G0N( - - - - - - - 1 - - - - - - - - 4 - - - - - - - 1 - - - 4 - - - 4 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - - - - - - - 4 - - - - - - - - - - - 1 - - - 4 - - - - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 1 - 1 - 1 - - - - - 1 - 1 - 1 - 112 - - - - - - - - 1 - 1 - 1 - 112 - - - - - 1 - 1 - 112 - 112 - - - - - - - - 1 - 1 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 6422528, [](Blob::Ptr& weights) { - auto * broadcast1_shape = reinterpret_cast(weights->buffer().as() + 256); - broadcast1_shape[0] = 1; - broadcast1_shape[1] = 64; - broadcast1_shape[2] = 112; - broadcast1_shape[3] = 112; - }); -} - -TEST_F(NGraphReaderTests, ConvertBroadcastToTiles3) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 1 - 112 - - - - - - - - 4 - - - - - - - 1 - 64 - 1 - 112 - - - 4 - - - 4 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 1 - 112 - - - - - - - - 1 - 64 - 1 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 6422528, [](Blob::Ptr& weights) { - auto * broadcast1_shape = reinterpret_cast(weights->buffer().as() + 256); - broadcast1_shape[0] = 1; - broadcast1_shape[1] = 64; - broadcast1_shape[2] = 112; - broadcast1_shape[3] = 112; - }); -} - -TEST_F(NGraphReaderTests, ConvertBroadcastToTiles4) { - std::string model = R"V0G0N( - - - - - - - 3 - 64 - - - - - - - - 4 - - - - - - - - 2 - - - - - - - 3 - 64 - - - 4 - - - 2 - - - - - 1 - 3 - 64 - 64 - - - - - - - 1 - 3 - 64 - 64 - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 3 - 64 - - - - - - - 4 - - - - - - - - - - - 3 - 64 - - - 4 - - - - - 1 - 3 - 64 - 1 - - - - - - - - 1 - 3 - 64 - 1 - - - - - 1 - 3 - 64 - 64 - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 6422528, [](Blob::Ptr& weights) { - auto * broadcast1_shape = reinterpret_cast(weights->buffer().as() + 256); - broadcast1_shape[0] = 1; - broadcast1_shape[1] = 3; - broadcast1_shape[2] = 64; - broadcast1_shape[3] = 64; - - broadcast1_shape[4] = 1; - broadcast1_shape[5] = 2; - }); -} - -TEST_F(NGraphReaderTests, DISABLED_ConvertBroadcastToTiles5) { - std::string model = R"V0G0N( - - - - - - 1 - 64 - - - - - - - - 4 - - - - - - - - 2 - - - - - - - 1 - 64 - - - 4 - - - 2 - - - - - 1 - 3 - 64 - 64 - - - - - - - 1 - 3 - 64 - 64 - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - - - - - - - 4 - - - - - - - - - - 1 - 64 - - - 4 - - - - - 1 - 1 - 64 - 1 - - - - - - - - 1 - 1 - 64 - 1 - - - - - 1 - 1 - 64 - 64 - - - - - - - - 1 - 1 - 64 - 64 - - - - - 1 - 3 - 64 - 64 - - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 6422528, [](Blob::Ptr& weights) { - auto * broadcast1_shape = reinterpret_cast(weights->buffer().as() + 256); - broadcast1_shape[0] = 1; - broadcast1_shape[1] = 3; - broadcast1_shape[2] = 64; - broadcast1_shape[3] = 64; - - broadcast1_shape[4] = 1; - broadcast1_shape[5] = 2; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/ceiling_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/ceiling_tests.cpp deleted file mode 100644 index 9f1371daf27d5b..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/ceiling_tests.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadCeilingNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/clamp_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/clamp_tests.cpp deleted file mode 100644 index 15bf05ce6c3d60..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/clamp_tests.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadClampNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - " - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - " - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/concat_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/concat_tests.cpp deleted file mode 100644 index 54550758149e3e..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/concat_tests.cpp +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadConcatNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - 1 - 3 - 22 - 22 - - - - - 1 - 6 - 22 - 22 - - - - - - - 1 - 6 - 22 - 22 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - 1 - 3 - 22 - 22 - - - - - 1 - 6 - 22 - 22 - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/constant_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/constant_tests.cpp deleted file mode 100644 index 9581a33fb9c9e3..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/constant_tests.cpp +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -using namespace InferenceEngine; - -TEST_F(NGraphReaderTests, ReadConstantNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - Core ie; - Blob::Ptr weights; - - weights = make_shared_blob(TensorDesc(Precision::U8, {5808}, Layout::C)); - weights->allocate(); - - auto network = ie.ReadNetwork(model, weights); -} - -TEST_F(NGraphReaderTests, ReadConstantNetworkWithNegativeDimension) { - // test for IR Parser that dimensions with negative values are not allowed - std::string model = R"V0G0N( - - - - - - - 1 - -3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - Core ie; - Blob::Ptr weights; - - weights = make_shared_blob(TensorDesc(Precision::U8, {5808}, Layout::C)); - weights->allocate(); - - EXPECT_THROW(ie.ReadNetwork(model, weights), std::exception); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/convert_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/convert_tests.cpp deleted file mode 100644 index 881db2d5862077..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/convert_tests.cpp +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadConvertNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 4 - - - - - - - - 1 - 3 - 4 - - - - - 1 - 3 - 4 - - - - - - - 1 - 3 - 4 - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 3 - 4 - - - - - - - - 1 - 3 - 4 - - - - - 1 - 3 - 4 - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 0); -} \ No newline at end of file diff --git a/src/tests/functional/inference_engine/ngraph_reader/convolution_backprop_data_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/convolution_backprop_data_tests.cpp deleted file mode 100644 index eb30034f7519f2..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/convolution_backprop_data_tests.cpp +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadConvolutionBackpropDataNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 1024 - 23 - 30 - - - - - - - - 1024 - 512 - 2 - 2 - - - - - - - - 1 - 1024 - 23 - 30 - - - 1024 - 512 - 2 - 2 - - - - - 1 - 512 - 46 - 60 - - - - - - - - 1 - 512 - 1 - 1 - - - - - - - 1 - 512 - 46 - 60 - - - 1 - 512 - 1 - 1 - - - - - 1 - 512 - 46 - 60 - - - - - - - 1 - 512 - 46 - 60 - - - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 1024 - 23 - 30 - - - - - - - - 1 - 1024 - 23 - 30 - - - - - 1 - 512 - 46 - 60 - - - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 8390656); -} \ No newline at end of file diff --git a/src/tests/functional/inference_engine/ngraph_reader/convolution_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/convolution_tests.cpp deleted file mode 100644 index 205e9ac93fd2e1..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/convolution_tests.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadConvolutionNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 227 - 227 - - - - - - - - 96 - 3 - 11 - 11 - - - - - - - - 1 - 3 - 227 - 227 - - - 96 - 3 - 11 - 11 - - - - - 1 - 96 - 55 - 55 - - - - - - - 1 - 96 - 55 - 55 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 227 - 227 - - - - - - - - 1 - 3 - 227 - 227 - - - - - 1 - 96 - 55 - 55 - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 139392); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/cos_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/cos_tests.cpp deleted file mode 100644 index 403dd21e888a9c..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/cos_tests.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadCosNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/cosh_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/cosh_tests.cpp deleted file mode 100644 index 137e3cb77f5259..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/cosh_tests.cpp +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include - -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadCoshNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/ctc_greedy_decoder_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/ctc_greedy_decoder_tests.cpp deleted file mode 100644 index 749b544624c0ed..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/ctc_greedy_decoder_tests.cpp +++ /dev/null @@ -1,246 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadCTCGreedyDecoderNetwork) { - std::string model = R"V0G0N( - - - - - - - 20 - 8 - 128 - - - - - - - - 20 - 8 - - - - - - - - 20 - 8 - 128 - - - 20 - 8 - - - - - 8 - 20 - 1 - 1 - - - - - - - 8 - 20 - 1 - 1 - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 20 - 8 - 128 - - - - - - - 20 - 8 - - - - - - - - - - - 20 - 8 - 128 - - - 20 - 8 - - - - - 8 - 20 - 1 - 1 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 640); -} - - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadCTCGreedyDecoderNoMergeNetwork) { - std::string model = R"V0G0N( - - - - - - - 20 - 8 - 128 - - - - - - - - 20 - 8 - - - - - - - - 20 - 8 - 128 - - - 20 - 8 - - - - - 8 - 20 - 1 - 1 - - - - - - - 8 - 20 - 1 - 1 - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 20 - 8 - 128 - - - - - - - 20 - 8 - - - - - - - - - - - 20 - 8 - 128 - - - 20 - 8 - - - - - 8 - 20 - 1 - 1 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 640); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/custom_op_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/custom_op_tests.cpp deleted file mode 100644 index 3cc01fb1195d12..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/custom_op_tests.cpp +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include -#include -#include "ngraph_reader_tests.hpp" - -class CustomAddConst : public ngraph::op::Op { -public: - OPENVINO_OP("CustomAddConst", "custom_opset"); - - CustomAddConst() = default; - CustomAddConst(const ngraph::Output& arg, const ngraph::element::Type element_type, - const ngraph::Shape shape, const std::shared_ptr data): - ngraph::op::Op({arg}), - m_element_type(element_type), - m_shape(shape), - m_data(data) { - constructor_validate_and_infer_types(); - } - void validate_and_infer_types() override { - set_output_type(0, m_element_type, m_shape); - } - std::shared_ptr clone_with_new_inputs(const ngraph::OutputVector& new_args) const override { - return std::make_shared(new_args.at(0), m_element_type, m_shape, m_data); - } - bool visit_attributes(ngraph::AttributeVisitor& visitor) override { - visitor.on_attribute("element_type", m_element_type); - visitor.on_attribute("shape", m_shape); - if (!m_data) { - m_data = std::make_shared(shape_size(m_shape) * m_element_type.size(), 64); - } - visitor.on_attribute("value", m_data); - return true; - } - - ngraph::Shape getShapeAttr() const { return m_shape; } - void* getDataPtr() { return (m_data ? m_data->get_ptr() : nullptr); } - -private: - ngraph::element::Type m_element_type; - ngraph::Shape m_shape{}; - std::shared_ptr m_data; -}; - -class CustomAddConstExtension : public InferenceEngine::IExtension { -public: - void GetVersion(const InferenceEngine::Version*& versionInfo) const noexcept override {} - - void Unload() noexcept override {} - - std::map getOpSets() override { - std::map opsets; - ngraph::OpSet opset; - opset.insert(); - opsets[CustomAddConst::get_type_info_static().version_id] = opset; - return opsets; - } -}; - -TEST_F(NGraphReaderTests, ReadCustomAddConstNetwork) { - std::string model = R"V0G0N( - - - - - - - 4 - - - - - - - - 4 - - - - - 4 - - - - - - - 4 - - - - - - - - - -)V0G0N"; - - const std::string expectedValue = std::string("0?|%.g6/,-{5~P1>"); - REPLACE_WITH_STR(model, "_VALUE_", expectedValue); - InferenceEngine::Blob::CPtr weights; - - InferenceEngine::Core ie; - ie.AddExtension(std::make_shared()); - auto network = ie.ReadNetwork(model, weights); - - bool found = false; - for (const auto & op : network.getFunction()->get_ops()) { - if (auto casted = std::dynamic_pointer_cast(op)) { - std::string actualValue(reinterpret_cast(casted->getDataPtr()), - expectedValue.length()); - ASSERT_EQ(expectedValue, actualValue); - found = true; - } - } - ASSERT_TRUE(found); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/deconvolution_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/deconvolution_tests.cpp deleted file mode 100644 index 277ba783dbf3fa..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/deconvolution_tests.cpp +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, DISABLED_ReadDeconvolution3DNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 512 - 4 - 4 - 4 - - - - - - - - 512 - 256 - 4 - 4 - 4 - - - - - - - - 1 - 512 - 4 - 4 - 4 - - - 512 - 256 - 4 - 4 - 4 - - - - - 1 - 256 - 8 - 8 - 8 - - - - - - - 1 - 256 - 8 - 8 - 8 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 512 - 4 - 4 - 4 - - - - - - - - 1 - 512 - 4 - 4 - 4 - - - - - 1 - 256 - 8 - 8 - 8 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 33554432); -} - -TEST_F(NGraphReaderTests, DISABLED_ReadDeconvolution2DNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 512 - 4 - 4 - - - - - - - - 512 - 256 - 4 - 4 - - - - - - - - 1 - 512 - 4 - 4 - - - 512 - 256 - 4 - 4 - - - - - 1 - 256 - 8 - 8 - - - - - - - 1 - 256 - 8 - 8 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 512 - 4 - 4 - - - - - - - - 1 - 512 - 4 - 4 - - - - - 1 - 256 - 8 - 8 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 33554432); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/deformable_convolution_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/deformable_convolution_tests.cpp deleted file mode 100644 index 3bd101556ff99f..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/deformable_convolution_tests.cpp +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadDeformableConvolutionNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 256 - 200 - 336 - - - - - - - - 1 - 18 - 100 - 168 - - - - - - - - 256 - 256 - 3 - 3 - - - - - - - - 1 - 256 - 200 - 336 - - - 1 - 18 - 100 - 168 - - - 256 - 256 - 3 - 3 - - - - - 1 - 256 - 100 - 168 - - - - - - - 1 - 256 - 100 - 168 - - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 256 - 200 - 336 - - - - - - - 1 - 18 - 100 - 168 - - - - - - - - 1 - 256 - 200 - 336 - - - 1 - 18 - 100 - 168 - - - - - 1 - 256 - 100 - 168 - - - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 2359296); -} \ No newline at end of file diff --git a/src/tests/functional/inference_engine/ngraph_reader/deformable_psroi_pooling_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/deformable_psroi_pooling_tests.cpp deleted file mode 100644 index 35f296d4139da0..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/deformable_psroi_pooling_tests.cpp +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadDeformablePSROIPoolingNetwork_incorrect_mode) { - std::string model = R"V0G0N( - - - - - - - 1 - 3240 - 38 - 38 - - - - - - - - 100 - 5 - - - - - - - - 1 - 3240 - 38 - 38 - - - 100 - 5 - - - - - 100 - 360 - 6 - 6 - - - - - - - 100 - 360 - 6 - 6 - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 3240 - 38 - 38 - - - - - - - 100 - 5 - - - - - - - - 1 - 3240 - 38 - 38 - - - 100 - 5 - - - - - 100 - 360 - 6 - 6 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7); -} - -TEST_F(NGraphReaderTests, ReadDeformablePSROIPoolingNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3240 - 38 - 38 - - - - - - - - 100 - 5 - - - - - - - - 1 - 3240 - 38 - 38 - - - 100 - 5 - - - - - 100 - 360 - 3 - 3 - - - - - - - 100 - 360 - 3 - 3 - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 3240 - 38 - 38 - - - - - - - 100 - 5 - - - - - - - - 1 - 3240 - 38 - 38 - - - 100 - 5 - - - - - 100 - 360 - 3 - 3 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/depth_to_space_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/depth_to_space_tests.cpp deleted file mode 100644 index a4d8e01f549fd0..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/depth_to_space_tests.cpp +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadDepthToSpaceNetwork) { - std::string model = R"V0G0N( - - - - - - - 5 - 4 - 28 - 2 - - - - - - - - 5 - 4 - 28 - 2 - - - - - 5 - 1 - 56 - 4 - - - - - - - 5 - 1 - 56 - 4 - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 5 - 4 - 28 - 2 - - - - - - - 6 - - - - - - - - - - - 5 - 4 - 28 - 2 - - - 6 - - - - - 5 - 2 - 2 - 1 - 28 - 2 - - - - - - - - 5 - 2 - 2 - 1 - 28 - 2 - - - - - 5 - 1 - 28 - 2 - 2 - 2 - - - - - - - 4 - - - - - - - - - - - 5 - 1 - 28 - 2 - 2 - 2 - - - 4 - - - - - 5 - 1 - 56 - 4 - - - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 80, [](Blob::Ptr& weights) { - auto* buffer = weights->buffer().as(); - buffer[0] = 0; - buffer[1] = 2; - buffer[2] = 2; - buffer[3] = 1; - buffer[4] = 28; - buffer[5] = 2; - buffer[7] = 0; - buffer[7] = 1; - buffer[8] = 56; - buffer[9] = 4; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/detection_output_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/detection_output_tests.cpp deleted file mode 100644 index 83dfc137e22a54..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/detection_output_tests.cpp +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, DISABLED_ReadDetectionOutputNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 38360 - - - - - - - 1 - 19180 - - - - - - - 1 - 2 - 38360 - - - - - - - - 1 - 38360 - - - 1 - 19180 - - - 1 - 2 - 38360 - - - 1 - 38360 - - - 1 - 19180 - - - - - 1 - 1 - 200 - 7 - - - - - - - 1 - 1 - 200 - 7 - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 38360 - - - - - - - 1 - 19180 - - - - - - - 1 - 2 - 38360 - - - - - - - - 1 - 38360 - - - 1 - 19180 - - - 1 - 2 - 38360 - - - - - 1 - 1 - 200 - 7 - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/dft.cpp b/src/tests/functional/inference_engine/ngraph_reader/dft.cpp deleted file mode 100644 index ac8afdfcad16ec..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/dft.cpp +++ /dev/null @@ -1,451 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -#include "common_test_utils/data_utils.hpp" - -TEST_F(NGraphReaderTests, ReadDFTNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 180 - 180 - 2 - - - - - - - - 2 - - - - - - - 1 - 180 - 180 - 2 - - - 2 - - - - - 1 - 180 - 180 - 2 - - - - - - - 1 - 180 - 180 - 2 - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 180 - 180 - 2 - - - - - - - 2 - - - - - - - - - - 1 - 180 - 180 - 2 - - - 2 - - - - - 1 - 180 - 180 - 2 - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV7, 16, [](Blob::Ptr& weights) { - auto * i64w = weights->buffer().as(); - i64w[0] = 2; - i64w[1] = 0; - }); -} - -TEST_F(NGraphReaderTests, ReadDFTNetwork2) { - std::string model = R"V0G0N( - - - - - - - 7 - 50 - 130 - 400 - 2 - - - - - - - - 3 - - - - - - - - 3 - - - - - - - 7 - 50 - 130 - 400 - 2 - - - 3 - - - 3 - - - - - 7 - 40 - 130 - 600 - 2 - - - - - - - 7 - 40 - 130 - 600 - 2 - - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 7 - 50 - 130 - 400 - 2 - - - - - - - 3 - - - - - - - - - - 3 - - - - - - - - - - 7 - 50 - 130 - 400 - 2 - - - 3 - - - 3 - - - - - 7 - 40 - 130 - 600 - 2 - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV7, 48, [](Blob::Ptr& weights) { - auto * i64w = weights->buffer().as(); - i64w[0] = 3; - i64w[1] = 0; - i64w[2] = 1; - i64w[3] = 600; - i64w[4] = -1; - i64w[5] = 40; - }); -} - -TEST_F(NGraphReaderTests, ReadDFTNetwork3) { - std::string model = R"V0G0N( - - - - - - - 7 - 15 - 200 - 124 - 70 - 2 - - - - - - - - 3 - - - - - - - - 3 - - - - - - - 7 - 15 - 200 - 124 - 70 - 2 - - - 3 - - - 3 - - - - - 7 - 15 - 100 - 124 - 280 - 2 - - - - - - - 7 - 15 - 100 - 124 - 280 - 2 - - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 7 - 15 - 200 - 124 - 70 - 2 - - - - - - - 3 - - - - - - - - - - 3 - - - - - - - - - - 7 - 15 - 200 - 124 - 70 - 2 - - - 3 - - - 3 - - - - - 7 - 15 - 100 - 124 - 280 - 2 - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV7, 48, [](Blob::Ptr& weights) { - auto * i64w = weights->buffer().as(); - i64w[0] = -3; - i64w[1] = 4; - i64w[2] = 0; - i64w[3] = 100; - i64w[4] = 280; - i64w[5] = -1; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/divide_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/divide_tests.cpp deleted file mode 100644 index c55117ddf3c9a7..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/divide_tests.cpp +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -#include "common_test_utils/data_utils.hpp" - -TEST_F(NGraphReaderTests, ReadDivideNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - - Blob::Ptr weights = make_shared_blob(TensorDesc(Precision::U8, {3245728}, Layout::C)); - weights->allocate(); - CommonTestUtils::fill_data(weights->buffer().as(), weights->size() / sizeof(float)); - - Core reader; - auto nGraph = reader.ReadNetwork(model, weights); - auto net = CNNNetwork(nGraph); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/einsum_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/einsum_tests.cpp deleted file mode 100644 index 0ddffaf4df75e0..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/einsum_tests.cpp +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include - -#include "ngraph_reader_tests.hpp" - -// since EinsumDecomposition is applied, disable these two tests -// until ngraph_reader_test checks only correctness of IR reading -TEST_F(NGraphReaderTests, DISABLED_ReadEinsumNetwork) { - std::string model = R"V0G0N( - - - - - - - 2 - 3 - 4 - - - - - - - - 5 - 3 - 4 - - - - - - - - 2 - 3 - 4 - - - 5 - 3 - 4 - - - - - 2 - 5 - - - - - - - 2 - 5 - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 2 - 3 - 4 - - - - - - - 5 - 3 - 4 - - - - - - - - 2 - 3 - 4 - - - 5 - 3 - 4 - - - - - 2 - 5 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7); -} - -TEST_F(NGraphReaderTests, DISABLED_ReadEinsumNetwork2) { - std::string model = R"V0G0N( - - - - - - - 2 - 3 - 4 - 5 - - - - - - - - 4 - 5 - 6 - - - - - - - - 7 - 4 - 5 - - - - - - - - 2 - 3 - 4 - 5 - - - 4 - 5 - 6 - - - 7 - 4 - 5 - - - - - 2 - 3 - 6 - - - - - - - 2 - 3 - 6 - - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 2 - 3 - 4 - 5 - - - - - - - 4 - 5 - 6 - - - - - - - 7 - 4 - 5 - - - - - - - - 2 - 3 - 4 - 5 - - - 4 - 5 - 6 - - - 7 - 4 - 5 - - - - - 2 - 3 - 6 - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/elu_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/elu_tests.cpp deleted file mode 100644 index 43527739fefb2a..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/elu_tests.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadELUNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/equal_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/equal_tests.cpp deleted file mode 100644 index 868711a6a49228..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/equal_tests.cpp +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadEqualNetwork) { - std::string model = R"V0G0N( - - - - - - - 256 - 56 - - - - - - - - 256 - 56 - - - - - - 256 - 56 - - - 256 - 56 - - - - - 256 - 56 - - - - - - - 256 - 56 - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 256 - 56 - - - - - - - 256 - 56 - - - - - - - - 256 - 56 - - - 256 - 56 - - - - - 256 - 56 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7); -} - -TEST_F(NGraphReaderTests, ReadEqualBroadcastNetwork) { - std::string model = R"V0G0N( - - - - - - - 8 - 1 - 1 - 6 - - - - - - - - 1 - 5 - 7 - 1 - - - - - - - 8 - 1 - 1 - 6 - - - 1 - 5 - 7 - 1 - - - - - 8 - 5 - 7 - 6 - - - - - - - 8 - 5 - 7 - 6 - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 8 - 1 - 1 - 6 - - - - - - - 1 - 5 - 7 - 1 - - - - - - - - 8 - 1 - 1 - 6 - - - 1 - 5 - 7 - 1 - - - - - 8 - 5 - 7 - 6 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7); -} \ No newline at end of file diff --git a/src/tests/functional/inference_engine/ngraph_reader/erf_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/erf_tests.cpp deleted file mode 100644 index 5ac0fff36e6879..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/erf_tests.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadErfNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/exp_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/exp_tests.cpp deleted file mode 100644 index ba32bd84fe73c2..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/exp_tests.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadExpNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/fake_quantize_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/fake_quantize_tests.cpp deleted file mode 100644 index f669ebcbaf48f3..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/fake_quantize_tests.cpp +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -#include "common_test_utils/data_utils.hpp" - -TEST_F(NGraphReaderTests, ReadFQNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 56 - 96 - 168 - - - - - - - - 1 - 56 - 1 - 1 - - - - - - - - 1 - 56 - 1 - 1 - - - - - - - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 56 - 96 - 168 - - - 1 - 56 - 1 - 1 - - - 1 - 56 - 1 - 1 - - - 1 - 1 - 1 - 1 - - - 1 - 1 - 1 - 1 - - - - - 1 - 56 - 96 - 168 - - - - - - - 1 - 56 - 96 - 168 - - - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 56 - 96 - 168 - - - - - - - 1 - 56 - 1 - 1 - - - - - - - - - - 1 - 56 - 1 - 1 - - - - - - - - - - 1 - 1 - 1 - 1 - - - - - - - - - - 1 - 1 - 1 - 1 - - - - - - - - - - - 1 - 56 - 96 - 168 - - - 1 - 56 - 1 - 1 - - - 1 - 56 - 1 - 1 - - - 1 - 1 - 1 - 1 - - - 1 - 1 - 1 - 1 - - - - - 1 - 56 - 96 - 168 - - - - - - - - - - - - - -)V0G0N"; - - Blob::Ptr weights = make_shared_blob(TensorDesc(Precision::U8, {139392}, Layout::C)); - weights->allocate(); - CommonTestUtils::fill_data(weights->buffer().as(), weights->size() / sizeof(float)); - - Core reader; - auto cnn = reader.ReadNetwork(model, weights); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/floor_mod_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/floor_mod_tests.cpp deleted file mode 100644 index 6ddb337b1562bd..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/floor_mod_tests.cpp +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadFloorModNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 1 - 4 - - - - - - - - 1 - - - - - - - - 3 - - - - - - - - 1 - - - 3 - - - - - 1 - 1 - 1 - - - - - - - 1 - 1 - 4 - - - 1 - 1 - 1 - - - - - 1 - 1 - 4 - - - - - - - 1 - 1 - 4 - - - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 1 - 4 - - - - - - - 1 - - - - - - - 3 - - - - - - - - - - - 1 - - - 3 - - - - - 1 - 1 - 1 - - - - - - - - 1 - 1 - 4 - - - 1 - 1 - 1 - - - - - 1 - 1 - 4 - - - - - - - - - - - -)V0G0N"; - // compareIRs(model, modelV7, 0); - compareIRs(model, modelV7, 40, [](Blob::Ptr& weights) { - auto* buffer = weights->buffer().as(); - buffer[0] = 1; - buffer[1] = 1; - buffer[2] = 1; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/floor_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/floor_tests.cpp deleted file mode 100644 index 550d2346815f78..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/floor_tests.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadFloorNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/fusion_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/fusion_tests.cpp deleted file mode 100644 index 0b9d412bd96792..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/fusion_tests.cpp +++ /dev/null @@ -1,595 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ConvBiasFusion) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 227 - 227 - - - - - - - - 96 - 3 - 11 - 11 - - - - - - - - 1 - 3 - 227 - 227 - - - 96 - 3 - 11 - 11 - - - - - 1 - 96 - 55 - 55 - - - - - - - - 96 - 1 - 1 - - - - - - - 1 - 96 - 55 - 55 - - - 96 - 1 - 1 - - - - - 1 - 96 - 55 - 55 - - - - - - - 1 - 96 - 55 - 55 - - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 227 - 227 - - - - - - - - 1 - 3 - 227 - 227 - - - - - 1 - 96 - 55 - 55 - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 139840, [](Blob::Ptr& weights) { - auto * broadcast_shape = reinterpret_cast(weights->buffer().as() + 139776); - broadcast_shape[0] = 1; - broadcast_shape[1] = 96; - broadcast_shape[2] = 55; - broadcast_shape[3] = 55; - }); -} - -TEST_F(NGraphReaderTests, DISABLED_ConvBiasFusionFP16) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 227 - 227 - - - - - - - - 96 - 3 - 11 - 11 - - - - - - - - 1 - 3 - 227 - 227 - - - 96 - 3 - 11 - 11 - - - - - 1 - 96 - 55 - 55 - - - - - - - - 96 - 1 - 1 - - - - - - - 1 - 96 - 55 - 55 - - - 96 - 1 - 1 - - - - - 1 - 96 - 55 - 55 - - - - - - - 1 - 96 - 55 - 55 - - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 227 - 227 - - - - - - - - 1 - 3 - 227 - 227 - - - - - 1 - 96 - 55 - 55 - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 139840, [](Blob::Ptr& weights) { - auto * broadcast_shape = reinterpret_cast(weights->buffer().as() + 139776); - broadcast_shape[0] = 1; - broadcast_shape[1] = 96; - broadcast_shape[2] = 55; - broadcast_shape[3] = 55; - }); -} - -TEST_F(NGraphReaderTests, MatMulBiasFusionNoBroadcast) { - std::string model = R"V0G0N( - - - - - - - 1 - 2048 - - - - - - - - 2048 - 1000 - - - - - - - 1 - 2048 - - - 2048 - 1000 - - - - - 1 - 1000 - - - - - - - - 1 - 1000 - - - - - - - 1 - 1000 - - - 1 - 1000 - - - - - 1 - 1000 - - - - - - - 1 - 1000 - - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 2048 - - - - - - - - 1 - 2048 - - - - - 1 - 1000 - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 8196024); -} - -TEST_F(NGraphReaderTests, DISABLED_MatMulBiasFusion) { - std::string model = R"V0G0N( - - - - - - 1 - 2048 - - - - - - - - 2048 - 1000 - - - - - - - 1 - 2048 - - - 2048 - 1000 - - - - - 1 - 1000 - - - - - - - - 1000 - - - - - - - - 2 - - - - - - - - 4 - - - - - - - 1000 - - - 2 - - - 4 - - - - - 1 - 1000 - - - - - - - 1 - 1000 - - - 1 - 1000 - - - - - 1 - 1000 - - - - - - - 1 - 1000 - - - - - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 2048 - - - - - - - - 1 - 2048 - - - - - 1 - 1000 - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 8196024); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/gather_elements_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/gather_elements_tests.cpp deleted file mode 100644 index f3e2cab56ba4d4..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/gather_elements_tests.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadGatherElementsNetwork) { - std::string model = R"V0G0N( - - - - - - - 3 - 7 - 5 - - - - - - - - 3 - 10 - 5 - - - - - - - - 3 - 7 - 5 - - - 3 - 10 - 5 - - - - - 3 - 10 - 5 - - - - - - - 3 - 10 - 5 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 3 - 7 - 5 - - - - - - - 3 - 10 - 5 - - - - - - - - 3 - 7 - 5 - - - 3 - 10 - 5 - - - - - 3 - 10 - 5 - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 10); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/gather_nd_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/gather_nd_tests.cpp deleted file mode 100644 index 5d38178ed68b2b..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/gather_nd_tests.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadGatherNDNetwork) { - std::string model = R"V0G0N( - - - - - - - 10 - 20 - 30 - - - - - - - - 10 - 3 - 2 - - - - - - - - 10 - 20 - 30 - - - 10 - 3 - 2 - - - - - 10 - 3 - 30 - - - - - - - 10 - 3 - 30 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 10 - 20 - 30 - - - - - - - 10 - 3 - 2 - - - - - - - - 10 - 20 - 30 - - - 10 - 3 - 2 - - - - - 10 - 3 - 30 - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 10); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/gather_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/gather_tests.cpp deleted file mode 100644 index a78422f717188d..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/gather_tests.cpp +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, Read_Gather1_Network) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 4 - - - - - - - - 1 - - - - - - - - - - - - - 1 - 3 - 4 - - - 1 - - - - - - 1 - 3 - 4 - - - - - - - 1 - 3 - 4 - - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 3 - 4 - - - - - - - 1 - - - - - - - - 1 - 3 - 4 - - - 1 - - - - - 1 - 3 - 4 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 16, [](Blob::Ptr& weights) { - auto* buffer = weights->buffer().as(); - buffer[0] = 0; - }); -} - -TEST_F(NGraphReaderTests, Read_Gather7_Network) { - std::string model = R"V0G0N( - - - - - - - 2 - 3 - 4 - - - - - - - - 8 - 16 - - - - - - - - - - - - - - 2 - 3 - 4 - - - 8 - 16 - - - - - - 2 - 8 - 16 - 4 - - - - - - - 2 - 8 - 16 - 4 - - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 2 - 3 - 4 - - - - - - - 8 - 16 - - - - - - - - 2 - 3 - 4 - - - 8 - 16 - - - - - 2 - 8 - 16 - 4 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 8, [](Blob::Ptr& weights) { - auto* buffer = weights->buffer().as(); - buffer[0] = 1; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/gather_tree_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/gather_tree_tests.cpp deleted file mode 100644 index 7adb42c3995a9d..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/gather_tree_tests.cpp +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadGatherTreeNetwork) { - std::string model = R"V0G0N( - - - - - - - 100 - 1 - 10 - - - - - - - - 100 - 1 - 10 - - - - - - - - 1 - - - - - - - - - - - - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 1 - - - - - - - 100 - 1 - 10 - - - - - - - 100 - 1 - 10 - - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 100 - 1 - 10 - - - - - - - 100 - 1 - 10 - - - - - - - 1 - - - - - - - 1 - - - - - - - - - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 1 - - - 1 - - - - - 100 - 1 - 10 - - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 10); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/gelu_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/gelu_tests.cpp deleted file mode 100644 index 4b9915b9d09121..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/gelu_tests.cpp +++ /dev/null @@ -1,327 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadGeluNetwork) { - std::string model_v10 = R"V0G0N( - - - - - - - 1 - 128 - - - - - - - 1 - 128 - - - - - 1 - 128 - - - - - - - 1 - 128 - - - - - - - - - -)V0G0N"; - - // f(x) = 0.5 * x * (1.0 + erf( x / sqrt(2.0) ) - std::string model_v7 = R"V0G0N( - - - - - - - 1 - 128 - - - - - - - - 1 - 128 - - - - - 1 - 128 - - - - - - - - 1 - 128 - - - - - 1 - 128 - - - - - - - 1 - 128 - - - - - 1 - 128 - - - - - - - - 1 - 128 - - - - - 1 - 128 - - - - - - - - 1 - 128 - - - 1 - 128 - - - - - 1 - 128 - - - - - - - - - - - - - - - )V0G0N"; - - compareIRs(model_v10, model_v7, 0); -} - - -TEST_F(NGraphReaderTests, ReadGelu6TanhNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 4 - - - - - - - - 1 - 3 - 4 - - - - - 1 - 3 - 4 - - - - - - - 1 - 3 - 4 - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 3 - 4 - - - - - - - - 1 - 3 - 4 - - - - - 1 - 3 - 4 - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7); -} - -TEST_F(NGraphReaderTests, ReadGelu6ErfNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 4 - - - - - - - - 1 - 3 - 4 - - - - - 1 - 3 - 4 - - - - - - - 1 - 3 - 4 - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 3 - 4 - - - - - - - - 1 - 3 - 4 - - - - - 1 - 3 - 4 - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7); -} \ No newline at end of file diff --git a/src/tests/functional/inference_engine/ngraph_reader/greater_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/greater_tests.cpp deleted file mode 100644 index 0fc1d3a51149d9..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/greater_tests.cpp +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, DISABLED_ReadGreaterNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 3211264); -} - -TEST_F(NGraphReaderTests, ReadGreaterEqualNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 3211264); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/grn_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/grn_tests.cpp deleted file mode 100644 index 89b140178a3369..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/grn_tests.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadGRNNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/group_convolution_backprop_data_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/group_convolution_backprop_data_tests.cpp deleted file mode 100644 index 5ec4df3a74b0c4..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/group_convolution_backprop_data_tests.cpp +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadGroupConvolutionBackpropDataNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 64 - 64 - - - - - - - - 64 - 1 - 1 - 4 - 4 - - - - - - - - 1 - 64 - 64 - 64 - - - 64 - 1 - 1 - 4 - 4 - - - - - 1 - 64 - 128 - 128 - - - - - - - 1 - 64 - 128 - 128 - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 64 - 64 - 64 - - - - - - - - 1 - 64 - 64 - 64 - - - - - 1 - 64 - 128 - 128 - - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 4096); -} \ No newline at end of file diff --git a/src/tests/functional/inference_engine/ngraph_reader/group_convolution_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/group_convolution_tests.cpp deleted file mode 100644 index f8e67a75b388c1..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/group_convolution_tests.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadGroupConvolutionNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 65 - 51 - - - - - - - - 64 - 1 - 1 - 3 - 3 - - - - - - - - 1 - 64 - 65 - 51 - - - 64 - 1 - 1 - 3 - 3 - - - - - 1 - 64 - 65 - 51 - - - - - - - 1 - 64 - 65 - 51 - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - - 1 - 64 - 65 - 51 - - - - - - - - 1 - 64 - 65 - 51 - - - - - 1 - 64 - 65 - 51 - - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 2304); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/hard_sigmoid_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/hard_sigmoid_tests.cpp deleted file mode 100644 index 913cbf9caf6710..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/hard_sigmoid_tests.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadHardSigmoidNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - - - - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 2 - 22 - 22 - - - - - - - 1 - 2 - 22 - 22 - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 8); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/hsigmoid_test.cpp b/src/tests/functional/inference_engine/ngraph_reader/hsigmoid_test.cpp deleted file mode 100644 index aa0d76621d7310..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/hsigmoid_test.cpp +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include - -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadHSigmoidNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 40); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/idft_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/idft_tests.cpp deleted file mode 100644 index 73ea0fb2549d61..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/idft_tests.cpp +++ /dev/null @@ -1,451 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -#include "common_test_utils/data_utils.hpp" - -TEST_F(NGraphReaderTests, ReadIDFTNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 180 - 180 - 2 - - - - - - - - 2 - - - - - - - 1 - 180 - 180 - 2 - - - 2 - - - - - 1 - 180 - 180 - 2 - - - - - - - 1 - 180 - 180 - 2 - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 180 - 180 - 2 - - - - - - - 2 - - - - - - - - - - 1 - 180 - 180 - 2 - - - 2 - - - - - 1 - 180 - 180 - 2 - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV7, 16, [](Blob::Ptr& weights) { - auto * i64w = weights->buffer().as(); - i64w[0] = 2; - i64w[1] = 0; - }); -} - -TEST_F(NGraphReaderTests, ReadIDFTNetwork2) { - std::string model = R"V0G0N( - - - - - - - 7 - 50 - 130 - 400 - 2 - - - - - - - - 3 - - - - - - - - 3 - - - - - - - 7 - 50 - 130 - 400 - 2 - - - 3 - - - 3 - - - - - 7 - 40 - 130 - 600 - 2 - - - - - - - 7 - 40 - 130 - 600 - 2 - - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 7 - 50 - 130 - 400 - 2 - - - - - - - 3 - - - - - - - - - - 3 - - - - - - - - - - 7 - 50 - 130 - 400 - 2 - - - 3 - - - 3 - - - - - 7 - 40 - 130 - 600 - 2 - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV7, 48, [](Blob::Ptr& weights) { - auto * i64w = weights->buffer().as(); - i64w[0] = 3; - i64w[1] = 0; - i64w[2] = 1; - i64w[3] = 600; - i64w[4] = -1; - i64w[5] = 40; - }); -} - -TEST_F(NGraphReaderTests, ReadIDFTNetwork3) { - std::string model = R"V0G0N( - - - - - - - 7 - 15 - 200 - 124 - 70 - 2 - - - - - - - - 3 - - - - - - - - 3 - - - - - - - 7 - 15 - 200 - 124 - 70 - 2 - - - 3 - - - 3 - - - - - 7 - 15 - 100 - 124 - 280 - 2 - - - - - - - 7 - 15 - 100 - 124 - 280 - 2 - - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 7 - 15 - 200 - 124 - 70 - 2 - - - - - - - 3 - - - - - - - - - - 3 - - - - - - - - - - 7 - 15 - 200 - 124 - 70 - 2 - - - 3 - - - 3 - - - - - 7 - 15 - 100 - 124 - 280 - 2 - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV7, 48, [](Blob::Ptr& weights) { - auto * i64w = weights->buffer().as(); - i64w[0] = -3; - i64w[1] = 4; - i64w[2] = 0; - i64w[3] = 100; - i64w[4] = 280; - i64w[5] = -1; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/interpolate_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/interpolate_tests.cpp deleted file mode 100644 index 56be5dd8c24410..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/interpolate_tests.cpp +++ /dev/null @@ -1,402 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadInterpolateNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 2 - 48 - 80 - - - - - - - - 2 - - - - - - - - 1 - 2 - 48 - 80 - - - 2 - - - - - 1 - 2 - 50 - 60 - - - - - - - 1 - 2 - 50 - 60 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 2 - 48 - 80 - - - - - - - - 1 - 2 - 48 - 80 - - - - - 1 - 2 - 50 - 60 - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 16, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - data[0] = 50; - data[1] = 60; - }); -} -TEST_F(NGraphReaderTests, ReadInterpolate2Network) { - std::string model = R"V0G0N( - - - - - - - 1 - 2 - 48 - 80 - - - - - - - - 4 - - - - - - - - 1 - 2 - 48 - 80 - - - 4 - - - - - 1 - 2 - 50 - 60 - - - - - - - 1 - 2 - 50 - 60 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 2 - 48 - 80 - - - - - - - - 1 - 2 - 48 - 80 - - - - - 1 - 2 - 50 - 60 - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 32, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - data[0] = 1; - data[1] = 2; - data[2] = 50; - data[3] = 60; - }); -} - -TEST_F(NGraphReaderTests, ReadInterpolate4Network) { - std::string model = R"V0G0N( - - - - - - - 1 - 2 - 300 - 300 - - - - - - - - 2 - - - - - - - - 2 - - - - - - - - 2 - - - - - - - - 1 - 2 - 300 - 300 - - - 2 - - - 2 - - - 2 - - - - - 9 - 12 - 600 - 900 - - - - - - - 9 - 12 - 600 - 900 - - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 2 - 300 - 300 - - - - - - - 2 - - - - - - - - - - 2 - - - - - - - - - - 2 - - - - - - - - - - - 1 - 2 - 300 - 300 - - - 2 - - - 2 - - - 2 - - - - - 9 - 12 - 600 - 900 - - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 24, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - data[0] = 600; - data[1] = 900; - data[4] = 2; - data[5] = 3; - - auto *fdata = weights->buffer().as(); - fdata[2] = 2.0; - fdata[3] = 2.0; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/less_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/less_tests.cpp deleted file mode 100644 index 5e40408acd7501..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/less_tests.cpp +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, DISABLED_ReadLessNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 3211264); -} - -TEST_F(NGraphReaderTests, ReadLessEqualNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 3211264); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/linear_ops_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/linear_ops_tests.cpp deleted file mode 100644 index ac86553d30e234..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/linear_ops_tests.cpp +++ /dev/null @@ -1,1924 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ConvertMulAddToScaleShift) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 64 - 1 - 1 - - - - - - - 1 - 64 - 112 - 112 - - - 64 - 1 - 1 - - - - - 1 - 64 - 112 - 112 - - - - - - - - 64 - 1 - 1 - - - - - - - 1 - 64 - 112 - 112 - - - 64 - 1 - 1 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 6422528); -} - -TEST_F(NGraphReaderTests, ConvertMulAddToPower) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 1 - 1 - 1 - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 1 - 1 - 1 - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 1 - 1 - 1 - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 1 - 1 - 1 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 6422528, [](Blob::Ptr& weights) { - // Set scale/shift constants - auto* scale = reinterpret_cast(weights->buffer().as() + 0); - scale[0] = 127.5; - - auto* shift = reinterpret_cast(weights->buffer().as() + 68); - shift[0] = 0.82; - }); -} - -TEST_F(NGraphReaderTests, ConvertMulToPower) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 1 - 1 - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 1 - 1 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 6422528, [](Blob::Ptr& weights) { - // Set scale/shift constants - auto* scale = reinterpret_cast(weights->buffer().as() + 0); - scale[0] = 127.5; - - auto* shift = reinterpret_cast(weights->buffer().as() + 68); - shift[0] = 0; - }); -} - -TEST_F(NGraphReaderTests, ConvertMulToPower2) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - - - - - - - 1 - 64 - 112 - 112 - - - 1 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 6422528, [](Blob::Ptr& weights) { - // Set scale/shift constants - float *scale = reinterpret_cast(weights->buffer().as() + 0); - scale[0] = 127.5; - - float *shift = reinterpret_cast(weights->buffer().as() + 68); - shift[0] = 0; - }); -} - -TEST_F(NGraphReaderTests, ConvertAddToPower) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 1 - 1 - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 1 - 1 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 6422528, [](Blob::Ptr& weights) { - // Set scale/shift constants - auto* scale = reinterpret_cast(weights->buffer().as() + 0); - scale[0] = 1; - - auto* shift = reinterpret_cast(weights->buffer().as() + 68); - shift[0] = 127; - }); -} - -TEST_F(NGraphReaderTests, ConvertMulToScaleShift) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 64 - 1 - 1 - - - - - - - 1 - 64 - 112 - 112 - - - 64 - 1 - 1 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 6422528); -} - -TEST_F(NGraphReaderTests, ConvertAddToScaleShift) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 64 - 1 - 1 - - - - - - - 1 - 64 - 112 - 112 - - - 64 - 1 - 1 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 6422528); -} - -TEST_F(NGraphReaderTests, ConvertMulToEltwise) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 112 - 1 - - - - - - - 1 - 64 - 112 - 112 - - - 112 - 1 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 1 - 112 - 1 - - - - - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 1 - 112 - 1 - - - - - 1 - 64 - 112 - 112 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 6422528); -} - -TEST_F(NGraphReaderTests, ConvertAddToEltwise) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 112 - 1 - - - - - - - 1 - 64 - 112 - 112 - - - 112 - 1 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 1 - 112 - 1 - - - - - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 1 - 112 - 1 - - - - - 1 - 64 - 112 - 112 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 6422528); -} - -TEST_F(NGraphReaderTests, ReadAddNoBroadcastNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 3211264); -} - -TEST_F(NGraphReaderTests, ReadMultiplyNoBroadcastNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 3211264); -} - -TEST_F(NGraphReaderTests, RemoveAdd) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 1 - 1 - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 1 - 1 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 10, [](Blob::Ptr& weights) { - // Set scale/shift constants - auto* scale = reinterpret_cast(weights->buffer().as() + 0); - scale[0] = 0; - }); -} - -TEST_F(NGraphReaderTests, RemoveMulAdd) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 1 - 1 - 1 - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 1 - 1 - 1 - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 1 - 1 - 1 - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 1 - 1 - 1 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 100, [](Blob::Ptr& weights) { - // Set scale/shift constants - auto* scale = reinterpret_cast(weights->buffer().as() + 0); - scale[0] = 1.; - - auto* shift = reinterpret_cast(weights->buffer().as() + 68); - shift[0] = 0.; - }); -} - -TEST_F(NGraphReaderTests, RemoveAdd2) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 1 - 1 - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 1 - 1 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 10, [](Blob::Ptr& weights) { - // Set scale/shift constants - auto* scale = reinterpret_cast(weights->buffer().as() + 0); - scale[0] = 0; - }); -} - -TEST_F(NGraphReaderTests, ConvertAddToEltwise2) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 1 - 1 - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 1 - 1 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 1 - 1 - 1 - - - - - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 1 - 1 - 1 - - - - - 1 - 64 - 112 - 112 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 10); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/log_softmax_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/log_softmax_tests.cpp deleted file mode 100644 index 21fe35a5db381c..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/log_softmax_tests.cpp +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadLogSoftmaxNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 1000 - - - - - - - - 1 - 1000 - - - - - 1 - 1000 - - - - - - - 1 - 1000 - - - - - - - - - -)V0G0N"; - std::string model_ref = R"V0G0N( - - - - - - 1 - 1000 - - - - - - - 1 - - - - - - - - - - - 1 - 1000 - - - 1 - - - - - 1 - 1 - - - - - - - - 1 - 1 - - - - - 1 - 1 - - - - - - - - 1 - 1000 - - - 1 - 1 - - - - - 1 - 1000 - - - - - - - 1 - 1000 - - - - - 1 - 1000 - - - - - - - 1 - - - - - - - - - - - 1 - 1000 - - - 1 - - - - - 1 - 1 - - - - - - - 1 - 1 - - - - - 1 - 1 - - - - - - - - 1 - 1 - - - - - 1 - 1 - - - - - - - - 1 - 1000 - - - 1 - 1 - - - - - 1 - 1000 - - - - - - - - - - - - - - - - - - - -)V0G0N"; - - compareIRs(model, model_ref, 16, [](Blob::Ptr& weights) { - auto* data = reinterpret_cast(weights->buffer().as()); - data[0] = 1; - data[1] = 1; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/log_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/log_tests.cpp deleted file mode 100644 index 075204fe610c14..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/log_tests.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadLogNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/logical_and_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/logical_and_tests.cpp deleted file mode 100644 index 9e42ea91461f50..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/logical_and_tests.cpp +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadLogicalAndNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - - 1 - 3 - 22 - 22 - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 1452); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/logical_not_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/logical_not_tests.cpp deleted file mode 100644 index 1eb94b15cb8086..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/logical_not_tests.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadLogicalNotNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/logical_or_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/logical_or_tests.cpp deleted file mode 100644 index 98cdcfe0252283..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/logical_or_tests.cpp +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadLogicalOrNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - - 1 - 3 - 22 - 22 - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 1452); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/logical_xor_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/logical_xor_tests.cpp deleted file mode 100644 index ca9a159ee4e98b..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/logical_xor_tests.cpp +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadLogicalXorNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - - 1 - 3 - 22 - 22 - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 1452); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/loop.cpp b/src/tests/functional/inference_engine/ngraph_reader/loop.cpp deleted file mode 100644 index de0ad0044890b2..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/loop.cpp +++ /dev/null @@ -1,587 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -#include "common_test_utils/data_utils.hpp" - -TEST_F(NGraphReaderTests, ReadLoopNetwork) { - std::string model = R"V0G0N( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - 1 - - - - - 1 - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 1 - 1 - 1 - - - - - - - - - - - - - - -)V0G0N"; - - Core reader; - Blob::Ptr weights; - weights = make_shared_blob(TensorDesc(Precision::U8, {8}, Layout::C)); - weights->allocate(); - weights->buffer().as()[0] = 0; - EXPECT_NO_THROW(reader.ReadNetwork(model, weights)); -} - -TEST_F(NGraphReaderTests, ReadLoopNetwork_2) { - std::string model = R"V0G0N( - - - - - - - - 1 - - - - - - - - - - - - - - 1 - 2 - - - - - - - 1 - - - - 1 - 2 - - - - - 1 - 2 - - - 3 - 1 - 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 2 - - - - - - - - 1 - 2 - - - - - - - 1 - 2 - - - 1 - 2 - - - - - 1 - 2 - - - - - - - 1 - 2 - - - - - - - - 1 - - - - - - - 1 - 2 - - - 1 - - - - - 3 - 1 - 2 - - - - - - - 3 - 1 - 2 - - - - - - - - - - - - - - - - - - - 1 - 2 - - - - - - - 3 - 1 - 2 - - - - - - - - - - - - - -)V0G0N"; - - Core reader; - Blob::Ptr weights; - weights = make_shared_blob(TensorDesc(Precision::U8, {8}, Layout::C)); - weights->allocate(); - weights->buffer().as()[0] = 0; - weights->buffer().as()[1] = 0; - EXPECT_NO_THROW(reader.ReadNetwork(model, weights)); -} - -TEST_F(NGraphReaderTests, ReadLoopNetwork_ExternalPort1IsNotConnected) { - std::string model = R"V0G0N( - - - - - - - - 1 - - - - - - - - - - - - - - 1 - 2 - - - - - - - 1 - - - - 1 - 2 - - - - - 1 - 2 - - - 3 - 1 - 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 2 - - - - - - - - 1 - 2 - - - - - - - 1 - 2 - - - 1 - 2 - - - - - 1 - 2 - - - - - - - 1 - 2 - - - - - - - - 1 - - - - - - - 1 - 2 - - - 1 - - - - - 3 - 1 - 2 - - - - - - - 3 - 1 - 2 - - - - - - - - - - - - - - - - - - - 1 - 2 - - - - - - - 3 - 1 - 2 - - - - - - - - - - - - - -)V0G0N"; - - Core reader; - Blob::Ptr weights; - weights = make_shared_blob(TensorDesc(Precision::U8, {8}, Layout::C)); - weights->allocate(); - weights->buffer().as()[0] = 0; - weights->buffer().as()[1] = 0; - EXPECT_NO_THROW(reader.ReadNetwork(model, weights)); -} - diff --git a/src/tests/functional/inference_engine/ngraph_reader/lrn_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/lrn_tests.cpp deleted file mode 100644 index 5b6d783f719350..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/lrn_tests.cpp +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadLrnNetwork) { - std::string model_v10 = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 2 - - - - - - - - 1 - 3 - 22 - 22 - - - 2 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - -)V0G0N"; - - std::string model_v5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model_v10, model_v5, 16, [](Blob::Ptr& weights) { - auto * w = weights->buffer().as(); - w[0] = 2; - w[1] = 3; - }); -} - -TEST_F(NGraphReaderTests, ReadLrnNetwork2) { - std::string model_v10 = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - - - - - - - - 1 - 3 - 22 - 22 - - - 2 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - -)V0G0N"; - - std::string model_v5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model_v10, model_v5, 8, [](Blob::Ptr& weights) { - auto * w = weights->buffer().as(); - w[0] = 1; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/lstm_cell_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/lstm_cell_tests.cpp deleted file mode 100644 index 5626ddab973ed2..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/lstm_cell_tests.cpp +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadLSTMCellNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 512 - - - - - - - - 1 - 256 - - - - - - - - 1 - 256 - - - - - - - - 1024 - 512 - - - - - - - - 1024 - 256 - - - - - - - - 1024 - - - - - - - - 1 - 512 - - - 1 - 256 - - - 1 - 256 - - - 1024 - 512 - - - 1024 - 256 - - - 1024 - - - - - 1 - 256 - - - 1 - 256 - - - - - - - 1 - 256 - - - - - - - 1 - 256 - - - - - - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 512 - - - - - - - 1 - 256 - - - - - - - 1 - 256 - - - - - - - - 1 - 512 - - - 1 - 256 - - - 1 - 256 - - - - - 1 - 256 - - - 1 - 256 - - - - - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 26000000); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/matmul_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/matmul_tests.cpp deleted file mode 100644 index 0d6390920cf0b2..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/matmul_tests.cpp +++ /dev/null @@ -1,717 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadMatMulNetwork1) { - std::string model = R"V0G0N( - - - - - - - 1 - 2048 - - - - - - - - 2048 - 1000 - - - - - - - 1 - 2048 - - - 2048 - 1000 - - - - - 1 - 1000 - - - - - - - 1 - 1000 - - - - - - - - - - -)V0G0N"; - // 'fc' layer biases are fake and added due to IE limitation for Fully Connected layer - std::string modelV5 = R"V0G0N( - - - - - - 1 - 2048 - - - - - - - - 1 - 2048 - - - - - 1 - 1000 - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 8193000); -} - -TEST_F(NGraphReaderTests, ReadMatMulNetwork2) { - std::string model = R"V0G0N( - - - - - - - 1 - 2048 - - - - - - - - 1000 - 2048 - - - - - - - - 1 - 2048 - - - 1000 - 2048 - - - - - 1 - 1000 - - - - - - - 1 - 1000 - - - - - - - - - - -)V0G0N"; - // 'fc' layer biases are fake and added due to IE limitation for Fully Connected layer - std::string modelV5 = R"V0G0N( - - - - - - 1 - 2048 - - - - - - - - 1 - 2048 - - - - - 1 - 1000 - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 8193000); -} - -TEST_F(NGraphReaderTests, ReadMatMulNetwork3) { - std::string model = R"V0G0N( - - - - - - - 2048 - 1 - - - - - - - - 1000 - 2048 - - - - - - - - 2048 - 1 - - - 1000 - 2048 - - - - - 1 - 1000 - - - - - - - 1 - 1000 - - - - - - - - - - -)V0G0N"; - // 'fc' layer biases are fake and added due to IE limitation for FUlly Connected layer - std::string modelV5 = R"V0G0N( - - - - - - 2048 - 1 - - - - - - - - 2048 - 1 - - - - - 1 - 2048 - - - - - - - - 1 - 2048 - - - - - 1 - 1000 - - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 8193000); -} - -TEST_F(NGraphReaderTests, ReadMatMulNetwork4) { - std::string model = R"V0G0N( - - - - - - - 2048 - 1 - - - - - - - - 1000 - 2048 - - - - - - - - 2048 - 1 - - - 1000 - 2048 - - - - - 1 - 1000 - - - - - - - 1 - 1000 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 2048 - 1 - - - - - - - 1000 - 2048 - - - - - - - - 2048 - 1 - - - 1000 - 2048 - - - - - 1 - 1000 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 8192000); -} - -TEST_F(NGraphReaderTests, ReadMatMulNetwork5) { - std::string model = R"V0G0N( - - - - - - - 2 - 3 - 2 - - - - - - - - 3 - 2 - 2 - 1 - - - - - - - 2 - 3 - 2 - - - 3 - 2 - 2 - 1 - - - - - 3 - 2 - 3 - 1 - - - - - - - 3 - 2 - 3 - 1 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 2 - 3 - 2 - - - - - - - 3 - 2 - 2 - 1 - - - - - - - 4 - - - - - - - - - - - 2 - 3 - 2 - - - 4 - - - - - 1 - 2 - 3 - 2 - - - - - - - - 1 - 2 - 3 - 2 - - - 3 - 2 - 2 - 1 - - - - - 3 - 2 - 3 - 1 - - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 48); -} - -TEST_F(NGraphReaderTests, ReadMatMul1DNetwork) { - std::string model = R"V0G0N( - - - - - - - 2048 - - - - - - - - 2048 - 1000 - - - - - - - 2048 - - - 2048 - 1000 - - - - - 1000 - - - - - - - 1000 - - - - - - - - - - -)V0G0N"; - // 'fc' layer biases are fake and added due to IE limitation for Fully Connected layer - std::string modelV5 = R"V0G0N( - - - - - - - - 2048 - - - - - - - 2 - - - - - - - - - - - 2048 - - - 2 - - - - - 1 - 2048 - - - - - - - - 1 - 2048 - - - - - 1 - 1000 - - - - - - - - - - - 1 - - - - - - - - - - - 1 - 1000 - - - 1 - - - - - 1000 - - - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 8293000); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/maximum_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/maximum_tests.cpp deleted file mode 100644 index 432590f13b823a..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/maximum_tests.cpp +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadMaximumNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 3211264); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/minimum_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/minimum_tests.cpp deleted file mode 100644 index 65ce5a5c46ea72..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/minimum_tests.cpp +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadMinimumNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 1 - 27 - 27 - - - - - - - - 1 - 1 - 27 - 27 - - - - - - - 1 - 1 - 27 - 27 - - - 1 - 1 - 27 - 27 - - - - - 1 - 1 - 27 - 27 - - - - - - - 1 - 1 - 27 - 27 - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 1 - 27 - 27 - - - - - - - - 1 - 1 - 27 - 27 - - - - - 1 - 1 - 27 - 27 - - - - - - - 1 - 1 - 27 - 27 - - - - - - - - 1 - 1 - 27 - 27 - - - - - 1 - 1 - 27 - 27 - - - - - - - - 1 - 1 - 27 - 27 - - - 1 - 1 - 27 - 27 - - - - - 1 - 1 - 27 - 27 - - - - - - - - 1 - 1 - 27 - 27 - - - - - 1 - 1 - 27 - 27 - - - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 0); -} \ No newline at end of file diff --git a/src/tests/functional/inference_engine/ngraph_reader/mod_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/mod_tests.cpp deleted file mode 100644 index 43828ee9b032d5..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/mod_tests.cpp +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -#include -#include - - -TEST_F(NGraphReaderTests, ReadModNetwork) { - std::string modelV10 = R"V0G0N( - - - - - - - 256 - 56 - - - - - - - - 256 - 56 - - - - - - - 256 - 56 - - - 256 - 56 - - - - - 256 - 56 - - - - - - - 256 - 56 - - - - - - - - - - -)V0G0N"; - Core ie; - Blob::Ptr weights; - std::shared_ptr f_ref{nullptr}; - - auto data_A = std::make_shared(ngraph::element::f32, ngraph::Shape{256, 56}); - auto data_B = std::make_shared(ngraph::element::f32, ngraph::Shape{256, 56}); - auto mod = std::make_shared(data_A, data_B); - f_ref = std::make_shared(ngraph::NodeVector{mod}, ngraph::ParameterVector{data_A, data_B}); - - auto network = ie.ReadNetwork(modelV10, weights); - auto f = network.getFunction(); - - auto res = compare_functions(f, f_ref); - ASSERT_TRUE(res.first) << res.second; -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/multiply_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/multiply_tests.cpp deleted file mode 100644 index 0978d01d1a06bc..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/multiply_tests.cpp +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadMultiplyNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 4 - - - - - - - - 1 - 4 - - - - - - - 1 - 4 - - - 1 - 4 - - - - - 1 - 4 - - - - - - - 1 - 4 - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 4 - - - - - - - 1 - 4 - - - - - - - - 1 - 4 - - - 1 - 4 - - - - - 1 - 4 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 0); -} \ No newline at end of file diff --git a/src/tests/functional/inference_engine/ngraph_reader/mvn_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/mvn_tests.cpp deleted file mode 100644 index 3ca8932f6a17e9..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/mvn_tests.cpp +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadMVNNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} - -TEST_F(NGraphReaderTests, ReadMVN6Network) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 3 - - - - - - - - 1 - 3 - 22 - 22 - - - 3 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 3 - - - - - - - - - - - 1 - 3 - 22 - 22 - - - 3 - - - - - 1 - 3 - 1 - 1 - - - - - - - - 1 - 3 - 1 - 1 - - - - - 1 - 3 - 1 - 1 - - - - - - - - 1 - 3 - 22 - 22 - - - 1 - 3 - 1 - 1 - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 24, [](Blob::Ptr& weights) { - auto* buffer = weights->buffer().as(); - buffer[0] = 0; - buffer[1] = 2; - buffer[2] = 3; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/neg_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/neg_tests.cpp deleted file mode 100644 index 3ed9f38a0d8a5b..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/neg_tests.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadNegativeNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/negative_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/negative_tests.cpp deleted file mode 100644 index be51b10e109360..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/negative_tests.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -#include "common_test_utils/data_utils.hpp" - -TEST_F(NGraphReaderTests, DISABLED_ReadIncorrectNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 4 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - -)V0G0N"; - - Blob::CPtr blob; - Core reader; - ASSERT_THROW(reader.ReadNetwork(model, blob), InferenceEngine::Exception); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/net_reader_test.cpp b/src/tests/functional/inference_engine/ngraph_reader/net_reader_test.cpp deleted file mode 100644 index 4f603db4d3dc43..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/net_reader_test.cpp +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include -#include -#include -#include -#include - -#include "common_test_utils/test_common.hpp" -#include "common_test_utils/unicode_utils.hpp" -#include "common_test_utils/file_utils.hpp" -#include "functional_test_utils/test_model/test_model.hpp" -#include "network_utils.hpp" -#include "openvino/runtime/core.hpp" - - -#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT -# define GTEST_COUT std::cerr << "[ ] [ INFO ] " -# include -#endif - -using NetReaderNoParamTest = CommonTestUtils::TestsCommon; - -TEST_F(NetReaderNoParamTest, IncorrectModel) { - InferenceEngine::Core ie; - ASSERT_THROW(ie.ReadNetwork("incorrectFilePath"), InferenceEngine::Exception); -} - -using NetReaderTestParams = std::tuple; - -class NetReaderTest - : public CommonTestUtils::TestsCommon, public testing::WithParamInterface { -protected: - static InferenceEngine::CNNNetwork read(const std::string &modelPath, const std::string &weightsPath, - InferenceEngine::Core &ie) { - return ie.ReadNetwork(modelPath, weightsPath); - } - - void SetUp() override { - InferenceEngine::SizeVector _inputDims; - InferenceEngine::Precision _netPrc; - std::tie(_inputDims, _netPrc) = GetParam(); - (void) FuncTestUtils::TestModel::generateTestModel(_modelPath, _weightsPath, _netPrc, _inputDims); - } - - void TearDown() override { - CommonTestUtils::removeIRFiles(_modelPath, _weightsPath); - } - - const std::string _modelPath = "NetReader_test.xml"; - const std::string _weightsPath = "NetReader_test.bin"; -}; - -TEST_P(NetReaderTest, ReadNetworkTwiceSeparately) { - ov::Core ie; - - auto network = ie.read_model(_modelPath, _weightsPath); - auto network2 = ie.read_model(_modelPath, _weightsPath); - - ASSERT_NE(network.get(), network2.get()); - ASSERT_NO_THROW(FuncTestUtils::compareCNNNetworks(InferenceEngine::CNNNetwork(network), - InferenceEngine::CNNNetwork(network2))); -} - -#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT - -TEST_P(NetReaderTest, ReadCorrectModelWithWeightsUnicodePath) { - GTEST_COUT << "params.modelPath: '" << _modelPath << "'" << std::endl; - GTEST_COUT << "params.weightsPath: '" << _weightsPath << "'" << std::endl; - for (std::size_t testIndex = 0; testIndex < CommonTestUtils::test_unicode_postfix_vector.size(); testIndex++) { - std::wstring postfix = L"_" + CommonTestUtils::test_unicode_postfix_vector[testIndex]; - std::wstring modelPath = CommonTestUtils::addUnicodePostfixToPath(_modelPath, postfix); - std::wstring weightsPath = CommonTestUtils::addUnicodePostfixToPath(_weightsPath, postfix); - try { - bool is_copy_successfully; - is_copy_successfully = CommonTestUtils::copyFile(_modelPath, modelPath); - if (!is_copy_successfully) { - FAIL() << "Unable to copy from '" << _modelPath << "' to '" - << ov::util::wstring_to_string(modelPath) << "'"; - } - is_copy_successfully = CommonTestUtils::copyFile(_weightsPath, weightsPath); - if (!is_copy_successfully) { - FAIL() << "Unable to copy from '" << _weightsPath << "' to '" - << ov::util::wstring_to_string(weightsPath) << "'"; - } - GTEST_COUT << "Test " << testIndex << std::endl; - InferenceEngine::Core ie; - ASSERT_NO_THROW(ie.ReadNetwork(modelPath, weightsPath)); - CommonTestUtils::removeFile(modelPath); - CommonTestUtils::removeFile(weightsPath); - GTEST_COUT << "OK" << std::endl; - } - catch (const InferenceEngine::Exception &e_next) { - CommonTestUtils::removeFile(modelPath); - CommonTestUtils::removeFile(weightsPath); - FAIL() << e_next.what(); - } - } -} - -#endif - -TEST(NetReaderTest, IRSupportModelDetection) { - InferenceEngine::Core ie; - - static char const *model = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - - // For supported model detection the IRReader uses first 512 bytes from model. - // These headers shifts the trim place. - - std::string headers[] = { - R"()", - R"()", - R"( - - - - - -)" - }; - - InferenceEngine::Blob::CPtr weights; - - for (auto header : headers) { - ASSERT_NO_THROW(ie.ReadNetwork(header + model, weights)); - } -} - -std::string getTestCaseName(testing::TestParamInfo testParams) { - InferenceEngine::SizeVector dims; - InferenceEngine::Precision prc; - std::tie(dims, prc) = testParams.param; - - std::ostringstream ss; - std::copy(dims.begin(), dims.end()-1, std::ostream_iterator(ss, "_")); - ss << dims.back() << "}_" << prc.name(); - return "{" + ss.str(); -} - -static const auto params = testing::Combine( - testing::Values(InferenceEngine::SizeVector{1, 3, 227, 227}), - testing::Values(InferenceEngine::Precision::FP32, InferenceEngine::Precision::FP16)); - -INSTANTIATE_TEST_SUITE_P( - NetReaderTest, - NetReaderTest, - params, - getTestCaseName); - -#ifdef GTEST_COUT -#undef GTEST_COUT -#endif diff --git a/src/tests/functional/inference_engine/ngraph_reader/network_utils.cpp b/src/tests/functional/inference_engine/ngraph_reader/network_utils.cpp deleted file mode 100644 index 706d84c4c63893..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/network_utils.cpp +++ /dev/null @@ -1,388 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include -#include -#include -#include -#include - -#include "network_utils.hpp" -#include "cpp/ie_cnn_network.h" -#include "functional_test_utils/blob_utils.hpp" -#include -#include - -namespace FuncTestUtils { - - bool compareParamVal(const std::string &val1, const std::string &val2) { - std::vector vals1, vals2; - std::stringstream ss1(val1); - std::string field; - while (getline(ss1, field, ',')) { - std::stringstream fs(field); - std::string value; - fs >> value; - vals1.emplace_back(value); - } - - std::stringstream ss2(val2); - while (getline(ss2, field, ',')) { - std::stringstream fs(field); - std::string value; - fs >> value; - vals2.emplace_back(value); - } - - if (vals1.size() != vals2.size()) - return false; - - for (size_t i = 0; i < vals1.size(); i++) { - try { - float v1 = std::stof(vals1[i]); - float v2 = std::stof(vals2[i]); - if (std::fabs(v2 - v1) > 0.00001f) - return false; - } catch (...) { - if (vals1[i] != vals2[i]) - return false; - } - } - return true; - } - - void - compareTensorIterators(const InferenceEngine::CNNLayerPtr &new_layer, const InferenceEngine::CNNLayerPtr &old_layer, - bool sameNetVersions); - - IE_SUPPRESS_DEPRECATED_START - - void compareCNNNLayers(const InferenceEngine::CNNLayerPtr &layer, const InferenceEngine::CNNLayerPtr &refLayer, - bool sameNetVersions) { - std::vector err_log; - - if (layer->type != refLayer->type) { - err_log.push_back("Layer " + layer->name + " and ref layer " + refLayer->name + " have different type: " + - layer->type + " and " + refLayer->type); - } else if (layer->type == "TensorIterator") { - compareTensorIterators(layer, refLayer, sameNetVersions); - } - if (layer->type == "Activation") { - err_log.pop_back(); - layer->type = "not"; - refLayer->params["type"] = "not"; - } - - if (layer->precision != refLayer->precision) { - err_log.push_back( - "Layer " + layer->name + " and ref layer " + refLayer->name + " have different precisions: " - + layer->precision.name() + " and " + refLayer->precision.name()); - } - - if (layer->insData.size() != refLayer->insData.size()) { - err_log.push_back( - "Layer " + layer->name + " and ref layer " + refLayer->name + " have different number of inputs: " + - std::to_string(layer->insData.size()) + " and " + std::to_string(refLayer->insData.size())); - } - - if (layer->outData.size() != refLayer->outData.size()) { - err_log.push_back( - "Layer " + layer->name + " and ref layer " + refLayer->name + - " have different number of outputs: " + - std::to_string(layer->outData.size()) + " and " + std::to_string(refLayer->outData.size())); - } - - - if (layer->blobs.size() != refLayer->blobs.size()) { - err_log.push_back( - "Layer " + layer->type + " with name " + layer->name + - " and ref layer " + layer->type + " with name " + refLayer->name + - " have different number of blobs: " + - std::to_string(layer->blobs.size()) + " and " + std::to_string(refLayer->blobs.size())); - } - - bool success = layer->type == refLayer->type && - layer->precision == refLayer->precision && - layer->insData.size() == refLayer->insData.size() && - layer->outData.size() == refLayer->outData.size() && - layer->blobs.size() == refLayer->blobs.size() && - layer->affinity == refLayer->affinity; - - - for (size_t i = 0; i < layer->insData.size() && success; i++) { - auto lockedRefData = refLayer->insData[i].lock(); - auto lockedData = layer->insData[i].lock(); - success = success && lockedRefData->getTensorDesc() == lockedData->getTensorDesc(); - if (lockedRefData->getTensorDesc() != lockedData->getTensorDesc()) { - err_log.push_back("Layer " + layer->name + " and ref layer " + refLayer->name + - " have different tensor desc for locked input data"); - } - } - - for (size_t i = 0; i < layer->outData.size() && success; i++) { - if (refLayer->outData[i]->getTensorDesc() != layer->outData[i]->getTensorDesc()) { - err_log.push_back("Layer " + layer->name + " and ref layer " + refLayer->name + - " have different tensor desc for out Data"); - } - success = success && refLayer->outData[i]->getTensorDesc() == layer->outData[i]->getTensorDesc(); - } - - // Different IR versions may have different layers specification which leads to parameters and blobs data mismatch - // E.g.: - // 1. V10 MatMul const weights input stores transposed weights relative to FullyConnected V5-V7 weights - // which makes them not element-wise comparable. - // 2. Interpolate layer has different parameters set in V5-V7 vs V10 specifications. - if (sameNetVersions) { - bool sameParamsCount = layer->params.size() == refLayer->params.size(); - if (!sameParamsCount) { - err_log.push_back( - "Layer " + layer->name + " and ref layer " + refLayer->name + - " have different number of parameters: " + - std::to_string(layer->params.size()) + " and " + std::to_string(refLayer->params.size())); - } - success = success && sameParamsCount; - for (const auto &item : layer->blobs) { - if (!success) { - break; - } - const InferenceEngine::Blob::Ptr layerBlob = item.second; - const InferenceEngine::Blob::Ptr refLayerBlob = refLayer->blobs[item.first]; - FuncTestUtils::compareBlobs(layerBlob, refLayerBlob); - } - } - - for (const auto &item : layer->params) { - if (!success) - break; - if (refLayer->params.find(item.first) != refLayer->params.end()) { - if (!compareParamVal(refLayer->params[item.first], item.second)) { - success = false; - err_log.push_back( - "Layer " + layer->name + " in new network differs from reference parameter " + item.first + - " (new, old): " + item.second + ", " + refLayer->params[item.first]); - } - } else { - if (item.first == "originalLayersNames") continue; - // ROIPooling specification says that there should be two parameters- pooled_h and pooled_w - // our implementation of this op has a single parameter - output_size. - if (item.first == "output_size" && layer->type == "ROIPooling") continue; - // autob is a WA for nGraph ops - if ((item.first != "auto_broadcast" && item.first != "autob") || item.second != "numpy") { - success = false; - err_log.push_back("Layer " + refLayer->name + " in ref net has no " + item.first + " attribute."); - } - } - } - - if (!success) { - for (auto &it : err_log) { - std::cout << "ERROR: " << it << std::endl; - } - IE_THROW() << "CNNNetworks have different layers!"; - } - } - - IE_SUPPRESS_DEPRECATED_END - - template - void compareInfo(T &new_info, T &old_info, const std::string &err_msg) { - bool success = new_info.size() == old_info.size(); - for (const auto &it : new_info) { - if (!success) - break; - success = success && old_info.find(it.first) != old_info.end(); - } - if (!success) - IE_THROW() << err_msg; - } - - void - compareTensorIterators(const InferenceEngine::CNNLayerPtr &new_layer, const InferenceEngine::CNNLayerPtr &old_layer, - bool sameNetVersions) { - IE_SUPPRESS_DEPRECATED_START - auto ti_new = std::dynamic_pointer_cast(new_layer); - auto ti_old = std::dynamic_pointer_cast(old_layer); - - if (!ti_new || !ti_old) { - IE_THROW() << "Cannot cast the layer to TensorIterator."; - } - - auto get_port_map = []( - const std::vector &port_map_list, - const std::vector &data_from, - const std::vector &data_to) { - std::map, InferenceEngine::TensorIterator::PortMap> ordered_port_maps; - for (auto &port_map : port_map_list) { - ordered_port_maps[{data_from[port_map.from]->getName(), data_to[port_map.to]->getName()}] = port_map; - } - - return std::move(ordered_port_maps); - }; - - auto get_data_ptrs = [](std::vector &wk_data_ptrs) { - std::vector data_ptrs; - for (auto &wk_data : wk_data_ptrs) { - auto data_ptr = wk_data.lock(); - IE_ASSERT(data_ptr != nullptr); - data_ptrs.push_back(data_ptr); - } - return std::move(data_ptrs); - }; - - auto compare_port_maps = []( - std::map, - InferenceEngine::TensorIterator::PortMap> &new_ordered_port_maps, - std::map, - InferenceEngine::TensorIterator::PortMap> &old_ordered_port_maps) { - if (new_ordered_port_maps.size() != old_ordered_port_maps.size()) { - IE_THROW() << "PortMaps have different numbers of layers: " << new_ordered_port_maps.size() << - " and " << old_ordered_port_maps.size(); - } - - auto iterator_new = new_ordered_port_maps.begin(); - auto iterator_old = old_ordered_port_maps.begin(); - - for (; iterator_new != new_ordered_port_maps.end() && iterator_old != old_ordered_port_maps.end(); - iterator_new++, iterator_old++) { - if (iterator_new->first != iterator_old->first) { - IE_THROW() << R"(Names of "from" and "to" layers in the port maps do not match!)"; - } - - InferenceEngine::TensorIterator::PortMap &pm_new = iterator_new->second; - InferenceEngine::TensorIterator::PortMap &pm_old = iterator_old->second; - - if (pm_new.part_size != pm_old.part_size || pm_new.axis != pm_old.axis || - pm_new.stride != pm_old.stride || - pm_new.end != pm_old.end || pm_new.start != pm_old.start) { - IE_THROW() << "Parameters in the port maps do not match!"; - } - } - }; - - auto output_port_mp_new = get_port_map(ti_new->output_port_map, ti_new->outData, ti_new->body.outputs); - auto output_port_mp_old = get_port_map(ti_old->output_port_map, ti_old->outData, ti_old->body.outputs); - compare_port_maps(output_port_mp_new, output_port_mp_old); - - auto input_port_mp_new = get_port_map(ti_new->input_port_map, get_data_ptrs(ti_new->insData), - ti_new->body.inputs); - auto input_port_mp_old = get_port_map(ti_old->input_port_map, get_data_ptrs(ti_old->insData), - ti_old->body.inputs); - compare_port_maps(input_port_mp_new, input_port_mp_old); - - auto back_edges_mp_new = get_port_map(ti_new->back_edges, ti_new->body.outputs, ti_new->body.inputs); - auto back_edges_mp_old = get_port_map(ti_old->back_edges, ti_old->body.outputs, ti_old->body.inputs); - compare_port_maps(back_edges_mp_new, back_edges_mp_old); - - // TI body comparison - auto nodes_new = InferenceEngine::NetPass::TIBodySortTopologically(ti_new->body); - auto nodes_old = InferenceEngine::NetPass::TIBodySortTopologically(ti_old->body); - - std::sort(nodes_new.begin(), nodes_new.end(), []( - const InferenceEngine::CNNLayerPtr &l, - const InferenceEngine::CNNLayerPtr &r) { - return l->name < r->name; - }); - - std::sort(nodes_old.begin(), nodes_old.end(), []( - const InferenceEngine::CNNLayerPtr &l, - const InferenceEngine::CNNLayerPtr &r) { - return l->name < r->name; - }); - - compareLayerByLayer(nodes_new, nodes_old, sameNetVersions); - - auto get_map = []( - const std::vector &data) -> std::map { - std::map name_to_data_map; - for (auto &it : data) { - name_to_data_map[it->getName()] = it; - } - return std::move(name_to_data_map); - }; - - auto new_inputs = get_map(ti_new->body.inputs); - auto old_inputs = get_map(ti_old->body.inputs); - compareInfo>(new_inputs, old_inputs, - "Bodies of TensorIterator have different inputs!"); - - auto new_outputs = get_map(ti_new->body.outputs); - auto old_outputs = get_map(ti_old->body.outputs); - compareInfo>(new_outputs, old_outputs, - "Bodies of TensorIterator have different outputs!"); - IE_SUPPRESS_DEPRECATED_END - } - - void compareCNNNetworks(const InferenceEngine::CNNNetwork &network, const InferenceEngine::CNNNetwork &refNetwork, - bool sameNetVersions) { - if (network.getName() != refNetwork.getName()) - IE_THROW() << "CNNNetworks have different names! " << network.getName() - << " and " << refNetwork.getName(); - - if (network.getBatchSize() != refNetwork.getBatchSize()) - IE_THROW() << "CNNNetworks have different batch size! " << std::to_string(network.getBatchSize()) - << " and " << std::to_string(refNetwork.getBatchSize()); - - compareLayerByLayer(network, refNetwork, sameNetVersions); - InferenceEngine::InputsDataMap newInput = network.getInputsInfo(); - InferenceEngine::InputsDataMap oldInput = refNetwork.getInputsInfo(); - InferenceEngine::OutputsDataMap newOutput = network.getOutputsInfo(); - InferenceEngine::OutputsDataMap oldOutput = refNetwork.getOutputsInfo(); - compareInfo(newInput, oldInput, "CNNNetworks have different inputs!"); - compareInfo(newOutput, oldOutput, "CNNNetworks have different outputs!"); - } - -IE_SUPPRESS_DEPRECATED_START - -void compareLayerByLayer(const std::vector& network, - const std::vector& refNetwork, - bool sameNetVersions) { - auto iterator = network.begin(); - auto refIterator = refNetwork.begin(); - if (network.size() != refNetwork.size()) - IE_THROW() << "CNNNetworks have different number of layers: " << - network.size() << " vs " << refNetwork.size(); - for (; iterator != network.end() && refIterator != refNetwork.end(); iterator++, refIterator++) { - InferenceEngine::CNNLayerPtr layer = *iterator; - InferenceEngine::CNNLayerPtr refLayer = *refIterator; - compareCNNNLayers(layer, refLayer, sameNetVersions); - } -} - -void compareLayerByLayer(const InferenceEngine::CNNNetwork& network, - const InferenceEngine::CNNNetwork& refNetwork, - bool sameNetVersions) { - InferenceEngine::details::CNNNetworkIterator iterator, refIterator, end; - std::shared_ptr convertedNetwork, convertedRefNetwork; - - auto convertNetwork = [] (const InferenceEngine::CNNNetwork & net, - std::shared_ptr & convertedNet, - InferenceEngine::details::CNNNetworkIterator & it) { - if (net.getFunction()) { - convertedNet.reset(new InferenceEngine::details::CNNNetworkImpl(net)); - it = InferenceEngine::details::CNNNetworkIterator(convertedNet.get()); - } else { - it = InferenceEngine::details::CNNNetworkIterator(net); - } - }; - - convertNetwork(network, convertedNetwork, iterator); - convertNetwork(refNetwork, convertedRefNetwork, refIterator); - - size_t layerCount = convertedNetwork ? convertedNetwork->layerCount() : network.layerCount(); - size_t layerRefCount = convertedRefNetwork ? convertedRefNetwork->layerCount() : refNetwork.layerCount(); - - if (layerCount != layerRefCount) - IE_THROW() << "CNNNetworks have different number of layers: " << layerCount << " vs " << layerRefCount; - for (; iterator != end && refIterator != end; iterator++, refIterator++) { - InferenceEngine::CNNLayerPtr layer = *iterator; - InferenceEngine::CNNLayerPtr refLayer = *refIterator; - compareCNNNLayers(layer, refLayer, sameNetVersions); - } - std::cout << std::endl; -} - -IE_SUPPRESS_DEPRECATED_END - -} // namespace FuncTestUtils diff --git a/src/tests/functional/inference_engine/ngraph_reader/network_utils.hpp b/src/tests/functional/inference_engine/ngraph_reader/network_utils.hpp deleted file mode 100644 index 3acdbf68a27997..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/network_utils.hpp +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include "cpp/ie_cnn_network.h" -#include - -namespace FuncTestUtils { - -void compareCNNNetworks(const InferenceEngine::CNNNetwork &network, const InferenceEngine::CNNNetwork &refNetwork, bool sameNetVersions = true); - -void compareCNNNLayers(const InferenceEngine::CNNLayerPtr &layer, const InferenceEngine::CNNLayerPtr &refLayer, bool sameNetVersions); - -void compareLayerByLayer(const InferenceEngine::CNNNetwork& network, - const InferenceEngine::CNNNetwork& refNetwork, - bool sameNetVersions = true); - -void compareLayerByLayer(const std::vector& network, - const std::vector& refNetwork, - bool sameNetVersions = true); - -} // namespace FuncTestUtils \ No newline at end of file diff --git a/src/tests/functional/inference_engine/ngraph_reader/ngraph_reader_tests.hpp b/src/tests/functional/inference_engine/ngraph_reader/ngraph_reader_tests.hpp deleted file mode 100644 index 660be845691fa9..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/ngraph_reader_tests.hpp +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include - -#include -#include -#include - -#include -#include -#include -#include - -#include "common_test_utils/test_common.hpp" -#include "common_test_utils/file_utils.hpp" -#include "common_test_utils/data_utils.hpp" -#include "network_utils.hpp" - -using namespace testing; -using namespace InferenceEngine; - -class NGraphReaderTests : public CommonTestUtils::TestsCommon { -protected: - void compareIRs(const std::string& modelV10, const std::string& oldModel, size_t weightsSize = 0, const std::function& fillBlob = {}) { - Core ie; - Blob::Ptr weights; - - if (weightsSize) { - weights = make_shared_blob(TensorDesc(Precision::U8, {weightsSize}, Layout::C)); - weights->allocate(); - CommonTestUtils::fill_data(weights->buffer().as(), weights->size() / sizeof(float)); - if (fillBlob) - fillBlob(weights); - } - - auto network = ie.ReadNetwork(modelV10, weights); - auto f = network.getFunction(); - // WA: we have to resolve dynamysm manually to compare resulting function with v7 IR - ngraph::pass::Manager manager; - manager.register_pass(); - manager.run_passes(f); - network = CNNNetwork(f); - auto cnnNetwork = ie.ReadNetwork(oldModel, weights); - - IE_SUPPRESS_DEPRECATED_START - auto convertedNetwork = std::make_shared(network); - - FuncTestUtils::compareCNNNetworks(InferenceEngine::CNNNetwork(convertedNetwork), cnnNetwork, false); - - for (auto it = details::CNNNetworkIterator(convertedNetwork.get()); it != details::CNNNetworkIterator(); it++) { - InferenceEngine::CNNLayerPtr layer = *it; - ASSERT_NE(nullptr, layer->getNode()); - } - - ASSERT_EQ(nullptr, cnnNetwork.getFunction()); - for (auto it = details::CNNNetworkIterator(cnnNetwork); it != details::CNNNetworkIterator(); it++) { - InferenceEngine::CNNLayerPtr layer = *it; - ASSERT_EQ(nullptr, layer->getNode()); - } - IE_SUPPRESS_DEPRECATED_END - } -}; diff --git a/src/tests/functional/inference_engine/ngraph_reader/non_max_suppression_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/non_max_suppression_tests.cpp deleted file mode 100644 index e0ee8c878d5412..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/non_max_suppression_tests.cpp +++ /dev/null @@ -1,365 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common_test_utils/ngraph_test_utils.hpp" - -using namespace ngraph; - -TEST_F(NGraphReaderTests, ReadNonMaxSuppression5) { - std::string model = R"V0G0N( - - - - - - - 1 - 15130 - 4 - - - - - - - - 1 - 80 - 15130 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 15130 - 4 - - - 1 - 80 - 15130 - - - - - - - - - 15130 - 3 - - - 15130 - 3 - - - 1 - - - - - - - 15130 - 3 - - - 15130 - 3 - - - - - 15130 - 3 - - - - - - - 15130 - 3 - - - - - - - 1 - - - 1 - - - - - 1 - - - - - - - 1 - - - - - - - 15130 - 3 - - - 15130 - 3 - - - - - 15130 - 3 - - - - - - - 15130 - 3 - - - - - - - - - - - - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 15130 - 4 - - - - - - - 1 - 80 - 15130 - - - - - - - 1 - - - - - - - - - - 1 - - - - - - - - - - 1 - - - - - - - - - - - 1 - 15130 - 4 - - - 1 - 80 - 15130 - - - 1 - - - 1 - - - 1 - - - - - 16000 - 3 - - - 16000 - 3 - - - 1 - - - - - - - - 16000 - 3 - - - 16000 - 3 - - - - - 16000 - 3 - - - - - - - - 1 - - - 1 - - - - - 1 - - - - - - - - 16000 - 3 - - - 16000 - 3 - - - - - 16000 - 3 - - - - - - - - - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 20, [](Blob::Ptr& weights) { - auto * i64w = weights->buffer().as(); - i64w[0] = 200; - - auto * fp32w = weights->buffer().as(); - fp32w[2] = 0.5; - fp32w[3] = 0.05; - fp32w[4] = 0.0; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/normalize_l2_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/normalize_l2_tests.cpp deleted file mode 100644 index 12ffb3409857b4..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/normalize_l2_tests.cpp +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadNormalizeL2Network) { - std::string model = R"V0G0N( - - - - - - - 6 - 24 - 12 - 10 - - - - - - - - 1 - - - - - - - - 6 - 24 - 12 - 10 - - - 1 - - - - - 6 - 24 - 12 - 10 - - - - - - - - 1 - - - - - - - 6 - 24 - 12 - 10 - - - 1 - - - - - 6 - 24 - 12 - 10 - - - - - - - 6 - 24 - 12 - 10 - - - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 6 - 24 - 12 - 10 - - - - - - - - 6 - 24 - 12 - 10 - - - - - 6 - 24 - 12 - 10 - - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 100, [](Blob::Ptr& weights) { - auto* buffer = weights->buffer().as(); - buffer[0] = 1; - buffer[1] = 32831; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/not_equal_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/not_equal_tests.cpp deleted file mode 100644 index b16ba5c449393b..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/not_equal_tests.cpp +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadNotEqualNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 4 - - - - - - - - 1 - 4 - - - - - - - 1 - 4 - - - 1 - 4 - - - - - 1 - 4 - - - - - - - 1 - 4 - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 4 - - - - - - - 1 - 4 - - - - - - - - 1 - 4 - - - 1 - 4 - - - - - 1 - 4 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 0); -} \ No newline at end of file diff --git a/src/tests/functional/inference_engine/ngraph_reader/one_hot_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/one_hot_tests.cpp deleted file mode 100644 index d3a2e13ff667f1..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/one_hot_tests.cpp +++ /dev/null @@ -1,318 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadOneHotFP32) { - std::string model = R"V0G0N( - - - - - - - 1 - 10 - 22 - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 10 - 22 - - - - - - - - 1 - 5 - 10 - 22 - - - - - - - 1 - 5 - 10 - 22 - - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 10 - 22 - - - - - - - - 1 - 10 - 22 - - - - - 1 - 5 - 10 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 16, [](Blob::Ptr& weights) { - auto * i64w = weights->buffer().as(); - i64w[0] = 5; - - auto * fp32w = weights->buffer().as(); - fp32w[2] = 1.25; - fp32w[3] = -4.0; - }); -} - -TEST_F(NGraphReaderTests, DISABLED_ReadOneHotINT16) { - std::string model = R"V0G0N( - - - - - - - 1 - 10 - 22 - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 10 - 22 - - - - - - - - 1 - 5 - 10 - 22 - - - - - - - 1 - 5 - 10 - 22 - - - 1 - 5 - 10 - 22 - - - - - 1 - 5 - 10 - 22 - - - - - - - 1 - 5 - 10 - 22 - - - - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 10 - 22 - - - - - - - - 1 - 10 - 22 - - - - - 1 - 5 - 10 - 22 - - - - - - - - 1 - 5 - 10 - 22 - - - - - 1 - 5 - 10 - 22 - - - - - - - - 1 - 5 - 10 - 22 - - - 1 - 5 - 10 - 22 - - - - - 1 - 5 - 10 - 22 - - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 12, [](Blob::Ptr& weights) { - auto * i64w = weights->buffer().as(); - i64w[0] = 5; - - auto * i16w = weights->buffer().as(); - i16w[4] = -4; - i16w[5] = 7; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/pad_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/pad_tests.cpp deleted file mode 100644 index d24e21afeee725..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/pad_tests.cpp +++ /dev/null @@ -1,274 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadPadNoPadValue) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 4 - - - - - - - - 4 - - - - - - - - 1 - 3 - 22 - 22 - - - 4 - - - 4 - - - - - 1 - 3 - 24 - 24 - - - - - - - 1 - 3 - 24 - 24 - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 24 - 24 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 80, [](Blob::Ptr& weights) { - auto * w = weights->buffer().as(); - w[0] = 0; - w[1] = 0; - w[2] = 1; - w[3] = 1; - - w[4] = 0; - w[5] = 0; - w[6] = 1; - w[7] = 1; - }); -} - -TEST_F(NGraphReaderTests, ReadPadWithPadValue) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 4 - - - - - - - - 4 - - - - - - - - - - - - - - - 1 - 3 - 22 - 22 - - - 4 - - - 4 - - - - - - - 1 - 3 - 24 - 24 - - - - - - - 1 - 3 - 24 - 24 - - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 24 - 24 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 80, [](Blob::Ptr& weights) { - auto * w = weights->buffer().as(); - w[0] = 0; - w[1] = 0; - w[2] = 1; - w[3] = 1; - - w[4] = 0; - w[5] = 0; - w[6] = 1; - w[7] = 1; - - auto * pad_value = reinterpret_cast(weights->buffer().as() + 64); - pad_value[0] = 127.5; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/pooling_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/pooling_tests.cpp deleted file mode 100644 index 7fb70732f3d199..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/pooling_tests.cpp +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadMaxPoolNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1floor - 3 - 11 - 11 - - - - - - - 1 - 3 - 12 - 12 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 12 - 12 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} - -TEST_F(NGraphReaderTests, ReadAvgPoolNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 11 - 11 - - - - - - - 1 - 3 - 11 - 11 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 12 - 12 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/pow_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/pow_tests.cpp deleted file mode 100644 index bb5b33f623e6b9..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/pow_tests.cpp +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadPowNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 3211264); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/prelu_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/prelu_tests.cpp deleted file mode 100644 index 614e2e0888812a..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/prelu_tests.cpp +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadPReLUNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 22 - 22 - - - - - - - - 64 - 1 - 1 - - - - - - - 1 - 64 - 22 - 22 - - - 64 - 1 - 1 - - - - - 1 - 64 - 22 - 22 - - - - - - - 1 - 64 - 22 - 22 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 22 - 22 - - - - - - - 1 - 64 - 22 - 22 - - - - - 1 - 64 - 22 - 22 - - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 256); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/prior_box_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/prior_box_tests.cpp deleted file mode 100644 index 424c46ee5cb6d7..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/prior_box_tests.cpp +++ /dev/null @@ -1,683 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadPriorBoxClusteredNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 768 - 30 - 30 - - - - - - - - 1 - 3 - 512 - 512 - - - - - - - - 1 - 2 - 32400 - - - - - - - 1 - 768 - 30 - 30 - - - - - 4 - - - - - - - - 1 - - - - - - - - 1 - - - - - - - - 1 - - - - - - - - 4 - - - 1 - - - 1 - - - 1 - - - - - 2 - - - - - - - 1 - 3 - 512 - 512 - - - - - 4 - - - - - - - - 4 - - - 1 - - - 1 - - - 1 - - - - - 2 - - - - - - - - 2 - - - 2 - - - - - 2 - 32400 - - - - - - - - 1 - - - - - - - 2 - 32400 - - - 1 - - - - - 1 - 2 - 32400 - - - - - - - - 1 - 2 - 32400 - - - 1 - 2 - 32400 - - - - - 1 - 4 - 32400 - - - - - - - 1 - 4 - 32400 - - - - - - - 1 - 768 - 30 - 30 - - - - - - - 1 - 3 - 512 - 512 - - - - - - - - - - - - - - - - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - - 1 - 3 - 512 - 512 - - - - - - - - 1 - 768 - 30 - 30 - - - - - - - - 1 - 2 - 32400 - - - - - - - 1 - 2 - 32400 - - - - - - - - - - - 1 - 2 - 32400 - - - 1 - 2 - 32400 - - - - - 1 - 4 - 32400 - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 259200, [](Blob::Ptr& weights) { - auto* buffer = weights->buffer().as(); - buffer[0] = 2; - buffer[1] = 4; - buffer[2] = 1; - buffer[3] = 0; - }); -} - -TEST_F(NGraphReaderTests, ReadPriorBoxNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 768 - 30 - 30 - - - - - - - - 1 - 3 - 512 - 512 - - - - - - - - 1 - 2 - 14400 - - - - - - - 1 - 768 - 30 - 30 - - - - - 4 - - - - - - - - 1 - - - - - - - - 1 - - - - - - - - 1 - - - - - - - - 4 - - - 1 - - - 1 - - - 1 - - - - - 2 - - - - - - - 1 - 3 - 512 - 512 - - - - - 4 - - - - - - - - 4 - - - 1 - - - 1 - - - 1 - - - - - 2 - - - - - - - - 2 - - - 2 - - - - - 2 - 14400 - - - - - - - - 1 - - - - - - - 2 - 14400 - - - 1 - - - - - 1 - 2 - 14400 - - - - - - - - 1 - 2 - 14400 - - - 1 - 2 - 14400 - - - - - 1 - 4 - 14400 - - - - - - - 1 - 4 - 14400 - - - - - - - 1 - 768 - 30 - 30 - - - - - - - 1 - 3 - 512 - 512 - - - - - - - - - - - - - - - - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - - 1 - 3 - 512 - 512 - - - - - - - - 1 - 768 - 30 - 30 - - - - - - - 1 - 2 - 14400 - - - - - - - - - - - 1 - 2 - 14400 - - - - - - - - 1 - 2 - 14400 - - - 1 - 2 - 14400 - - - - - 1 - 4 - 14400 - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 115200, [](Blob::Ptr& weights) { - auto* buffer = weights->buffer().as(); - buffer[0] = 2; - buffer[1] = 4; - buffer[2] = 1; - buffer[3] = 0; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/proposal_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/proposal_tests.cpp deleted file mode 100644 index f7f0fa0206eb30..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/proposal_tests.cpp +++ /dev/null @@ -1,408 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph/opsets/opset6.hpp" -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadProposalNetwork) { - std::string model_v10 = R"V0G0N( - - - - - - - 1 - 12 - 34 - 62 - - - - - - - - 1 - 24 - 34 - 62 - - - - - - - - 3 - - - - - - - - 1 - 12 - 34 - 62 - - - 1 - 24 - 34 - 62 - - - 3 - - - - - 200 - 5 - - - - - - - 200 - 5 - - - - - - - - - - - - )V0G0N"; - std::string model_v6 = R"V0G0N( - - - - - - 1 - 3 - - - - - - - - - - 1 - 24 - 34 - 62 - - - - - - - 1 - 12 - 34 - 62 - - - - - - - - 1 - 12 - 34 - 62 - - - 1 - 24 - 34 - 62 - - - 1 - 3 - - - - - 200 - 5 - - - - - - - - - - - -)V0G0N"; - - compareIRs(model_v10, model_v6, 24); -} - -TEST_F(NGraphReaderTests, ReadProposalNetwork_2) { - std::string model_v10 = R"V0G0N( - - - - - - - 1 - 12 - 34 - 62 - - - - - - - - 1 - 24 - 34 - 62 - - - - - - - - 4 - - - - - - - - 1 - 12 - 34 - 62 - - - 1 - 24 - 34 - 62 - - - 4 - - - - - 200 - 5 - - - - - - - 200 - 5 - - - - - - - - - - - - )V0G0N"; - std::string model_v6 = R"V0G0N( - - - - - - 1 - 4 - - - - - - - - - - 1 - 24 - 34 - 62 - - - - - - - 1 - 12 - 34 - 62 - - - - - - - - 1 - 12 - 34 - 62 - - - 1 - 24 - 34 - 62 - - - 1 - 4 - - - - - 200 - 5 - - - - - - - - - - - -)V0G0N"; - - compareIRs(model_v10, model_v6, 32); -} - -TEST_F(NGraphReaderTests, ReadExtensionProposalNetwork) { - // the Proposal with 2 inputs was initially marked as "extension" operation but later was added to opset - // the test checks that IR reader properly instantiate the "extension" Proposal as "opset6" Proposal - std::string model_v10 = R"V0G0N( - - - - - - - 1 - 12 - 34 - 62 - - - - - - - - 1 - 24 - 34 - 62 - - - - - - - - 3 - - - - - - - - 1 - 12 - 34 - 62 - - - 1 - 24 - 34 - 62 - - - 3 - - - - - 1000 - 5 - - - 1000 - - - - - - - 200 - 5 - - - - - - - - - - - - )V0G0N"; - - Core ie; - Blob::Ptr weights; - - weights = make_shared_blob(TensorDesc(Precision::U8, {12}, Layout::C)); - weights->allocate(); - CommonTestUtils::fill_data(weights->buffer().as(), weights->size() / sizeof(float)); - - auto func = ie.ReadNetwork(model_v10, weights).getFunction(); - for (auto op : func->get_ordered_ops()) { - if (op->get_friendly_name() == "proposal" && - op->get_type_info() == ngraph::opset6::Proposal::get_type_info_static()) { - return; - } - } - FAIL() << "Custom proposal layer is not an opset6 operation."; -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/psroi_pooling_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/psroi_pooling_tests.cpp deleted file mode 100644 index 4de1913e227583..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/psroi_pooling_tests.cpp +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadPSROIPoolingNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 392 - 34 - 62 - - - - - - - - 200 - 5 - - - - - - - - 1 - 392 - 34 - 62 - - - 200 - 5 - - - - - 200 - 8 - 7 - 7 - - - - - - - 200 - 8 - 7 - 7 - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 392 - 34 - 62 - - - - - - - 200 - 5 - - - - - - - - 1 - 392 - 34 - 62 - - - 200 - 5 - - - - - 200 - 8 - 7 - 7 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/range_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/range_tests.cpp deleted file mode 100644 index 2e5bfdedbc1552..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/range_tests.cpp +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadRangeNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 2 - 12 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4 - - - - - - - - - 1 - 2 - 12 - - - 4 - - - - - 1 - 2 - 3 - 4 - - - - - - - 1 - 2 - 3 - 4 - - - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 2 - 12 - - - - - - - 4 - - - - - - - - - - 1 - 2 - 12 - - - 4 - - - - - 1 - 2 - 3 - 4 - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 80, [](Blob::Ptr& weights) { - auto * w = weights->buffer().as(); - w[0] = 1; - w[1] = 5; - w[2] = 1; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/reduce_logical_and_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/reduce_logical_and_tests.cpp deleted file mode 100644 index 9267f858857dc0..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/reduce_logical_and_tests.cpp +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadReduceLogicalAndNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - - - - - - - - 1 - 3 - 22 - 22 - - - 1 - - - - - 1 - 3 - 1 - 22 - - - - - - - 1 - 3 - 1 - 22 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - - - - - - - - - - - 1 - 3 - 22 - 22 - - - 1 - - - - - 1 - 3 - 1 - 22 - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 8, [](Blob::Ptr& w) {(w->buffer().as())[0] = 2;}); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/reduce_logical_or_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/reduce_logical_or_tests.cpp deleted file mode 100644 index 8381b8445c9a5c..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/reduce_logical_or_tests.cpp +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadReduceLogicalOrNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - - - - - - - - 1 - 3 - 22 - 22 - - - 1 - - - - - 1 - 3 - 1 - 22 - - - - - - - 1 - 3 - 1 - 22 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - - - - - - - - - - - 1 - 3 - 22 - 22 - - - 1 - - - - - 1 - 3 - 1 - 22 - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 8, [](Blob::Ptr& w) {(w->buffer().as())[0] = 2;}); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/reduce_min_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/reduce_min_tests.cpp deleted file mode 100644 index 8d8e7bec96238e..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/reduce_min_tests.cpp +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadReduceMinNetwork) { - std::string model = R"V0G0N( - - - - - - - 3 - 2 - 2 - - - - - - - - 3 - - - - - - - - 3 - 2 - 2 - - - 3 - - - - - 1 - 1 - 1 - - - - - - - 1 - 1 - 1 - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 3 - 2 - 2 - - - - - - - 3 - - - - - - - - - - - 3 - 2 - 2 - - - 3 - - - - - 1 - 1 - 1 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 100, [](Blob::Ptr& weights) { - auto* buffer = weights->buffer().as(); - buffer[0] = 0; - buffer[1] = 1; - buffer[2] = 2; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/reduce_prod_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/reduce_prod_tests.cpp deleted file mode 100644 index ba35911c5ff428..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/reduce_prod_tests.cpp +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadReduceProdNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 1 - 4 - - - - - - - - 1 - - - - - - - - 1 - 1 - 4 - - - 1 - - - - - 1 - 4 - - - - - - - 1 - 4 - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 1 - 4 - - - - - - - 1 - - - - - - - - - - - 1 - 1 - 4 - - - 1 - - - - - 1 - 4 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 16, [](Blob::Ptr& weights) { - auto *buffer = weights->buffer().as(); - buffer[0] = 1; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/reduce_to_pooling_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/reduce_to_pooling_tests.cpp deleted file mode 100644 index 23bc7216c8535e..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/reduce_to_pooling_tests.cpp +++ /dev/null @@ -1,1127 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReduceMeanToAvgPool) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 227 - 227 - - - - - - - - 2 - - - - - - - - 1 - 3 - 227 - 227 - - - 2 - - - - - 1 - 3 - 1 - 1 - - - - - - - 1 - 3 - 1 - 1 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 227 - 227 - - - - - - - - 1 - 3 - 227 - 227 - - - - - 1 - 3 - 1 - 1 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 139840, [](Blob::Ptr& weights) { - auto* reduce_axes = weights->buffer().as(); - reduce_axes[0] = 2; - reduce_axes[1] = 3; - }); -} - -TEST_F(NGraphReaderTests, ReduceMeanToAvgPoolKeepDimsFalse) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 227 - 64 - - - - - - - - 1 - - - - - - - - 1 - 3 - 227 - 64 - - - 1 - - - - - 1 - 3 - 64 - - - - - - - 1 - 3 - 64 - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 227 - 64 - - - - - - - - 1 - 3 - 227 - 64 - - - - - 1 - 3 - 1 - 64 - - - - - - - 3 - - - - - - - - - - 1 - 3 - 1 - 64 - - - 3 - - - - - 1 - 3 - 64 - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 139840, [](Blob::Ptr& weights) { - auto* reduce_axes = weights->buffer().as(); - reduce_axes[0] = 2; - }); -} - -TEST_F(NGraphReaderTests, ReduceMeanToAvgPoolNonSpatial) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 24 - 12 - - - - - - - - 1 - - - - - - - - 1 - 3 - 24 - 12 - - - 1 - - - - - 1 - 1 - 24 - 12 - - - - - - - 1 - 1 - 24 - 12 - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 24 - 12 - - - - - - - 4 - - - - - - - - - - - 1 - 3 - 24 - 12 - - - 4 - - - - - 1 - 1 - 3 - 288 - - - - - - - - 1 - 1 - 3 - 288 - - - - - 1 - 1 - 1 - 288 - - - - - - - 4 - - - - - - - - - - 1 - 1 - 1 - 288 - - - 4 - - - - - 1 - 1 - 24 - 12 - - - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 139840, [](Blob::Ptr& weights) { - auto* reduce_axes = weights->buffer().as(); - reduce_axes[0] = 1; - }); -} - -TEST_F(NGraphReaderTests, ReduceMeanToAvgPoolNonSpatialHard) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 24 - 12 - - - - - - - - 2 - - - - - - - - 1 - 3 - 24 - 12 - - - 2 - - - - - 1 - 1 - 1 - 12 - - - - - - - 1 - 1 - 1 - 12 - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 24 - 12 - - - - - - - 4 - - - - - - - - - - - 1 - 3 - 24 - 12 - - - 4 - - - - - 1 - 1 - 72 - 12 - - - - - - - - 1 - 1 - 72 - 12 - - - - - 1 - 1 - 1 - 12 - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 139840, [](Blob::Ptr& weights) { - auto* reduce_axes = weights->buffer().as(); - reduce_axes[0] = 1; - reduce_axes[1] = 2; - }); -} - -TEST_F(NGraphReaderTests, ReduceMeanToMaxPool) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 227 - 227 - - - - - - - - 2 - - - - - - - - 1 - 3 - 227 - 227 - - - 2 - - - - - 1 - 3 - 1 - 1 - - - - - - - 1 - 3 - 1 - 1 - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 227 - 227 - - - - - - - - 1 - 3 - 227 - 227 - - - - - 1 - 3 - 1 - 1 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 139840, [](Blob::Ptr& weights) { - auto* reduce_axes = weights->buffer().as(); - reduce_axes[0] = 2; - reduce_axes[1] = 3; - }); -} - -TEST_F(NGraphReaderTests, ReduceMeanToMaxPoolKeepDimsFalse) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 227 - 64 - - - - - - - - 1 - - - - - - - - 1 - 3 - 227 - 64 - - - 1 - - - - - 1 - 3 - 64 - - - - - - - 1 - 3 - 64 - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 227 - 64 - - - - - - - - 1 - 3 - 227 - 64 - - - - - 1 - 3 - 1 - 64 - - - - - - - 3 - - - - - - - - - - 1 - 3 - 1 - 64 - - - 3 - - - - - 1 - 3 - 64 - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 139840, [](Blob::Ptr& weights) { - auto* reduce_axes = weights->buffer().as(); - reduce_axes[0] = 2; - }); -} - -TEST_F(NGraphReaderTests, ReduceMeanToMaxPoolNonSpatial) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 24 - 12 - - - - - - - - 1 - - - - - - - - 1 - 3 - 24 - 12 - - - 1 - - - - - 1 - 1 - 24 - 12 - - - - - - - 1 - 1 - 24 - 12 - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 24 - 12 - - - - - - - 4 - - - - - - - - - - - 1 - 3 - 24 - 12 - - - 4 - - - - - 1 - 1 - 3 - 288 - - - - - - - - 1 - 1 - 3 - 288 - - - - - 1 - 1 - 1 - 288 - - - - - - - 4 - - - - - - - - - - 1 - 1 - 1 - 288 - - - 4 - - - - - 1 - 1 - 24 - 12 - - - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 139840, [](Blob::Ptr& weights) { - auto* reduce_axes = weights->buffer().as(); - reduce_axes[0] = 1; - }); -} - -TEST_F(NGraphReaderTests, ReduceSumToAvgPool) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 227 - 227 - - - - - - - - 2 - - - - - - - - 1 - 3 - 227 - 227 - - - 2 - - - - - 1 - 3 - 1 - 1 - - - - - - - 1 - 3 - 1 - 1 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 227 - 227 - - - - - - - - 1 - 3 - 227 - 227 - - - - - 1 - 3 - 1 - 1 - - - - - - - - 1 - 3 - 1 - 1 - - - - - 1 - 3 - 1 - 1 - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 139840, [](Blob::Ptr& weights) { - auto* reduce_axes = weights->buffer().as(); - reduce_axes[0] = 2; - reduce_axes[1] = 3; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/region_yolo_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/region_yolo_tests.cpp deleted file mode 100644 index 81f429410deb62..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/region_yolo_tests.cpp +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadRegionYoloNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 125 - 13 - 13 - - - - - - - - 1 - 125 - 13 - 13 - - - - - 1 - 21125 - - - - - - - 1 - 21125 - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 125 - 13 - 13 - - - - - - - - 1 - 125 - 13 - 13 - - - - - 1 - 21125 - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 4); -} - - -TEST_F(NGraphReaderTests, ReadRegionYoloMaskNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 255 - 26 - 26 - - - - - - - - 1 - 255 - 26 - 26 - - - - - 1 - 255 - 26 - 26 - - - - - - - 1 - 255 - 26 - 26 - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 255 - 26 - 26 - - - - - - - - 1 - 255 - 26 - 26 - - - - - 1 - 255 - 26 - 26> - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 4); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/relu_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/relu_tests.cpp deleted file mode 100644 index 9b932898e44a69..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/relu_tests.cpp +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadReLUNetworkWithoutTopologicalOrder) { - std::string model = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} - -TEST_F(NGraphReaderTests, ReadReLUNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} - -TEST_F(NGraphReaderTests, ReadReLUScalarNetwork) { - std::string model = R"V0G0N( - - - - - - - - - - - - - - - - - - - - - - - - - - - -)V0G0N"; - - Blob::CPtr blob; - Core reader; - auto cnn = reader.ReadNetwork(model, blob); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/reorg_yolo_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/reorg_yolo_tests.cpp deleted file mode 100644 index 438e21ddfb884c..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/reorg_yolo_tests.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadReorgYoloNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 26 - 64 - 26 - - - - - - - - 1 - 26 - 64 - 26 - - - - - 1 - 104 - 32 - 13 - - - - - - - 1 - 104 - 32 - 13 - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 1 - 26 - 64 - 26 - - - - - - - - 1 - 26 - 64 - 26 - - - - - 1 - 104 - 32 - 13 - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/reshape_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/reshape_tests.cpp deleted file mode 100644 index 2ad46f7c0a76d8..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/reshape_tests.cpp +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadReshapeNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 2048 - 1 - 1 - - - - - - - - 2 - - - - - - - - 1 - 2048 - 1 - 1 - - - 2 - - - - - 1 - 2048 - - - - - - - 1 - 2048 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 2048 - 1 - 1 - - - - - - - 2 - - - - - - - - - - 1 - 2048 - 1 - 1 - - - 2 - - - - - 1 - 2048 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 16, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - data[0] = 1; - data[1] = 2048; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/reverse_sequence_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/reverse_sequence_tests.cpp deleted file mode 100644 index c6500c6e968ed7..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/reverse_sequence_tests.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadReverseSequenceNetwork) { - std::string model = R"V0G0N( - - - - - - - 3 - 10 - 100 - 200 - - - - - - - - 3 - - - - - - - 3 - 10 - 100 - 200 - - - 3 - - - - - 3 - 10 - 100 - 200 - - - - - - - 3 - 10 - 100 - 200 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 3 - 10 - 100 - 200 - - - - - - - 3 - - - - - - - - - - - 3 - 10 - 100 - 200 - - - 3 - - - - - 3 - 10 - 100 - 200 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 24, nullptr); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/roi_pooling_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/roi_pooling_tests.cpp deleted file mode 100644 index b81e2ee0d3ead2..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/roi_pooling_tests.cpp +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ROIPoolingNetwork) { - std::string model_v10 = R"V0G0N( - - - - - - - 1 - 1024 - 100 - 100 - - - - - - - - 100 - 5 - - - - - - - - 1 - 1024 - 100 - 100 - - - 100 - 5 - - - - - 100 - 1024 - 14 - 14 - - - - - - - 100 - 1024 - 14 - 14 - - - - - - - - - - - )V0G0N"; - std::string model_v6 = R"V0G0N( - - - - - - 100 - 5 - - - - - - - 1 - 1024 - 100 - 100 - - - - - - - - 1 - 1024 - 100 - 100 - - - 100 - 5 - - - - - 100 - 1024 - 14 - 14 - - - - - - - - - - - )V0G0N"; - - compareIRs(model_v10, model_v6, 48); -} - -TEST_F(NGraphReaderTests, DISABLED_ROIPoolingNetwork_2) { - std::string model_v10 = R"V0G0N( - - - - - - - 1 - 1024 - 14 - 14 - - - - - - - - 300 - 5 - - - - - - - - 1 - 1024 - 14 - 14 - - - 300 - 5 - - - - - 300 - 1024 - 14 - 14 - - - - - - - 300 - 1024 - 14 - 14 - - - - - - - - - - - )V0G0N"; - std::string model_v6 = R"V0G0N( - - - - - - 300 - 5 - - - - - - - 1 - 1024 - 14 - 14 - - - - - - - - 1 - 1024 - 14 - 14 - - - 300 - 5 - - - - - 300 - 1024 - 14 - 14 - - - - - - - - - - - )V0G0N"; - - compareIRs(model_v10, model_v6, 48); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/roll_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/roll_tests.cpp deleted file mode 100644 index ad33421b1fe35b..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/roll_tests.cpp +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadRollNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 4 - 2 - 3 - - - - - - - - 4 - - - - - - - - 4 - - - - - - - 1 - 4 - 2 - 3 - - - 4 - - - 4 - - - - - 1 - 4 - 2 - 3 - - - - - - - 1 - 4 - 2 - 3 - - - - - - - - - - - - )V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - - 1 - 4 - 2 - 3 - - - - - - - - 4 - - - - - - - - 4 - - - - - - - 1 - 4 - 2 - 3 - - - 4 - - - 4 - - - - - 1 - 4 - 2 - 3 - - - - - - - - - - - )V0G0N"; - compareIRs(model, modelV7); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/round_test.cpp b/src/tests/functional/inference_engine/ngraph_reader/round_test.cpp deleted file mode 100644 index 022301bd81a7a2..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/round_test.cpp +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadRoundEvenNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} - -TEST_F(NGraphReaderTests, ReadRoundAwayNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - -compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/select_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/select_tests.cpp deleted file mode 100644 index 92284b1a564afd..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/select_tests.cpp +++ /dev/null @@ -1,328 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" - -TEST_F(NGraphReaderTests, ReadSelectFP32Network) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - 1 - 3 - 22 - 22 - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - 1 - 3 - 22 - 22 - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} - -TEST_F(NGraphReaderTests, ReadSelectI32Network) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - 1 - 3 - 22 - 22 - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - 1 - 3 - 22 - 22 - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/selu_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/selu_tests.cpp deleted file mode 100644 index a7d9c4c6bd3cea..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/selu_tests.cpp +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadSeluNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - - - - - - - - 1 - - - - - - - 1 - 3 - 22 - 22 - - - 1 - - - 1 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 16, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - data[0] = 1; - data[1] = 2; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/sequences.cpp b/src/tests/functional/inference_engine/ngraph_reader/sequences.cpp deleted file mode 100644 index d84d9faabcd431..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/sequences.cpp +++ /dev/null @@ -1,470 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -#include "common_test_utils/data_utils.hpp" - -TEST_F(NGraphReaderTests, LSTMSeqNetwork) { - std::string model = R"V0G0N( - - - - - - - 10 - 3 - 512 - - - - - - - - 10 - 1 - 256 - - - - - - - - 10 - 1 - 256 - - - - - - - - 10 - - - - - - - - 1 - 1024 - 512 - - - - - - - - 1 - 1024 - 256 - - - - - - - - 1 - 1024 - - - - - - - - 10 - 3 - 512 - - - 10 - 1 - 256 - - - 10 - 1 - 256 - - - 10 - - - 1 - 1024 - 512 - - - 1 - 1024 - 256 - - - 1 - 1024 - - - - - 10 - 1 - 3 - 256 - - - 10 - 1 - 256 - - - 10 - 1 - 256 - - - - - - - 10 - 1 - 3 - 256 - - - - - - - 10 - 1 - 256 - - - - - - - 10 - 1 - 256 - - - - - - - - - - - - - - - - - -)V0G0N"; - - Blob::CPtr blob; - Core reader; - reader.ReadNetwork(model, blob); -} - -TEST_F(NGraphReaderTests, GRUSeqNetwork) { - std::string model = R"V0G0N( - - - - - - - 10 - 3 - 512 - - - - - - - - 10 - 1 - 256 - - - - - - - - 10 - - - - - - - - 1 - 768 - 512 - - - - - - - - 1 - 768 - 256 - - - - - - - - 1 - 768 - - - - - - - - 10 - 3 - 512 - - - 10 - 1 - 256 - - - 10 - - - 1 - 768 - 512 - - - 1 - 768 - 256 - - - 1 - 768 - - - - - 10 - 1 - 3 - 256 - - - 10 - 1 - 256 - - - - - - - 10 - 1 - 3 - 256 - - - - - - - 10 - 1 - 256 - - - - - - - - - - - - - - - -)V0G0N"; - - Blob::CPtr blob; - Core reader; - reader.ReadNetwork(model, blob); -} - -TEST_F(NGraphReaderTests, RNNSeqNetwork) { - std::string model = R"V0G0N( - - - - - - - 10 - 3 - 512 - - - - - - - - 10 - 1 - 256 - - - - - - - - 10 - - - - - - - - 1 - 256 - 512 - - - - - - - - 1 - 256 - 256 - - - - - - - - 1 - 256 - - - - - - - - 10 - 3 - 512 - - - 10 - 1 - 256 - - - 10 - - - 1 - 256 - 512 - - - 1 - 256 - 256 - - - 1 - 256 - - - - - 10 - 1 - 3 - 256 - - - 10 - 1 - 256 - - - - - - - 10 - 1 - 3 - 256 - - - - - - - 10 - 1 - 256 - - - - - - - - - - - - - - - -)V0G0N"; - - Blob::CPtr blob; - Core reader; - reader.ReadNetwork(model, blob); -} \ No newline at end of file diff --git a/src/tests/functional/inference_engine/ngraph_reader/shape_of_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/shape_of_tests.cpp deleted file mode 100644 index b322f842e16754..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/shape_of_tests.cpp +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, DISABLED_ReadShapeOfNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 4 - - - - - - - 1 - 3 - 22 - 22 - - - 4 - - - - - 4 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 4 - - - - - - - 1 - 3 - 22 - 22 - - - 4 - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} - -TEST_F(NGraphReaderTests, ReadShapeOfFromScalar) { - // The test checks case when ShapeOf gets a scalar as input and the result tensor has shape [0]. This means an empty - // tensor which does not have data. There is nothing to do with this tensor so the test model has another ShapeOf - // producing tensor with shape [1] which is the output of the model. - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 7 - - - - - - - - 1 - - - - - - - - 1 - - - - - 1 - - - - - - - - 1 - - - - - - - 1 - - - 1 - - - - - - - - - - - - - - - 0 - - - - - - - - 0 - - - - - 1 - - - - - - - 1 - - - - - - - - - - - - - -)V0G0N"; - - Blob::Ptr blob; - blob = make_shared_blob(TensorDesc(Precision::I64, {1}, Layout::C)); - blob->allocate(); - auto *data = blob->buffer().as(); - data[0] = 0; - Core reader; - reader.ReadNetwork(model, blob); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/sigmoid_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/sigmoid_tests.cpp deleted file mode 100644 index b3f933d6cf0e2b..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/sigmoid_tests.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadSigmoidNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/sign_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/sign_tests.cpp deleted file mode 100644 index 7ac02eeca2d4ee..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/sign_tests.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadSignNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/sin_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/sin_tests.cpp deleted file mode 100644 index 015d3d83a39f2a..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/sin_tests.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadSinNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/sinh_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/sinh_tests.cpp deleted file mode 100644 index 05efd5fc661d40..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/sinh_tests.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadSinhNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/softmax_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/softmax_tests.cpp deleted file mode 100644 index 2b3a869b6a8485..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/softmax_tests.cpp +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadSoftMaxNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 1000 - - - - - - - - 1 - 1000 - - - - - 1 - 1000 - - - - - - - 1 - 1000 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 1000 - - - - - - - - 1 - 1000 - - - - - 1 - 1000 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/space_to_depth_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/space_to_depth_tests.cpp deleted file mode 100644 index a378ca10ebaa00..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/space_to_depth_tests.cpp +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadSpaceToDepthNetwork) { - std::string model = R"V0G0N( - - - - - - - 6 - 5 - 4 - 4 - - - - - - - - 6 - 5 - 4 - 4 - - - - - 6 - 20 - 2 - 2 - - - - - - - 6 - 20 - 2 - 2 - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 6 - 5 - 4 - 4 - - - - - - - 6 - - - - - - - - - - - 6 - 5 - 4 - 4 - - - 6 - - - - - 6 - 5 - 2 - 2 - 2 - 2 - - - - - - - - 6 - 5 - 2 - 2 - 2 - 2 - - - - - 6 - 2 - 2 - 5 - 2 - 2 - - - - - - - 4 - - - - - - - - - - - 6 - 2 - 2 - 5 - 2 - 2 - - - 4 - - - - - 6 - 20 - 2 - 2 - - - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 80, [](Blob::Ptr& weights) { - auto* buffer = weights->buffer().as(); - buffer[0] = 6; - buffer[1] = 5; - buffer[2] = 2; - buffer[3] = 2; - buffer[4] = 2; - buffer[5] = 2; - buffer[7] = 6; - buffer[7] = 14; - buffer[8] = 2; - buffer[9] = 2; - }); -} \ No newline at end of file diff --git a/src/tests/functional/inference_engine/ngraph_reader/split_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/split_tests.cpp deleted file mode 100644 index c9d92f87be86e0..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/split_tests.cpp +++ /dev/null @@ -1,506 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadSplitNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 6 - 22 - 22 - - - - - - - - - - - - - - 1 - 6 - 22 - 22 - - - - - - 1 - 3 - 22 - 22 - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 6 - 22 - 22 - - - - - - - - 1 - 6 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 8, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - data[0] = 1; - }); -} - -TEST_F(NGraphReaderTests, ReadSplitNetwork2) { - std::string model = R"V0G0N( - - - - - - - 1 - 63 - 46 - 46 - - - - - - - - - - - - - - 1 - 63 - 46 - 46 - - - - - - 1 - 21 - 46 - 46 - - - 1 - 21 - 46 - 46 - - - 1 - 21 - 46 - 46 - - - - - - - 1 - 21 - 46 - 46 - - - 1 - 21 - 46 - 46 - - - - - 1 - 21 - 46 - 46 - - - - - - - 1 - 21 - 46 - 46 - - - 1 - 21 - 46 - 46 - - - - - 1 - 21 - 46 - 46 - - - - - - - 1 - 21 - 46 - 46 - - - - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 63 - 46 - 46 - - - - - - - - 1 - 63 - 46 - 46 - - - - - 1 - 21 - 46 - 46 - - - 1 - 21 - 46 - 46 - - - 1 - 21 - 46 - 46 - - - - - - - - 1 - 21 - 46 - 46 - - - 1 - 21 - 46 - 46 - - - - - 1 - 21 - 46 - 46 - - - - - - - - 1 - 21 - 46 - 46 - - - 1 - 21 - 46 - 46 - - - - - 1 - 21 - 46 - 46 - - - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 8, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - data[0] = 1; - }); -} - -TEST_F(NGraphReaderTests, ReadVariadicSplitNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 6 - 22 - 22 - - - - - - - - - - - - - - 2 - - - - - - - 1 - 6 - 22 - 22 - - - - 2 - - - - - 1 - 2 - 22 - 22 - - - 1 - 4 - 22 - 22 - - - - - - - 1 - 2 - 22 - 22 - - - - - - - 1 - 4 - 22 - 22 - - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 6 - 22 - 22 - - - - - - - - 1 - 6 - 22 - 22 - - - - - 1 - 2 - 22 - 22 - - - 1 - 4 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 24, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - data[0] = 1; - data[1] = 2; - data[2] = 4; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/sqrt_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/sqrt_tests.cpp deleted file mode 100644 index 9d6368a5d01cc6..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/sqrt_tests.cpp +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadSqrtNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/squared_difference_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/squared_difference_tests.cpp deleted file mode 100644 index b32f425968d536..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/squared_difference_tests.cpp +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadSquaredDifferenceNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 112 - 112 - - - - - - - 1 - 64 - 112 - 112 - - - - - - - - - - - 1 - 64 - 112 - 112 - - - 1 - 64 - 112 - 112 - - - - - 1 - 64 - 112 - 112 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 3211264); -} - diff --git a/src/tests/functional/inference_engine/ngraph_reader/squeeze_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/squeeze_tests.cpp deleted file mode 100644 index dbed97c49c5199..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/squeeze_tests.cpp +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadSqueeze) { - std::string model = R"V0G0N( - - - - - - - 1 - 2048 - 1 - 1 - - - - - - - - 1 - - - - - - - 1 - 2048 - 1 - 1 - - - 1 - - - - - 1 - 2048 - 1 - - - - - - - 1 - 2048 - 1 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 2048 - 1 - 1 - - - - - - - 1 - - - - - - - - - - 1 - 2048 - 1 - 1 - - - 1 - - - - - 1 - 2048 - 1 - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV5, 24, [](Blob::Ptr& weights) { - auto* w = weights->buffer().as(); - w[0] = 3; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/strided_slice_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/strided_slice_tests.cpp deleted file mode 100644 index 68efeab1a5a24d..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/strided_slice_tests.cpp +++ /dev/null @@ -1,667 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -// Crop supports only 2d, 4d and 5d blobs -// This test should pass after deleting -// "input_shape.size() != 2 && input_shape.size() != 4 && input_shape.size() != 5" condition in -// strided_slice_to_crop transformation -TEST_F(NGraphReaderTests, ConvertStridedSliceToCrop) { - std::string model_version10 = R"V0G0N( - - - - - - - 300 - 90 - 1 - 4 - - - - - - - - 4 - - - - - - - - 4 - - - - - - - - 4 - - - - - - - - 300 - 90 - 1 - 4 - - - 4 - - - 4 - - - 4 - - - - - 300 - 1 - 1 - 4 - - - - - - - 300 - 1 - 1 - 4 - - - - - - - - - - - - - )V0G0N"; - std::string model_version6 = R"V0G0N( - - - - - - 300 - 90 - 1 - 4 - - - - - - - - 300 - 90 - 1 - 4 - - - - - 300 - 1 - 1 - 4 - - - - - - - - - -)V0G0N"; - - compareIRs(model_version10, model_version6, 96, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - - // According to begin (0,1,0,0) and end masks (0,1,0,0) - // and input and result shapes (300, 90, 1, 4) -> (300, 1, 1, 4) - // begin - data[0] = 0; - data[1] = 1; - data[2] = 0; - data[3] = 0; - - // end - data[4] = 0; - data[5] = 2; - data[6] = 0; - data[7] = 0; - // Set "1" into each stride to apply "StrideSliceToCrop" transformation - for (int stride_node_idx = 8; stride_node_idx < 12; ++stride_node_idx) { - data[stride_node_idx] = 1; - } - }); -} - -// Crop supports only 2d, 4d and 5d blobs -// This test should pass after deleting -// "input_shape.size() != 2 && input_shape.size() != 4 && input_shape.size() != 5" condition in -// strided_slice_to_crop transformation -TEST_F(NGraphReaderTests, DISABLED_ConvertStridedSliceToCropMultipleMasks) { - // c = np.zeros((9, 9, 9, 9, 9, 9, 9)) - // const_use_axis_mask = tf.constant(c) - // strided_slice_with_mask = tf.strided_slice(const_use_axis_mask, - // name="OurStridedSlice", - // begin=[0, 0, 0, 0, 0, 0], end=[ 2, 2, 2, 2, 2, 2], - // new_axis_mask = 9, - // ellipsis_mask= 2, - // shrink_axis_mask=4) - // # (1, 9, 9, 9, 9, 2, 1, 2, 2) without shrink - // # (1, 9, 9, 9, 9, 1, 2, 2) with shrink - std::string model_version10 = R"V0G0N( - - - - - - - 9 - 9 - 9 - 9 - 9 - 9 - 9 - - - - - - - - 6 - - - - - - - - 6 - - - - - - - - 6 - - - - - - - - 9 - 9 - 9 - 9 - 9 - 9 - 9 - - - 6 - - - 6 - - - 6 - - - - - 1 - 9 - 9 - 9 - 9 - 1 - 2 - 2 - - - - - - - 1 - 9 - 9 - 9 - 9 - 1 - 2 - 2 - - - - - - - - - - - - -)V0G0N"; - std::string model_version6 = R"V0G0N( - - - - - - 9 - 9 - 9 - 9 - 9 - 9 - 9 - - - - - - - 8 - - - - - - - - - - 9 - - - - - - - - - - - 9 - 9 - 9 - 9 - 9 - 9 - 9 - - - 9 - - - - - 1 - 9 - 9 - 9 - 9 - 1 - 1 - 9 - 9 - - - - - - - - 1 - 9 - 9 - 9 - 9 - 1 - 1 - 9 - 9 - - - - - 1 - 9 - 9 - 9 - 9 - 1 - 1 - 2 - 2 - - - - - - - - 1 - 9 - 9 - 9 - 9 - 1 - 1 - 2 - 2 - - - 8 - - - - - 1 - 9 - 9 - 9 - 9 - 1 - 2 - 2 - - - - - - - - - - - - - -)V0G0N"; - - - compareIRs(model_version10, model_version6, 144, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - - for (int begin_node = 0; begin_node < 6; ++begin_node) - data[begin_node] = 0; - for (int end_node = 6; end_node < 12; ++end_node) - data[end_node] = 2; - - // Set "1" into each stride to apply "StrideSliceToCrop" transformation - for (int stride_node_idx = 12; stride_node_idx < 18; ++stride_node_idx) { - data[stride_node_idx] = 1; - } - }); -} - -// TODO delete this check in ngraph "Check 'static_cast(data_rank) == mask_size' -TEST_F(NGraphReaderTests, DISABLED_ConvertStridedSliceToCropMultipleMasks_2) { - std::string model_version10 = R"V0G0N( - - - - - - - 9 - 9 - 9 - 9 - 9 - 9 - 9 - - - - - - - - 8 - - - - - - - - 8 - - - - - - - - 8 - - - - - - - - 9 - 9 - 9 - 9 - 9 - 9 - 9 - - - 8 - - - 8 - - - 8 - - - - - 1 - 1 - 1 - 9 - 9 - 9 - 9 - 2 - 1 - 2 - 1 - - - - - - - 1 - 1 - 1 - 9 - 9 - 9 - 9 - 2 - 1 - 2 - 1 - - - - - - - - - - - - -)V0G0N"; - std::string model_version6 = R"V0G0N( - - - - - - 9 - 9 - 9 - 9 - 9 - 9 - 9 - - - - - - - 11 - - - - - - - - - - - 9 - 9 - 9 - 9 - 9 - 9 - 9 - - - 11 - - - - - 1 - 9 - 1 - 9 - 9 - 9 - 9 - 9 - 1 - 9 - 1 - - - - - - - - 1 - 9 - 1 - 9 - 9 - 9 - 9 - 9 - 1 - 9 - 1 - - - - - 1 - 1 - 1 - 9 - 9 - 9 - 9 - 2 - 1 - 2 - 1 - - - - - - - - - - - -)V0G0N"; - - compareIRs(model_version10, model_version6, 192, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - - // begin node - data[0] = 0; - data[1] = 2; - data[2] = 0; - data[3] = 0; - data[4] = 2; - data[5] = 0; - data[6] = 2; - data[7] = 0; - - // end node - data[8] = 0; - data[9] = 3; - data[10] = 0; - data[11] = 0; - data[12] = 4; - data[13] = 0; - data[14] = 4; - data[15] = 0; - - // Set "1" into each stride to apply "StrideSliceToCrop" transformation - for (int stride_node_idx = 16; stride_node_idx < 24; ++stride_node_idx){ - data[stride_node_idx] = 1; - } - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/subtract_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/subtract_tests.cpp deleted file mode 100644 index 0fa94457dfbda5..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/subtract_tests.cpp +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadSubtractNetwork) { - std::string model = R"V0G0N( - - - - - - - 3 - 4 - 5 - - - - - - - - 3 - 4 - 5 - - - - - - - 3 - 4 - 5 - - - 3 - 4 - 5 - - - - - 3 - 4 - 5 - - - - - - - 3 - 4 - 5 - - - - - - - - - - -)V0G0N"; - std::string modelV7 = R"V0G0N( - - - - - - 3 - 4 - 5 - - - - - - - 3 - 4 - 5 - - - - - - - - 3 - 4 - 5 - - - - - 3 - 4 - 5 - - - - - - - - 3 - 4 - 5 - - - 3 - 4 - 5 - - - - - 3 - 4 - 5 - - - - - - - - - - -)V0G0N"; - compareIRs(model, modelV7, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/tan_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/tan_tests.cpp deleted file mode 100644 index 1108e4a9304181..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/tan_tests.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadTanNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/tanh_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/tanh_tests.cpp deleted file mode 100644 index ad8be685311070..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/tanh_tests.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadTanhNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 0); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/tensor_names.cpp b/src/tests/functional/inference_engine/ngraph_reader/tensor_names.cpp deleted file mode 100644 index 48082ba81e63f7..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/tensor_names.cpp +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include - -#include "ngraph_reader_tests.hpp" -#include "openvino/openvino.hpp" - -TEST_F(NGraphReaderTests, ReadNetworkWithTensorNames) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - 1 - 3 - 22 - 22 - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - -)V0G0N"; - Core ie; - Blob::Ptr weights; - - auto network = ie.ReadNetwork(model, weights); - auto function = network.getFunction(); - auto inputs = network.getInputsInfo(); - auto outputs = network.getOutputsInfo(); - std::unordered_set inNames; - for (const auto& in : inputs) - inNames.emplace(in.first); - std::unordered_set outNames; - for (const auto& out : outputs) - outNames.emplace(out.first); - - ASSERT_EQ(1, inputs.size()); - ASSERT_EQ(1, outputs.size()); - ASSERT_EQ(1, function->get_results().size()); - - for (const auto& param : function->get_parameters()) { - ASSERT_TRUE(!param->get_output_tensor(0).get_names().empty()); - for (const auto& name : param->get_output_tensor(0).get_names()) - ASSERT_TRUE(inNames.count(network.getOVNameForTensor(name))); - } - - for (const auto& result : function->get_results()) { - ASSERT_TRUE(!result->get_input_tensor(0).get_names().empty()); - for (const auto& name : result->get_input_tensor(0).get_names()) - ASSERT_TRUE(outNames.count(network.getOVNameForTensor(name))); - } - ASSERT_NO_THROW(network.getOVNameForTensor("relu,t")); -} - -TEST_F(NGraphReaderTests, ReadModelWithTensorNamesWithSpaces) { - std::string model_str = R"V0G0N( - - - - - - - 1 - 4 - 512 - - - - - - - - 1 - 4 - 512 - - - - - - - - 1 - 4 - 512 - - - 1 - 4 - 512 - - - - - 1 - 4 - 512 - - - - - - - 1 - 4 - 512 - - - - - - - - - - - )V0G0N"; - ov::Core core; - auto model = core.read_model(model_str, ov::Tensor{}); - auto outputs = model->outputs(); - EXPECT_EQ(outputs.size(), 1); - auto names = outputs.at(0).get_names(); - EXPECT_EQ(names.size(), 1); - auto it = names.find("output 0([1 4 512])"); - EXPECT_NE(it, names.end()); -} - -TEST_F(NGraphReaderTests, ReadModelWithTensorNamesAddOutput) { - std::string model_str = R"V0G0N( - - - - - - - 1 - 4 - 512 - - - - - - - - 1 - 4 - 512 - - - - - - - - 1 - 4 - 512 - - - 1 - 4 - 512 - - - - - 1 - 4 - 512 - - - - - - - 1 - 4 - 512 - - - - - 1 - 4 - 512 - - - - - - - - - - 1 - 4 - 512 - - - - - - - - - - -)V0G0N"; - ov::Core core; - std::string tensor_name = "output add"; - auto model = core.read_model(model_str, ov::Tensor{}); - model->add_output(tensor_name); - auto outputs = model->outputs(); - EXPECT_EQ(outputs.size(), 2); - auto names = outputs.at(1).get_names(); - EXPECT_EQ(names.size(), 1); - auto it = names.find(tensor_name); - EXPECT_NE(it, names.end()); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/ti.cpp b/src/tests/functional/inference_engine/ngraph_reader/ti.cpp deleted file mode 100644 index 22f19dbcc93125..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/ti.cpp +++ /dev/null @@ -1,2799 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadTensorIteratorNetwork_opset1) { - std::string model_v10 = R"V0G0N( - - - - - - - 1 - 25 - 512 - - - - - - - - 1 - 256 - - - - - - - - 1 - 256 - - - - - - - 1 - 25 - 512 - - - 1 - 256 - - - 1 - 256 - - - - - 1 - 25 - 256 - - - - - - - - - - - - - - - - - - - 1 - 1 - 512 - - - - - - - - 2 - - - - - - - - 1 - 1 - 512 - - - 2 - - - - - 1 - 512 - - - - - - - - 1 - 256 - - - - - - - - 1 - 256 - - - - - - - - 1024 - 512 - - - - - - - - 1024 - 256 - - - - - - - - 1024 - - - - - - - - 1 - 512 - - - 1 - 256 - - - 1 - 256 - - - 1024 - 512 - - - 1024 - 256 - - - 1024 - - - - - 1 - 256 - - - 1 - 256 - - - - - - - 1 - 256 - - - - - - - 1 - 256 - - - - - - - - 3 - - - - - - - - 1 - 256 - - - 3 - - - - - 1 - 1 - 256 - - - - - - - 1 - 1 - 256 - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 25 - 256 - - - - - - - - - - - - )V0G0N"; - std::string model_v6 = R"VOGON( - - - - - - 1 - 25 - 512 - - - - - - - 1 - 256 - - - - - - - 1 - 256 - - - - - - - 1 - 25 - 512 - - - 1 - 256 - - - 1 - 256 - - - - - 1 - 25 - 256 - - - - - - - - - - - - - - - - - - 2 - - - - - - - - - - 1 - 1 - 512 - - - 2 - - - - - 1 - 512 - - - - - - - - 1 - 512 - - - 1 - 256 - - - 1 - 256 - - - - - 1 - 256 - - - 1 - 256 - - - - - - - - - - - 3 - - - - - - - - - - 1 - 256 - - - 3 - - - - - 1 - 1 - 256 - - - - - - - - - - - - - - - - - - - - )VOGON"; - - compareIRs(model_v10, model_v6, 3149864, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - data[0] = 1; - data[1] = 512; - - data[393730] = 1; - data[393731] = 1; - data[393732] = 256; - }); -} - -TEST_F(NGraphReaderTests, ReadTensorIteratorNetwork_resnet_opset1) { - std::string model_v10 = R"V0G0N( - - - - - - - 16 - 1 - 512 - - - - - - - - 1 - 512 - - - - - - - - 1 - 512 - - - - - - - 16 - 1 - 512 - - - 1 - 512 - - - 1 - 512 - - - - - 16 - 1 - 512 - - - 1 - 512 - - - 1 - 512 - - - - - - - - - - - - - - - - - - - - - 1 - 1 - 512 - - - - - - - - 2 - - - - - - - - 1 - 1 - 512 - - - 2 - - - - - 1 - 512 - - - - - - - - 1 - 512 - - - - - - - - 1 - 512 - - - - - - - - 2048 - 512 - - - - - - - - 2048 - 512 - - - - - - - - 2048 - - - - - - - - 1 - 512 - - - 1 - 512 - - - 1 - 512 - - - 2048 - 512 - - - 2048 - 512 - - - 2048 - - - - - 1 - 512 - - - 1 - 512 - - - - - - - 1 - 512 - - - - - - - 1 - 512 - - - - - - - - 3 - - - - - - - - 1 - 512 - - - 3 - - - - - 1 - 1 - 512 - - - - - - - 1 - 1 - 512 - - - - - - - - - - - - - - - - - - - - - - - - - 16 - 1 - 512 - - - - - - - 1 - 512 - - - - - - - 1 - 512 - - - - - - - - - - - - - - )V0G0N"; - std::string model_v6 = R"V0G0N( - - - - - - 16 - 1 - 512 - - - - - - - 1 - 512 - - - - - - - 1 - 512 - - - - - - - 16 - 1 - 512 - - - 1 - 512 - - - 1 - 512 - - - - - 16 - 1 - 512 - - - 1 - 512 - - - 1 - 512 - - - - - - - - - - - - - - - - - - - - 2 - - - - - - - - - - 1 - 1 - 512 - - - 2 - - - - - 1 - 512 - - - - - - - - 1 - 512 - - - 1 - 512 - - - 1 - 512 - - - - - 1 - 512 - - - 1 - 512 - - - - - - - - - - - 3 - - - - - - - - - - 1 - 512 - - - 3 - - - - - 1 - 1 - 512 - - - - - - - - - - - - - - - - - - - - )V0G0N"; - - compareIRs(model_v10, model_v6, 8396840, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - data[0] = 1; - data[1] = 512; - - data[1049602] = 1; - data[1049603] = 1; - data[1049604] = 512; - }); -} - -TEST_F(NGraphReaderTests, ReadTensorIteratorNetwork_negative_stride_opset1) { - std::string model_v10 = R"V0G0N( - - - - - - - 1 - 25 - 512 - - - - - - - - 1 - 256 - - - - - - - - 1 - 256 - - - - - - - 1 - 25 - 512 - - - 1 - 256 - - - 1 - 256 - - - - - 1 - 25 - 256 - - - - - - - - - - - - - - - - - - - 1 - 1 - 512 - - - - - - - - 2 - - - - - - - - 1 - 1 - 512 - - - 2 - - - - - 1 - 512 - - - - - - - - 1 - 256 - - - - - - - - 1 - 256 - - - - - - - - 1024 - 512 - - - - - - - - 1024 - 256 - - - - - - - - 1024 - - - - - - - - 1 - 512 - - - 1 - 256 - - - 1 - 256 - - - 1024 - 512 - - - 1024 - 256 - - - 1024 - - - - - 1 - 256 - - - 1 - 256 - - - - - - - 1 - 256 - - - - - - - 1 - 256 - - - - - - - - 3 - - - - - - - - 1 - 256 - - - 3 - - - - - 1 - 1 - 256 - - - - - - - 1 - 1 - 256 - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 25 - 256 - - - - - - - - - - - - )V0G0N"; - std::string model_v6 = R"VOGON( - - - - - - 1 - 25 - 512 - - - - - - - 1 - 256 - - - - - - - 1 - 256 - - - - - - - 1 - 25 - 512 - - - 1 - 256 - - - 1 - 256 - - - - - 1 - 25 - 256 - - - - - - - - - - - - - - - - - - 2 - - - - - - - - - - 1 - 1 - 512 - - - 2 - - - - - 1 - 512 - - - - - - - - 1 - 512 - - - 1 - 256 - - - 1 - 256 - - - - - 1 - 256 - - - 1 - 256 - - - - - - - - - - - 3 - - - - - - - - - - 1 - 256 - - - 3 - - - - - 1 - 1 - 256 - - - - - - - - - - - - - - - - - - - - )VOGON"; - - compareIRs(model_v10, model_v6, 3149864, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - data[0] = 1; - data[1] = 512; - - data[393730] = 1; - data[393731] = 1; - data[393732] = 256; - }); -} - -TEST_F(NGraphReaderTests, ReadTensorIteratorNetwork_opset4) { - std::string model_v10 = R"V0G0N( - - - - - - - 1 - 25 - 512 - - - - - - - - 1 - 256 - - - - - - - - 1 - 256 - - - - - - - 1 - 25 - 512 - - - 1 - 256 - - - 1 - 256 - - - - - 1 - 25 - 256 - - - - - - - - - - - - - - - - - - - 1 - 1 - 512 - - - - - - - - 2 - - - - - - - - 1 - 1 - 512 - - - 2 - - - - - 1 - 512 - - - - - - - - 1 - 256 - - - - - - - - 1 - 256 - - - - - - - - 1024 - 512 - - - - - - - - 1024 - 256 - - - - - - - - 1024 - - - - - - - - 1 - 512 - - - 1 - 256 - - - 1 - 256 - - - 1024 - 512 - - - 1024 - 256 - - - 1024 - - - - - 1 - 256 - - - 1 - 256 - - - - - - - 1 - 256 - - - - - - - 1 - 256 - - - - - - - - 3 - - - - - - - - 1 - 256 - - - 3 - - - - - 1 - 1 - 256 - - - - - - - 1 - 1 - 256 - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 25 - 256 - - - - - - - - - - - - )V0G0N"; - std::string model_v6 = R"VOGON( - - - - - - 1 - 25 - 512 - - - - - - - 1 - 256 - - - - - - - 1 - 256 - - - - - - - 1 - 25 - 512 - - - 1 - 256 - - - 1 - 256 - - - - - 1 - 25 - 256 - - - - - - - - - - - - - - - - - - 2 - - - - - - - - - - 1 - 1 - 512 - - - 2 - - - - - 1 - 512 - - - - - - - - 1 - 512 - - - 1 - 256 - - - 1 - 256 - - - - - 1 - 256 - - - 1 - 256 - - - - - - - - - - - 3 - - - - - - - - - - 1 - 256 - - - 3 - - - - - 1 - 1 - 256 - - - - - - - - - - - - - - - - - - - - )VOGON"; - - compareIRs(model_v10, model_v6, 3149864, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - data[0] = 1; - data[1] = 512; - - data[393730] = 1; - data[393731] = 1; - data[393732] = 256; - }); -} - -TEST_F(NGraphReaderTests, ReadTensorIteratorNetwork_resnet_opset4) { - std::string model_v10 = R"V0G0N( - - - - - - - 16 - 1 - 512 - - - - - - - - 1 - 512 - - - - - - - - 1 - 512 - - - - - - - 16 - 1 - 512 - - - 1 - 512 - - - 1 - 512 - - - - - 16 - 1 - 512 - - - 1 - 512 - - - 1 - 512 - - - - - - - - - - - - - - - - - - - - - 1 - 1 - 512 - - - - - - - - 2 - - - - - - - - 1 - 1 - 512 - - - 2 - - - - - 1 - 512 - - - - - - - - 1 - 512 - - - - - - - - 1 - 512 - - - - - - - - 2048 - 512 - - - - - - - - 2048 - 512 - - - - - - - - 2048 - - - - - - - - 1 - 512 - - - 1 - 512 - - - 1 - 512 - - - 2048 - 512 - - - 2048 - 512 - - - 2048 - - - - - 1 - 512 - - - 1 - 512 - - - - - - - 1 - 512 - - - - - - - 1 - 512 - - - - - - - - 3 - - - - - - - - 1 - 512 - - - 3 - - - - - 1 - 1 - 512 - - - - - - - 1 - 1 - 512 - - - - - - - - - - - - - - - - - - - - - - - - - 16 - 1 - 512 - - - - - - - 1 - 512 - - - - - - - 1 - 512 - - - - - - - - - - - - - - )V0G0N"; - std::string model_v6 = R"V0G0N( - - - - - - 16 - 1 - 512 - - - - - - - 1 - 512 - - - - - - - 1 - 512 - - - - - - - 16 - 1 - 512 - - - 1 - 512 - - - 1 - 512 - - - - - 16 - 1 - 512 - - - 1 - 512 - - - 1 - 512 - - - - - - - - - - - - - - - - - - - - 2 - - - - - - - - - - 1 - 1 - 512 - - - 2 - - - - - 1 - 512 - - - - - - - - 1 - 512 - - - 1 - 512 - - - 1 - 512 - - - - - 1 - 512 - - - 1 - 512 - - - - - - - - - - - 3 - - - - - - - - - - 1 - 512 - - - 3 - - - - - 1 - 1 - 512 - - - - - - - - - - - - - - - - - - - - )V0G0N"; - - compareIRs(model_v10, model_v6, 8396840, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - data[0] = 1; - data[1] = 512; - - data[1049602] = 1; - data[1049603] = 1; - data[1049604] = 512; - }); -} - -TEST_F(NGraphReaderTests, ReadTensorIteratorNetwork_negative_stride_opset4) { - std::string model_v10 = R"V0G0N( - - - - - - - 1 - 25 - 512 - - - - - - - - 1 - 256 - - - - - - - - 1 - 256 - - - - - - - 1 - 25 - 512 - - - 1 - 256 - - - 1 - 256 - - - - - 1 - 25 - 256 - - - - - - - - - - - - - - - - - - - 1 - 1 - 512 - - - - - - - - 2 - - - - - - - - 1 - 1 - 512 - - - 2 - - - - - 1 - 512 - - - - - - - - 1 - 256 - - - - - - - - 1 - 256 - - - - - - - - 1024 - 512 - - - - - - - - 1024 - 256 - - - - - - - - 1024 - - - - - - - - 1 - 512 - - - 1 - 256 - - - 1 - 256 - - - 1024 - 512 - - - 1024 - 256 - - - 1024 - - - - - 1 - 256 - - - 1 - 256 - - - - - - - 1 - 256 - - - - - - - 1 - 256 - - - - - - - - 3 - - - - - - - - 1 - 256 - - - 3 - - - - - 1 - 1 - 256 - - - - - - - 1 - 1 - 256 - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 25 - 256 - - - - - - - - - - - - )V0G0N"; - std::string model_v6 = R"VOGON( - - - - - - 1 - 25 - 512 - - - - - - - 1 - 256 - - - - - - - 1 - 256 - - - - - - - 1 - 25 - 512 - - - 1 - 256 - - - 1 - 256 - - - - - 1 - 25 - 256 - - - - - - - - - - - - - - - - - - 2 - - - - - - - - - - 1 - 1 - 512 - - - 2 - - - - - 1 - 512 - - - - - - - - 1 - 512 - - - 1 - 256 - - - 1 - 256 - - - - - 1 - 256 - - - 1 - 256 - - - - - - - - - - - 3 - - - - - - - - - - 1 - 256 - - - 3 - - - - - 1 - 1 - 256 - - - - - - - - - - - - - - - - - - - - )VOGON"; - - compareIRs(model_v10, model_v6, 3149864, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - data[0] = 1; - data[1] = 512; - - data[393730] = 1; - data[393731] = 1; - data[393732] = 256; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/tile_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/tile_tests.cpp deleted file mode 100644 index 14301f0aaeff03..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/tile_tests.cpp +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadTileNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 2 - 3 - 4 - - - - - - - - 4 - - - - - - - 1 - 2 - 3 - 4 - - - 4 - - - - - 1 - 4 - 3 - 4 - - - - - - - 1 - 4 - 3 - 4 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 2 - 3 - 4 - - - - - - - - 1 - 2 - 3 - 4 - - - - - 1 - 4 - 3 - 4 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 32, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - data[0] = 1; - data[1] = 2; - data[2] = 1; - data[3] = 1; - }); -} - -TEST_F(NGraphReaderTests, ReadTileNetwork2) { - std::string model = R"V0G0N( - - - - - - - 1 - 64 - 10 - 10 - - - - - - - - 4 - - - - - - - 1 - 64 - 10 - 10 - - - 4 - - - - - 2 - 64 - 30 - 40 - - - - - - - 2 - 64 - 30 - 40 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 64 - 10 - 10 - - - - - - - - 1 - 64 - 10 - 10 - - - - - 1 - 64 - 10 - 40 - - - - - - - - 1 - 64 - 10 - 40 - - - - - 1 - 64 - 30 - 40 - - - - - - - - 1 - 64 - 30 - 40 - - - - - 2 - 64 - 30 - 40 - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 32, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - data[0] = 2; - data[1] = 1; - data[2] = 3; - data[3] = 4; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/topK_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/topK_tests.cpp deleted file mode 100644 index 4cf29218ae198b..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/topK_tests.cpp +++ /dev/null @@ -1,324 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -#include "openvino/runtime/core.hpp" - -TEST_F(NGraphReaderTests, DISABLED_ReadTopKNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - - - - - 1 - 3 - 22 - 22 - - - - - - 1 - 3 - 5 - 22 - - - 1 - 3 - 5 - 22 - - - - - - - 1 - 3 - 5 - 22 - - - 1 - 3 - 5 - 22 - - - - - 1 - 3 - 5 - 22 - - - - - - - 1 - 3 - 5 - 22 - - - 1 - 3 - 5 - 22 - - - - - 1 - 3 - 5 - 22 - - - - - - - 1 - 3 - 5 - 22 - - - - - - - 1 - 3 - 5 - 22 - - - - - - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - - - - - - - - 1 - 3 - 22 - 22 - - - 1 - - - - - 1 - 3 - 5 - 22 - - - 1 - 3 - 5 - 22 - - - - - - - - 1 - 3 - 5 - 22 - - - 1 - 3 - 5 - 22 - - - - - 1 - 3 - 5 - 22 - - - - - - - - 1 - 3 - 5 - 22 - - - 1 - 3 - 5 - 22 - - - - - 1 - 3 - 5 - 22 - - - - - - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 8, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - data[0] = 5; - }); -} - -TEST_F(NGraphReaderTests, ReadTopKV10Network) { - std::string model = R"V0G0N( - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - - - - - 1 - 3 - 22 - 22 - - - - - - 1 - 3 - 5 - 22 - - - 1 - 3 - 5 - 22 - - - - - - - 1 - 3 - 5 - 22 - - - - - - - - - - -)V0G0N"; - - ov::Core core; - ov::Tensor t(ov::element::i64, {1}); - t.data()[0] = 5; - core.read_model(model, t); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/transpose_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/transpose_tests.cpp deleted file mode 100644 index 472ca22fa8ada0..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/transpose_tests.cpp +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadTransposeNetwork) { - std::string model = R"V0G0N( - - - - - - - 1 - 2 - 3 - 4 - - - - - - - - 4 - - - - - - - 1 - 2 - 3 - 4 - - - 4 - - - - - 4 - 3 - 2 - 1 - - - - - - - 4 - 3 - 2 - 1 - - - - - - - - - - -)V0G0N"; - std::string modelV5 = R"V0G0N( - - - - - - 1 - 2 - 3 - 4 - - - - - - - - 1 - 2 - 3 - 4 - - - - - 4 - 3 - 2 - 1 - - - - - - - - -)V0G0N"; - - compareIRs(model, modelV5, 32, [](Blob::Ptr& weights) { - auto *data = weights->buffer().as(); - data[0] = 3; - data[1] = 2; - data[2] = 1; - data[3] = 0; - }); -} diff --git a/src/tests/functional/inference_engine/ngraph_reader/unsqueeze_tests.cpp b/src/tests/functional/inference_engine/ngraph_reader/unsqueeze_tests.cpp deleted file mode 100644 index 977fc7e9b6c919..00000000000000 --- a/src/tests/functional/inference_engine/ngraph_reader/unsqueeze_tests.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "ngraph_reader_tests.hpp" -TEST_F(NGraphReaderTests, ReadUnsqueeze) { - std::string model_version10 = R"V0G0N( - - - - - - - 32 - 64 - 60 - - - - - - - - 1 - - - - - - - 32 - 64 - 60 - - - 1 - - - - - 1 - 32 - 64 - 60 - - - - - - - 1 - 32 - 64 - 60 - - - - - - - - - - -)V0G0N"; - std::string model_version6 = R"V0G0N( - - - - - - 32 - 64 - 60 - - - - - - - 1 - - - - - - - - - - 32 - 64 - 60 - - - 1 - - - - - 32 - 64 - 60 - 1 - - - - - - - - - - -)V0G0N"; - - compareIRs(model_version10, model_version6, 8, [](Blob::Ptr& weights) { - auto* w = weights->buffer().as(); - w[0] = 3; - }); -} diff --git a/src/tests/util/visitor.hpp b/src/tests/util/visitor.hpp index 2ae05bde1e5833..0ba8f38ae2ab9a 100644 --- a/src/tests/util/visitor.hpp +++ b/src/tests/util/visitor.hpp @@ -373,11 +373,12 @@ class SerializeAttributeVisitor : public AttributeVisitor { class NodeBuilder : public ValueMap, public DeserializeAttributeVisitor { public: - NodeBuilder() : DeserializeAttributeVisitor(static_cast(*this)), m_serializer(*this) {} + NodeBuilder() : DeserializeAttributeVisitor(static_cast(*this)), m_serializer(*this), m_inputs{} {} - NodeBuilder(const std::shared_ptr& node) + NodeBuilder(const std::shared_ptr& node, ov::OutputVector inputs = {}) : DeserializeAttributeVisitor(static_cast(*this)), - m_serializer(*this) { + m_serializer(*this), + m_inputs(inputs) { save_node(node); } @@ -386,12 +387,17 @@ class NodeBuilder : public ValueMap, public DeserializeAttributeVisitor { node->visit_attributes(m_serializer); } - // Does not validate, since inputs aren't set std::shared_ptr create() { std::shared_ptr node(get_ops().create(m_node_type_info)); node->visit_attributes(*this); - return node; + + if (m_inputs.size()) { + node->set_arguments(m_inputs); + return node->clone_with_new_inputs(m_inputs); + } else + return node; } + AttributeVisitor& get_node_saver() { return m_serializer; } @@ -412,6 +418,7 @@ class NodeBuilder : public ValueMap, public DeserializeAttributeVisitor { protected: Node::type_info_t m_node_type_info; SerializeAttributeVisitor m_serializer; + ov::OutputVector m_inputs; }; } // namespace test } // namespace ngraph