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 /src/armnnTfLiteParser/test/ParserFlatbuffersFixture.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 'src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp')
-rw-r--r-- | src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp b/src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp index b20bea247d..0c6428012b 100644 --- a/src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp +++ b/src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp @@ -29,22 +29,27 @@ #include <iostream> using armnnTfLiteParser::ITfLiteParser; -using TensorRawPtr = const tflite::TensorT *; +using armnnTfLiteParser::ITfLiteParserPtr; +using TensorRawPtr = const tflite::TensorT *; struct ParserFlatbuffersFixture { ParserFlatbuffersFixture() : - m_Parser(ITfLiteParser::Create()), + m_Parser(nullptr, &ITfLiteParser::Destroy), m_Runtime(armnn::IRuntime::Create(armnn::IRuntime::CreationOptions())), m_NetworkIdentifier(-1) { + ITfLiteParser::TfLiteParserOptions options; + options.m_StandInLayerForUnsupported = true; + + m_Parser.reset(ITfLiteParser::CreateRaw(armnn::Optional<ITfLiteParser::TfLiteParserOptions>(options))); } std::vector<uint8_t> m_GraphBinary; - std::string m_JsonString; - std::unique_ptr<ITfLiteParser, void (*)(ITfLiteParser *parser)> m_Parser; - armnn::IRuntimePtr m_Runtime; - armnn::NetworkId m_NetworkIdentifier; + std::string m_JsonString; + ITfLiteParserPtr m_Parser; + armnn::IRuntimePtr m_Runtime; + armnn::NetworkId m_NetworkIdentifier; /// If the single-input-single-output overload of Setup() is called, these will store the input and output name /// so they don't need to be passed to the single-input-single-output overload of RunTest(). @@ -346,4 +351,4 @@ void ParserFlatbuffersFixture::RunTest(std::size_t subgraphId, } } } -}
\ No newline at end of file +} |