Skip to content

Commit

Permalink
review corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
DariaMityagina committed May 19, 2021
1 parent 0069bfe commit 6e80629
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,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 && isPadZeros(padsBegin) && isPadZeros(padsEnd);
VPU_THROW_UNLESS(paramIsSupported, "Current Interpolate does not support paddings, 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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ const std::vector<std::vector<size_t>> targetShapes2x = {
{5, 19, 37 * 2, 37 * 2},
};

const std::vector<std::vector<size_t>> inShapesNoBatch = {
{1, 8, 38, 38},
{1, 8, 36, 36},
};

const std::vector<std::vector<size_t>> targetShapesNoBatch = {
{1, 8, 38 * 2, 38 * 2},
{1, 8, 70, 70}, // * 1.94
};

const std::vector<ngraph::op::v4::Interpolate::InterpolateMode> modesWithoutNearest = {
ngraph::op::v4::Interpolate::InterpolateMode::linear,
Expand Down Expand Up @@ -185,6 +194,32 @@ INSTANTIATE_TEST_CASE_P(smoke_Interpolate_nearest_mode_2x, InterpolateLayerTest,
::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(
interpolateCasesNearestMode,
::testing::ValuesIn(netPrecisions),
Expand Down

0 comments on commit 6e80629

Please sign in to comment.