diff --git a/inference-engine/tests/functional/inference_engine/serialization/single_layer/batch_to_space.cpp b/inference-engine/tests/functional/inference_engine/serialization/single_layer/batch_to_space.cpp new file mode 100644 index 00000000000..a8278e8c7c1 --- /dev/null +++ b/inference-engine/tests/functional/inference_engine/serialization/single_layer/batch_to_space.cpp @@ -0,0 +1,72 @@ +// Copyright (C) 2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "shared_test_classes/single_layer/batch_to_space.hpp" + +using namespace LayerTestsDefinitions; + +namespace { +TEST_P(BatchToSpaceLayerTest, Serialize) { + Serialize(); +} + +const std::vector netPrecisions = { + InferenceEngine::Precision::FP32, InferenceEngine::Precision::FP16}; + +const std::vector> block_shapes_4D = { + {1, 1, 2, 2}, + {1, 1, 4, 2} +}; + +const std::vector> crops_4D = { + {0, 0, 0, 0}, + {0, 0, 1, 0}, + {0, 0, 0, 1} +}; + +const auto batch_to_space_4D_params = ::testing::Combine( + ::testing::ValuesIn(block_shapes_4D), + ::testing::ValuesIn(crops_4D), + ::testing::ValuesIn(crops_4D), + ::testing::Values(std::vector{16, 1, 2, 2}), + ::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(CommonTestUtils::DEVICE_CPU)); + +const std::vector> block_shapes_5D = { + {1, 1, 2, 1, 3}, + {1, 1, 4, 2, 2} +}; + +const std::vector> crops_5D = { + {0, 0, 0, 0, 0}, + {0, 0, 1, 0, 1}, + {0, 0, 0, 1, 1} +}; + +const auto batch_to_space_5D_params = ::testing::Combine( + ::testing::ValuesIn(block_shapes_5D), + ::testing::ValuesIn(crops_5D), + ::testing::ValuesIn(crops_5D), + ::testing::Values(std::vector{48, 1, 3, 4, 2}), + ::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(CommonTestUtils::DEVICE_CPU)); + +INSTANTIATE_TEST_SUITE_P( + smoke_BatchToSpace_Serialization_4D, BatchToSpaceLayerTest, + batch_to_space_4D_params, + BatchToSpaceLayerTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P( + smoke_BatchToSpace_Serialization_5D, BatchToSpaceLayerTest, + batch_to_space_5D_params, + BatchToSpaceLayerTest::getTestCaseName); +} // namespace diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/batch_to_space.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/batch_to_space.cpp index ddf930f34b7..cd81911f707 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/batch_to_space.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/batch_to_space.cpp @@ -11,46 +11,125 @@ using namespace LayerTestsDefinitions; namespace { -batchToSpaceParamsTuple bts_only_test_cases[] = { - batchToSpaceParamsTuple({1, 1, 2, 2}, {0, 0, 0, 0}, {0, 0, 0, 0}, {4, 1, 1, 1}, - InferenceEngine::Precision::FP32, - InferenceEngine::Precision::UNSPECIFIED, - InferenceEngine::Precision::UNSPECIFIED, - InferenceEngine::Layout::ANY, - InferenceEngine::Layout::ANY, - CommonTestUtils::DEVICE_CPU), - batchToSpaceParamsTuple({1, 1, 2, 2}, {0, 0, 0, 0}, {0, 0, 0, 0}, {4, 3, 1, 1}, - InferenceEngine::Precision::FP32, - InferenceEngine::Precision::UNSPECIFIED, - InferenceEngine::Precision::UNSPECIFIED, - InferenceEngine::Layout::ANY, - InferenceEngine::Layout::ANY, - CommonTestUtils::DEVICE_CPU), - batchToSpaceParamsTuple({1, 1, 2, 2}, {0, 0, 0, 0}, {0, 0, 0, 0}, {4, 1, 2, 2}, - InferenceEngine::Precision::FP32, - InferenceEngine::Precision::UNSPECIFIED, - InferenceEngine::Precision::UNSPECIFIED, - InferenceEngine::Layout::ANY, - InferenceEngine::Layout::ANY, - CommonTestUtils::DEVICE_CPU), - batchToSpaceParamsTuple({1, 1, 2, 2}, {0, 0, 0, 0}, {0, 0, 0, 0}, {8, 1, 1, 2}, - InferenceEngine::Precision::FP32, - InferenceEngine::Precision::UNSPECIFIED, - InferenceEngine::Precision::UNSPECIFIED, - InferenceEngine::Layout::ANY, - InferenceEngine::Layout::ANY, - CommonTestUtils::DEVICE_CPU), - batchToSpaceParamsTuple({1, 1, 3, 2, 2}, {0, 0, 1, 0, 3}, {0, 0, 2, 0, 0}, {12, 1, 2, 1, 2}, - InferenceEngine::Precision::FP32, - InferenceEngine::Precision::UNSPECIFIED, - InferenceEngine::Precision::UNSPECIFIED, - InferenceEngine::Layout::ANY, - InferenceEngine::Layout::ANY, - CommonTestUtils::DEVICE_CPU), +const std::vector net_precisions = { + InferenceEngine::Precision::FP32, + InferenceEngine::Precision::I32 }; -INSTANTIATE_TEST_SUITE_P(smoke_MKLDNN, BatchToSpaceLayerTest, ::testing::ValuesIn(bts_only_test_cases), - BatchToSpaceLayerTest::getTestCaseName); +const std::vector> data_shapes_4D = { + {4, 1, 2, 2}, + {4, 3, 2, 2}, + {8, 1, 3, 2} +}; +const std::vector> block_shapes_4D = { + {1, 1, 2, 2}, + {1, 2, 1, 2} +}; + +const std::vector> crops_begin_4D = { + {0, 0, 0, 0}, + {0, 0, 0, 1}, + {0, 0, 2, 0} +}; + +const std::vector> crops_end_4D = { + {0, 0, 0, 0}, + {0, 0, 1, 0}, + {0, 0, 0, 2} +}; + +const auto space_to_batch_4d_spatial_dims_tests = ::testing::Combine( + ::testing::Values(block_shapes_4D[0]), + ::testing::ValuesIn(crops_begin_4D), + ::testing::ValuesIn(crops_end_4D), + ::testing::ValuesIn(data_shapes_4D), + ::testing::ValuesIn(net_precisions), + ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), + ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), + ::testing::Values(InferenceEngine::Layout::ANY), + ::testing::Values(InferenceEngine::Layout::ANY), + ::testing::Values(CommonTestUtils::DEVICE_CPU)); + +const auto space_to_batch_4d_channel_dim_tests = ::testing::Combine( + ::testing::Values(block_shapes_4D[1]), + ::testing::Values(crops_begin_4D[0]), + ::testing::Values(crops_end_4D[0]), + ::testing::ValuesIn(data_shapes_4D), + ::testing::ValuesIn(net_precisions), + ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), + ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), + ::testing::Values(InferenceEngine::Layout::ANY), + ::testing::Values(InferenceEngine::Layout::ANY), + ::testing::Values(CommonTestUtils::DEVICE_CPU)); + +INSTANTIATE_TEST_CASE_P( + smoke_BatchToSpace_4D_spatial_dims, + BatchToSpaceLayerTest, + space_to_batch_4d_spatial_dims_tests, + BatchToSpaceLayerTest::getTestCaseName); + +INSTANTIATE_TEST_CASE_P( + smoke_BatchToSpace_4D_channel_dim, + BatchToSpaceLayerTest, + space_to_batch_4d_channel_dim_tests, + BatchToSpaceLayerTest::getTestCaseName); + +const std::vector> data_shapes_5D = { + {12, 1, 2, 1, 2} +}; + +const std::vector> block_shapes_5D = { + {1, 1, 3, 2, 2}, + {1, 2, 1, 2, 3} +}; + +const std::vector> crops_begin_5D = { + {0, 0, 0, 0, 0}, + {0, 0, 0, 1, 0}, + {0, 0, 1, 0, 0} +}; + +const std::vector> crops_end_5D = { + {0, 0, 0, 0, 0}, + {0, 0, 1, 0, 1}, + {0, 0, 0, 0, 1} +}; + +const auto space_to_batch_5d_spatial_dims_tests = ::testing::Combine( + ::testing::Values(block_shapes_5D[0]), + ::testing::ValuesIn(crops_begin_5D), + ::testing::ValuesIn(crops_end_5D), + ::testing::ValuesIn(data_shapes_5D), + ::testing::ValuesIn(net_precisions), + ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), + ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), + ::testing::Values(InferenceEngine::Layout::ANY), + ::testing::Values(InferenceEngine::Layout::ANY), + ::testing::Values(CommonTestUtils::DEVICE_CPU)); + +const auto space_to_batch_5d_channel_dim_tests = ::testing::Combine( + ::testing::Values(block_shapes_5D[1]), + ::testing::Values(crops_begin_5D[0]), + ::testing::Values(crops_end_5D[0]), + ::testing::ValuesIn(data_shapes_5D), + ::testing::ValuesIn(net_precisions), + ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), + ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), + ::testing::Values(InferenceEngine::Layout::ANY), + ::testing::Values(InferenceEngine::Layout::ANY), + ::testing::Values(CommonTestUtils::DEVICE_CPU)); + +INSTANTIATE_TEST_CASE_P( + smoke_BatchToSpace_5D_spatial_dims, + BatchToSpaceLayerTest, + space_to_batch_5d_spatial_dims_tests, + BatchToSpaceLayerTest::getTestCaseName); + +INSTANTIATE_TEST_CASE_P( + smoke_BatchToSpace_5D_channel_dim, + BatchToSpaceLayerTest, + space_to_batch_5d_channel_dim_tests, + BatchToSpaceLayerTest::getTestCaseName); } // namespace \ No newline at end of file diff --git a/inference-engine/tests/ie_test_utils/functional_test_utils/layer_tests_summary/utils/constants.py b/inference-engine/tests/ie_test_utils/functional_test_utils/layer_tests_summary/utils/constants.py index 7693826baf2..cb281578c88 100644 --- a/inference-engine/tests/ie_test_utils/functional_test_utils/layer_tests_summary/utils/constants.py +++ b/inference-engine/tests/ie_test_utils/functional_test_utils/layer_tests_summary/utils/constants.py @@ -9,6 +9,7 @@ VERIFIED_OP_REFERENCES = [ 'Assign-6', 'AvgPool-1', 'BatchNormInference-5', + 'BatchToSpace-2', 'BinaryConvolution-1', 'Broadcast-1', 'Broadcast-3',