aboutsummaryrefslogtreecommitdiff
path: root/src/backends/aclCommon/ArmComputeUtils.hpp
diff options
context:
space:
mode:
authorMatteo Martincigh <matteo.martincigh@arm.com>2018-10-01 09:26:39 +0100
committerMatthew Bentham <matthew.bentham@arm.com>2018-10-10 16:16:58 +0100
commit539b44dbd620c9f793f84933c1bcc51ce3ff085e (patch)
tree4d75b13cd8ac213f16279ecf54b2ce9c20d04b9a /src/backends/aclCommon/ArmComputeUtils.hpp
parent084523a492efd8001cd8e07956d45c9aeb2bb046 (diff)
downloadarmnn-539b44dbd620c9f793f84933c1bcc51ce3ff085e.tar.gz
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
Diffstat (limited to 'src/backends/aclCommon/ArmComputeUtils.hpp')
-rw-r--r--src/backends/aclCommon/ArmComputeUtils.hpp6
1 files changed, 4 insertions, 2 deletions
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