diff options
author | Teresa Charlin <teresa.charlinreyes@arm.com> | 2023-09-15 15:19:21 +0100 |
---|---|---|
committer | TeresaARM <teresa.charlinreyes@arm.com> | 2023-09-29 11:05:29 +0000 |
commit | 077cddbe9e956c6740557a9add499385f235c384 (patch) | |
tree | ae1816443bf4f85c7968aa3e542ef2b5e5400e7e /src/armnnTfLiteParser/TfLiteParser.cpp | |
parent | 9a45e8fab86f7078d22360794058f5550413df78 (diff) | |
download | armnn-077cddbe9e956c6740557a9add499385f235c384.tar.gz |
IVGCVSW-8055 Add support for GELU activation function.
* Add support to CpuRef, CpuAcc and GpuAcc
* Add support to tflite parser, classic and opaque tflite delegates
* Add support to serializer and deserializer
* Add Unit tests
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com>
Change-Id: Ibc60ef2ef2a051e6d9af6e15d24c46316ec19de4
Diffstat (limited to 'src/armnnTfLiteParser/TfLiteParser.cpp')
-rw-r--r-- | src/armnnTfLiteParser/TfLiteParser.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/armnnTfLiteParser/TfLiteParser.cpp b/src/armnnTfLiteParser/TfLiteParser.cpp index 3f4f0d811f..c2be54f5f5 100644 --- a/src/armnnTfLiteParser/TfLiteParser.cpp +++ b/src/armnnTfLiteParser/TfLiteParser.cpp @@ -771,6 +771,7 @@ TfLiteParserImpl::TfLiteParserImpl(const Optional<ITfLiteParser::TfLiteParserOpt m_ParserFunctions[tflite::BuiltinOperator_FLOOR_DIV] = &TfLiteParserImpl::ParseFloorDiv; m_ParserFunctions[tflite::BuiltinOperator_FULLY_CONNECTED] = &TfLiteParserImpl::ParseFullyConnected; m_ParserFunctions[tflite::BuiltinOperator_GATHER] = &TfLiteParserImpl::ParseGather; + m_ParserFunctions[tflite::BuiltinOperator_GELU] = &TfLiteParserImpl::ParseGelu; m_ParserFunctions[tflite::BuiltinOperator_GATHER_ND] = &TfLiteParserImpl::ParseGatherNd; m_ParserFunctions[tflite::BuiltinOperator_GREATER] = &TfLiteParserImpl::ParseGreater; m_ParserFunctions[tflite::BuiltinOperator_GREATER_EQUAL] = &TfLiteParserImpl::ParseGreaterOrEqual; @@ -3159,6 +3160,11 @@ void TfLiteParserImpl::ParseHardSwish(size_t subgraphIndex, size_t operatorIndex ParseActivation(subgraphIndex, operatorIndex, ActivationFunction::HardSwish); } +void TfLiteParserImpl::ParseGelu(size_t subgraphIndex, size_t operatorIndex) +{ + ParseActivation(subgraphIndex,operatorIndex,ActivationFunction::Gelu); +} + void TfLiteParserImpl::ParseActivation(size_t subgraphIndex, size_t operatorIndex, ActivationFunction activationType) { CHECK_MODEL(m_Model, subgraphIndex, operatorIndex); @@ -3219,6 +3225,11 @@ void TfLiteParserImpl::ParseActivation(size_t subgraphIndex, size_t operatorInde layerName += fmt::format("HARDSWISH:{}:{}", subgraphIndex, operatorIndex); break; } + case ActivationFunction::Gelu: + { + layerName += fmt::format("GELU:{}:{}", subgraphIndex, operatorIndex); + break; + } default: { throw ParseException( |