aboutsummaryrefslogtreecommitdiff
path: root/delegate/opaque/src/Quantization.hpp
diff options
context:
space:
mode:
authorMike Kelly <mike.kelly@arm.com>2023-08-03 10:42:11 +0100
committerTeresaARM <teresa.charlinreyes@arm.com>2023-08-03 22:04:58 +0000
commita280650509c4fbaa2508cdbc42e31f5a1805bd2a (patch)
tree1b60f4a2e6c7719ae873e8bdef2a76bd82c35033 /delegate/opaque/src/Quantization.hpp
parent7d1b1ca5b25a3aaeecebc537e8cbed2ee1ed3337 (diff)
downloadarmnn-a280650509c4fbaa2508cdbc42e31f5a1805bd2a.tar.gz
MLCE-1092 Added layerNames to opaque delegate
* All layers added through the opaque delegate will have a name that includes the nodeIndex from the tflite model. * Added utilities to OpaqueDelegateUtils to get the names for the layers. Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: Iadcc21646d0b6fcc2c524d6239211ad3af6b6577
Diffstat (limited to 'delegate/opaque/src/Quantization.hpp')
-rw-r--r--delegate/opaque/src/Quantization.hpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/delegate/opaque/src/Quantization.hpp b/delegate/opaque/src/Quantization.hpp
index 7a1dd6fd17..d7f5c5c73f 100644
--- a/delegate/opaque/src/Quantization.hpp
+++ b/delegate/opaque/src/Quantization.hpp
@@ -79,7 +79,8 @@ TfLiteStatus VisitDequantizeOperator(DelegateData& delegateData,
return isSupported ? kTfLiteOk : kTfLiteError;
}
- armnn::IConnectableLayer* dequantizeLayer = delegateData.m_Network->AddDequantizeLayer();
+ auto layerName = GetName(armnn::LayerType::Dequantize, nodeIndex);
+ armnn::IConnectableLayer* dequantizeLayer = delegateData.m_Network->AddDequantizeLayer(layerName.c_str());
dequantizeLayer->SetBackendId(setBackend);
ARMNN_ASSERT(dequantizeLayer != nullptr);
@@ -89,7 +90,8 @@ TfLiteStatus VisitDequantizeOperator(DelegateData& delegateData,
auto inputsTensorsProcess = ProcessInputs(dequantizeLayer,
delegateData,
tfLiteContext,
- tfLiteNode);
+ tfLiteNode,
+ nodeIndex);
if (inputsTensorsProcess == kTfLiteError)
{
return inputsTensorsProcess;
@@ -176,7 +178,8 @@ TfLiteStatus VisitQuantizeOperator(DelegateData& delegateData,
return isSupported ? kTfLiteOk : kTfLiteError;
}
- armnn::IConnectableLayer* quantizeLayer = delegateData.m_Network->AddQuantizeLayer();
+ auto layerName = GetName(armnn::LayerType::Quantize, nodeIndex);
+ armnn::IConnectableLayer* quantizeLayer = delegateData.m_Network->AddQuantizeLayer(layerName.c_str());
quantizeLayer->SetBackendId(setBackend);
ARMNN_ASSERT(quantizeLayer != nullptr);
@@ -184,7 +187,7 @@ TfLiteStatus VisitQuantizeOperator(DelegateData& delegateData,
outputSlot.SetTensorInfo(outputTensorInfo);
// try to connect the Constant Inputs if there are any
- if(ProcessInputs(quantizeLayer,delegateData, tfLiteContext, tfLiteNode) != kTfLiteOk )
+ if (ProcessInputs(quantizeLayer, delegateData, tfLiteContext, tfLiteNode, nodeIndex) != kTfLiteOk)
{
return kTfLiteError;
}