aboutsummaryrefslogtreecommitdiff
path: root/src/backends/aclCommon/ArmComputeUtils.hpp
diff options
context:
space:
mode:
authorColm Donelan <Colm.Donelan@arm.com>2019-08-15 16:03:17 +0100
committerÁron Virginás-Tar <aron.virginas-tar@arm.com>2019-08-16 15:23:24 +0000
commitc3c5fc259c0bfcab9f0096b7b68fc13b0937296a (patch)
tree0a2e54b66828bc788186d13b006945b14dcae8fc /src/backends/aclCommon/ArmComputeUtils.hpp
parentdba634fd6a66a9e033a1925b0b26c80b270bbf21 (diff)
downloadarmnn-c3c5fc259c0bfcab9f0096b7b68fc13b0937296a.tar.gz
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 <Colm.Donelan@arm.com> Change-Id: Ibb0660e4cb0dc6bd4c804c4397fbd61f38acdd9c
Diffstat (limited to 'src/backends/aclCommon/ArmComputeUtils.hpp')
-rw-r--r--src/backends/aclCommon/ArmComputeUtils.hpp10
1 files changed, 8 insertions, 2 deletions
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);