diff --git a/inference-engine/src/mkldnn_plugin/nodes/mkldnn_normalize_node.cpp b/inference-engine/src/mkldnn_plugin/nodes/mkldnn_normalize_node.cpp index ac1950b6e90..80845426ed1 100644 --- a/inference-engine/src/mkldnn_plugin/nodes/mkldnn_normalize_node.cpp +++ b/inference-engine/src/mkldnn_plugin/nodes/mkldnn_normalize_node.cpp @@ -708,13 +708,10 @@ void MKLDNNNormalizeNode::getSupportedDescriptors() { if (inData == nullptr) { THROW_IE_EXCEPTION << errPrefix << "has nullable input data."; } - const auto& layout = inData->getLayout(); const auto& inDims = inData->getDims(); - size_t channels = 1lu; - if (layout == Layout::NCHW || layout == Layout::NC) - channels = inDims[1]; - else - THROW_IE_EXCEPTION << errPrefix << "has unsupported layout: '" << layout << "'."; + if (inDims.size() < 2) + THROW_IE_EXCEPTION << errPrefix << "has unsupported layout: '" << inData->getLayout() << "'."; + const size_t channels = inDims[1]; const auto weightsSize = tweights->size(); if (weightsSize != channels) { if (weightsSize == 1) { diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/normalize_l2.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/normalize_l2.cpp index 0df1e6573cf..3f562d581f0 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/normalize_l2.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/normalize_l2.cpp @@ -29,7 +29,7 @@ const auto normL2params = testing::Combine( testing::ValuesIn(axes), testing::ValuesIn(eps), testing::ValuesIn(epsMode), - testing::Values(std::vector{1, 3, 10, 5}), + testing::ValuesIn(std::vector>({{1, 3, 10, 5}, {1, 5, 3}})), testing::ValuesIn(netPrecisions), testing::Values(CommonTestUtils::DEVICE_CPU) );