diff options
-rw-r--r-- | delegate/CMakeLists.txt | 2 | ||||
-rw-r--r-- | delegate/src/DelegateUtils.hpp | 6 |
2 files changed, 7 insertions, 1 deletions
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 <tensorflow/lite/c/builtin_op_data.h> #include <tensorflow/lite/c/common.h> #include <tensorflow/lite/minimal_logging.h> +#include <tensorflow/lite/version.h> #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; |