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
diff --git a/src/backends/aclCommon/ArmComputeUtils.hpp b/src/backends/aclCommon/ArmComputeUtils.hpp
index db47296..ec3701b 100644
--- a/src/backends/aclCommon/ArmComputeUtils.hpp
+++ b/src/backends/aclCommon/ArmComputeUtils.hpp
@@ -15,9 +15,11 @@
{
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