From c3c5fc259c0bfcab9f0096b7b68fc13b0937296a Mon Sep 17 00:00:00 2001 From: Colm Donelan Date: Thu, 15 Aug 2019 16:03:17 +0100 Subject: IVGCVSW-3620 Fix Hal 1.2 Softmax test failures on GpuAcc and CpuAcc The following NeuralNetworkTests tests were failing on GpuAcc and CpuAcc: GeneratedTests.softmax_v1_2_relaxed GeneratedTests.softmax_v1_2_quant8 GeneratedTests.softmax_v1_2_2 GeneratedTests.softmax_v1_2_relaxed_2 GeneratedTests.softmax_v1_2_quant8_2 The default value for Softmax axis parameter in Android is -1 but is 1 in ACL. Detect and handle this in ArmComputeUtils.ComputeSoftmaxAclAxis. Signed-off-by: Colm Donelan Change-Id: Ibb0660e4cb0dc6bd4c804c4397fbd61f38acdd9c --- src/backends/aclCommon/ArmComputeUtils.hpp | 10 ++++++++-- 1 file changed, 8 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 0f56160051..4d690901c6 100644 --- a/src/backends/aclCommon/ArmComputeUtils.hpp +++ b/src/backends/aclCommon/ArmComputeUtils.hpp @@ -135,9 +135,15 @@ inline arm_compute::InterpolationPolicy ConvertResizeMethodToAclInterpolationPol } } -inline unsigned int ComputeSoftmaxAclAxis(const armnn::TensorInfo& tensor) +inline unsigned int ComputeSoftmaxAclAxis(const SoftmaxDescriptor& softmaxDesc, const armnn::TensorInfo& tensor) { - unsigned int dim = tensor.GetNumDimensions(); + // Detect the Android default value of -1 and return the ACL default value of 1. + if (softmaxDesc.m_Axis == -1) + { + return 1; + } + + unsigned int dim = tensor.GetNumDimensions(); BOOST_ASSERT(dim != 0); -- cgit v1.2.1