From 9a701c840f9e2fdc16117321658c9d4d7b4ccb60 Mon Sep 17 00:00:00 2001 From: Keith Davis Date: Tue, 28 Sep 2021 16:43:24 +0100 Subject: IVGCVSW-6160 Support building tensorflowlite 2.5 through cmake Signed-off-by: Keith Davis Change-Id: I825f09d008505e701d42b79be936f4da24620c06 --- delegate/CMakeLists.txt | 2 +- delegate/src/DelegateUtils.hpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'delegate') diff --git a/delegate/CMakeLists.txt b/delegate/CMakeLists.txt index 9e4fdd9de3..504256da80 100644 --- a/delegate/CMakeLists.txt +++ b/delegate/CMakeLists.txt @@ -67,7 +67,7 @@ if(NOT ARMNN_SUB_PROJECT) endif() target_link_libraries(armnnDelegate PUBLIC Armnn::Armnn) -## Add TfLite v2.3.1 dependency +## Add TfLite dependency find_package(TfLiteSrc REQUIRED MODULE) find_package(TfLite REQUIRED MODULE) diff --git a/delegate/src/DelegateUtils.hpp b/delegate/src/DelegateUtils.hpp index 8c7ba25e15..e408dba138 100644 --- a/delegate/src/DelegateUtils.hpp +++ b/delegate/src/DelegateUtils.hpp @@ -16,6 +16,7 @@ #include #include #include +#include #include "tensorflow/lite/kernels/kernel_util.h" @@ -294,7 +295,12 @@ TfLiteStatus FusedActivation(TfLiteContext* tfLiteContext, activationDesc.m_Function = armnn::ActivationFunction::ReLu; break; } +// The name of kTfLiteActRelu1 changed after TF Lite v2.3 +#if TF_MAJOR_VERSION > 2 || (TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION > 3) + case kTfLiteActReluN1To1: +#else case kTfLiteActRelu1: +#endif { activationDesc.m_Function = armnn::ActivationFunction::BoundedReLu; activationDesc.m_A = 1.0f; -- cgit v1.2.1