diff options
author | Cathal Corbett <cathal.corbett@arm.com> | 2022-01-28 12:17:19 +0000 |
---|---|---|
committer | Cathal Corbett <cathal.corbett@arm.com> | 2022-02-21 09:29:38 +0000 |
commit | b0baff73b1574a198e57d46fcd704cedc43cea16 (patch) | |
tree | 0db88ad2d0f9e32dec916822d9a42d5d5ab81723 /src/backends/aclCommon/ArmComputeUtils.hpp | |
parent | 23a08cc51569077e057c57fdd2c2b99c0aa982e2 (diff) | |
download | armnn-b0baff73b1574a198e57d46fcd704cedc43cea16.tar.gz |
IVGCVSW-6268 Add support of Unidirectional Sequence Lstm fp32/fp16 to Neon
!ComputeLibrary:7150
Signed-off-by: Cathal Corbett <cathal.corbett@arm.com>
Change-Id: I3de48ffc8d08c95a22705e2b68d069791bddae73
Diffstat (limited to 'src/backends/aclCommon/ArmComputeUtils.hpp')
-rw-r--r-- | src/backends/aclCommon/ArmComputeUtils.hpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/backends/aclCommon/ArmComputeUtils.hpp b/src/backends/aclCommon/ArmComputeUtils.hpp index e76af02765..fab52ffb0f 100644 --- a/src/backends/aclCommon/ArmComputeUtils.hpp +++ b/src/backends/aclCommon/ArmComputeUtils.hpp @@ -112,6 +112,30 @@ ConvertAdditionalInfoToAclActivationLayerInfo(const QueueDescriptor& queueDescri return arm_compute::ActivationLayerInfo(); } +inline arm_compute::ActivationLayerInfo +ConvertLstmActivationFuncToAclLayerInfo(uint32_t activationFunction) +{ + // For preparing the object for the class ActivationLayerInfo, we need to consider 5 situations. + switch (activationFunction) + { + case 0: + return arm_compute::ActivationLayerInfo(); // no activation, do nothing + case 1: + return arm_compute::ActivationLayerInfo(arm_compute::ActivationLayerInfo::ActivationFunction::RELU); + case 3: + return arm_compute::ActivationLayerInfo( + arm_compute::ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 6.0); + case 4: + return arm_compute::ActivationLayerInfo( + arm_compute::ActivationLayerInfo::ActivationFunction::TANH, 1.0, 1.0); + case 6: + return arm_compute::ActivationLayerInfo( + arm_compute::ActivationLayerInfo::ActivationFunction::LOGISTIC); + default: + throw armnn::Exception("Wrong Type of Activation Function!"); + } +} + inline arm_compute::ComparisonOperation ConvertComparisonOperationToAcl(const ComparisonDescriptor& descriptor) { switch (descriptor.m_Operation) |