diff options
author | Aron Virginas-Tar <Aron.Virginas-Tar@arm.com> | 2019-10-23 17:38:17 +0100 |
---|---|---|
committer | Áron Virginás-Tar <aron.virginas-tar@arm.com> | 2019-10-24 14:47:31 +0000 |
commit | c975f9295e076febd4ecd45c9174d54f7327b3cc (patch) | |
tree | a712ed96879644a720a94cde01d927300ee5af17 /include/armnnTfLiteParser/ITfLiteParser.hpp | |
parent | 7bbdf9db051f40377a284a28375816e60349376d (diff) | |
download | armnn-c975f9295e076febd4ecd45c9174d54f7327b3cc.tar.gz |
IVGCVSW-4007 Add StandInLayer for unsupported operations in TfLiteParser
* Fixed bug in custom operator support that caused all custom operators
to be parsed as a DetectionPostProcessLayer
* Added support for handling unsupported operators (built-in or custom)
by replacing them with a StandInLayer in the generated network
* Added options to TfLiteParser to control whether we want to use
StandInLayers when we encounter unsupported operators, or we prefer
to throw a ParserException as until now
Signed-off-by: Aron Virginas-Tar <Aron.Virginas-Tar@arm.com>
Change-Id: I125a63016c7c510b1fdde6033842db4f276718c4
Diffstat (limited to 'include/armnnTfLiteParser/ITfLiteParser.hpp')
-rw-r--r-- | include/armnnTfLiteParser/ITfLiteParser.hpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/include/armnnTfLiteParser/ITfLiteParser.hpp b/include/armnnTfLiteParser/ITfLiteParser.hpp index 36b9246ee5..de1eae7635 100644 --- a/include/armnnTfLiteParser/ITfLiteParser.hpp +++ b/include/armnnTfLiteParser/ITfLiteParser.hpp @@ -8,6 +8,7 @@ #include "armnn/NetworkFwd.hpp" #include "armnn/Tensor.hpp" #include "armnn/INetwork.hpp" +#include "armnn/Optional.hpp" #include <memory> #include <map> @@ -24,8 +25,16 @@ using ITfLiteParserPtr = std::unique_ptr<ITfLiteParser, void(*)(ITfLiteParser* p class ITfLiteParser { public: - static ITfLiteParser* CreateRaw(); - static ITfLiteParserPtr Create(); + struct TfLiteParserOptions + { + TfLiteParserOptions() + : m_StandInLayerForUnsupported(false) {} + + bool m_StandInLayerForUnsupported; + }; + + static ITfLiteParser* CreateRaw(const armnn::Optional<TfLiteParserOptions>& options = armnn::EmptyOptional()); + static ITfLiteParserPtr Create(const armnn::Optional<TfLiteParserOptions>& options = armnn::EmptyOptional()); static void Destroy(ITfLiteParser* parser); /// Create the network from a flatbuffers binary file on disk |