Remove legacy API from common test utils (#19647)

* Remove legacy API from common test utils

* Fixed code style

* Fixed build

* Try to fix Windows build

* Fixed GNA build
This commit is contained in:
Ilya Churaev
2023-09-12 07:09:12 +04:00
committed by GitHub
parent 497f42bd82
commit 7becaf8494
43 changed files with 1284 additions and 1136 deletions

View File

@@ -25,6 +25,7 @@
// clang-format on
#include "common_test_utils/file_utils.hpp"
#include "common_test_utils/ov_test_utils.hpp"
#include "ngraph/file_util.hpp"
#include "default_opset.hpp"
#include "openvino/opsets/opset12.hpp"
#include "common_test_utils/test_case.hpp"
@@ -765,20 +766,21 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_gemm_abc) {
Inputs inputs;
inputs.emplace_back(
test::NDArray<float, 2>({{1, 2, 3, 4, 5, 6}, {7, 8, 9, 10, 11, 12}, {13, 14, 15, 16, 17, 18}}).get_vector());
ov::test::NDArray<float, 2>({{1, 2, 3, 4, 5, 6}, {7, 8, 9, 10, 11, 12}, {13, 14, 15, 16, 17, 18}})
.get_vector());
inputs.emplace_back(test::NDArray<float, 2>({{19, 20, 21, 22},
{23, 24, 25, 26},
{27, 28, 29, 30},
{31, 32, 33, 34},
{35, 36, 37, 38},
{39, 40, 41, 42}})
inputs.emplace_back(ov::test::NDArray<float, 2>({{19, 20, 21, 22},
{23, 24, 25, 26},
{27, 28, 29, 30},
{31, 32, 33, 34},
{35, 36, 37, 38},
{39, 40, 41, 42}})
.get_vector());
inputs.emplace_back(test::NDArray<float, 2>({{1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}}).get_vector());
inputs.emplace_back(ov::test::NDArray<float, 2>({{1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}}).get_vector());
auto expected_output =
test::NDArray<float, 2>({{340, 350.5, 361, 371.5}, {862, 890.5, 919, 947.5}, {1384, 1430.5, 1477, 1523.5}})
ov::test::NDArray<float, 2>({{340, 350.5, 361, 371.5}, {862, 890.5, 919, 947.5}, {1384, 1430.5, 1477, 1523.5}})
.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
@@ -793,11 +795,13 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_matmul) {
std::vector<std::vector<float>> inputs;
inputs.emplace_back(test::NDArray<float, 2>({{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}}).get_vector());
inputs.emplace_back(ov::test::NDArray<float, 2>({{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}}).get_vector());
inputs.emplace_back(test::NDArray<float, 2>({{13, 14, 15}, {16, 17, 18}, {19, 20, 21}, {22, 23, 24}}).get_vector());
inputs.emplace_back(
ov::test::NDArray<float, 2>({{13, 14, 15}, {16, 17, 18}, {19, 20, 21}, {22, 23, 24}}).get_vector());
auto expected_output = test::NDArray<float, 2>({{190, 200, 210}, {470, 496, 522}, {750, 792, 834}}).get_vector();
auto expected_output =
ov::test::NDArray<float, 2>({{190, 200, 210}, {470, 496, 522}, {750, 792, 834}}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);
@@ -997,11 +1001,11 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_sub) {
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/sub.onnx"));
Inputs inputs;
inputs.emplace_back(test::NDArray<float, 3>({{{1, 2, 3}}}).get_vector());
inputs.emplace_back(ov::test::NDArray<float, 3>({{{1, 2, 3}}}).get_vector());
inputs.emplace_back(test::NDArray<float, 3>({{{4, 5, 7}}}).get_vector());
inputs.emplace_back(ov::test::NDArray<float, 3>({{{4, 5, 7}}}).get_vector());
auto expected_output = test::NDArray<float, 3>({{{-3, -3, -4}}}).get_vector();
auto expected_output = ov::test::NDArray<float, 3>({{{-3, -3, -4}}}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);
@@ -1014,10 +1018,10 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_div) {
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/div.onnx"));
Inputs inputs;
inputs.emplace_back(test::NDArray<float, 3>({{{1, 2, 3}}}).get_vector());
inputs.emplace_back(test::NDArray<float, 3>({{{1, 4, 12}}}).get_vector());
inputs.emplace_back(ov::test::NDArray<float, 3>({{{1, 2, 3}}}).get_vector());
inputs.emplace_back(ov::test::NDArray<float, 3>({{{1, 4, 12}}}).get_vector());
auto expected_output = test::NDArray<float, 3>({{{1, 0.5, 0.25}}}).get_vector();
auto expected_output = ov::test::NDArray<float, 3>({{{1, 0.5, 0.25}}}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);
@@ -1030,17 +1034,18 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_add_bcast) {
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/add_bcast.onnx"));
Inputs inputs;
inputs.emplace_back(test::NDArray<float, 3>({{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}})
.get_vector());
inputs.emplace_back(
ov::test::NDArray<float, 3>({{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}})
.get_vector());
inputs.emplace_back(test::NDArray<float, 1>({1, 2, 3, 4, 5}).get_vector());
inputs.emplace_back(ov::test::NDArray<float, 1>({1, 2, 3, 4, 5}).get_vector());
auto expected_output =
test::NDArray<float, 4>({{{{2, 3, 4, 5, 6}, {2, 3, 4, 5, 6}, {2, 3, 4, 5, 6}, {2, 3, 4, 5, 6}},
{{2, 3, 4, 5, 6}, {2, 3, 4, 5, 6}, {2, 3, 4, 5, 6}, {2, 3, 4, 5, 6}},
{{2, 3, 4, 5, 6}, {2, 3, 4, 5, 6}, {2, 3, 4, 5, 6}, {2, 3, 4, 5, 6}}}})
ov::test::NDArray<float, 4>({{{{2, 3, 4, 5, 6}, {2, 3, 4, 5, 6}, {2, 3, 4, 5, 6}, {2, 3, 4, 5, 6}},
{{2, 3, 4, 5, 6}, {2, 3, 4, 5, 6}, {2, 3, 4, 5, 6}, {2, 3, 4, 5, 6}},
{{2, 3, 4, 5, 6}, {2, 3, 4, 5, 6}, {2, 3, 4, 5, 6}, {2, 3, 4, 5, 6}}}})
.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
@@ -1177,10 +1182,11 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reduce_log_sum) {
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/reduce_log_sum.onnx"));
// input data shape (1, 1, 4, 4)
Inputs inputs{test::NDArray<float, 4>({{{{1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}}}}).get_vector()};
Inputs inputs{
ov::test::NDArray<float, 4>({{{{1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}}}}).get_vector()};
// output data shape (1,)
auto expected_output = test::NDArray<float, 4>({{{{2.77258872f}}}}).get_vector();
auto expected_output = ov::test::NDArray<float, 4>({{{{2.77258872f}}}}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);
@@ -1194,10 +1200,11 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reduce_log_sum_exp) {
"onnx/reduce_log_sum_exp.onnx"));
// input data shape (1, 1, 4, 4)
Inputs inputs{test::NDArray<float, 4>({{{{1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}}}}).get_vector()};
Inputs inputs{
ov::test::NDArray<float, 4>({{{{1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}}}}).get_vector()};
// output data shape (1,)
auto expected_output = test::NDArray<float, 4>({{{{3.77258872f}}}}).get_vector();
auto expected_output = ov::test::NDArray<float, 4>({{{{3.77258872f}}}}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);
@@ -1210,10 +1217,11 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reduce_l1) {
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/reduce_l1.onnx"));
// input data shape (1, 1, 4, 4)
Inputs inputs{test::NDArray<float, 4>({{{{1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}}}}).get_vector()};
Inputs inputs{
ov::test::NDArray<float, 4>({{{{1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}}}}).get_vector()};
// output data shape (1,)
auto expected_output = test::NDArray<float, 4>({{{{16}}}}).get_vector();
auto expected_output = ov::test::NDArray<float, 4>({{{{16}}}}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);
@@ -1226,10 +1234,11 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reduce_l2) {
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/reduce_l2.onnx"));
// input data shape (1, 1, 4, 4)
Inputs inputs{test::NDArray<float, 4>({{{{1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}}}}).get_vector()};
Inputs inputs{
ov::test::NDArray<float, 4>({{{{1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}}}}).get_vector()};
// output data shape (1,)
auto expected_output = test::NDArray<float, 4>({{{{4}}}}).get_vector();
auto expected_output = ov::test::NDArray<float, 4>({{{{4}}}}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);
@@ -1243,10 +1252,10 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reduce_max) {
// input data shape (1, 1, 4, 4)
Inputs inputs{
test::NDArray<float, 4>({{{{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}}}}).get_vector()};
ov::test::NDArray<float, 4>({{{{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}}}}).get_vector()};
// output data shape (1,)
auto expected_output = test::NDArray<float, 4>({{{{16}}}}).get_vector();
auto expected_output = ov::test::NDArray<float, 4>({{{{16}}}}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);
@@ -1266,10 +1275,11 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reduce_mean) {
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/reduce_mean.onnx"));
// input data shape (1, 1, 4, 4)
Inputs inputs{test::NDArray<float, 4>({{{{1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}}}}).get_vector()};
Inputs inputs{
ov::test::NDArray<float, 4>({{{{1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}}}}).get_vector()};
// output data shape (1,)
auto expected_output = test::NDArray<float, 4>({{{{1}}}}).get_vector();
auto expected_output = ov::test::NDArray<float, 4>({{{{1}}}}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);
@@ -1283,10 +1293,10 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reduce_min) {
// input data shape (1, 1, 4, 4)
Inputs inputs{
test::NDArray<float, 4>({{{{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}}}}).get_vector()};
ov::test::NDArray<float, 4>({{{{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}}}}).get_vector()};
// output data shape (1,)
auto expected_output = test::NDArray<float, 4>({{{{1}}}}).get_vector();
auto expected_output = ov::test::NDArray<float, 4>({{{{1}}}}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);
@@ -1299,10 +1309,11 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reduce_prod) {
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/reduce_prod.onnx"));
// input data shape (1, 1, 4, 4)
Inputs inputs{test::NDArray<float, 4>({{{{1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}}}}).get_vector()};
Inputs inputs{
ov::test::NDArray<float, 4>({{{{1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}}}}).get_vector()};
// output data shape (1,)
auto expected_output = test::NDArray<float, 4>({{{{1}}}}).get_vector();
auto expected_output = ov::test::NDArray<float, 4>({{{{1}}}}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);
@@ -1315,10 +1326,11 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reduce_sum) {
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/reduce_sum.onnx"));
// input data shape (1, 1, 4, 4)
Inputs inputs{test::NDArray<float, 4>({{{{1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}}}}).get_vector()};
Inputs inputs{
ov::test::NDArray<float, 4>({{{{1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}}}}).get_vector()};
// output data shape (1,)
auto expected_output = test::NDArray<float, 4>({{{{16}}}}).get_vector();
auto expected_output = ov::test::NDArray<float, 4>({{{{16}}}}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);
@@ -1344,10 +1356,11 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reduce_sum_square) {
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/reduce_sum_square.onnx"));
// input data shape (1, 1, 4, 4)
Inputs inputs{test::NDArray<float, 4>({{{{1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}}}}).get_vector()};
Inputs inputs{
ov::test::NDArray<float, 4>({{{{1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}}}}).get_vector()};
// output data shape (1,)
auto expected_output = test::NDArray<float, 4>({{{{16}}}}).get_vector();
auto expected_output = ov::test::NDArray<float, 4>({{{{16}}}}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);
@@ -1360,10 +1373,10 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reduce_sum_13_axes_as_constant) {
SERIALIZED_ZOO,
"onnx/reduce_sum_13_axes_as_constant.onnx"));
Inputs inputs{test::NDArray<float, 4>({{{{1.0f, 1.0f, 1.0f, 1.0f},
{1.0f, 1.0f, 1.0f, 1.0f},
{1.0f, 1.0f, 1.0f, 1.0f},
{1.0f, 1.0f, 1.0f, 1.0f}}}})
Inputs inputs{ov::test::NDArray<float, 4>({{{{1.0f, 1.0f, 1.0f, 1.0f},
{1.0f, 1.0f, 1.0f, 1.0f},
{1.0f, 1.0f, 1.0f, 1.0f},
{1.0f, 1.0f, 1.0f, 1.0f}}}})
.get_vector()};
auto test_case = ov::test::TestCase(function, s_device);
@@ -1380,7 +1393,7 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reduce_sum_13_axes_as_constant_single_
SERIALIZED_ZOO,
"onnx/reduce_sum_13_axes_as_constant_single_axis.onnx"));
Inputs inputs{test::NDArray<float, 3>({{{1, 2, 3}, {4, 5, 6}}, {{7, 8, 9}, {10, 11, 12}}}).get_vector()};
Inputs inputs{ov::test::NDArray<float, 3>({{{1, 2, 3}, {4, 5, 6}}, {{7, 8, 9}, {10, 11, 12}}}).get_vector()};
auto test_case = ov::test::TestCase(function, s_device);
@@ -1397,10 +1410,10 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reduce_sum_13_axes_as_constant_keepdim
"onnx/reduce_sum_13_axes_as_constant_keepdims_off.onnx"));
// input data shape (1, 1, 4, 4)
Inputs inputs{test::NDArray<float, 4>({{{{1.0f, 1.0f, 1.0f, 1.0f},
{1.0f, 1.0f, 1.0f, 1.0f},
{1.0f, 1.0f, 1.0f, 1.0f},
{1.0f, 1.0f, 1.0f, 1.0f}}}})
Inputs inputs{ov::test::NDArray<float, 4>({{{{1.0f, 1.0f, 1.0f, 1.0f},
{1.0f, 1.0f, 1.0f, 1.0f},
{1.0f, 1.0f, 1.0f, 1.0f},
{1.0f, 1.0f, 1.0f, 1.0f}}}})
.get_vector()};
auto test_case = ov::test::TestCase(function, s_device);
@@ -2174,10 +2187,11 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_shape) {
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/shape.onnx"));
Inputs inputs;
inputs.emplace_back(test::NDArray<float, 3>({{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}})
.get_vector());
inputs.emplace_back(
ov::test::NDArray<float, 3>({{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}})
.get_vector());
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);
@@ -2191,13 +2205,13 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_elu) {
Inputs inputs;
inputs.emplace_back(
test::NDArray<float, 3>({{{-9, -8, -7, -6, -5}, {-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}},
{{-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}},
{{1, 1, 1, 1, 1}, {-1, -1, -1, -1, -1}, {0, 0, 0, 0, 0}, {2, 2, 2, 2, 2}}})
ov::test::NDArray<float, 3>({{{-9, -8, -7, -6, -5}, {-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}},
{{-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}},
{{1, 1, 1, 1, 1}, {-1, -1, -1, -1, -1}, {0, 0, 0, 0, 0}, {2, 2, 2, 2, 2}}})
.get_vector());
auto expected_output =
test::NDArray<float, 3>(
ov::test::NDArray<float, 3>(
{{{-1.999753180391830f, -1.999329074744190f, -1.998176236068890f, -1.995042495646670f, -1.986524106001830f},
{-1.963368722222530f, -1.900425863264270f, -1.729329433526770f, -1.264241117657120f, 0},
{1, 2, 3, 4, 5},
@@ -2224,13 +2238,13 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_leaky_relu) {
Inputs inputs;
inputs.emplace_back(
test::NDArray<float, 3>({{{-9, -8, -7, -6, -5}, {-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}},
{{-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}},
{{1, 1, 1, 1, 1}, {-1, -1, -1, -1, -1}, {0, 0, 0, 0, 0}, {2, 2, 2, 2, 2}}})
ov::test::NDArray<float, 3>({{{-9, -8, -7, -6, -5}, {-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}},
{{-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}},
{{1, 1, 1, 1, 1}, {-1, -1, -1, -1, -1}, {0, 0, 0, 0, 0}, {2, 2, 2, 2, 2}}})
.get_vector());
auto expected_output =
test::NDArray<float, 3>(
ov::test::NDArray<float, 3>(
{{{-0.9f, -0.8f, -0.7f, -0.6f, -0.5f}, {-0.4f, -0.3f, -0.2f, -0.1f, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}},
{{-0.4f, -0.3f, -0.2f, -0.1f, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}},
{{1, 1, 1, 1, 1}, {-0.1f, -0.1f, -0.1f, -0.1f, -0.1f}, {0, 0, 0, 0, 0}, {2, 2, 2, 2, 2}}})
@@ -2248,20 +2262,21 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_prelu_nd) {
Inputs inputs;
inputs.emplace_back(
test::NDArray<float, 3>({{{-9, -8, -7, -6, -5}, {-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}},
{{-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}},
{{1, 1, 1, 1, 1}, {-1, -1, -1, -1, -1}, {0, 0, 0, 0, 0}, {2, 2, 2, 2, 2}}})
ov::test::NDArray<float, 3>({{{-9, -8, -7, -6, -5}, {-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}},
{{-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}},
{{1, 1, 1, 1, 1}, {-1, -1, -1, -1, -1}, {0, 0, 0, 0, 0}, {2, 2, 2, 2, 2}}})
.get_vector());
inputs.emplace_back(test::NDArray<float, 3>({{{1, 0, 1, 0, 1}, {0, 1, 0, 1, 0}, {1, 0, 1, 0, 1}, {0, 1, 0, 1, 0}},
{{0, 1, 0, 1, 0}, {1, 0, 1, 0, 1}, {0, 1, 0, 1, 0}, {1, 0, 1, 0, 1}},
{{1, 0, 1, 0, 1}, {0, 1, 0, 1, 0}, {1, 0, 1, 0, 1}, {0, 1, 0, 1, 0}}})
.get_vector());
inputs.emplace_back(
ov::test::NDArray<float, 3>({{{1, 0, 1, 0, 1}, {0, 1, 0, 1, 0}, {1, 0, 1, 0, 1}, {0, 1, 0, 1, 0}},
{{0, 1, 0, 1, 0}, {1, 0, 1, 0, 1}, {0, 1, 0, 1, 0}, {1, 0, 1, 0, 1}},
{{1, 0, 1, 0, 1}, {0, 1, 0, 1, 0}, {1, 0, 1, 0, 1}, {0, 1, 0, 1, 0}}})
.get_vector());
auto expected_output =
test::NDArray<float, 3>({{{-9, 0, -7, 0, -5}, {0, -3, 0, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}},
{{0, -3, 0, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}},
{{1, 1, 1, 1, 1}, {0, -1, 0, -1, 0}, {0, 0, 0, 0, 0}, {2, 2, 2, 2, 2}}})
ov::test::NDArray<float, 3>({{{-9, 0, -7, 0, -5}, {0, -3, 0, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}},
{{0, -3, 0, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}},
{{1, 1, 1, 1, 1}, {0, -1, 0, -1, 0}, {0, 0, 0, 0, 0}, {2, 2, 2, 2, 2}}})
.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
@@ -2376,13 +2391,13 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_selu) {
Inputs inputs;
inputs.emplace_back(
test::NDArray<float, 3>({{{-9, -8, -7, -6, -5}, {-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}},
{{-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}},
{{1, 1, 1, 1, 1}, {-1, -1, -1, -1, -1}, {0, 0, 0, 0, 0}, {2, 2, 2, 2, 2}}})
ov::test::NDArray<float, 3>({{{-9, -8, -7, -6, -5}, {-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}},
{{-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}},
{{1, 1, 1, 1, 1}, {-1, -1, -1, -1, -1}, {0, 0, 0, 0, 0}, {2, 2, 2, 2, 2}}})
.get_vector());
auto expected_output =
test::NDArray<float, 3>(
ov::test::NDArray<float, 3>(
{{{-5.99925954117548f, -5.99798722423258f, -5.99452870820667f, -5.98512748694000f, -5.95957231800549f},
{-5.89010616666759f, -5.70127758979282f, -5.18798830058032f, -3.79272335297135f, 0},
{3, 6, 9, 12, 15},
@@ -2409,13 +2424,13 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_sigmoid) {
Inputs inputs;
inputs.emplace_back(
test::NDArray<float, 3>({{{-9, -8, -7, -6, -5}, {-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}},
{{-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}},
{{1, 1, 1, 1, 1}, {-1, -1, -1, -1, -1}, {0, 0, 0, 0, 0}, {2, 2, 2, 2, 2}}})
ov::test::NDArray<float, 3>({{{-9, -8, -7, -6, -5}, {-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}},
{{-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}},
{{1, 1, 1, 1, 1}, {-1, -1, -1, -1, -1}, {0, 0, 0, 0, 0}, {2, 2, 2, 2, 2}}})
.get_vector());
auto expected_output =
test::NDArray<float, 3>(
ov::test::NDArray<float, 3>(
{{{0.00012339457598623f,
0.00033535013046648f,
0.00091105119440065f,
@@ -2446,13 +2461,13 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_tanh) {
Inputs inputs;
inputs.emplace_back(
test::NDArray<float, 3>({{{-9, -8, -7, -6, -5}, {-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}},
{{-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}},
{{1, 1, 1, 1, 1}, {-1, -1, -1, -1, -1}, {0, 0, 0, 0, 0}, {2, 2, 2, 2, 2}}})
ov::test::NDArray<float, 3>({{{-9, -8, -7, -6, -5}, {-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}},
{{-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}},
{{1, 1, 1, 1, 1}, {-1, -1, -1, -1, -1}, {0, 0, 0, 0, 0}, {2, 2, 2, 2, 2}}})
.get_vector());
auto expected_output =
test::NDArray<float, 3>(
ov::test::NDArray<float, 3>(
{{{-0.999999969540041f, -0.999999774929676f, -0.999998336943945f, -0.999987711650796f, -0.999909204262595f},
{-0.999329299739067f, -0.995054753686731f, -0.964027580075817f, -0.761594155955765f, 0},
{0.761594155955765f, 0.964027580075817f, 0.995054753686731f, 0.999329299739067f, 0.999909204262595f},
@@ -2479,15 +2494,15 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_thresholded_relu) {
Inputs inputs;
inputs.emplace_back(
test::NDArray<float, 3>({{{-9, -8, -7, -6, -5}, {-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}},
{{-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}},
{{1, 1, 1, 1, 1}, {-1, -1, -1, -1, -1}, {0, 0, 0, 0, 0}, {2, 2, 2, 2, 2}}})
ov::test::NDArray<float, 3>({{{-9, -8, -7, -6, -5}, {-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}},
{{-4, -3, -2, -1, 0}, {1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}},
{{1, 1, 1, 1, 1}, {-1, -1, -1, -1, -1}, {0, 0, 0, 0, 0}, {2, 2, 2, 2, 2}}})
.get_vector());
auto expected_output =
test::NDArray<float, 3>({{{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 3, 4, 5}, {6, 7, 8, 9, 10}},
{{0, 0, 0, 0, 0}, {0, 0, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}},
{{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}}})
ov::test::NDArray<float, 3>({{{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 3, 4, 5}, {6, 7, 8, 9, 10}},
{{0, 0, 0, 0, 0}, {0, 0, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}},
{{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}}})
.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
@@ -2502,9 +2517,9 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_matmul_vec_ten3d) {
Inputs inputs;
inputs.emplace_back(std::vector<float>{0.f, 1.f});
inputs.emplace_back(test::NDArray<float, 3>{{{0.f}, {1.f}}, {{2.f}, {3.f}}, {{4.f}, {5.f}}}.get_vector());
inputs.emplace_back(ov::test::NDArray<float, 3>{{{0.f}, {1.f}}, {{2.f}, {3.f}}, {{4.f}, {5.f}}}.get_vector());
auto expected_output = test::NDArray<float, 2>{{1.f}, {3.f}, {5.f}}.get_vector();
auto expected_output = ov::test::NDArray<float, 2>{{1.f}, {3.f}, {5.f}}.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);
@@ -2574,15 +2589,15 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_sum_opset8) {
Inputs inputs;
inputs.emplace_back(std::vector<float>{1.0f, 2.0f, 3.0f});
inputs.emplace_back(test::NDArray<float, 2>{{10.0f}, {20.0f}, {30.0f}}.get_vector());
inputs.emplace_back(test::NDArray<float, 3>{{{100.0f}}, {{200.0f}}, {{300.0f}}}.get_vector());
inputs.emplace_back(ov::test::NDArray<float, 2>{{10.0f}, {20.0f}, {30.0f}}.get_vector());
inputs.emplace_back(ov::test::NDArray<float, 3>{{{100.0f}}, {{200.0f}}, {{300.0f}}}.get_vector());
auto expected_output =
test::NDArray<float, 3>{{{111.0f, 112.0f, 113.0f}, {121.0f, 122.0f, 123.0f}, {131.0f, 132.0f, 133.0f}},
ov::test::NDArray<float, 3>{{{111.0f, 112.0f, 113.0f}, {121.0f, 122.0f, 123.0f}, {131.0f, 132.0f, 133.0f}},
{{211.0f, 212.0f, 213.0f}, {221.0f, 222.0f, 223.0f}, {231.0f, 232.0f, 233.0f}},
{{211.0f, 212.0f, 213.0f}, {221.0f, 222.0f, 223.0f}, {231.0f, 232.0f, 233.0f}},
{{311.0f, 312.0f, 313.0f}, {321.0f, 322.0f, 323.0f}, {331.0f, 332.0f, 333.0f}}}
{{311.0f, 312.0f, 313.0f}, {321.0f, 322.0f, 323.0f}, {331.0f, 332.0f, 333.0f}}}
.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
@@ -2903,13 +2918,13 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_erf) {
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/erf.onnx"));
Inputs inputs;
inputs.emplace_back(test::NDArray<float, 2>{
inputs.emplace_back(ov::test::NDArray<float, 2>{
{-std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity()},
{-3.141592f, 0.0f},
{0.5f, 1.0f}}.get_vector());
const std::vector<float> expected_output =
test::NDArray<float, 2>{{-1.0f, 1.0f}, {-0.99999112f, 0.0f}, {0.52049988f, 0.84270079f}}.get_vector();
ov::test::NDArray<float, 2>{{-1.0f, 1.0f}, {-0.99999112f, 0.0f}, {0.52049988f, 0.84270079f}}.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);
@@ -5512,15 +5527,15 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_unsqueeze_ai_onnx_domain) {
SERIALIZED_ZOO,
"onnx/unsqueeze_ai_onnx_domain.onnx"));
auto input = test::NDArray<float, 3>({{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}})
auto input = ov::test::NDArray<float, 3>({{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}})
.get_vector();
auto expected_output =
test::NDArray<float, 4>({{{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}}})
ov::test::NDArray<float, 4>({{{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}}})
.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
@@ -5534,15 +5549,15 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_unsqueeze_default_domain) {
SERIALIZED_ZOO,
"onnx/unsqueeze_default_domain.onnx"));
auto input = test::NDArray<float, 3>({{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}})
auto input = ov::test::NDArray<float, 3>({{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}})
.get_vector();
auto expected_output =
test::NDArray<float, 4>({{{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}}})
ov::test::NDArray<float, 4>({{{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}}})
.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
@@ -5556,14 +5571,14 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_unsqueeze_default_domain_opset13) {
SERIALIZED_ZOO,
"onnx/unsqueeze_default_domain_opset13.onnx"));
auto input = test::NDArray<float, 3>({{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}})
auto input = ov::test::NDArray<float, 3>({{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}})
.get_vector();
auto expected_output =
test::NDArray<float, 4>({{{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}}})
ov::test::NDArray<float, 4>({{{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}}})
.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
@@ -5577,14 +5592,14 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_unsqueeze_ai_onnx_domain_opset13) {
SERIALIZED_ZOO,
"onnx/unsqueeze_ai_onnx_domain_opset13.onnx"));
auto input = test::NDArray<float, 3>({{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}})
auto input = ov::test::NDArray<float, 3>({{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}})
.get_vector();
auto expected_output =
test::NDArray<float, 4>({{{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}}})
ov::test::NDArray<float, 4>({{{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}}})
.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
@@ -6458,10 +6473,10 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_squeeze_default_domain_opset13) {
SERIALIZED_ZOO,
"onnx/squeeze_default_domain_opset13.onnx"));
auto input =
test::NDArray<float, 3>({{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}}).get_vector();
auto input = ov::test::NDArray<float, 3>({{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}})
.get_vector();
auto expected_output =
test::NDArray<float, 2>({{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}).get_vector();
ov::test::NDArray<float, 2>({{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_input(input);

View File

@@ -18,6 +18,7 @@
#include "common_test_utils/test_case.hpp"
#include "onnx_import/onnx.hpp"
#include "onnx_utils.hpp"
#include "ngraph/file_util.hpp"
#include "common_test_utils/test_control.hpp"
OPENVINO_SUPPRESS_DEPRECATED_START

View File

@@ -20,6 +20,7 @@
#include "common_test_utils/test_control.hpp"
#include "common_test_utils/test_tools.hpp"
#include "gtest/gtest.h"
#include "ngraph/file_util.hpp"
#include "ngraph/ngraph.hpp"
#include "onnx_import/onnx.hpp"
#include "onnx_utils.hpp"
@@ -42,21 +43,22 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_conv2d_strides_padding) {
Inputs inputs;
// data (1, 1, 7, 5) input tensor
inputs.emplace_back(test::NDArray<float, 4>{{{{{0.f, 1.f, 2.f, 3.f, 4.f},
{5.f, 6.f, 7.f, 8.f, 9.f},
{10.f, 11.f, 12.f, 13.f, 14.f},
{15.f, 16.f, 17.f, 18.f, 19.f},
{20.f, 21.f, 22.f, 23.f, 24.f},
{25.f, 26.f, 27.f, 28.f, 29.f},
{30.f, 31.f, 32.f, 33.f, 34.f}}}}}
inputs.emplace_back(ov::test::NDArray<float, 4>{{{{{0.f, 1.f, 2.f, 3.f, 4.f},
{5.f, 6.f, 7.f, 8.f, 9.f},
{10.f, 11.f, 12.f, 13.f, 14.f},
{15.f, 16.f, 17.f, 18.f, 19.f},
{20.f, 21.f, 22.f, 23.f, 24.f},
{25.f, 26.f, 27.f, 28.f, 29.f},
{30.f, 31.f, 32.f, 33.f, 34.f}}}}}
.get_vector());
// filters (1, 1, 3, 3) aka convolution weights
inputs.emplace_back(test::NDArray<float, 4>{{{{{1.f, 1.f, 1.f}, {1.f, 1.f, 1.f}, {1.f, 1.f, 1.f}}}}}.get_vector());
inputs.emplace_back(
ov::test::NDArray<float, 4>{{{{{1.f, 1.f, 1.f}, {1.f, 1.f, 1.f}, {1.f, 1.f, 1.f}}}}}.get_vector());
// (1, 1, 4, 3)
auto expected_output =
test::NDArray<float, 4>(
ov::test::NDArray<float, 4>(
{{{{12.f, 27.f, 24.f}, {63.f, 108.f, 81.f}, {123.f, 198.f, 141.f}, {112.f, 177.f, 124.f}}}})
.get_vector();
@@ -74,20 +76,21 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_conv2d_strides_no_padding) {
Inputs inputs;
// data (1, 1, 7, 5) input tensor
inputs.emplace_back(test::NDArray<float, 4>{{{{{0.f, 1.f, 2.f, 3.f, 4.f},
{5.f, 6.f, 7.f, 8.f, 9.f},
{10.f, 11.f, 12.f, 13.f, 14.f},
{15.f, 16.f, 17.f, 18.f, 19.f},
{20.f, 21.f, 22.f, 23.f, 24.f},
{25.f, 26.f, 27.f, 28.f, 29.f},
{30.f, 31.f, 32.f, 33.f, 34.f}}}}}
inputs.emplace_back(ov::test::NDArray<float, 4>{{{{{0.f, 1.f, 2.f, 3.f, 4.f},
{5.f, 6.f, 7.f, 8.f, 9.f},
{10.f, 11.f, 12.f, 13.f, 14.f},
{15.f, 16.f, 17.f, 18.f, 19.f},
{20.f, 21.f, 22.f, 23.f, 24.f},
{25.f, 26.f, 27.f, 28.f, 29.f},
{30.f, 31.f, 32.f, 33.f, 34.f}}}}}
.get_vector());
// filters (1, 1, 3, 3) aka convolution weights
inputs.emplace_back(test::NDArray<float, 4>{{{{{1.f, 1.f, 1.f}, {1.f, 1.f, 1.f}, {1.f, 1.f, 1.f}}}}}.get_vector());
inputs.emplace_back(
ov::test::NDArray<float, 4>{{{{{1.f, 1.f, 1.f}, {1.f, 1.f, 1.f}, {1.f, 1.f, 1.f}}}}}.get_vector());
// (1, 1, 3, 2)
auto expected_output = test::NDArray<float, 4>({{{{54.f, 72.f}, {144.f, 162.f}, {234.f, 252.f}}}}).get_vector();
auto expected_output = ov::test::NDArray<float, 4>({{{{54.f, 72.f}, {144.f, 162.f}, {234.f, 252.f}}}}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);
@@ -104,21 +107,22 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_conv2d_strides_assymetric_padding) {
Inputs inputs;
// data (1, 1, 7, 5) input tensor
inputs.emplace_back(test::NDArray<float, 4>{{{{{0.f, 1.f, 2.f, 3.f, 4.f},
{5.f, 6.f, 7.f, 8.f, 9.f},
{10.f, 11.f, 12.f, 13.f, 14.f},
{15.f, 16.f, 17.f, 18.f, 19.f},
{20.f, 21.f, 22.f, 23.f, 24.f},
{25.f, 26.f, 27.f, 28.f, 29.f},
{30.f, 31.f, 32.f, 33.f, 34.f}}}}}
inputs.emplace_back(ov::test::NDArray<float, 4>{{{{{0.f, 1.f, 2.f, 3.f, 4.f},
{5.f, 6.f, 7.f, 8.f, 9.f},
{10.f, 11.f, 12.f, 13.f, 14.f},
{15.f, 16.f, 17.f, 18.f, 19.f},
{20.f, 21.f, 22.f, 23.f, 24.f},
{25.f, 26.f, 27.f, 28.f, 29.f},
{30.f, 31.f, 32.f, 33.f, 34.f}}}}}
.get_vector());
// filters (1, 1, 3, 3) aka convolution weights
inputs.emplace_back(test::NDArray<float, 4>{{{{{1.f, 1.f, 1.f}, {1.f, 1.f, 1.f}, {1.f, 1.f, 1.f}}}}}.get_vector());
inputs.emplace_back(
ov::test::NDArray<float, 4>{{{{{1.f, 1.f, 1.f}, {1.f, 1.f, 1.f}, {1.f, 1.f, 1.f}}}}}.get_vector());
// (1, 1, 4, 2)
auto expected_output =
test::NDArray<float, 4>({{{{21.f, 33.f}, {99.f, 117.f}, {189.f, 207.f}, {171.f, 183.f}}}}).get_vector();
ov::test::NDArray<float, 4>({{{{21.f, 33.f}, {99.f, 117.f}, {189.f, 207.f}, {171.f, 183.f}}}}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);
@@ -142,20 +146,20 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_conv2d_dilation_assymetric_pads_stride
Inputs inputs;
// {2, 1, 1, 1}
inputs.emplace_back(
test::NDArray<float, 4>({{{{-0.09103918075561523f}}}, {{{-0.32513630390167236f}}}}).get_vector());
ov::test::NDArray<float, 4>({{{{-0.09103918075561523f}}}, {{{-0.32513630390167236f}}}}).get_vector());
// {2, 1, 3, 3}
inputs.emplace_back(
test::NDArray<float, 4>({{{{0.4312484860420227f, -0.12559029459953308f, 0.44889551401138306f},
{-0.3100617825984955f, 0.13522827625274658f, -0.06791308522224426f},
{0.22671669721603394f, -0.17391827702522278f, -0.31299442052841187f}}},
{{{-0.31545522809028625f, 0.06560015678405762f, 0.2656586766242981f},
{0.41363757848739624f, 0.31231558322906494f, -0.376018226146698f},
{-0.005708813667297363f, 0.34922850131988525f, 0.45095211267471313f}}}})
ov::test::NDArray<float, 4>({{{{0.4312484860420227f, -0.12559029459953308f, 0.44889551401138306f},
{-0.3100617825984955f, 0.13522827625274658f, -0.06791308522224426f},
{0.22671669721603394f, -0.17391827702522278f, -0.31299442052841187f}}},
{{{-0.31545522809028625f, 0.06560015678405762f, 0.2656586766242981f},
{0.41363757848739624f, 0.31231558322906494f, -0.376018226146698f},
{-0.005708813667297363f, 0.34922850131988525f, 0.45095211267471313f}}}})
.get_vector());
// {2, 2, 1, 2}
auto expected_output =
test::NDArray<float, 4>(
ov::test::NDArray<float, 4>(
{{{{-0.012311071157455444f, 0.02822777070105076f}}, {{-0.028432954102754593f, -0.037657227367162704f}}},
{{{-0.04396762326359749f, 0.10081233829259872f}}, {{-0.10154513269662857f, -0.13448859751224518f}}}})
.get_vector();
@@ -298,12 +302,12 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_average_pool_2d) {
// input data shape (1, 1, 4, 4)
Inputs inputs;
inputs.push_back(
test::NDArray<float, 4>(
ov::test::NDArray<float, 4>(
{{{{0.f, 1.f, 2.f, 3.f}, {4.f, 5.f, 6.f, 7.f}, {8.f, 9.f, 10.f, 11.f}, {12.f, 13.f, 14.f, 15.f}}}})
.get_vector());
// (1, 1, 2, 2)
auto expected_output = test::NDArray<float, 4>({{{{2.5f, 4.5f}, {10.5f, 12.5f}}}}).get_vector();
auto expected_output = ov::test::NDArray<float, 4>({{{{2.5f, 4.5f}, {10.5f, 12.5f}}}}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);
@@ -320,13 +324,13 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_average_pool_2d_pads) {
// input data shape (1, 1, 4, 4)
Inputs inputs;
inputs.push_back(
test::NDArray<float, 4>(
ov::test::NDArray<float, 4>(
{{{{0.f, 1.f, 2.f, 3.f}, {4.f, 5.f, 6.f, 7.f}, {8.f, 9.f, 10.f, 11.f}, {12.f, 13.f, 14.f, 15.f}}}})
.get_vector());
// (1, 1, 3, 3)
auto expected_output =
test::NDArray<float, 4>({{{{0.f, 1.5f, 3.f}, {6.f, 7.5f, 9.f}, {12.f, 13.5f, 15.f}}}}).get_vector();
ov::test::NDArray<float, 4>({{{{0.f, 1.5f, 3.f}, {6.f, 7.5f, 9.f}, {12.f, 13.5f, 15.f}}}}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);
@@ -370,13 +374,13 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_max_pool_2d_pads) {
// input data shape (1, 1, 4, 4)
Inputs inputs;
inputs.push_back(
test::NDArray<float, 4>(
ov::test::NDArray<float, 4>(
{{{{0.f, 1.f, 2.f, 3.f}, {4.f, 5.f, 6.f, 7.f}, {8.f, 9.f, 10.f, 11.f}, {12.f, 13.f, 14.f, 15.f}}}})
.get_vector());
// (1, 1, 3, 3)
auto expected_output =
test::NDArray<float, 4>({{{{0.f, 2.f, 3.f}, {8.f, 10.f, 11.f}, {12.f, 14.f, 15.f}}}}).get_vector();
ov::test::NDArray<float, 4>({{{{0.f, 2.f, 3.f}, {8.f, 10.f, 11.f}, {12.f, 14.f, 15.f}}}}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);

View File

@@ -20,6 +20,7 @@
#include "common_test_utils/test_control.hpp"
#include "common_test_utils/test_tools.hpp"
#include "gtest/gtest.h"
#include "ngraph/file_util.hpp"
#include "ngraph/ngraph.hpp"
#include "onnx_import/onnx.hpp"
#include "onnx_utils.hpp"
@@ -36,8 +37,8 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_affine) {
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/affine.onnx"));
// input/output shape (1, 3)
auto input = test::NDArray<float, 2>{{{0.f, 1.f, 2.f}}}.get_vector();
auto expected_output = test::NDArray<float, 2>{{{50.f, 50.5f, 51.f}}}.get_vector();
auto input = ov::test::NDArray<float, 2>{{{0.f, 1.f, 2.f}}}.get_vector();
auto expected_output = ov::test::NDArray<float, 2>{{{50.f, 50.5f, 51.f}}}.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_input(Shape{1, 3}, input);
@@ -50,14 +51,14 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_crop) {
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/crop.onnx"));
// input shape (1, 1, 4, 4)
auto input = test::NDArray<float, 4>({{{{19.f, 20.f, 21.f, 22.f},
{23.f, 24.f, 25.f, 26.f},
{27.f, 28.f, 29.f, 30.f},
{31.f, 32.f, 33.f, 34.f}}}})
auto input = ov::test::NDArray<float, 4>({{{{19.f, 20.f, 21.f, 22.f},
{23.f, 24.f, 25.f, 26.f},
{27.f, 28.f, 29.f, 30.f},
{31.f, 32.f, 33.f, 34.f}}}})
.get_vector();
// output shape (1, 1, 2, 2)
auto expected_output = test::NDArray<float, 4>{{{{24.f, 25.f}, {28.f, 29.f}}}}.get_vector();
auto expected_output = ov::test::NDArray<float, 4>{{{{24.f, 25.f}, {28.f, 29.f}}}}.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_input(Shape{1, 1, 4, 4}, input);
@@ -70,14 +71,14 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_crop_with_scale) {
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/crop_with_scale.onnx"));
// input shape (1, 1, 4, 4)
auto input = test::NDArray<float, 4>({{{{19.f, 20.f, 21.f, 22.f},
{23.f, 24.f, 25.f, 26.f},
{27.f, 28.f, 29.f, 30.f},
{31.f, 32.f, 33.f, 34.f}}}})
auto input = ov::test::NDArray<float, 4>({{{{19.f, 20.f, 21.f, 22.f},
{23.f, 24.f, 25.f, 26.f},
{27.f, 28.f, 29.f, 30.f},
{31.f, 32.f, 33.f, 34.f}}}})
.get_vector();
// output shape (1, 1, 2, 3)
auto expected_output = test::NDArray<float, 4>{{{{24.f, 25.f, 26.f}, {28.f, 29.f, 30.f}}}}.get_vector();
auto expected_output = ov::test::NDArray<float, 4>{{{{24.f, 25.f, 26.f}, {28.f, 29.f, 30.f}}}}.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_input(Shape{1, 1, 4, 4}, input);

View File

@@ -29,6 +29,7 @@
#include "ngraph/ngraph.hpp"
#include "ngraph/pass/constant_folding.hpp"
#include "ngraph/pass/manager.hpp"
#include "ngraph/file_util.hpp"
#include "onnx_import/core/null_node.hpp"
#include "onnx_import/onnx.hpp"
#include "onnx_import/onnx_utils.hpp"

View File

@@ -18,6 +18,7 @@
#include "common_test_utils/test_case.hpp"
#include "onnx_import/onnx.hpp"
#include "common_test_utils/test_control.hpp"
#include "ngraph/file_util.hpp"
#include "onnx_utils.hpp"
OPENVINO_SUPPRESS_DEPRECATED_START

View File

@@ -21,6 +21,7 @@
#include "common_test_utils/test_control.hpp"
#include "common_test_utils/test_tools.hpp"
#include "gtest/gtest.h"
#include "ngraph/file_util.hpp"
#include "ngraph/ngraph.hpp"
#include "onnx_import/onnx.hpp"
#include "onnx_utils.hpp"

View File

@@ -19,6 +19,7 @@
#include "common_test_utils/test_control.hpp"
#include "common_test_utils/test_tools.hpp"
#include "gtest/gtest.h"
#include "ngraph/file_util.hpp"
#include "ngraph/ngraph.hpp"
#include "onnx_import/onnx.hpp"
#include "onnx_utils.hpp"
@@ -39,13 +40,13 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reshape_reduced_dims) {
"onnx/reshape_reduced_dims.onnx"));
// input data shape (2, 3, 4)
auto input = test::NDArray<float, 3>({{{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}},
{{12, 13, 14, 15}, {16, 17, 18, 19}, {20, 21, 22, 23}}})
auto input = ov::test::NDArray<float, 3>({{{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}},
{{12, 13, 14, 15}, {16, 17, 18, 19}, {20, 21, 22, 23}}})
.get_vector();
// output data shape (2, 12)
auto expected_output = test::NDArray<float, 2>({{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11},
{12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}})
auto expected_output = ov::test::NDArray<float, 2>({{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11},
{12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}})
.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
@@ -60,15 +61,15 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reshape_reordered_dims) {
"onnx/reshape_reordered_dims.onnx"));
// input data shape (2, 3, 4)
auto input = test::NDArray<float, 3>({{{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}},
{{12, 13, 14, 15}, {16, 17, 18, 19}, {20, 21, 22, 23}}})
auto input = ov::test::NDArray<float, 3>({{{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}},
{{12, 13, 14, 15}, {16, 17, 18, 19}, {20, 21, 22, 23}}})
.get_vector();
// output data shape (4, 2, 3)
auto expected_output = test::NDArray<float, 3>({{{0, 1, 2}, {3, 4, 5}},
{{6, 7, 8}, {9, 10, 11}},
{{12, 13, 14}, {15, 16, 17}},
{{18, 19, 20}, {21, 22, 23}}})
auto expected_output = ov::test::NDArray<float, 3>({{{0, 1, 2}, {3, 4, 5}},
{{6, 7, 8}, {9, 10, 11}},
{{12, 13, 14}, {15, 16, 17}},
{{18, 19, 20}, {21, 22, 23}}})
.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
@@ -83,14 +84,14 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reshape_extended_dims) {
"onnx/reshape_extended_dims.onnx"));
// input data shape (2, 3, 4)
auto input = test::NDArray<float, 3>({{{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}},
{{12, 13, 14, 15}, {16, 17, 18, 19}, {20, 21, 22, 23}}})
auto input = ov::test::NDArray<float, 3>({{{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}},
{{12, 13, 14, 15}, {16, 17, 18, 19}, {20, 21, 22, 23}}})
.get_vector();
// output data shape (3, 2, 2, 2)
auto expected_output = test::NDArray<float, 4>({{{{0, 1}, {2, 3}}, {{4, 5}, {6, 7}}},
{{{8, 9}, {10, 11}}, {{12, 13}, {14, 15}}},
{{{16, 17}, {18, 19}}, {{20, 21}, {22, 23}}}})
auto expected_output = ov::test::NDArray<float, 4>({{{{0, 1}, {2, 3}}, {{4, 5}, {6, 7}}},
{{{8, 9}, {10, 11}}, {{12, 13}, {14, 15}}},
{{{16, 17}, {18, 19}}, {{20, 21}, {22, 23}}}})
.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
@@ -105,14 +106,14 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reshape_single_dim) {
"onnx/reshape_single_dim.onnx"));
// input data shape (2, 3, 4)
auto input = test::NDArray<float, 3>({{{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}},
{{12, 13, 14, 15}, {16, 17, 18, 19}, {20, 21, 22, 23}}})
auto input = ov::test::NDArray<float, 3>({{{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}},
{{12, 13, 14, 15}, {16, 17, 18, 19}, {20, 21, 22, 23}}})
.get_vector();
// output data shape (24, )
auto expected_output =
test::NDArray<float, 1>({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23})
.get_vector();
auto expected_output = ov::test::NDArray<float, 1>(
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23})
.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_input(Shape{2, 3, 4}, input);
@@ -127,29 +128,29 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reshape_negative_dim) {
"onnx/reshape_negative_dim.onnx"));
// 2x3x4
auto input = test::NDArray<float, 3>({{{0.5488135f, 0.71518934f, 0.60276335f, 0.5448832f},
{0.4236548f, 0.6458941f, 0.4375872f, 0.891773f},
{0.96366274f, 0.3834415f, 0.79172504f, 0.5288949f}},
auto input = ov::test::NDArray<float, 3>({{{0.5488135f, 0.71518934f, 0.60276335f, 0.5448832f},
{0.4236548f, 0.6458941f, 0.4375872f, 0.891773f},
{0.96366274f, 0.3834415f, 0.79172504f, 0.5288949f}},
{{0.56804454f, 0.92559665f, 0.07103606f, 0.0871293f},
{0.0202184f, 0.83261985f, 0.77815676f, 0.87001216f},
{0.9786183f, 0.7991586f, 0.46147937f, 0.7805292f}}})
{{0.56804454f, 0.92559665f, 0.07103606f, 0.0871293f},
{0.0202184f, 0.83261985f, 0.77815676f, 0.87001216f},
{0.9786183f, 0.7991586f, 0.46147937f, 0.7805292f}}})
.get_vector();
// 2x6x2
auto expected_output = test::NDArray<float, 3>({{{0.5488135f, 0.71518934f},
{0.60276335f, 0.5448832f},
{0.4236548f, 0.6458941f},
{0.4375872f, 0.891773f},
{0.96366274f, 0.3834415f},
{0.79172504f, 0.5288949f}},
auto expected_output = ov::test::NDArray<float, 3>({{{0.5488135f, 0.71518934f},
{0.60276335f, 0.5448832f},
{0.4236548f, 0.6458941f},
{0.4375872f, 0.891773f},
{0.96366274f, 0.3834415f},
{0.79172504f, 0.5288949f}},
{{0.56804454f, 0.92559665f},
{0.07103606f, 0.0871293f},
{0.0202184f, 0.83261985f},
{0.77815676f, 0.87001216f},
{0.9786183f, 0.7991586f},
{0.46147937f, 0.7805292f}}})
{{0.56804454f, 0.92559665f},
{0.07103606f, 0.0871293f},
{0.0202184f, 0.83261985f},
{0.77815676f, 0.87001216f},
{0.9786183f, 0.7991586f},
{0.46147937f, 0.7805292f}}})
.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
@@ -164,13 +165,13 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reshape_negative_with_zero_dim) {
"onnx/reshape_negative_with_zero_dims.onnx"));
// input data shape (2, 3, 4)
auto input = test::NDArray<float, 3>({{{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}},
{{12, 13, 14, 15}, {16, 17, 18, 19}, {20, 21, 22, 23}}})
auto input = ov::test::NDArray<float, 3>({{{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}},
{{12, 13, 14, 15}, {16, 17, 18, 19}, {20, 21, 22, 23}}})
.get_vector();
// output data shape (2, 6, 2)
auto expected_output = test::NDArray<float, 3>({{{0, 1}, {2, 3}, {4, 5}, {6, 7}, {8, 9}, {10, 11}},
{{12, 13}, {14, 15}, {16, 17}, {18, 19}, {20, 21}, {22, 23}}})
auto expected_output = ov::test::NDArray<float, 3>({{{0, 1}, {2, 3}, {4, 5}, {6, 7}, {8, 9}, {10, 11}},
{{12, 13}, {14, 15}, {16, 17}, {18, 19}, {20, 21}, {22, 23}}})
.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
@@ -185,13 +186,13 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_reshape_output_shape_as_input) {
"onnx/reshape_output_shape_as_input.onnx"));
// input data shape (2, 3, 4)
auto input = test::NDArray<float, 3>({{{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}},
{{12, 13, 14, 15}, {16, 17, 18, 19}, {20, 21, 22, 23}}})
auto input = ov::test::NDArray<float, 3>({{{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}},
{{12, 13, 14, 15}, {16, 17, 18, 19}, {20, 21, 22, 23}}})
.get_vector();
// output data shape (2, 6, 2)
auto expected_output = test::NDArray<float, 3>({{{0, 1}, {2, 3}, {4, 5}, {6, 7}, {8, 9}, {10, 11}},
{{12, 13}, {14, 15}, {16, 17}, {18, 19}, {20, 21}, {22, 23}}})
auto expected_output = ov::test::NDArray<float, 3>({{{0, 1}, {2, 3}, {4, 5}, {6, 7}, {8, 9}, {10, 11}},
{{12, 13}, {14, 15}, {16, 17}, {18, 19}, {20, 21}, {22, 23}}})
.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
@@ -352,12 +353,12 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_squeeze) {
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/squeeze.onnx"));
// {1, 4, 1, 1, 2}
auto input = test::NDArray<float, 5>({{{{{1.0f, 2.0f}}}, {{{3.0f, 4.0f}}}, {{{5.0f, 6.0f}}}, {{{7.0f, 8.0f}}}}})
auto input = ov::test::NDArray<float, 5>({{{{{1.0f, 2.0f}}}, {{{3.0f, 4.0f}}}, {{{5.0f, 6.0f}}}, {{{7.0f, 8.0f}}}}})
.get_vector();
// {4, 2}
auto expected_output =
test::NDArray<float, 2>({{1.0f, 2.0f}, {3.0f, 4.0f}, {5.0f, 6.0f}, {7.0f, 8.0f}}).get_vector();
ov::test::NDArray<float, 2>({{1.0f, 2.0f}, {3.0f, 4.0f}, {5.0f, 6.0f}, {7.0f, 8.0f}}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_input(Shape{1, 4, 1, 1, 2}, input);
@@ -393,15 +394,15 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_unsqueeze) {
auto function = onnx_import::import_onnx_model(
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/unsqueeze.onnx"));
auto input = test::NDArray<float, 3>({{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}})
auto input = ov::test::NDArray<float, 3>({{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}})
.get_vector();
auto expected_output =
test::NDArray<float, 4>({{{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}}})
ov::test::NDArray<float, 4>({{{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}}})
.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
@@ -415,15 +416,15 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_unsqueeze_negative_axes) {
SERIALIZED_ZOO,
"onnx/unsqueeze_negative_axes.onnx"));
auto input = test::NDArray<float, 4>({{{{-1.8427763f, -1.0467733f, 0.50550157f, 1.4897262f, 0.33057404f}},
{{1.9244908f, -0.3804572f, 0.76275414f, -0.8183123f, 0.93889356f}},
{{-0.05270234f, 0.7113202f, -0.45783648f, -1.3378475f, 0.26926285f}}}})
auto input = ov::test::NDArray<float, 4>({{{{-1.8427763f, -1.0467733f, 0.50550157f, 1.4897262f, 0.33057404f}},
{{1.9244908f, -0.3804572f, 0.76275414f, -0.8183123f, 0.93889356f}},
{{-0.05270234f, 0.7113202f, -0.45783648f, -1.3378475f, 0.26926285f}}}})
.get_vector();
auto expected_output =
test::NDArray<float, 5>({{{{{-1.8427763f, -1.0467733f, 0.50550157f, 1.4897262f, 0.33057404f}}},
{{{1.9244908f, -0.3804572f, 0.76275414f, -0.8183123f, 0.93889356f}}},
{{{-0.05270234f, 0.7113202f, -0.45783648f, -1.3378475f, 0.26926285f}}}}})
ov::test::NDArray<float, 5>({{{{{-1.8427763f, -1.0467733f, 0.50550157f, 1.4897262f, 0.33057404f}}},
{{{1.9244908f, -0.3804572f, 0.76275414f, -0.8183123f, 0.93889356f}}},
{{{-0.05270234f, 0.7113202f, -0.45783648f, -1.3378475f, 0.26926285f}}}}})
.get_vector();
auto test_case = ov::test::TestCase(function, s_device);
@@ -438,10 +439,10 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_concat) {
Inputs inputs;
inputs.emplace_back(test::NDArray<float, 1>({1, 2}).get_vector());
inputs.emplace_back(test::NDArray<float, 1>({3, 4}).get_vector());
inputs.emplace_back(ov::test::NDArray<float, 1>({1, 2}).get_vector());
inputs.emplace_back(ov::test::NDArray<float, 1>({3, 4}).get_vector());
auto expected_output = test::NDArray<float, 1>({1, 2, 3, 4}).get_vector();
auto expected_output = ov::test::NDArray<float, 1>({1, 2, 3, 4}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);
@@ -456,10 +457,10 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_concat_negative_axis) {
Inputs inputs;
inputs.emplace_back(test::NDArray<float, 2>({{1, 2}, {3, 4}}).get_vector());
inputs.emplace_back(test::NDArray<float, 2>({{5, 6}, {7, 8}}).get_vector());
inputs.emplace_back(ov::test::NDArray<float, 2>({{1, 2}, {3, 4}}).get_vector());
inputs.emplace_back(ov::test::NDArray<float, 2>({{5, 6}, {7, 8}}).get_vector());
auto expected_output = test::NDArray<float, 2>({{1, 2}, {3, 4}, {5, 6}, {7, 8}}).get_vector();
auto expected_output = ov::test::NDArray<float, 2>({{1, 2}, {3, 4}, {5, 6}, {7, 8}}).get_vector();
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_multiple_inputs(inputs);

View File

@@ -21,6 +21,7 @@
#include "common_test_utils/test_control.hpp"
#include "common_test_utils/test_tools.hpp"
#include "gtest/gtest.h"
#include "ngraph/file_util.hpp"
#include "ngraph/ngraph.hpp"
#include "onnx_import/onnx.hpp"
#include "onnx_utils.hpp"

View File

@@ -4,6 +4,8 @@
#include <vector>
#include "ngraph/file_util.hpp"
// clang-format off
#ifdef ${BACKEND_NAME}_FLOAT_TOLERANCE_BITS
#define DEFAULT_FLOAT_TOLERANCE_BITS ${BACKEND_NAME}_FLOAT_TOLERANCE_BITS

View File

@@ -16,6 +16,7 @@
#include "common_test_utils/test_case.hpp"
#include "gtest/gtest.h"
#include "ngraph/ngraph.hpp"
#include "ngraph/file_util.hpp"
#include "common_test_utils/test_control.hpp"
#include "onnx_utils.hpp"

View File

@@ -6,6 +6,7 @@
#include "common_test_utils/test_case.hpp"
#include "common_test_utils/test_control.hpp"
#include "gtest/gtest.h"
#include "ngraph/file_util.hpp"
#include "ngraph/ngraph.hpp"
#include "onnx_import/onnx.hpp"
#include "onnx_import/onnx_utils.hpp"