diff options
Diffstat (limited to 'src/armnnTfLiteParser/TfLiteParser.cpp')
-rw-r--r-- | src/armnnTfLiteParser/TfLiteParser.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/armnnTfLiteParser/TfLiteParser.cpp b/src/armnnTfLiteParser/TfLiteParser.cpp index 5075da41c2..8b2d7a25bc 100644 --- a/src/armnnTfLiteParser/TfLiteParser.cpp +++ b/src/armnnTfLiteParser/TfLiteParser.cpp @@ -2444,8 +2444,10 @@ void TfLiteParserImpl::ParseSub(size_t subgraphIndex, size_t operatorIndex) auto inputTensorIndexes = AsUnsignedVector(GetInputTensorIds(m_Model, subgraphIndex, operatorIndex)); RegisterInputSlots(subgraphIndex, operatorIndex, layer, {inputTensorIndexes[0], inputTensorIndexes[1]}); - - layer = AddFusedActivationLayer(layer, 0, options->fused_activation_function); + if (options) + { + layer = AddFusedActivationLayer(layer, 0, options->fused_activation_function); + } auto outputTensorIndexes = AsUnsignedVector(GetOutputTensorIds(m_Model, subgraphIndex, operatorIndex)); RegisterOutputSlots(subgraphIndex, operatorIndex, layer, {outputTensorIndexes[0]}); @@ -2476,7 +2478,10 @@ void TfLiteParserImpl::ParseDiv(size_t subgraphIndex, size_t operatorIndex) auto inputTensorIndexes = AsUnsignedVector(GetInputTensorIds(m_Model, subgraphIndex, operatorIndex)); RegisterInputSlots(subgraphIndex, operatorIndex, layer, {inputTensorIndexes[0], inputTensorIndexes[1]}); - layer = AddFusedActivationLayer(layer, 0, options->fused_activation_function); + if (options) + { + layer = AddFusedActivationLayer(layer, 0, options->fused_activation_function); + } auto outputTensorIndexes = AsUnsignedVector(GetOutputTensorIds(m_Model, subgraphIndex, operatorIndex)); RegisterOutputSlots(subgraphIndex, operatorIndex, layer, {outputTensorIndexes[0]}); @@ -2535,7 +2540,10 @@ void TfLiteParserImpl::ParseAdd(size_t subgraphIndex, size_t operatorIndex) auto inputTensorIndexes = AsUnsignedVector(GetInputTensorIds(m_Model, subgraphIndex, operatorIndex)); RegisterInputSlots(subgraphIndex, operatorIndex, layer, {inputTensorIndexes[0], inputTensorIndexes[1]}); - layer = AddFusedActivationLayer(layer, 0, options->fused_activation_function); + if (options) + { + layer = AddFusedActivationLayer(layer, 0, options->fused_activation_function); + } auto outputTensorIndexes = AsUnsignedVector(GetOutputTensorIds(m_Model, subgraphIndex, operatorIndex)); RegisterOutputSlots(subgraphIndex, operatorIndex, layer, {outputTensorIndexes[0]}); @@ -2566,7 +2574,10 @@ void TfLiteParserImpl::ParseMul(size_t subgraphIndex, size_t operatorIndex) auto inputTensorIndexes = AsUnsignedVector(GetInputTensorIds(m_Model, subgraphIndex, operatorIndex)); RegisterInputSlots(subgraphIndex, operatorIndex, layer, {inputTensorIndexes[0], inputTensorIndexes[1]}); - layer = AddFusedActivationLayer(layer, 0, options->fused_activation_function); + if (options) + { + layer = AddFusedActivationLayer(layer, 0, options->fused_activation_function); + } auto outputTensorIndexes = AsUnsignedVector(GetOutputTensorIds(m_Model, subgraphIndex, operatorIndex)); RegisterOutputSlots(subgraphIndex, operatorIndex, layer, {outputTensorIndexes[0]}); |