aboutsummaryrefslogtreecommitdiff
path: root/delegate/src/Activation.hpp
diff options
context:
space:
mode:
authorMatthew Sloyan <matthew.sloyan@arm.com>2020-12-16 12:50:01 +0000
committerJim Flynn <jim.flynn@arm.com>2020-12-17 12:20:58 +0000
commit7515d0730acc926316886a85401bcd36f640627e (patch)
tree97b312e641e7419b14dd6f7b1686afc6b56e788b /delegate/src/Activation.hpp
parentdf82f3abc8acc90acfd56f18744a8cae201a759a (diff)
downloadarmnn-7515d0730acc926316886a85401bcd36f640627e.tar.gz
IVGCVSW-5614 Enable Hard Swish and Elu activations
* Enabled Hard Swish and Elu in TfLiteDelegate * Added support for Elu in TfLiteParser Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: If09321b58568a98e14cabce610a1586556da041e
Diffstat (limited to 'delegate/src/Activation.hpp')
-rw-r--r--delegate/src/Activation.hpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/delegate/src/Activation.hpp b/delegate/src/Activation.hpp
index b50854aca5..5f14e2c45c 100644
--- a/delegate/src/Activation.hpp
+++ b/delegate/src/Activation.hpp
@@ -49,21 +49,14 @@ TfLiteStatus VisitActivationOperator(DelegateData& delegateData,
const TfLiteTensor* tfLiteTensors = tfLiteContext->tensors;
const TfLiteTensor& tfLiteInputTensor = tfLiteTensors[tfLiteNode->inputs->data[0]];
- if (IsDynamicTensor(tfLiteInputTensor))
+ if (!IsValid(tfLiteContext, tfLiteInputTensor, operatorCode, nodeIndex))
{
- TF_LITE_MAYBE_KERNEL_LOG(
- tfLiteContext,
- "TfLiteArmnnDelegate: Dynamic input tensors are not supported in node #%d: ",
- nodeIndex);
return kTfLiteError;
}
+
const TfLiteTensor& tfLiteOutputTensor = tfLiteTensors[tfLiteNode->outputs->data[0]];
- if (IsDynamicTensor(tfLiteOutputTensor))
+ if (!IsValid(tfLiteContext, tfLiteOutputTensor, operatorCode, nodeIndex))
{
- TF_LITE_MAYBE_KERNEL_LOG(
- tfLiteContext,
- "TfLiteArmnnDelegate: Dynamic output tensors are not supported in node #%d: ",
- nodeIndex);
return kTfLiteError;
}
@@ -96,6 +89,17 @@ TfLiteStatus VisitActivationOperator(DelegateData& delegateData,
activationDesc.m_B = 1.0f;
break;
}
+ case kTfLiteBuiltinElu:
+ {
+ activationDesc.m_Function = armnn::ActivationFunction::Elu;
+ activationDesc.m_A = 1.0f;
+ break;
+ }
+ case kTfLiteBuiltinHardSwish:
+ {
+ activationDesc.m_Function = armnn::ActivationFunction::HardSwish;
+ break;
+ }
default:
{
return kTfLiteError;