diff options
author | Tianle Cheng <tianle.cheng@arm.com> | 2023-07-28 11:53:04 +0100 |
---|---|---|
committer | Tianle Cheng <tianle.cheng@arm.com> | 2023-08-01 14:45:49 +0000 |
commit | ae93173f7b37285ed107d4fa38adbe8669280e25 (patch) | |
tree | 163da33eeda3896afefcbfa6d000e76ff939eb38 /delegate/classic/src | |
parent | 09e4d05b85cc5ed419d282cdfc0b153f83c3fa39 (diff) | |
download | armnn-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/classic/src')
-rw-r--r-- | delegate/classic/src/Activation.hpp | 8 | ||||
-rw-r--r-- | delegate/classic/src/armnn_delegate.cpp | 14 |
2 files changed, 18 insertions, 4 deletions
diff --git a/delegate/classic/src/Activation.hpp b/delegate/classic/src/Activation.hpp index e813956f6f..442ce4fac3 100644 --- a/delegate/classic/src/Activation.hpp +++ b/delegate/classic/src/Activation.hpp @@ -101,6 +101,14 @@ TfLiteStatus VisitActivationOperator(DelegateData& delegateData, activationDesc.m_Function = armnn::ActivationFunction::HardSwish; break; } + case kTfLiteBuiltinLeakyRelu: + { + // Get the alpha param from builtin data + auto* leakyReluParameters = reinterpret_cast<TfLiteLeakyReluParams*>(tfLiteNode->builtin_data); + activationDesc.m_Function = armnn::ActivationFunction::LeakyReLu; + activationDesc.m_A = leakyReluParameters->alpha; + break; + } default: { return kTfLiteError; diff --git a/delegate/classic/src/armnn_delegate.cpp b/delegate/classic/src/armnn_delegate.cpp index 45bea3d442..2483835989 100644 --- a/delegate/classic/src/armnn_delegate.cpp +++ b/delegate/classic/src/armnn_delegate.cpp @@ -741,10 +741,16 @@ TfLiteStatus ArmnnSubgraph::VisitNode(DelegateData& delegateData, kTfLiteBuiltinL2Normalization); case kTfLiteBuiltinL2Pool2d: return VisitPooling2dOperator(delegateData, - tfLiteContext, - tfLiteNode, - nodeIndex, - kTfLiteBuiltinL2Pool2d); + tfLiteContext, + tfLiteNode, + nodeIndex, + kTfLiteBuiltinL2Pool2d); + case kTfLiteBuiltinLeakyRelu: + return VisitActivationOperator(delegateData, + tfLiteContext, + tfLiteNode, + nodeIndex, + kTfLiteBuiltinLeakyRelu); case kTfLiteBuiltinLess: return VisitComparisonOperator(delegateData, tfLiteContext, |