From 76d0c4c6ff4f2dc71f9d3a73ad6f051d2562135b Mon Sep 17 00:00:00 2001 From: Matthew Sloyan Date: Thu, 7 Sep 2023 14:48:56 +0100 Subject: IVGCVSW-7954 Upgrade Arm NN to Tensorflow 2.14 * Added initializers for async_kernel and inplace_operator during Classic Delegate registration. * Updated failing Delegate unit tests. * Updated experimental Opaque Delegate header paths. * Updated libraries in FindTfLite.cmake for building with a debug TensorFlow build. * Update get_tensorflow.sh to TensorFlow 2.14 Signed-off-by: Matthew Sloyan Signed-off-by: Idriss Chaouch Change-Id: I084d54bcd1cd941d7cab8122bc244d94821ce6fc --- delegate/classic/src/armnn_delegate.cpp | 2 ++ delegate/classic/src/test/ArmnnClassicDelegateTest.cpp | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'delegate/classic/src') diff --git a/delegate/classic/src/armnn_delegate.cpp b/delegate/classic/src/armnn_delegate.cpp index c428d46d87..c8f57d6cc3 100644 --- a/delegate/classic/src/armnn_delegate.cpp +++ b/delegate/classic/src/armnn_delegate.cpp @@ -124,6 +124,8 @@ TfLiteStatus DoPrepare(TfLiteContext* tfLiteContext, TfLiteDelegate* tfLiteDeleg .custom_name = "TfLiteArmNnDelegate", .version = 1, .registration_external = nullptr, + .async_kernel = nullptr, + .inplace_operator = 0 }; const TfLiteStatus status = diff --git a/delegate/classic/src/test/ArmnnClassicDelegateTest.cpp b/delegate/classic/src/test/ArmnnClassicDelegateTest.cpp index 409b769273..e83f47f244 100644 --- a/delegate/classic/src/test/ArmnnClassicDelegateTest.cpp +++ b/delegate/classic/src/test/ArmnnClassicDelegateTest.cpp @@ -31,9 +31,13 @@ TEST_CASE ("ArmnnDelegate Registered") tfLiteInterpreter->SetTensorParametersReadWrite(1, kTfLiteFloat32, "input2", {1,2,2,1}, TfLiteQuantization()); tfLiteInterpreter->SetTensorParametersReadWrite(2, kTfLiteFloat32, "output", {1,2,2,1}, TfLiteQuantization()); + TfLiteAddParams* addParams = reinterpret_cast(malloc(sizeof(TfLiteAddParams))); + addParams->activation = kTfLiteActNone; + addParams->pot_scale_int16 = false; + tflite::ops::builtin::BuiltinOpResolver opResolver; const TfLiteRegistration* opRegister = opResolver.FindOp(BuiltinOperator_ADD, 1); - tfLiteInterpreter->AddNodeWithParameters({0, 1}, {2}, "", 0, nullptr, opRegister); + tfLiteInterpreter->AddNodeWithParameters({0, 1}, {2}, "", 0, addParams, opRegister); // Create the Armnn Delegate std::vector backends = { armnn::Compute::CpuRef }; @@ -69,9 +73,13 @@ TEST_CASE ("ArmnnDelegateOptimizerOptionsRegistered") tfLiteInterpreter->SetTensorParametersReadWrite(1, kTfLiteFloat32, "input2", {1,2,2,1}, TfLiteQuantization()); tfLiteInterpreter->SetTensorParametersReadWrite(2, kTfLiteFloat32, "output", {1,2,2,1}, TfLiteQuantization()); + TfLiteAddParams* addParams = reinterpret_cast(malloc(sizeof(TfLiteAddParams))); + addParams->activation = kTfLiteActNone; + addParams->pot_scale_int16 = false; + tflite::ops::builtin::BuiltinOpResolver opResolver; const TfLiteRegistration* opRegister = opResolver.FindOp(BuiltinOperator_ADD, 1); - tfLiteInterpreter->AddNodeWithParameters({0, 1}, {2}, "", 0, nullptr, opRegister); + tfLiteInterpreter->AddNodeWithParameters({0, 1}, {2}, "", 0, addParams, opRegister); // Create the Armnn Delegate std::vector backends = { armnn::Compute::CpuRef }; -- cgit v1.2.1