aboutsummaryrefslogtreecommitdiff
path: root/delegate/opaque
diff options
context:
space:
mode:
authorTianle Cheng <tianle.cheng@arm.com>2023-07-28 11:53:04 +0100
committerTianle Cheng <tianle.cheng@arm.com>2023-08-01 14:45:49 +0000
commitae93173f7b37285ed107d4fa38adbe8669280e25 (patch)
tree163da33eeda3896afefcbfa6d000e76ff939eb38 /delegate/opaque
parent09e4d05b85cc5ed419d282cdfc0b153f83c3fa39 (diff)
downloadarmnn-ae93173f7b37285ed107d4fa38adbe8669280e25.tar.gz
IVGCVSW-7451 LEAKY_RELU not supported by delegate
* Added LEAKY_RELU support to classic and opaque delegate * CMake files updated * Test added Signed-off-by: Tianle Cheng <tianle.cheng@arm.com> Change-Id: Ib9a2ce8f637b14afcd796bbae11fd3fa03653a2c
Diffstat (limited to 'delegate/opaque')
-rw-r--r--delegate/opaque/src/Activation.hpp9
-rw-r--r--delegate/opaque/src/armnn_delegate.cpp6
2 files changed, 15 insertions, 0 deletions
diff --git a/delegate/opaque/src/Activation.hpp b/delegate/opaque/src/Activation.hpp
index 9fce7a12e0..f56609001a 100644
--- a/delegate/opaque/src/Activation.hpp
+++ b/delegate/opaque/src/Activation.hpp
@@ -166,6 +166,15 @@ TfLiteStatus VisitActivationOperator(DelegateData& delegateData,
activationDesc.m_Function = armnn::ActivationFunction::HardSwish;
break;
}
+ case kTfLiteBuiltinLeakyRelu:
+ {
+ // Get alpha param from builtin data
+ auto* leakyReluParameters =
+ reinterpret_cast<TfLiteLeakyReluParams*>(TfLiteOpaqueNodeGetBuiltinData(tfLiteNode));
+ activationDesc.m_Function = armnn::ActivationFunction::LeakyReLu;
+ activationDesc.m_A = leakyReluParameters->alpha;
+ break;
+ }
default:
{
return kTfLiteError;
diff --git a/delegate/opaque/src/armnn_delegate.cpp b/delegate/opaque/src/armnn_delegate.cpp
index 49fa30d8f0..60da293eb2 100644
--- a/delegate/opaque/src/armnn_delegate.cpp
+++ b/delegate/opaque/src/armnn_delegate.cpp
@@ -828,6 +828,12 @@ TfLiteStatus ArmnnSubgraph::VisitNode(DelegateData& delegateData,
tfLiteNode,
nodeIndex,
kTfLiteBuiltinL2Pool2d);
+ case kTfLiteBuiltinLeakyRelu:
+ return VisitActivationOperator(delegateData,
+ tfLiteContext,
+ tfLiteNode,
+ nodeIndex,
+ kTfLiteBuiltinLeakyRelu);
case kTfLiteBuiltinLess:
return VisitComparisonOperator(delegateData,
tfLiteContext,