From 539b44dbd620c9f793f84933c1bcc51ce3ff085e Mon Sep 17 00:00:00 2001 From: Matteo Martincigh Date: Mon, 1 Oct 2018 09:26:39 +0100 Subject: IVGCVSW-1863 Unit tests for NHWC L2Normalization * Added NHWC unit test implementation * Programmatically selected the channel dimension when creating the ACL Normalization layer info * Set the input/output data layout in the constructor of the L2Normalization workload Change-Id: Ie69f1a360022c29d1a3a3808c1f26b69243fa8f9 --- src/backends/aclCommon/ArmComputeUtils.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/backends/aclCommon/ArmComputeUtils.hpp') diff --git a/src/backends/aclCommon/ArmComputeUtils.hpp b/src/backends/aclCommon/ArmComputeUtils.hpp index db472964ea..ec3701bb35 100644 --- a/src/backends/aclCommon/ArmComputeUtils.hpp +++ b/src/backends/aclCommon/ArmComputeUtils.hpp @@ -15,9 +15,11 @@ namespace armnn { inline arm_compute::NormalizationLayerInfo -CreateAclNormalizationLayerInfoForL2Normalization(const armnn::TensorInfo& tensorInfo) +CreateAclNormalizationLayerInfoForL2Normalization(const armnn::TensorInfo& tensorInfo, + armnn::DataLayout dataLayout) { - const unsigned int depth = tensorInfo.GetShape()[1]; + unsigned int depthDimension = dataLayout == armnn::DataLayout::NCHW ? 1 : 3; + const unsigned int depth = tensorInfo.GetShape()[depthDimension]; // At the time of writing, {CL|Neon}L2Normalization performs the reduction only along dimension 0. This version of // L2 Normalization always performs the reduction along the depth axis, though. Thus, we repurpose -- cgit v1.2.1