diff options
author | Mike Kelly <mike.kelly@arm.com> | 2023-08-02 13:23:09 +0100 |
---|---|---|
committer | Nikhil Raj Arm <nikhil.raj@arm.com> | 2023-08-03 20:29:40 +0000 |
commit | 07169c8cc8b73ba5f3550cb0e8688de73d438c7e (patch) | |
tree | 5c9447a52ac676268756a3421a0a8e933321e60a /delegate/classic/src/Control.hpp | |
parent | b179382bcb4944d0137aa9799c3c56a2102ecda2 (diff) | |
download | armnn-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/Control.hpp')
-rw-r--r-- | delegate/classic/src/Control.hpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/delegate/classic/src/Control.hpp b/delegate/classic/src/Control.hpp index e6779f360a..0adf262c23 100644 --- a/delegate/classic/src/Control.hpp +++ b/delegate/classic/src/Control.hpp @@ -127,7 +127,9 @@ TfLiteStatus VisitConcatenationOperator(DelegateData& delegateData, } // Setup layer and connect. - armnn::IConnectableLayer* concatenationLayer = delegateData.m_Network->AddConcatLayer(concatDescriptor); + auto layerName = GetLayerName(armnn::LayerType::Concat, nodeIndex); + armnn::IConnectableLayer* concatenationLayer = delegateData.m_Network->AddConcatLayer(concatDescriptor, + layerName.c_str()); concatenationLayer->SetBackendId(setBackend); ARMNN_ASSERT(concatenationLayer != nullptr); @@ -135,7 +137,8 @@ TfLiteStatus VisitConcatenationOperator(DelegateData& delegateData, auto inputsTensorsProcess = ProcessInputs(concatenationLayer, delegateData, tfLiteContext, - tfLiteNode); + tfLiteNode, + nodeIndex); if (inputsTensorsProcess == kTfLiteError) { return inputsTensorsProcess; @@ -155,7 +158,7 @@ TfLiteStatus VisitConcatenationOperator(DelegateData& delegateData, } // Check and Create activation - return FusedActivation(tfLiteContext, tfLiteNode, activationType, concatenationLayer, 0, delegateData); + return FusedActivation(tfLiteContext, tfLiteNode, activationType, concatenationLayer, 0, delegateData, nodeIndex); } TfLiteStatus VisitMeanOperator(DelegateData& delegateData, @@ -271,7 +274,8 @@ TfLiteStatus VisitMeanOperator(DelegateData& delegateData, } // Setup layer and connect. - armnn::IConnectableLayer* meanLayer = delegateData.m_Network->AddMeanLayer(desc); + auto layerName = GetLayerName(armnn::LayerType::Mean, nodeIndex); + armnn::IConnectableLayer* meanLayer = delegateData.m_Network->AddMeanLayer(desc, layerName.c_str()); meanLayer->SetBackendId(setBackend); ARMNN_ASSERT(meanLayer != nullptr); @@ -279,7 +283,7 @@ TfLiteStatus VisitMeanOperator(DelegateData& delegateData, outputSlot.SetTensorInfo(outputTensorInfo); // try to connect the Constant Inputs if there are any - if(ProcessInputs(meanLayer,delegateData, tfLiteContext, tfLiteNode) != kTfLiteOk ) + if (ProcessInputs(meanLayer, delegateData, tfLiteContext, tfLiteNode, nodeIndex) != kTfLiteOk) { return kTfLiteError; } |