aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCathal Corbett <cathal.corbett@arm.com>2022-05-25 11:21:11 +0100
committerCathal Corbett <cathal.corbett@arm.com>2022-08-03 10:30:01 +0000
commite126be953e227351c246db138520fd567866a021 (patch)
treea555c3fc9ecb25e0cbb15066a943f5baad2a7197
parentde41b61517cad6bbb6beb4445d051fa23fcbc7a2 (diff)
downloadarmnn-e126be953e227351c246db138520fd567866a021.tar.gz
Fix '#if defined(ARMNN_POST_TFLITE_2_3)' in TfLiteParser Conv3D test.
Signed-off-by: Cathal Corbett <cathal.corbett@arm.com> Change-Id: I5c68b81a67fc2b5a33cf62753351440564bb868e
-rw-r--r--delegate/include/armnn_delegate.hpp4
-rw-r--r--src/armnnTfLiteParser/TfLiteParser.cpp4
-rw-r--r--src/armnnTfLiteParser/TfLiteParser.hpp2
-rw-r--r--src/armnnTfLiteParser/test/Conv3D.cpp2
4 files changed, 8 insertions, 4 deletions
diff --git a/delegate/include/armnn_delegate.hpp b/delegate/include/armnn_delegate.hpp
index 8aaf255a9d..79ab4bf79c 100644
--- a/delegate/include/armnn_delegate.hpp
+++ b/delegate/include/armnn_delegate.hpp
@@ -17,6 +17,10 @@
#define ARMNN_POST_TFLITE_2_3
#endif
+#if TF_MAJOR_VERSION > 2 || (TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION > 4)
+#define ARMNN_POST_TFLITE_2_4
+#endif
+
#if TF_MAJOR_VERSION > 2 || (TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION > 5)
#define ARMNN_POST_TFLITE_2_5
#endif
diff --git a/src/armnnTfLiteParser/TfLiteParser.cpp b/src/armnnTfLiteParser/TfLiteParser.cpp
index 91420ab302..33567953a2 100644
--- a/src/armnnTfLiteParser/TfLiteParser.cpp
+++ b/src/armnnTfLiteParser/TfLiteParser.cpp
@@ -684,7 +684,7 @@ TfLiteParserImpl::TfLiteParserImpl(const Optional<ITfLiteParser::TfLiteParserOpt
m_ParserFunctions[tflite::BuiltinOperator_CONCATENATION] = &TfLiteParserImpl::ParseConcatenation;
m_ParserFunctions[tflite::BuiltinOperator_CONV_2D] = &TfLiteParserImpl::ParseConv2D;
// Conv3D support was added in TF 2.5, so for backwards compatibility a hash define is needed.
- #if defined(ARMNN_POST_TFLITE_2_3)
+ #if defined(ARMNN_POST_TFLITE_2_4)
m_ParserFunctions[tflite::BuiltinOperator_CONV_3D] = &TfLiteParserImpl::ParseConv3D;
#endif
m_ParserFunctions[tflite::BuiltinOperator_CUSTOM] = &TfLiteParserImpl::ParseCustomOperator;
@@ -1160,7 +1160,7 @@ void TfLiteParserImpl::ParseConv2D(size_t subgraphIndex, size_t operatorIndex)
}
// Conv3D support was added in TF 2.5, so for backwards compatibility a hash define is needed.
-#if defined(ARMNN_POST_TFLITE_2_3)
+#if defined(ARMNN_POST_TFLITE_2_4)
void TfLiteParserImpl::ParseConv3D(size_t subgraphIndex, size_t operatorIndex)
{
CHECK_MODEL(m_Model, subgraphIndex, operatorIndex);
diff --git a/src/armnnTfLiteParser/TfLiteParser.hpp b/src/armnnTfLiteParser/TfLiteParser.hpp
index e742d30521..49744a0484 100644
--- a/src/armnnTfLiteParser/TfLiteParser.hpp
+++ b/src/armnnTfLiteParser/TfLiteParser.hpp
@@ -120,7 +120,7 @@ private:
void ParseConcatenation(size_t subgraphIndex, size_t operatorIndex);
void ParseConv2D(size_t subgraphIndex, size_t operatorIndex);
// Conv3D support was added in TF 2.5, so for backwards compatibility a hash define is needed.
- #if defined(ARMNN_POST_TFLITE_2_3)
+ #if defined(ARMNN_POST_TFLITE_2_4)
void ParseConv3D(size_t subgraphIndex, size_t operatorIndex);
#endif
void ParseDepthToSpace(size_t subgraphIndex, size_t operatorIndex);
diff --git a/src/armnnTfLiteParser/test/Conv3D.cpp b/src/armnnTfLiteParser/test/Conv3D.cpp
index dd55aea211..53332107ff 100644
--- a/src/armnnTfLiteParser/test/Conv3D.cpp
+++ b/src/armnnTfLiteParser/test/Conv3D.cpp
@@ -7,7 +7,7 @@
#include <sstream>
// Conv3D support was added in TF 2.5, so for backwards compatibility a hash define is needed.
-#if defined(ARMNN_POST_TFLITE_2_3)
+#if defined(ARMNN_POST_TFLITE_2_4)
TEST_SUITE("TensorflowLiteParser_Conv3D")
{
struct SimpleConv3DFixture : public ParserFlatbuffersFixture