Skip to content

Commit

Permalink
Fixed values for GPU
Browse files Browse the repository at this point in the history
  • Loading branch information
gkrivor committed Jun 21, 2024
1 parent 1d8980d commit fd10d89
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions src/frontends/onnx/tests/onnx_import.in.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4949,7 +4949,13 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_random_uniform) {
const auto model = convert_model("random_uniform.onnx");

auto test_case = ov::test::TestCase(model, s_device);
test_case.add_expected_output<float>(Shape{2, 2}, {43.70129f, 45.26042f, 43.48503f, 46.43743f});

if (std::string("${BACKEND_NAME}") == std::string("IE_GPU")) {
test_case.add_expected_output<float>(Shape{2, 2}, {40.96875f, 43.4375f, 49.4375f, 45.46875f});
} else {
test_case.add_expected_output<float>(Shape{2, 2}, {43.70129f, 45.26042f, 43.48503f, 46.43743f});
}

test_case.run();
}

Expand All @@ -4958,15 +4964,27 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_random_uniform_like) {

auto test_case = ov::test::TestCase(model, s_device);
test_case.add_input<float>(Shape{2, 2}, {41, 42, 43, 44});
test_case.add_expected_output<float>(Shape{2, 2}, {43.70129f, 45.26042f, 43.48503f, 46.43743f});

if (std::string("${BACKEND_NAME}") == std::string("IE_GPU")) {
test_case.add_expected_output<float>(Shape{2, 2}, {40.96875f, 43.4375f, 49.4375f, 45.46875f});
} else {
test_case.add_expected_output<float>(Shape{2, 2}, {43.70129f, 45.26042f, 43.48503f, 46.43743f});
}

test_case.run();
}

OPENVINO_TEST(${BACKEND_NAME}, onnx_model_random_normal) {
const auto model = convert_model("random_normal.onnx");

auto test_case = ov::test::TestCase(model, s_device);
test_case.add_expected_output<float>(Shape{2, 2}, {30.357481f, 72.41268f, 12.999034f, 70.04985f});

if (std::string("${BACKEND_NAME}") == std::string("IE_GPU")) {
test_case.add_expected_output<float>(Shape{2, 2}, {77.351875f, 74.047821f, -5.996780f, 13.922290f});
} else {
test_case.add_expected_output<float>(Shape{2, 2}, {30.357481f, 72.41268f, 12.999034f, 70.04985f});
}

test_case.run();
}

Expand All @@ -4975,7 +4993,13 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_random_normal_like) {

auto test_case = ov::test::TestCase(model, s_device);
test_case.add_input<float>(Shape{2, 2}, {0, 0, 0, 0});
test_case.add_expected_output<float>(Shape{2, 2}, {30.357481f, 72.41268f, 12.999034f, 70.04985f});

if (std::string("${BACKEND_NAME}") == std::string("IE_GPU")) {
test_case.add_expected_output<float>(Shape{2, 2}, {77.351875f, 74.047821f, -5.996780f, 13.922290f});
} else {
test_case.add_expected_output<float>(Shape{2, 2}, {30.357481f, 72.41268f, 12.999034f, 70.04985f});
}

test_case.run();
}

Expand Down

0 comments on commit fd10d89

Please sign in to comment.