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
diff --git a/delegate/classic/src/Unpack.hpp b/delegate/classic/src/Unpack.hpp
index 685293b..2cd3256 100644
--- a/delegate/classic/src/Unpack.hpp
+++ b/delegate/classic/src/Unpack.hpp
@@ -171,10 +171,8 @@
return isSupported ? kTfLiteOk : kTfLiteError;
};
- std::string splitterLayerName("Unpack Splitter");
-
- armnn::IConnectableLayer* splitterLayer = delegateData.m_Network->AddSplitterLayer(splitDesc,
- splitterLayerName.c_str());
+ auto layerName = GetLayerName(armnn::LayerType::Splitter, nodeIndex, "Unpack");
+ armnn::IConnectableLayer* splitterLayer = delegateData.m_Network->AddSplitterLayer(splitDesc, layerName.c_str());
splitterLayer->SetBackendId(setBackendSplit);
ARMNN_ASSERT(splitterLayer != nullptr);
@@ -189,9 +187,9 @@
// Create reshape to remove the unpacked dimension for unpack operator of each output from Splitter.
for (unsigned int outputIndex = 0; outputIndex < splitterLayer->GetNumOutputSlots(); ++outputIndex)
{
- std::string reshapeLayerName("Unpack Reshape");
+ auto reshapeName = GetLayerName(armnn::LayerType::Reshape, nodeIndex, "Unpack");
armnn::IConnectableLayer* reshapeLayer = delegateData.m_Network->AddReshapeLayer(reshapeDescriptor,
- reshapeLayerName.c_str());
+ reshapeName.c_str());
reshapeLayer->SetBackendId(setBackendReshape);
ARMNN_ASSERT(reshapeLayer != nullptr);