From 07169c8cc8b73ba5f3550cb0e8688de73d438c7e Mon Sep 17 00:00:00 2001 From: Mike Kelly Date: Wed, 2 Aug 2023 13:23:09 +0100 Subject: 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 Change-Id: Iac567486d1f91c0a99b77ed8963f6b6ca26b0b59 --- delegate/classic/src/Pooling.hpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'delegate/classic/src/Pooling.hpp') diff --git a/delegate/classic/src/Pooling.hpp b/delegate/classic/src/Pooling.hpp index 50e944effc..f61a1a27d2 100644 --- a/delegate/classic/src/Pooling.hpp +++ b/delegate/classic/src/Pooling.hpp @@ -117,7 +117,8 @@ TfLiteStatus VisitPooling2dOperator(DelegateData& delegateData, return isSupported ? kTfLiteOk : kTfLiteError; } - armnn::IConnectableLayer* poolingLayer = delegateData.m_Network->AddPooling2dLayer(descriptor); + auto layerName = GetLayerName(armnn::LayerType::Pooling2d, nodeIndex); + armnn::IConnectableLayer* poolingLayer = delegateData.m_Network->AddPooling2dLayer(descriptor, layerName.c_str()); poolingLayer->SetBackendId(setBackend); ARMNN_ASSERT(poolingLayer != nullptr); @@ -125,18 +126,18 @@ TfLiteStatus VisitPooling2dOperator(DelegateData& delegateData, outputSlot.SetTensorInfo(outputTensorInfo); // try to connect the Constant Inputs if there are any - if(ProcessInputs(poolingLayer,delegateData, tfLiteContext, tfLiteNode) != kTfLiteOk ) + if (ProcessInputs(poolingLayer, delegateData, tfLiteContext, tfLiteNode, nodeIndex) != kTfLiteOk) { return kTfLiteError; } - if(Connect(poolingLayer, tfLiteNode, delegateData) != kTfLiteOk) + if (Connect(poolingLayer, tfLiteNode, delegateData) != kTfLiteOk) { return kTfLiteError; } // Check and create activation - return FusedActivation(tfLiteContext, tfLiteNode, activationType, poolingLayer, 0, delegateData); + return FusedActivation(tfLiteContext, tfLiteNode, activationType, poolingLayer, 0, delegateData, nodeIndex); } TfLiteStatus VisitPooling3dOperator(DelegateData& delegateData, @@ -302,6 +303,7 @@ TfLiteStatus VisitPooling3dOperator(DelegateData& delegateData, } // Create the Layer + auto layerName = GetLayerName(armnn::LayerType::Pooling3d, nodeIndex); armnn::IConnectableLayer* poolingLayer = delegateData.m_Network->AddPooling3dLayer(descriptor); poolingLayer->SetBackendId(setBackend); ARMNN_ASSERT(poolingLayer != nullptr); @@ -311,17 +313,17 @@ TfLiteStatus VisitPooling3dOperator(DelegateData& delegateData, outputSlot.SetTensorInfo(outputTensorInfo); // try to connect the Constant Inputs if there are any - if(ProcessInputs(poolingLayer,delegateData, tfLiteContext, tfLiteNode) != kTfLiteOk ) + if (ProcessInputs(poolingLayer, delegateData, tfLiteContext, tfLiteNode, nodeIndex) != kTfLiteOk) { return kTfLiteError; } - if(Connect(poolingLayer, tfLiteNode, delegateData) != kTfLiteOk) + if (Connect(poolingLayer, tfLiteNode, delegateData) != kTfLiteOk) { return kTfLiteError; } - return FusedActivation(tfLiteContext, tfLiteNode, activationType, poolingLayer, 0, delegateData); + return FusedActivation(tfLiteContext, tfLiteNode, activationType, poolingLayer, 0, delegateData, nodeIndex); } } // namespace armnnDelegate -- cgit v1.2.1