Skip to content

Commit

Permalink
[ONNX FE] [CPU] Tests were aligned with DeformableConvolution specifi…
Browse files Browse the repository at this point in the history
…cation (#10808)
  • Loading branch information
yury-intel authored Jun 16, 2023
1 parent 77584d3 commit f5dc8e7
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ graph {
dim_value: 1
}
dim {
dim_value: 1
dim_value: 8
}
dim {
dim_value: 2
dim_value: 3
}
dim {
dim_value: 2
dim_value: 3
}
}
}
Expand Down
23 changes: 17 additions & 6 deletions src/frontends/onnx/tests/onnx_import_org_openvino.in.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,12 +574,23 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_deformable_conv_2d) {
{1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f});

// deformations
test_case.add_input<float>({0.5f, -0.5f, 0.0f, 1.0f});

test_case.add_expected_output<float>(
Shape{1, 1, 3, 3},
{4.5999999f, 5.2000003f, 6.4000001f, 8.4000006f, 9.8000002f, 9.6999998f, 11.5f, 13.4000006f, 14.3999996f});

test_case.add_input<float>({0.5f, -0.5f, 0.0f, 1.0f, 0.5f, -0.5f, 0.0f, 1.0f, 1.0f, 0.5f, -0.5f, 0.0f,
1.0f, 0.5f, -0.5f, 0.0f, 1.0f, 1.0f, 0.5f, -0.5f, 0.0f, 1.0f, 0.5f, -0.5f,
0.0f, 1.0f, 1.0f, 0.5f, -0.5f, 0.0f, 1.0f, 0.5f, -0.5f, 0.0f, 1.0f, 1.0f,
0.5f, -0.5f, 0.0f, 1.0f, 0.5f, -0.5f, 0.0f, 1.0f, 1.0f, 0.5f, -0.5f, 0.0f,
1.0f, 0.5f, -0.5f, 0.0f, 1.0f, 1.0f, 0.5f, -0.5f, 0.0f, 1.0f, 0.5f, -0.5f,
0.0f, 1.0f, 1.0f, 0.5f, -0.5f, 0.0f, 1.0f, 0.5f, -0.5f, 0.0f, 1.0f, 1.0f});

test_case.add_expected_output<float>(Shape{1, 1, 3, 3},
{6.9000001f,
2.8500001f,
6.4000001f,
13.4000006f,
11.8999996f,
7.9000006f,
12.4000006f,
4.6999998f,
1.6000000f});
test_case.run();
}

Expand Down
3 changes: 0 additions & 3 deletions src/frontends/onnx/tests/runtime/ie/unit_test.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,6 @@ IE_CPU/ElemTypesTests/1.onnx_test_add_abc_set_precission
# RuntimeError: Unsupported dynamic ops: v4::Interpolate - Ticket: 50691
onnx_upsample6_dynamic

# random values returned from the plugin: ticket 51762
onnx_model_deformable_conv_2d

# Not yet implemented - refer PR#6601
IE_CPU.onnx_model_gather_float_2D_neg_indices

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,12 @@ const std::vector<std::vector<size_t>> spatParamsDilationUneven = {
{1, 1}, // off. spat. shape
{2, 2} // ker. spat. shape
};
const std::vector<std::vector<size_t>> spatParams5_onnx2d = {
{1}, // batch
{4, 4}, // in. spat. shape
{3, 3}, // off. spat. shape
{2, 2} // ker. spat. shape
};
const std::vector<std::vector<size_t>> channelParamsSingleGr = {
{1}, // gr. 2,4
{1, 2}, // def. gr. 1,2
Expand All @@ -360,7 +366,12 @@ const std::vector<std::vector<size_t>> channelParamsMulGr = {
{3, 7}, // in. ch. per gr.
{3, 7} // out. ch. per gr.
};

const std::vector<std::vector<size_t>> channelParams_onnx2d = {
{1}, // gr. 2,4
{1}, // def. gr. 1,2
{1}, // in. ch. per gr.
{1} // out. ch. per gr.
};
const std::vector<std::vector<InputShape>> dynShapeChainRef = {
{
// gr == 2, dg == 1, in_ch_per_gr == 3, out_ch_per_gr == 3
Expand Down Expand Up @@ -599,6 +610,14 @@ const auto params10 = ::testing::Combine(
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_CPU)),
::testing::ValuesIn(filterCPUInfoForDevice(false)));
const auto params11 = ::testing::Combine(
::testing::Combine(
addSpParams,
::testing::ValuesIn(static_shapes_to_test_representation(buildStaticParams(spatParams5_onnx2d, channelParams_onnx2d))),
defConvSpecificParams,
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_CPU)),
::testing::ValuesIn(filterCPUInfoForDevice()));

INSTANTIATE_TEST_SUITE_P(DefConvLayoutTest1, DefConvLayerCPUTest, params1, DefConvLayerCPUTest::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(DefConvLayoutTest2, DefConvLayerCPUTest, params2, DefConvLayerCPUTest::getTestCaseName);
Expand All @@ -610,5 +629,6 @@ INSTANTIATE_TEST_SUITE_P(DefConvLayoutTest7, DefConvLayerCPUTest, params7, DefCo
INSTANTIATE_TEST_SUITE_P(DefConvLayoutTest8, DefConvLayerCPUTest, params8, DefConvLayerCPUTest::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(DefConvLayoutTest9, DefConvLayerCPUTest, params9, DefConvLayerCPUTest::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(DefConvLayoutTest10, DefConvLayerCPUTest, params10, DefConvLayerCPUTest::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(DefConvLayoutTest11, DefConvLayerCPUTest, params11, DefConvLayerCPUTest::getTestCaseName);
} // namespace
} // namespace CPULayerTestsDefinitions

0 comments on commit f5dc8e7

Please sign in to comment.