Refactor ConvolutionBackpropDataLayerTest, ConvolutionLayerTest, DeformableConvolutionLayerTest (#19810)

* Refactor ConvolutionBackpropDataLayerTest

* Refactor ConvolutionLayerTest

* Refactor DeformableConvolutionLayerTest

* Apply comments

* Apply comments

* Fix
This commit is contained in:
Oleg Pipikin authored and GitHub committed 2023-09-21 00:50:52 +04:00
1 parent c1a8380052
commit 69e9124eb7
13 files changed
+738 -233

No files matched your search

@@ -5,15 +5,15 @@
#include <vector>
#include "common_test_utils/test_constants.hpp"
#include "single_layer_tests/convolution.hpp"
#include "single_op_tests/convolution.hpp"
using namespace LayerTestsDefinitions;
namespace {
using ov::test::ConvolutionLayerTest;
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32, InferenceEngine::Precision::FP16,
InferenceEngine::Precision::I32};
const std::vector<ov::element::Type> model_type = {
ov::element::f32, ov::element::f16,
ov::element::i32};
/* ============= 1D Convolution ============= */
const std::vector<std::vector<size_t>> kernels1D = {{3}, {5}};
@@ -27,35 +27,28 @@ const auto conv1DParams_ExplicitPadding = ::testing::Combine(
::testing::ValuesIn(kernels1D), ::testing::ValuesIn(strides1D),
::testing::ValuesIn(padBegins1D), ::testing::ValuesIn(padEnds1D),
::testing::ValuesIn(dilations1D), ::testing::ValuesIn(numOutChannels1D),
::testing::Values(ngraph::op::PadType::EXPLICIT));
::testing::Values(ov::op::PadType::EXPLICIT));
const auto conv1DParams_AutoPadValid = ::testing::Combine(
::testing::ValuesIn(kernels1D), ::testing::ValuesIn(strides1D),
::testing::Values(std::vector<ptrdiff_t>({0})),
::testing::Values(std::vector<ptrdiff_t>({0})),
::testing::ValuesIn(dilations1D), ::testing::ValuesIn(numOutChannels1D),
::testing::Values(ngraph::op::PadType::VALID));
::testing::Values(ov::op::PadType::VALID));
INSTANTIATE_TEST_SUITE_P(
smoke_Convolution1D_ExplicitPadding, ConvolutionLayerTest,
::testing::Combine(
conv1DParams_ExplicitPadding, ::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(std::vector<size_t>({1, 3, 30})),
conv1DParams_ExplicitPadding,
::testing::ValuesIn(model_type),
::testing::Values(ov::test::static_shapes_to_test_representation({{1, 3, 30}})),
::testing::Values(ov::test::utils::DEVICE_CPU)),
ConvolutionLayerTest::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(
smoke_Convolution1D_AutoPadValid, ConvolutionLayerTest,
::testing::Combine(
conv1DParams_AutoPadValid, ::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(std::vector<size_t>({1, 3, 30})),
conv1DParams_AutoPadValid, ::testing::ValuesIn(model_type),
::testing::Values(ov::test::static_shapes_to_test_representation({{1, 3, 30}})),
::testing::Values(ov::test::utils::DEVICE_CPU)),
ConvolutionLayerTest::getTestCaseName);
@@ -82,24 +75,16 @@ const auto conv2DParams_AutoPadValid = ::testing::Combine(
INSTANTIATE_TEST_SUITE_P(
smoke_Convolution2D_ExplicitPadding, ConvolutionLayerTest,
::testing::Combine(
conv2DParams_ExplicitPadding, ::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(std::vector<size_t>({1, 3, 30, 30})),
conv2DParams_ExplicitPadding, ::testing::ValuesIn(model_type),
::testing::Values(ov::test::static_shapes_to_test_representation({{1, 3, 30, 30}})),
::testing::Values(ov::test::utils::DEVICE_CPU)),
ConvolutionLayerTest::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(
smoke_Convolution2D_AutoPadValid, ConvolutionLayerTest,
::testing::Combine(
conv2DParams_AutoPadValid, ::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(std::vector<size_t>({1, 3, 30, 30})),
conv2DParams_AutoPadValid, ::testing::ValuesIn(model_type),
::testing::Values(ov::test::static_shapes_to_test_representation({{1, 3, 30, 30}})),
::testing::Values(ov::test::utils::DEVICE_CPU)),
ConvolutionLayerTest::getTestCaseName);
@@ -122,12 +107,8 @@ const auto conv2DParams_WeightLayout = ::testing::Combine(::testing::Values(kern
INSTANTIATE_TEST_SUITE_P(smoke_Convolution2D_SpecificWeightLayout, ConvolutionLayerTest,
::testing::Combine(conv2DParams_WeightLayout,
::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(std::vector<size_t>({1, 1, 50, 75})),
::testing::ValuesIn(model_type),
::testing::Values(ov::test::static_shapes_to_test_representation({{1, 1, 50, 75}})),
::testing::Values(ov::test::utils::DEVICE_CPU)),
ConvolutionLayerTest::getTestCaseName);
} // namespace specificWeightLayout
@@ -154,24 +135,16 @@ const auto conv3DParams_AutoPadValid = ::testing::Combine(
INSTANTIATE_TEST_SUITE_P(
smoke_Convolution3D_ExplicitPadding, ConvolutionLayerTest,
::testing::Combine(
conv3DParams_ExplicitPadding, ::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(std::vector<size_t>({1, 3, 10, 10, 10})),
conv3DParams_ExplicitPadding, ::testing::ValuesIn(model_type),
::testing::Values(ov::test::static_shapes_to_test_representation({{1, 3, 10, 10, 10}})),
::testing::Values(ov::test::utils::DEVICE_CPU)),
ConvolutionLayerTest::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(
smoke_Convolution3D_AutoPadValid, ConvolutionLayerTest,
::testing::Combine(
conv3DParams_AutoPadValid, ::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(std::vector<size_t>({1, 3, 10, 10, 10})),
conv3DParams_AutoPadValid, ::testing::ValuesIn(model_type),
::testing::Values(ov::test::static_shapes_to_test_representation({{1, 3, 10, 10, 10}})),
::testing::Values(ov::test::utils::DEVICE_CPU)),
ConvolutionLayerTest::getTestCaseName);
@@ -4,31 +4,30 @@
#include <vector>
#include "single_layer_tests/convolution_backprop_data.hpp"
#include "single_op_tests/convolution_backprop_data.hpp"
#include "common_test_utils/test_constants.hpp"
using namespace LayerTestsDefinitions;
namespace {
using ov::test::ConvolutionBackpropDataLayerTest;
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16
const std::vector<ov::element::Type> model_type = {
ov::element::f32,
ov::element::f16
};
const std::vector<size_t> numOutChannels = {1, 5, 16};
const std::vector<std::vector<size_t >> emptyOutputShape = {{}};
const std::vector<std::vector<ptrdiff_t >> emptyOutputPadding = {{}};
const std::vector<ov::Shape> emptyOutputShape = {{}};
const std::vector<std::vector<ptrdiff_t>> emptyOutputPadding = {{}};
/* ============= 2D ConvolutionBackpropData ============= */
const std::vector<std::vector<size_t >> inputShapes2D = {{1, 3, 30, 30},
{1, 16, 10, 10},
{1, 32, 10, 10}};
const std::vector<std::vector<size_t >> kernels2D = {{1, 1}, {3, 3}, {3, 5}};
const std::vector<std::vector<size_t >> strides2D = {{1, 1}, {1, 3}};
const std::vector<std::vector<ov::Shape>> inputShapes2D_static = {{{1, 3, 30, 30}},
{{1, 16, 10, 10}},
{{1, 32, 10, 10}}};
const std::vector<std::vector<size_t>> kernels2D = {/*{1, 1},*/ {3, 3}, {3, 5}};
const std::vector<std::vector<size_t>> strides2D = {{1, 1}, {1, 3}};
const std::vector<std::vector<ptrdiff_t>> padBegins2D = {{0, 0}};
const std::vector<std::vector<ptrdiff_t>> padEnds2D = {{0, 0}, {1, 1}};
const std::vector<std::vector<size_t >> dilations2D = {{1, 1}, {2, 2}};
const std::vector<std::vector<size_t>> dilations2D = {{1, 1}, {2, 2}};
const auto conv2DParams_ExplicitPadding = ::testing::Combine(
::testing::ValuesIn(kernels2D),
@@ -37,7 +36,7 @@ const auto conv2DParams_ExplicitPadding = ::testing::Combine(
::testing::ValuesIn(padEnds2D),
::testing::ValuesIn(dilations2D),
::testing::ValuesIn(numOutChannels),
::testing::Values(ngraph::op::PadType::EXPLICIT),
::testing::Values(ov::op::PadType::EXPLICIT),
::testing::ValuesIn(emptyOutputPadding)
);
const auto conv2DParams_AutoPadValid = ::testing::Combine(
@@ -47,19 +46,15 @@ const auto conv2DParams_AutoPadValid = ::testing::Combine(
::testing::Values(std::vector<ptrdiff_t>({0, 0})),
::testing::ValuesIn(dilations2D),
::testing::ValuesIn(numOutChannels),
::testing::Values(ngraph::op::PadType::VALID),
::testing::Values(ov::op::PadType::VALID),
::testing::ValuesIn(emptyOutputPadding)
);
INSTANTIATE_TEST_SUITE_P(smoke_ConvolutionBackpropData2D_ExplicitPadding, ConvolutionBackpropDataLayerTest,
::testing::Combine(
conv2DParams_ExplicitPadding,
::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::ValuesIn(inputShapes2D),
::testing::ValuesIn(model_type),
::testing::ValuesIn(ov::test::static_shapes_to_test_representation(inputShapes2D_static)),
::testing::ValuesIn(emptyOutputShape),
::testing::Values(ov::test::utils::DEVICE_CPU)),
ConvolutionBackpropDataLayerTest::getTestCaseName);
@@ -67,28 +62,20 @@ INSTANTIATE_TEST_SUITE_P(smoke_ConvolutionBackpropData2D_ExplicitPadding, Convol
INSTANTIATE_TEST_SUITE_P(smoke_ConvolutionBackpropData2D_AutoPadValid, ConvolutionBackpropDataLayerTest,
::testing::Combine(
conv2DParams_AutoPadValid,
::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::ValuesIn(inputShapes2D),
::testing::ValuesIn(model_type),
::testing::ValuesIn(ov::test::static_shapes_to_test_representation(inputShapes2D_static)),
::testing::ValuesIn(emptyOutputShape),
::testing::Values(ov::test::utils::DEVICE_CPU)),
ConvolutionBackpropDataLayerTest::getTestCaseName);
const std::vector<std::vector<size_t >> inputShape2D = {{1, 3, 9, 12}};
const std::vector<std::vector<size_t >> outputShapes2D = {{6, 6}, {4, 9}};
const std::vector<ov::Shape> inputShape2D_static = {{1, 3, 9, 12}};
const std::vector<ov::Shape> outputShapes2D = {{6, 6}, {4, 9}};
INSTANTIATE_TEST_SUITE_P(smoke_ConvolutionBackpropData2D_OutputShapeDefined, ConvolutionBackpropDataLayerTest,
::testing::Combine(
conv2DParams_AutoPadValid,
::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::ValuesIn(inputShape2D),
::testing::ValuesIn(model_type),
::testing::Values(ov::test::static_shapes_to_test_representation(inputShape2D_static)),
::testing::ValuesIn(outputShapes2D),
::testing::Values(ov::test::utils::DEVICE_CPU)),
ConvolutionBackpropDataLayerTest::getTestCaseName);
@@ -103,7 +90,7 @@ const auto conv2DParams_ExplicitPadding_output_padding = ::testing::Combine(
::testing::ValuesIn(padEnds2D),
::testing::ValuesIn(dilations2D),
::testing::ValuesIn(numOutChannels),
::testing::Values(ngraph::op::PadType::EXPLICIT),
::testing::Values(ov::op::PadType::EXPLICIT),
::testing::ValuesIn(outputPadding2D)
);
const auto conv2DParams_AutoPadValid_output_padding = ::testing::Combine(
@@ -113,19 +100,15 @@ const auto conv2DParams_AutoPadValid_output_padding = ::testing::Combine(
::testing::Values(std::vector<ptrdiff_t>({0, 0})),
::testing::ValuesIn(dilations2D),
::testing::ValuesIn(numOutChannels),
::testing::Values(ngraph::op::PadType::VALID),
::testing::Values(ov::op::PadType::VALID),
::testing::ValuesIn(outputPadding2D)
);
INSTANTIATE_TEST_SUITE_P(smoke_ConvolutionBackpropData2D_ExplicitPadding_OutputPaddingDefined, ConvolutionBackpropDataLayerTest,
::testing::Combine(
conv2DParams_AutoPadValid_output_padding,
::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::ValuesIn(inputShapes2D),
::testing::ValuesIn(model_type),
::testing::ValuesIn(ov::test::static_shapes_to_test_representation(inputShapes2D_static)),
::testing::ValuesIn(emptyOutputShape),
::testing::Values(ov::test::utils::DEVICE_CPU)),
ConvolutionBackpropDataLayerTest::getTestCaseName);
@@ -133,12 +116,8 @@ INSTANTIATE_TEST_SUITE_P(smoke_ConvolutionBackpropData2D_ExplicitPadding_OutputP
INSTANTIATE_TEST_SUITE_P(smoke_ConvolutionBackpropData2D_AutoPadding_OutputPaddingDefined, ConvolutionBackpropDataLayerTest,
::testing::Combine(
conv2DParams_ExplicitPadding_output_padding,
::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::ValuesIn(inputShapes2D),
::testing::ValuesIn(model_type),
::testing::ValuesIn(ov::test::static_shapes_to_test_representation(inputShapes2D_static)),
::testing::ValuesIn(emptyOutputShape),
::testing::Values(ov::test::utils::DEVICE_CPU)),
ConvolutionBackpropDataLayerTest::getTestCaseName);
@@ -152,23 +131,19 @@ INSTANTIATE_TEST_CASE_P(smoke_ConvolutionBackpropData2D_RoundingOfPadding, Convo
::testing::Values(std::vector<ptrdiff_t>({15, 0})),
::testing::Values(std::vector<size_t>({1, 1})),
::testing::Values(size_t(4)),
::testing::Values(ngraph::op::PadType::SAME_LOWER),
::testing::Values(ov::op::PadType::SAME_LOWER),
::testing::Values(std::vector<ptrdiff_t>({0, 0}))),
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(std::vector<size_t>({ 1, 512, 2, 1 })),
::testing::Values(std::vector<size_t>({ 16, 1 })),
::testing::Values(ov::element::f32),
::testing::Values(ov::test::static_shapes_to_test_representation({{1, 512, 2, 1}})),
::testing::Values(ov::Shape({ 16, 1 })),
::testing::Values(ov::test::utils::DEVICE_CPU)),
ConvolutionBackpropDataLayerTest::getTestCaseName);
/* ============= 3D ConvolutionBackpropData ============= */
const std::vector<std::vector<size_t >> inputShapes3D = {{1, 3, 10, 10, 10},
{1, 16, 5, 5, 5},
{1, 32, 5, 5, 5}};
const std::vector<std::vector<size_t >> kernels3D = {{1, 1, 1}, {3, 3, 3}};
const std::vector<std::vector<ov::Shape>> inputShapes3D_static = {{{1, 3, 10, 10, 10}},
{{1, 16, 5, 5, 5}},
{{1, 32, 5, 5, 5}}};
const std::vector<std::vector<size_t >> kernels3D = {/*{1, 1, 1},*/ {3, 3, 3}};
const std::vector<std::vector<size_t >> strides3D = {{1, 1, 1}};
const std::vector<std::vector<ptrdiff_t>> padBegins3D = {{0, 0, 0}};
const std::vector<std::vector<ptrdiff_t>> padEnds3D = {{0, 0, 0}, {1, 1, 1}};
@@ -181,7 +156,7 @@ const auto conv3DParams_ExplicitPadding = ::testing::Combine(
::testing::ValuesIn(padEnds3D),
::testing::ValuesIn(dilations3D),
::testing::ValuesIn(numOutChannels),
::testing::Values(ngraph::op::PadType::EXPLICIT),
::testing::Values(ov::op::PadType::EXPLICIT),
::testing::ValuesIn(emptyOutputPadding)
);
const auto conv3DParams_AutoPadValid = ::testing::Combine(
@@ -191,19 +166,15 @@ const auto conv3DParams_AutoPadValid = ::testing::Combine(
::testing::Values(std::vector<ptrdiff_t>({0, 0, 0})),
::testing::ValuesIn(dilations3D),
::testing::ValuesIn(numOutChannels),
::testing::Values(ngraph::op::PadType::VALID),
::testing::Values(ov::op::PadType::VALID),
::testing::ValuesIn(emptyOutputPadding)
);
INSTANTIATE_TEST_SUITE_P(smoke_ConvolutionBackpropData3D_ExplicitPadding, ConvolutionBackpropDataLayerTest,
::testing::Combine(
conv3DParams_ExplicitPadding,
::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::ValuesIn(inputShapes3D),
::testing::ValuesIn(model_type),
::testing::ValuesIn(ov::test::static_shapes_to_test_representation(inputShapes3D_static)),
::testing::ValuesIn(emptyOutputShape),
::testing::Values(ov::test::utils::DEVICE_CPU)),
ConvolutionBackpropDataLayerTest::getTestCaseName);
@@ -211,28 +182,20 @@ INSTANTIATE_TEST_SUITE_P(smoke_ConvolutionBackpropData3D_ExplicitPadding, Convol
INSTANTIATE_TEST_SUITE_P(smoke_ConvolutionBackpropData3D_AutoPadValid, ConvolutionBackpropDataLayerTest,
::testing::Combine(
conv3DParams_AutoPadValid,
::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::ValuesIn(inputShapes3D),
::testing::ValuesIn(model_type),
::testing::ValuesIn(ov::test::static_shapes_to_test_representation(inputShapes3D_static)),
::testing::ValuesIn(emptyOutputShape),
::testing::Values(ov::test::utils::DEVICE_CPU)),
ConvolutionBackpropDataLayerTest::getTestCaseName);
const std::vector<std::vector<size_t >> inputShape3D = {{1, 3, 10, 10, 10}};
const std::vector<std::vector<size_t >> outputShapes3D = {{8, 8, 8}, {10, 10, 10}};
const std::vector<ov::Shape> inputShape3D_static = {{1, 3, 10, 10, 10}};
const std::vector<ov::Shape> outputShapes3D = {{8, 8, 8}, {10, 10, 10}};
INSTANTIATE_TEST_SUITE_P(smoke_ConvolutionBackpropData3D_OutputShapeDefined, ConvolutionBackpropDataLayerTest,
::testing::Combine(
conv3DParams_AutoPadValid,
::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::ValuesIn(inputShape3D),
::testing::ValuesIn(model_type),
::testing::Values(ov::test::static_shapes_to_test_representation(inputShape3D_static)),
::testing::ValuesIn(outputShapes3D),
::testing::Values(ov::test::utils::DEVICE_CPU)),
ConvolutionBackpropDataLayerTest::getTestCaseName);
@@ -247,7 +210,7 @@ const auto conv3DParams_ExplicitPadding_output_padding = ::testing::Combine(
::testing::ValuesIn(padEnds3D),
::testing::ValuesIn(dilations3D),
::testing::ValuesIn(numOutChannels),
::testing::Values(ngraph::op::PadType::EXPLICIT),
::testing::Values(ov::op::PadType::EXPLICIT),
::testing::ValuesIn(outputPadding3D)
);
const auto conv3DParams_AutoPadValid_output_padding = ::testing::Combine(
@@ -257,34 +220,26 @@ const auto conv3DParams_AutoPadValid_output_padding = ::testing::Combine(
::testing::Values(std::vector<ptrdiff_t>({0, 0, 0})),
::testing::ValuesIn(dilations3D),
::testing::ValuesIn(numOutChannels),
::testing::Values(ngraph::op::PadType::VALID),
::testing::Values(ov::op::PadType::VALID),
::testing::ValuesIn(outputPadding3D)
);
INSTANTIATE_TEST_SUITE_P(smoke_ConvolutionBackpropData3D_ExplicitPadding_OutputPaddingDefined, ConvolutionBackpropDataLayerTest,
::testing::Combine(
conv3DParams_AutoPadValid_output_padding,
::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::ValuesIn(inputShapes3D),
::testing::ValuesIn(emptyOutputShape),
::testing::Values(ov::test::utils::DEVICE_CPU)),
ConvolutionBackpropDataLayerTest::getTestCaseName);
// INSTANTIATE_TEST_SUITE_P(smoke_ConvolutionBackpropData3D_ExplicitPadding_OutputPaddingDefined, ConvolutionBackpropDataLayerTest,
// ::testing::Combine(
// conv3DParams_AutoPadValid_output_padding,
// ::testing::ValuesIn(model_type),
// ::testing::ValuesIn(ov::test::static_shapes_to_test_representation(inputShapes3D_static)),
// ::testing::ValuesIn(emptyOutputShape),
// ::testing::Values(ov::test::utils::DEVICE_CPU)),
// ConvolutionBackpropDataLayerTest::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(smoke_ConvolutionBackpropData3D_AutoPadding_OutputPaddingDefined, ConvolutionBackpropDataLayerTest,
::testing::Combine(
conv3DParams_ExplicitPadding_output_padding,
::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::ValuesIn(inputShapes3D),
::testing::ValuesIn(emptyOutputShape),
::testing::Values(ov::test::utils::DEVICE_CPU)),
ConvolutionBackpropDataLayerTest::getTestCaseName);
// INSTANTIATE_TEST_SUITE_P(smoke_ConvolutionBackpropData3D_AutoPadding_OutputPaddingDefined, ConvolutionBackpropDataLayerTest,
// ::testing::Combine(
// conv3DParams_ExplicitPadding_output_padding,
// ::testing::ValuesIn(model_type),
// ::testing::ValuesIn(ov::test::static_shapes_to_test_representation(inputShapes3D_static)),
// ::testing::ValuesIn(emptyOutputShape),
// ::testing::Values(ov::test::utils::DEVICE_CPU)),
// ConvolutionBackpropDataLayerTest::getTestCaseName);
} // namespace
@@ -1,15 +1,15 @@
// Copyright (C) 2018-2023 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <vector>
#include "common_test_utils/test_constants.hpp"
#include "single_layer_tests/deformable_convolution.hpp"
using namespace LayerTestsDefinitions;
namespace {
#include "single_op_tests/deformable_convolution.hpp"
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32, InferenceEngine::Precision::FP16,
InferenceEngine::Precision::I32, InferenceEngine::Precision::I16};
namespace {
using ov::test::DeformableConvolutionLayerTest;
const std::vector<ov::element::Type> netPrecisions = {
ov::element::f32, ov::element::f16,
ov::element::i32, ov::element::i16};
/* ============= 2D DeformableConvolution ============= */
const std::vector<std::vector<size_t>> deformable_vals = {{1, 16, 2, 2}};
@@ -25,74 +25,117 @@ const std::vector<size_t> multiple_defor_groups = {4};
const std::vector<std::vector<size_t>> deform_vals = {{1, 72, 64, 64}};
const std::vector<std::vector<size_t>> kernel = {{16, 16, 3, 3}};
const std::vector<ov::Shape> shapes_no_modulation {
{1, 2, 3, 3},
{1, 16, 2, 2}, //deformable_vals
{2, 2, 2, 2}, //kernels
};
const std::vector<ov::Shape> shapes_with_modulation {
{1, 2, 3, 3},
{1, 16, 2, 2}, //deformable_vals
{2, 2, 2, 2}, //kernels
{1, 8, 2, 2}, //modulation_shape
};
const std::vector<bool> with_bilinear_interpolation_pad = { false, true };
const std::vector<bool> with_modulated_scalar = { false, true };
const auto deformableConv2DParams_ExplicitPadding = ::testing::Combine(
::testing::ValuesIn(deformable_vals),
::testing::ValuesIn(kernels), ::testing::ValuesIn(strides),
::testing::ValuesIn(strides),
::testing::ValuesIn(padBegins), ::testing::ValuesIn(padEnds),
::testing::ValuesIn(dilations), ::testing::ValuesIn(groups),
::testing::ValuesIn(defor_groups), ::testing::ValuesIn(numOutChannels),
::testing::Values(ngraph::op::PadType::EXPLICIT), ::testing::ValuesIn(with_bilinear_interpolation_pad),
::testing::ValuesIn(with_modulated_scalar));
::testing::Values(ov::op::PadType::EXPLICIT), ::testing::ValuesIn(with_bilinear_interpolation_pad));
const auto deformableConv2DParams_AutoPadValid = ::testing::Combine(
::testing::ValuesIn(deformable_vals),
::testing::ValuesIn(kernels), ::testing::ValuesIn(strides),
::testing::ValuesIn(strides),
::testing::Values(std::vector<ptrdiff_t>({0, 0})),
::testing::Values(std::vector<ptrdiff_t>({0, 0})),
::testing::ValuesIn(dilations), ::testing::ValuesIn(groups),
::testing::ValuesIn(defor_groups), ::testing::ValuesIn(numOutChannels),
::testing::Values(ngraph::op::PadType::VALID),
::testing::ValuesIn(with_bilinear_interpolation_pad),
::testing::ValuesIn(with_modulated_scalar));
::testing::Values(ov::op::PadType::VALID),
::testing::ValuesIn(with_bilinear_interpolation_pad));
const auto deformableConv2DParams_DeformableGroups_AutoPadExplicit = ::testing::Combine(
::testing::ValuesIn(deform_vals),
::testing::ValuesIn(kernel), ::testing::ValuesIn(strides),
::testing::ValuesIn(strides),
::testing::Values(std::vector<ptrdiff_t>({0, 0})),
::testing::Values(std::vector<ptrdiff_t>({0, 0})),
::testing::ValuesIn(dilations), ::testing::ValuesIn(groups),
::testing::ValuesIn(multiple_defor_groups), ::testing::ValuesIn(numOutChannels),
::testing::Values(ngraph::op::PadType::EXPLICIT),
::testing::ValuesIn(with_bilinear_interpolation_pad),
::testing::ValuesIn(with_modulated_scalar));
::testing::Values(ov::op::PadType::EXPLICIT),
::testing::ValuesIn(with_bilinear_interpolation_pad));
INSTANTIATE_TEST_SUITE_P(
smoke_DeformableConvolution2D_ExplicitPadding, DeformableConvolutionLayerTest,
smoke_DeformableConvolution2D_ExplicitPadding_NoModulation, DeformableConvolutionLayerTest,
::testing::Combine(
deformableConv2DParams_ExplicitPadding, ::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(std::vector<size_t>({1, 2, 3, 3})),
deformableConv2DParams_ExplicitPadding,
::testing::Values(false),
::testing::ValuesIn(netPrecisions),
::testing::Values(ov::test::static_shapes_to_test_representation(shapes_no_modulation)),
::testing::Values(ov::test::utils::DEVICE_CPU)),
DeformableConvolutionLayerTest::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(
smoke_DeformableConvolution2D_AutoPadValid, DeformableConvolutionLayerTest,
smoke_DeformableConvolution2D_ExplicitPadding_WithModulation, DeformableConvolutionLayerTest,
::testing::Combine(
deformableConv2DParams_AutoPadValid, ::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(std::vector<size_t>({1, 2, 3, 3})),
deformableConv2DParams_ExplicitPadding,
::testing::Values(true),
::testing::ValuesIn(netPrecisions),
::testing::Values(ov::test::static_shapes_to_test_representation(shapes_with_modulation)),
::testing::Values(ov::test::utils::DEVICE_CPU)),
DeformableConvolutionLayerTest::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(
smoke_DeformableConvolution2D_DeformableGroups_ExplicitPadding, DeformableConvolutionLayerTest,
smoke_DeformableConvolution2D_AutoPadValid_NoModulation, DeformableConvolutionLayerTest,
::testing::Combine(
deformableConv2DParams_AutoPadValid,
::testing::Values(false),
::testing::ValuesIn(netPrecisions),
::testing::Values(ov::test::static_shapes_to_test_representation(shapes_no_modulation)),
::testing::Values(ov::test::utils::DEVICE_CPU)),
DeformableConvolutionLayerTest::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(
smoke_DeformableConvolution2D_AutoPadValid_WithModulation, DeformableConvolutionLayerTest,
::testing::Combine(
deformableConv2DParams_AutoPadValid,
::testing::Values(true),
::testing::ValuesIn(netPrecisions),
::testing::Values(ov::test::static_shapes_to_test_representation(shapes_with_modulation)),
::testing::Values(ov::test::utils::DEVICE_CPU)),
DeformableConvolutionLayerTest::getTestCaseName);
const std::vector<ov::Shape> shapes_2d_deformable_groups_no_modulation {
{1, 16, 66, 66},
{1, 72, 64, 64}, //deformable_vals
{16, 16, 3, 3}, //kernels
};
const std::vector<ov::Shape> shapes_2d_deformable_groups_with_modulation {
{1, 16, 66, 66},
{1, 72, 64, 64}, //deformable_vals
{16, 16, 3, 3}, //kernels
{1, 36, 64, 64}, //modulation_shape
};
INSTANTIATE_TEST_SUITE_P(
smoke_DeformableConvolution2D_DeformableGroups_ExplicitPadding_NoModulation, DeformableConvolutionLayerTest,
::testing::Combine(
deformableConv2DParams_DeformableGroups_AutoPadExplicit,
::testing::Values(false),
::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(std::vector<size_t>({1, 16, 66, 66})),
::testing::Values(ov::test::static_shapes_to_test_representation(shapes_2d_deformable_groups_no_modulation)),
::testing::Values(ov::test::utils::DEVICE_CPU)),
DeformableConvolutionLayerTest::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(
smoke_DeformableConvolution2D_DeformableGroups_ExplicitPadding_WithModulation, DeformableConvolutionLayerTest,
::testing::Combine(
deformableConv2DParams_DeformableGroups_AutoPadExplicit,
::testing::Values(true),
::testing::ValuesIn(netPrecisions),
::testing::Values(ov::test::static_shapes_to_test_representation(shapes_2d_deformable_groups_with_modulation)),
::testing::Values(ov::test::utils::DEVICE_CPU)),
DeformableConvolutionLayerTest::getTestCaseName);
@@ -101,9 +144,21 @@ const std::vector<std::vector<size_t>> single_deform_vals = {{1, 54, 28, 28}};
const std::vector<std::vector<size_t>> single_kernel = {{1, 3, 3, 3}};
const std::vector<size_t> single_deform_groups = {3};
const std::vector<ov::Shape> shapes_single_no_modulation {
{1, 3, 30, 30},
{1, 54, 28, 28}, //deformable_vals
{1, 3, 3, 3}, //kernels
};
const std::vector<ov::Shape> shapes_single_with_modulation {
{1, 3, 30, 30},
{1, 54, 28, 28}, //deformable_vals
{1, 3, 3, 3}, //kernels
{1, 27, 28, 28}, //modulation_shape
};
const auto deformableConv2DParams_SingleTestCase = ::testing::Combine(
::testing::ValuesIn(single_deform_vals),
::testing::ValuesIn(single_kernel),
::testing::ValuesIn(strides),
::testing::ValuesIn(padBegins),
::testing::ValuesIn(padEnds),
@@ -112,29 +167,47 @@ const auto deformableConv2DParams_SingleTestCase = ::testing::Combine(
::testing::ValuesIn(single_deform_groups),
::testing::ValuesIn(numOutChannels),
::testing::Values(ngraph::op::PadType::EXPLICIT),
::testing::ValuesIn(with_bilinear_interpolation_pad),
::testing::ValuesIn(with_modulated_scalar)
);
::testing::ValuesIn(with_bilinear_interpolation_pad));
INSTANTIATE_TEST_SUITE_P(
smoke_DeformableConvolution2D_SingleTestCase, DeformableConvolutionLayerTest,
smoke_DeformableConvolution2D_SingleTestCase_NoModulation, DeformableConvolutionLayerTest,
::testing::Combine(
deformableConv2DParams_SingleTestCase,
::testing::Values(false),
::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(std::vector<size_t>({1, 3, 30, 30})),
::testing::Values(ov::test::static_shapes_to_test_representation(shapes_single_no_modulation)),
::testing::Values(ov::test::utils::DEVICE_CPU)),
DeformableConvolutionLayerTest::getTestCaseName);
/* ============= Multiple groups case ============= */
INSTANTIATE_TEST_SUITE_P(
smoke_DeformableConvolution2D_MultipleGroups, DeformableConvolutionLayerTest,
smoke_DeformableConvolution2D_SingleTestCase_WithModulation, DeformableConvolutionLayerTest,
::testing::Combine(
deformableConv2DParams_SingleTestCase,
::testing::Values(true),
::testing::ValuesIn(netPrecisions),
::testing::Values(ov::test::static_shapes_to_test_representation(shapes_single_with_modulation)),
::testing::Values(ov::test::utils::DEVICE_CPU)),
DeformableConvolutionLayerTest::getTestCaseName);
/* ============= Multiple groups case ============= */
const std::vector<ov::Shape> shapes_multiple_groups_no_modulation {
{1, 4, 3, 3},
{1, 16, 2, 2}, //deformable_vals
{2, 2, 2, 2}, //kernels
};
const std::vector<ov::Shape> shapes_multiple_groups_with_modulation {
{1, 4, 3, 3},
{1, 16, 2, 2}, //deformable_vals
{2, 2, 2, 2}, //kernels
{1, 8, 2, 2}, //modulation_shape
};
INSTANTIATE_TEST_SUITE_P(
smoke_DeformableConvolution2D_MultipleGroups_NoModulation, DeformableConvolutionLayerTest,
::testing::Combine(
::testing::Combine(
::testing::ValuesIn(std::vector<std::vector<size_t>> {{1, 16, 2, 2}}), // offsets
::testing::ValuesIn(std::vector<std::vector<size_t>> {{2, 2, 2, 2}}), // ker.
::testing::ValuesIn(strides),
::testing::Values(std::vector<ptrdiff_t>({0, 0})),
::testing::Values(std::vector<ptrdiff_t>({0, 0})),
@@ -143,22 +216,49 @@ INSTANTIATE_TEST_SUITE_P(
::testing::ValuesIn(std::vector<size_t> {2}), // def. gr.
::testing::ValuesIn(numOutChannels),
::testing::Values(ngraph::op::PadType::EXPLICIT),
::testing::ValuesIn(with_bilinear_interpolation_pad),
::testing::ValuesIn(with_modulated_scalar)),
::testing::ValuesIn(with_bilinear_interpolation_pad)),
::testing::Values(false),
::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(std::vector<size_t>({1, 4, 3, 3})),
::testing::Values(ov::test::static_shapes_to_test_representation(shapes_multiple_groups_no_modulation)),
::testing::Values(ov::test::utils::DEVICE_CPU)),
DeformableConvolutionLayerTest::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(
smoke_DeformableConvolution2D_MultipleGroups_2, DeformableConvolutionLayerTest,
smoke_DeformableConvolution2D_MultipleGroups_WithModulation, DeformableConvolutionLayerTest,
::testing::Combine(
::testing::Combine(
::testing::ValuesIn(strides),
::testing::Values(std::vector<ptrdiff_t>({0, 0})),
::testing::Values(std::vector<ptrdiff_t>({0, 0})),
::testing::ValuesIn(dilations),
::testing::ValuesIn(std::vector<size_t> {2}), // gr.
::testing::ValuesIn(std::vector<size_t> {2}), // def. gr.
::testing::ValuesIn(numOutChannels),
::testing::Values(ngraph::op::PadType::EXPLICIT),
::testing::ValuesIn(with_bilinear_interpolation_pad)),
::testing::Values(true),
::testing::ValuesIn(netPrecisions),
::testing::Values(ov::test::static_shapes_to_test_representation(shapes_multiple_groups_with_modulation)),
::testing::Values(ov::test::utils::DEVICE_CPU)),
DeformableConvolutionLayerTest::getTestCaseName);
const std::vector<ov::Shape> shapes_multiple_groups_2_no_modulation {
{1, 8, 68, 68},
{1, 18, 66, 66}, //deformable_vals
{4, 2, 3, 3}, //kernels
};
const std::vector<ov::Shape> shapes_multiple_groups_2_with_modulation {
{1, 8, 68, 68},
{1, 18, 66, 66}, //deformable_vals
{4, 2, 3, 3}, //kernels
{1, 9, 66, 66}, //modulation_shape
};
INSTANTIATE_TEST_SUITE_P(
smoke_DeformableConvolution2D_MultipleGroups_2_NoModulation, DeformableConvolutionLayerTest,
::testing::Combine(
::testing::Combine(
::testing::ValuesIn(std::vector<std::vector<size_t>> {{1, 18, 66, 66}}), // offsets
::testing::ValuesIn(std::vector<std::vector<size_t>> {{4, 2, 3, 3}}), // ker.
::testing::ValuesIn(strides),
::testing::Values(std::vector<ptrdiff_t>({0, 0})),
::testing::Values(std::vector<ptrdiff_t>({0, 0})),
@@ -167,14 +267,29 @@ INSTANTIATE_TEST_SUITE_P(
::testing::ValuesIn(std::vector<size_t> {1}), // def. gr.
::testing::ValuesIn(numOutChannels),
::testing::Values(ngraph::op::PadType::EXPLICIT),
::testing::ValuesIn(with_bilinear_interpolation_pad),
::testing::ValuesIn(with_modulated_scalar)),
::testing::ValuesIn(with_bilinear_interpolation_pad)),
::testing::Values(false),
::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(std::vector<size_t>({1, 8, 68, 68})),
::testing::Values(ov::test::static_shapes_to_test_representation(shapes_multiple_groups_2_no_modulation)),
::testing::Values(ov::test::utils::DEVICE_CPU)),
DeformableConvolutionLayerTest::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(
smoke_DeformableConvolution2D_MultipleGroups_2_WithModulation, DeformableConvolutionLayerTest,
::testing::Combine(
::testing::Combine(
::testing::ValuesIn(strides),
::testing::Values(std::vector<ptrdiff_t>({0, 0})),
::testing::Values(std::vector<ptrdiff_t>({0, 0})),
::testing::ValuesIn(dilations),
::testing::ValuesIn(std::vector<size_t> {4}), // gr.
::testing::ValuesIn(std::vector<size_t> {1}), // def. gr.
::testing::ValuesIn(numOutChannels),
::testing::Values(ngraph::op::PadType::EXPLICIT),
::testing::ValuesIn(with_bilinear_interpolation_pad)),
::testing::Values(true),
::testing::ValuesIn(netPrecisions),
::testing::Values(ov::test::static_shapes_to_test_representation(shapes_multiple_groups_2_with_modulation)),
::testing::Values(ov::test::utils::DEVICE_CPU)),
DeformableConvolutionLayerTest::getTestCaseName);
} // namespace