[CPU] NormalizeL2. Support 3D layout. (#3259)

This commit is contained in:
Nikolay Shchegolev 2020-11-22 20:18:14 +03:00 committed by GitHub
parent 92ec30c54b
commit e4ec55bea4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 7 deletions

View File

@ -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) {

View File

@ -29,7 +29,7 @@ const auto normL2params = testing::Combine(
testing::ValuesIn(axes),
testing::ValuesIn(eps),
testing::ValuesIn(epsMode),
testing::Values(std::vector<size_t>{1, 3, 10, 5}),
testing::ValuesIn(std::vector<std::vector<size_t>>({{1, 3, 10, 5}, {1, 5, 3}})),
testing::ValuesIn(netPrecisions),
testing::Values(CommonTestUtils::DEVICE_CPU)
);