From 0ebbf413d16a01268aa775e393966d8262adb02e Mon Sep 17 00:00:00 2001 From: Daria Mityagina Date: Fri, 21 May 2021 12:54:58 +0300 Subject: [PATCH] [VPU] Batch support for interpolate (#5520) * batch support for interpolate * hash update * compilation errors solved * changes in tests, so not to break other plugins * changes in tests, so not to break other plugins * Revert "changes in tests, so not to break other plugins" This reverts commit 67e5c1e4ddba4f0cc858eb1293e50ce9d9ae0227. * Revert "changes in tests, so not to break other plugins" This reverts commit f6a537d2236f0b64f0ff028627af9e0e388a2d23. * review corrections * Firmware update --- inference-engine/cmake/vpu_dependencies.cmake | 6 +- .../src/stages/interpolate.cpp | 18 ++-- .../single_layer_tests/interpolate.cpp | 14 ++- .../cpu/single_layer_tests/interpolate.cpp | 24 +++-- .../single_layer_tests/interpolate.cpp | 8 +- .../single_layer_tests/interpolate.cpp | 93 +++++++++++++------ .../single_layer/interpolate.hpp | 17 ++-- .../src/single_layer/interpolate.cpp | 9 +- 8 files changed, 129 insertions(+), 60 deletions(-) diff --git a/inference-engine/cmake/vpu_dependencies.cmake b/inference-engine/cmake/vpu_dependencies.cmake index f01d9b4e23fde3..df08027aa8e7d5 100644 --- a/inference-engine/cmake/vpu_dependencies.cmake +++ b/inference-engine/cmake/vpu_dependencies.cmake @@ -6,14 +6,14 @@ include_guard(GLOBAL) set(VPU_SUPPORTED_FIRMWARES usb-ma2x8x pcie-ma2x8x) set(VPU_SUPPORTED_FIRMWARES_HASH - "11a6db07d3a17c9c0fc4247fce47c942e0dcd59f8d70665a96bae0d7b7121fe9" - "43f3dc0f0a8114ca34226167970aafdc869600929d6e3761c1eaa6eec71f2237") + "dc93ba50e2096759aa3aeae67a85be1d49d2ba0ca84f319ca5ff911b13788f2c" + "c50db9859c4851fd4a3a5822ff05fc0af3d16a972625f965527a450aa4bb4624") # # Default packages # -set(FIRMWARE_PACKAGE_VERSION 1658) +set(FIRMWARE_PACKAGE_VERSION 1676) set(VPU_CLC_MA2X8X_VERSION "movi-cltools-20.09.2") # diff --git a/inference-engine/src/vpu/graph_transformer/src/stages/interpolate.cpp b/inference-engine/src/vpu/graph_transformer/src/stages/interpolate.cpp index 8be7070ebea52f..2e3cd77d3a9455 100644 --- a/inference-engine/src/vpu/graph_transformer/src/stages/interpolate.cpp +++ b/inference-engine/src/vpu/graph_transformer/src/stages/interpolate.cpp @@ -29,16 +29,18 @@ void FrontEnd::parseInterpolate(const Model& model, const ie::CNNLayerPtr& _laye const auto interpolateMode = _layer->GetParamAsString(g_mode, g_nearest); - const auto input = inputs[0]; + const auto input = inputs[0]; const auto output = outputs[0]; // try to use existing resize layers + const auto oc = output->desc().dim(Dim::C); + const auto on = output->desc().dim(Dim::N, 1); + const auto ic = input->desc().dim(Dim::C); - const auto in = (input->desc().numDims() == 3) ? 1 : input->desc().dim(Dim::N); + const auto in = input->desc().dim(Dim::N, 1); - const auto oc = output->desc().dim(Dim::C); - const auto on = (output->desc().numDims() == 3) ? 1 : output->desc().dim(Dim::N); + VPU_THROW_UNLESS(in == on, "incompatible: input batch=%d, output batch=%d", in, on); auto padsBegin = _layer->GetParamAsInts(g_pads_begin, {}); auto padsEnd = _layer->GetParamAsInts(g_pads_end, {}); @@ -48,7 +50,7 @@ void FrontEnd::parseInterpolate(const Model& model, const ie::CNNLayerPtr& _laye }; const auto orderIsSupported = input->desc().dimsOrder() == DimsOrder::NCHW || input->desc().dimsOrder() == DimsOrder::NHWC - || input->desc().dimsOrder() == DimsOrder::CHW || input->desc().dimsOrder() == DimsOrder::HWC; + || input->desc().dimsOrder() == DimsOrder::CHW || input->desc().dimsOrder() == DimsOrder::HWC; VPU_THROW_UNLESS(orderIsSupported, "Current Interpolate supports (N)HWC, (N)CHW data orders only, actual {}", input->desc().dimsOrder()); const auto interpolateModeIt = interpModeMap.find(interpolateMode); @@ -59,8 +61,10 @@ void FrontEnd::parseInterpolate(const Model& model, const ie::CNNLayerPtr& _laye interpolateModeIt->second == InterpolateMode::LinearOnnx; VPU_THROW_UNLESS(modeIsSupported, "Current Interpolate supports 'nearest' and 'linear' modes only, actual {}", interpolateMode); - const auto paramIsSupported = ic == oc && in == 1 && on == 1 && isPadZeros(padsBegin) && isPadZeros(padsEnd); - VPU_THROW_UNLESS(paramIsSupported, "Current Interpolate does not support paddings, batches, and resize by channels"); + auto paramIsSupported = ic == oc; + VPU_THROW_UNLESS(paramIsSupported, "Current Interpolate does not support resize by channels"); + paramIsSupported = isPadZeros(padsBegin) && isPadZeros(padsEnd); + VPU_THROW_UNLESS(paramIsSupported, "Current Interpolate does not support paddings"); if (interpolateModeIt->second == InterpolateMode::Nearest) { // current "Resample" supports the following "Interpolate" modes only: diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/interpolate.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/interpolate.cpp index d5a9c8364e7cd2..08c529379767a7 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/interpolate.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/interpolate.cpp @@ -82,6 +82,8 @@ const std::vector> defaultScales = { {1.f, 1.f, 1.333333f, 1.333333f} }; +std::map additional_config = {}; + const auto interpolateCasesWithoutNearest = ::testing::Combine( ::testing::ValuesIn(modesWithoutNearest), ::testing::ValuesIn(shapeCalculationMode), @@ -115,7 +117,8 @@ INSTANTIATE_TEST_CASE_P(smoke_Interpolate_Basic, InterpolateLayerTest, ::testing ::testing::Values(InferenceEngine::Layout::ANY), ::testing::ValuesIn(inShapes), ::testing::ValuesIn(targetShapes), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), + ::testing::Values(CommonTestUtils::DEVICE_CPU), + ::testing::Values(additional_config)), InterpolateLayerTest::getTestCaseName); INSTANTIATE_TEST_CASE_P(smoke_Interpolate_Nearest, InterpolateLayerTest, ::testing::Combine( @@ -127,7 +130,8 @@ INSTANTIATE_TEST_CASE_P(smoke_Interpolate_Nearest, InterpolateLayerTest, ::testi ::testing::Values(InferenceEngine::Layout::ANY), ::testing::ValuesIn(inShapes), ::testing::ValuesIn(targetShapes), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), + ::testing::Values(CommonTestUtils::DEVICE_CPU), + ::testing::Values(additional_config)), InterpolateLayerTest::getTestCaseName); const std::vector> targetShapesTailTest = { @@ -171,7 +175,8 @@ INSTANTIATE_TEST_CASE_P(smoke_Interpolate_Basic_Down_Sample_Tail, InterpolateLay ::testing::Values(InferenceEngine::Layout::ANY), ::testing::ValuesIn(inShapes), ::testing::ValuesIn(targetShapesTailTest), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), + ::testing::Values(CommonTestUtils::DEVICE_CPU), + ::testing::Values(additional_config)), InterpolateLayerTest::getTestCaseName); INSTANTIATE_TEST_CASE_P(smoke_Interpolate_Nearest_Down_Sample_Tail, InterpolateLayerTest, ::testing::Combine( @@ -183,7 +188,8 @@ INSTANTIATE_TEST_CASE_P(smoke_Interpolate_Nearest_Down_Sample_Tail, InterpolateL ::testing::Values(InferenceEngine::Layout::ANY), ::testing::ValuesIn(inShapes), ::testing::ValuesIn(targetShapesTailTest), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), + ::testing::Values(CommonTestUtils::DEVICE_CPU), + ::testing::Values(additional_config)), InterpolateLayerTest::getTestCaseName); } // namespace diff --git a/inference-engine/tests/functional/plugin/cpu/single_layer_tests/interpolate.cpp b/inference-engine/tests/functional/plugin/cpu/single_layer_tests/interpolate.cpp index 174c47255576ef..55863095e75acb 100644 --- a/inference-engine/tests/functional/plugin/cpu/single_layer_tests/interpolate.cpp +++ b/inference-engine/tests/functional/plugin/cpu/single_layer_tests/interpolate.cpp @@ -60,7 +60,9 @@ class InterpolateLayerCPUTest : public testing::WithParamInterface inputShape; std::vector targetShape; Precision netPrecision; - std::tie(interpolateParams, netPrecision, inPrc, outPrc, inLayout, outLayout, inputShape, targetShape, targetDevice) = basicParamsSet; + std::map additional_config; + std::tie(interpolateParams, netPrecision, inPrc, outPrc, inLayout, outLayout, inputShape, + targetShape, targetDevice, additional_config) = basicParamsSet; ngraph::op::v4::Interpolate::InterpolateMode mode; ngraph::op::v4::Interpolate::ShapeCalcMode shapeCalcMode; @@ -242,6 +244,8 @@ const std::vector interpolateFusingParamsSet{ fusingFakeQuantizePerChannelRelu, }; +std::map additional_config = {}; + std::vector> filterAdditionalConfig() { if (with_cpu_x86_avx512f()) { return { @@ -267,7 +271,8 @@ INSTANTIATE_TEST_CASE_P(smoke_InterpolateNN_Layout_Test, InterpolateLayerCPUTest ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({1, 21, 4, 4})), ::testing::Values(std::vector({1, 21, 5, 6})), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), + ::testing::Values(CommonTestUtils::DEVICE_CPU), + ::testing::Values(additional_config)), ::testing::ValuesIn(filterCPUInfoForDevice()), ::testing::ValuesIn(interpolateFusingParamsSet), ::testing::ValuesIn(filterAdditionalConfig())), @@ -284,7 +289,8 @@ INSTANTIATE_TEST_CASE_P(smoke_InterpolateLinearOnnx_Layout_Test, InterpolateLaye ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({1, 21, 4, 4})), ::testing::Values(std::vector({1, 21, 5, 6})), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), + ::testing::Values(CommonTestUtils::DEVICE_CPU), + ::testing::Values(additional_config)), ::testing::ValuesIn(filterCPUInfoForDevice()), ::testing::ValuesIn(interpolateFusingParamsSet), ::testing::ValuesIn(filterAdditionalConfig())), @@ -301,7 +307,8 @@ INSTANTIATE_TEST_CASE_P(smoke_InterpolateLinear_Layout_Test, InterpolateLayerCPU ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({1, 21, 4, 4})), ::testing::Values(std::vector({1, 21, 5, 6})), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), + ::testing::Values(CommonTestUtils::DEVICE_CPU), + ::testing::Values(additional_config)), ::testing::ValuesIn(filterCPUInfoForDevice()), ::testing::ValuesIn(interpolateFusingParamsSet), ::testing::ValuesIn(filterAdditionalConfig())), @@ -318,7 +325,8 @@ INSTANTIATE_TEST_CASE_P(smoke_InterpolateCubic_Layout_Test, InterpolateLayerCPUT ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({1, 21, 4, 4})), ::testing::Values(std::vector({1, 21, 5, 6})), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), + ::testing::Values(CommonTestUtils::DEVICE_CPU), + ::testing::Values(additional_config)), ::testing::ValuesIn(filterCPUInfoForDevice()), ::testing::ValuesIn(interpolateFusingParamsSet), ::testing::ValuesIn(filterAdditionalConfig())), @@ -390,7 +398,8 @@ INSTANTIATE_TEST_CASE_P(smoke_InterpolateLinearOnnx5D_Layout_Test, InterpolateLa ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({1, 21, 4, 4, 4})), ::testing::Values(std::vector({1, 21, 5, 6, 2})), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), + ::testing::Values(CommonTestUtils::DEVICE_CPU), + ::testing::Values(additional_config)), ::testing::ValuesIn(filterCPUInfoForDevice5D()), ::testing::ValuesIn(interpolateFusingParamsSet), ::testing::ValuesIn(filterAdditionalConfig())), @@ -407,7 +416,8 @@ INSTANTIATE_TEST_CASE_P(smoke_InterpolateNN5D_Layout_Test, InterpolateLayerCPUTe ::testing::Values(InferenceEngine::Layout::ANY), ::testing::Values(std::vector({1, 21, 4, 4, 4})), ::testing::Values(std::vector({1, 21, 5, 6, 2})), - ::testing::Values(CommonTestUtils::DEVICE_CPU)), + ::testing::Values(CommonTestUtils::DEVICE_CPU), + ::testing::Values(additional_config)), ::testing::ValuesIn(filterCPUInfoForDevice5D()), ::testing::ValuesIn(interpolateFusingParamsSet), ::testing::ValuesIn(filterAdditionalConfig())), diff --git a/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/single_layer_tests/interpolate.cpp b/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/single_layer_tests/interpolate.cpp index fbbb30c1e2c6fe..0b210ebef2e4db 100644 --- a/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/single_layer_tests/interpolate.cpp +++ b/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/single_layer_tests/interpolate.cpp @@ -82,6 +82,8 @@ const std::vector> defaultScales = { {1.f, 1.f, 2.f, 2.f} }; +std::map additional_config = {}; + const auto interpolateCasesWithoutNearest = ::testing::Combine( ::testing::ValuesIn(modesWithoutNearest), ::testing::ValuesIn(shapeCalculationMode), @@ -115,7 +117,8 @@ INSTANTIATE_TEST_CASE_P(smoke_Interpolate_Basic, InterpolateLayerTest, ::testing ::testing::Values(InferenceEngine::Layout::ANY), ::testing::ValuesIn(inShapes), ::testing::ValuesIn(targetShapes), - ::testing::Values(CommonTestUtils::DEVICE_GPU)), + ::testing::Values(CommonTestUtils::DEVICE_GPU), + ::testing::Values(additional_config)), InterpolateLayerTest::getTestCaseName); INSTANTIATE_TEST_CASE_P(smoke_Interpolate_Nearest, InterpolateLayerTest, ::testing::Combine( @@ -127,7 +130,8 @@ INSTANTIATE_TEST_CASE_P(smoke_Interpolate_Nearest, InterpolateLayerTest, ::testi ::testing::Values(InferenceEngine::Layout::ANY), ::testing::ValuesIn(inShapes), ::testing::ValuesIn(targetShapes), - ::testing::Values(CommonTestUtils::DEVICE_GPU)), + ::testing::Values(CommonTestUtils::DEVICE_GPU), + ::testing::Values(additional_config)), InterpolateLayerTest::getTestCaseName); } // namespace diff --git a/inference-engine/tests/functional/plugin/myriad/shared_tests_instances/single_layer_tests/interpolate.cpp b/inference-engine/tests/functional/plugin/myriad/shared_tests_instances/single_layer_tests/interpolate.cpp index 338d74c57bb616..3a6d57fd858163 100644 --- a/inference-engine/tests/functional/plugin/myriad/shared_tests_instances/single_layer_tests/interpolate.cpp +++ b/inference-engine/tests/functional/plugin/myriad/shared_tests_instances/single_layer_tests/interpolate.cpp @@ -16,40 +16,51 @@ const std::vector netPrecisions = { InferenceEngine::Precision::FP16, }; -const std::vector> inShapes = { - {1, 8, 38, 38}, - {1, 8, 36, 36}, - {1, 8, 35, 35}, - {1, 8, 6, 6}, +typedef std::map Config; - {1, 8, 3, 3}, - {1, 8, 4, 4}, - {1, 8, 16, 16}, - {1, 8, 31, 31}, - {1, 8, 26, 26}, +const std::vector> inShapes = { + {3, 8, 38, 38}, + {3, 8, 36, 36}, + {3, 8, 35, 35}, + {3, 8, 6, 6}, + + {3, 8, 3, 3}, + {3, 8, 4, 4}, + {3, 8, 16, 16}, + {3, 8, 31, 31}, + {3, 8, 26, 26}, }; const std::vector> targetShapes = { - {1, 8, 38 * 2, 38 * 2}, - {1, 8, 70, 70}, // * 1.94 - {1, 8, 46, 46}, // * 1.3 - {1, 8, 9, 9}, - - {1, 8, 6, 6}, - {1, 8, 3, 3}, - {1, 8, 36, 36}, - {1, 8, 72, 72}, - {1, 8, 30, 30}, + {3, 8, 38 * 2, 38 * 2}, + {3, 8, 70, 70}, // * 1.94 + {3, 8, 46, 46}, // * 1.3 + {3, 8, 9, 9}, + + {3, 8, 6, 6}, + {3, 8, 3, 3}, + {3, 8, 36, 36}, + {3, 8, 72, 72}, + {3, 8, 30, 30}, }; const std::vector> inShapes2x = { - {1, 19, 37, 37}, + {5, 19, 37, 37}, }; const std::vector> targetShapes2x = { - {1, 19, 37 * 2, 37 * 2}, + {5, 19, 37 * 2, 37 * 2}, }; +const std::vector> inShapesNoBatch = { + {1, 8, 38, 38}, + {1, 8, 36, 36}, +}; + +const std::vector> targetShapesNoBatch = { + {1, 8, 38 * 2, 38 * 2}, + {1, 8, 70, 70}, // * 1.94 +}; const std::vector modesWithoutNearest = { ngraph::op::v4::Interpolate::InterpolateMode::linear, @@ -179,7 +190,34 @@ INSTANTIATE_TEST_CASE_P(smoke_Interpolate_nearest_mode_2x, InterpolateLayerTest, ::testing::Values(InferenceEngine::Layout::ANY), ::testing::ValuesIn(inShapes2x), ::testing::ValuesIn(targetShapes2x), - ::testing::Values(CommonTestUtils::DEVICE_MYRIAD)), + ::testing::Values(CommonTestUtils::DEVICE_MYRIAD), + ::testing::Values(Config{{InferenceEngine::MYRIAD_DETECT_NETWORK_BATCH, CONFIG_VALUE(NO)}})), + InterpolateLayerTest::getTestCaseName); + +INSTANTIATE_TEST_CASE_P(smoke_Interpolate_nearest_mode_no_batch, InterpolateLayerTest, ::testing::Combine( + interpolateCasesNearestMode, + ::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(inShapesNoBatch), + ::testing::ValuesIn(targetShapesNoBatch), + ::testing::Values(CommonTestUtils::DEVICE_MYRIAD), + ::testing::Values(Config{{InferenceEngine::MYRIAD_DETECT_NETWORK_BATCH, CONFIG_VALUE(NO)}})), + InterpolateLayerTest::getTestCaseName); + +INSTANTIATE_TEST_CASE_P(smoke_Interpolate_without_nearest_mode_no_batch, InterpolateLayerTest, ::testing::Combine( + interpolateCasesWithoutNearestMode, + ::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(inShapesNoBatch), + ::testing::ValuesIn(targetShapesNoBatch), + ::testing::Values(CommonTestUtils::DEVICE_MYRIAD), + ::testing::Values(Config{{InferenceEngine::MYRIAD_DETECT_NETWORK_BATCH, CONFIG_VALUE(NO)}})), InterpolateLayerTest::getTestCaseName); INSTANTIATE_TEST_CASE_P(smoke_Interpolate_nearest_mode, InterpolateLayerTest, ::testing::Combine( @@ -191,7 +229,8 @@ INSTANTIATE_TEST_CASE_P(smoke_Interpolate_nearest_mode, InterpolateLayerTest, :: ::testing::Values(InferenceEngine::Layout::ANY), ::testing::ValuesIn(inShapes), ::testing::ValuesIn(targetShapes), - ::testing::Values(CommonTestUtils::DEVICE_MYRIAD)), + ::testing::Values(CommonTestUtils::DEVICE_MYRIAD), + ::testing::Values(Config{{InferenceEngine::MYRIAD_DETECT_NETWORK_BATCH, CONFIG_VALUE(NO)}})), InterpolateLayerTest::getTestCaseName); INSTANTIATE_TEST_CASE_P(smoke_Interpolate_nearest_mode_more, InterpolateLayerTest, ::testing::Combine( @@ -203,7 +242,8 @@ INSTANTIATE_TEST_CASE_P(smoke_Interpolate_nearest_mode_more, InterpolateLayerTes ::testing::Values(InferenceEngine::Layout::ANY), ::testing::ValuesIn(inShapes), ::testing::ValuesIn(targetShapes), - ::testing::Values(CommonTestUtils::DEVICE_MYRIAD)), + ::testing::Values(CommonTestUtils::DEVICE_MYRIAD), + ::testing::Values(Config{{InferenceEngine::MYRIAD_DETECT_NETWORK_BATCH, CONFIG_VALUE(NO)}})), InterpolateLayerTest::getTestCaseName); INSTANTIATE_TEST_CASE_P(smoke_Interpolate_without_nearest, InterpolateLayerTest, ::testing::Combine( @@ -215,7 +255,8 @@ INSTANTIATE_TEST_CASE_P(smoke_Interpolate_without_nearest, InterpolateLayerTest, ::testing::Values(InferenceEngine::Layout::ANY), ::testing::ValuesIn(inShapes), ::testing::ValuesIn(targetShapes), - ::testing::Values(CommonTestUtils::DEVICE_MYRIAD)), + ::testing::Values(CommonTestUtils::DEVICE_MYRIAD), + ::testing::Values(Config{{InferenceEngine::MYRIAD_DETECT_NETWORK_BATCH, CONFIG_VALUE(NO)}})), InterpolateLayerTest::getTestCaseName); } // namespace diff --git a/inference-engine/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/interpolate.hpp b/inference-engine/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/interpolate.hpp index b18792485a010d..07e86512ee0ea9 100644 --- a/inference-engine/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/interpolate.hpp +++ b/inference-engine/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/interpolate.hpp @@ -31,14 +31,15 @@ typedef std::tuple< typedef std::tuple< InterpolateSpecificParams, - InferenceEngine::Precision, // Net precision - InferenceEngine::Precision, // Input precision - InferenceEngine::Precision, // Output precision - InferenceEngine::Layout, // Input layout - InferenceEngine::Layout, // Output layout - InferenceEngine::SizeVector, // Input shapes - InferenceEngine::SizeVector, // Target shapes - LayerTestsUtils::TargetDevice // Device name + InferenceEngine::Precision, // Net precision + InferenceEngine::Precision, // Input precision + InferenceEngine::Precision, // Output precision + InferenceEngine::Layout, // Input layout + InferenceEngine::Layout, // Output layout + InferenceEngine::SizeVector, // Input shapes + InferenceEngine::SizeVector, // Target shapes + LayerTestsUtils::TargetDevice, // Device name + std::map // Additional network configuration > InterpolateLayerTestParams; class InterpolateLayerTest : public testing::WithParamInterface, diff --git a/inference-engine/tests/functional/shared_test_classes/src/single_layer/interpolate.cpp b/inference-engine/tests/functional/shared_test_classes/src/single_layer/interpolate.cpp index b7b566922acd79..37db7bdeeab173 100644 --- a/inference-engine/tests/functional/shared_test_classes/src/single_layer/interpolate.cpp +++ b/inference-engine/tests/functional/shared_test_classes/src/single_layer/interpolate.cpp @@ -18,7 +18,8 @@ std::string InterpolateLayerTest::getTestCaseName(testing::TestParamInfo additional_config; + std::tie(interpolateParams, netPrecision, inPrc, outPrc, inLayout, outLayout, inputShapes, targetShapes, targetDevice, additional_config) = obj.param; std::vector padBegin, padEnd; std::vector axes; std::vector scales; @@ -55,8 +56,8 @@ void InterpolateLayerTest::SetUp() { InterpolateSpecificParams interpolateParams; std::vector inputShape, targetShape; auto netPrecision = InferenceEngine::Precision::UNSPECIFIED; - - std::tie(interpolateParams, netPrecision, inPrc, outPrc, inLayout, outLayout, inputShape, targetShape, targetDevice) = this->GetParam(); + std::map additional_config; + std::tie(interpolateParams, netPrecision, inPrc, outPrc, inLayout, outLayout, inputShape, targetShape, targetDevice, additional_config) = this->GetParam(); std::vector padBegin, padEnd; std::vector axes; std::vector scales; @@ -66,6 +67,8 @@ void InterpolateLayerTest::SetUp() { ngraph::op::v4::Interpolate::CoordinateTransformMode coordinateTransformMode; ngraph::op::v4::Interpolate::NearestMode nearestMode; + configuration.insert(additional_config.begin(), additional_config.end()); + double cubeCoef; std::tie(mode, shapeCalcMode, coordinateTransformMode, nearestMode, antialias, padBegin, padEnd, cubeCoef, axes, scales) = interpolateParams;