aboutsummaryrefslogtreecommitdiff
path: root/delegate/classic/src/Quantization.hpp
diff options
context:
space:
mode:
authorMike Kelly <mike.kelly@arm.com>2023-08-02 13:23:09 +0100
committerNikhil Raj Arm <nikhil.raj@arm.com>2023-08-03 20:29:40 +0000
commit07169c8cc8b73ba5f3550cb0e8688de73d438c7e (patch)
tree5c9447a52ac676268756a3421a0a8e933321e60a /delegate/classic/src/Quantization.hpp
parentb179382bcb4944d0137aa9799c3c56a2102ecda2 (diff)
downloadarmnn-07169c8cc8b73ba5f3550cb0e8688de73d438c7e.tar.gz
MLCE-1092 Added layerNames to classic delegate
* All layers added through the classic delegate will have a name that includes the nodeIndex from the tflite model. * Added utilities to ClassicDelegateUtils to get the names for the layers. Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: Iac567486d1f91c0a99b77ed8963f6b6ca26b0b59
Diffstat (limited to 'delegate/classic/src/Quantization.hpp')
-rw-r--r--delegate/classic/src/Quantization.hpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/delegate/classic/src/Quantization.hpp b/delegate/classic/src/Quantization.hpp
index f1192960e4..8291854383 100644
--- a/delegate/classic/src/Quantization.hpp
+++ b/delegate/classic/src/Quantization.hpp
@@ -70,7 +70,8 @@ TfLiteStatus VisitDequantizeOperator(DelegateData& delegateData,
return isSupported ? kTfLiteOk : kTfLiteError;
}
- armnn::IConnectableLayer* dequantizeLayer = delegateData.m_Network->AddDequantizeLayer();
+ auto layerName = GetLayerName(armnn::LayerType::Dequantize, nodeIndex);
+ armnn::IConnectableLayer* dequantizeLayer = delegateData.m_Network->AddDequantizeLayer(layerName.c_str());
dequantizeLayer->SetBackendId(setBackend);
ARMNN_ASSERT(dequantizeLayer != nullptr);
@@ -80,7 +81,8 @@ TfLiteStatus VisitDequantizeOperator(DelegateData& delegateData,
auto inputsTensorsProcess = ProcessInputs(dequantizeLayer,
delegateData,
tfLiteContext,
- tfLiteNode);
+ tfLiteNode,
+ nodeIndex);
if (inputsTensorsProcess == kTfLiteError)
{
return inputsTensorsProcess;
@@ -152,7 +154,8 @@ TfLiteStatus VisitQuantizeOperator(DelegateData& delegateData,
return isSupported ? kTfLiteOk : kTfLiteError;
}
- armnn::IConnectableLayer* quantizeLayer = delegateData.m_Network->AddQuantizeLayer();
+ auto layerName = GetLayerName(armnn::LayerType::Quantize, nodeIndex);
+ armnn::IConnectableLayer* quantizeLayer = delegateData.m_Network->AddQuantizeLayer(layerName.c_str());
quantizeLayer->SetBackendId(setBackend);
ARMNN_ASSERT(quantizeLayer != nullptr);
@@ -160,7 +163,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;
}