From a280650509c4fbaa2508cdbc42e31f5a1805bd2a Mon Sep 17 00:00:00 2001 From: Mike Kelly Date: Thu, 3 Aug 2023 10:42:11 +0100 Subject: 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 Change-Id: Iadcc21646d0b6fcc2c524d6239211ad3af6b6577 --- delegate/opaque/src/BatchSpace.hpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'delegate/opaque/src/BatchSpace.hpp') diff --git a/delegate/opaque/src/BatchSpace.hpp b/delegate/opaque/src/BatchSpace.hpp index c760a14f5e..00e270558e 100644 --- a/delegate/opaque/src/BatchSpace.hpp +++ b/delegate/opaque/src/BatchSpace.hpp @@ -119,7 +119,8 @@ TfLiteStatus VisitBatchToSpaceNdOperator(DelegateData& delegateData, } // Add a BatchToSpace layer - armnn::IConnectableLayer* layer = delegateData.m_Network->AddBatchToSpaceNdLayer(descriptor); + auto layerName = GetName(armnn::LayerType::BatchToSpaceNd, nodeIndex); + armnn::IConnectableLayer* layer = delegateData.m_Network->AddBatchToSpaceNdLayer(descriptor, layerName.c_str()); layer->SetBackendId(setBackend); ARMNN_ASSERT(layer != nullptr); @@ -127,7 +128,7 @@ TfLiteStatus VisitBatchToSpaceNdOperator(DelegateData& delegateData, outputSlot.SetTensorInfo(outputTensorInfo); // try to connect the Constant Inputs if there are any - if(ProcessInputs(layer,delegateData, tfLiteContext, tfLiteNode) != kTfLiteOk ) + if (ProcessInputs(layer, delegateData, tfLiteContext, tfLiteNode, nodeIndex) != kTfLiteOk) { return kTfLiteError; } @@ -244,7 +245,8 @@ TfLiteStatus VisitSpaceToBatchNdOperator(DelegateData& delegateData, } // Add a SpaceToBatch layer - armnn::IConnectableLayer* layer = delegateData.m_Network->AddSpaceToBatchNdLayer(descriptor); + auto layerName = GetName(armnn::LayerType::SpaceToBatchNd, nodeIndex); + armnn::IConnectableLayer* layer = delegateData.m_Network->AddSpaceToBatchNdLayer(descriptor, layerName.c_str()); layer->SetBackendId(setBackend); ARMNN_ASSERT(layer != nullptr); @@ -252,7 +254,7 @@ TfLiteStatus VisitSpaceToBatchNdOperator(DelegateData& delegateData, outputSlot.SetTensorInfo(outputTensorInfo); // try to connect the Constant Inputs if there are any - if(ProcessInputs(layer,delegateData, tfLiteContext, tfLiteNode) != kTfLiteOk ) + if (ProcessInputs(layer, delegateData, tfLiteContext, tfLiteNode, nodeIndex) != kTfLiteOk) { return kTfLiteError; } -- cgit v1.2.1