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 <mike.kelly@arm.com>
Change-Id: Iadcc21646d0b6fcc2c524d6239211ad3af6b6577
diff --git a/delegate/opaque/src/Softmax.hpp b/delegate/opaque/src/Softmax.hpp
index 8792761..31fe1c9 100644
--- a/delegate/opaque/src/Softmax.hpp
+++ b/delegate/opaque/src/Softmax.hpp
@@ -125,6 +125,8 @@
}
armnn::IConnectableLayer* softmaxLayer = nullptr;
+ auto layerName = GetName(armnn::LayerType::Softmax, nodeIndex);
+
switch(tfliteSoftmaxOperatorCode)
{
case kTfLiteBuiltinSoftmax:
@@ -132,13 +134,13 @@
armnn::SoftmaxDescriptor descriptor;
auto* nodeParameters = reinterpret_cast<TfLiteSoftmaxParams*>(TfLiteOpaqueNodeGetBuiltinData(tfLiteNode));
descriptor.m_Beta = nodeParameters->beta;
- softmaxLayer = delegateData.m_Network->AddSoftmaxLayer(descriptor);
+ softmaxLayer = delegateData.m_Network->AddSoftmaxLayer(descriptor, layerName.c_str());
break;
}
case kTfLiteBuiltinLogSoftmax:
{
armnn::LogSoftmaxDescriptor descriptor;
- softmaxLayer = delegateData.m_Network->AddLogSoftmaxLayer(descriptor);
+ softmaxLayer = delegateData.m_Network->AddLogSoftmaxLayer(descriptor, layerName.c_str());
break;
}
default:
@@ -150,7 +152,7 @@
outputSlot.SetTensorInfo(outputTensorInfo);
// try to connect the Constant Inputs if there are any
- if(ProcessInputs(softmaxLayer,delegateData, tfLiteContext, tfLiteNode) != kTfLiteOk )
+ if (ProcessInputs(softmaxLayer, delegateData, tfLiteContext, tfLiteNode, nodeIndex) != kTfLiteOk)
{
return kTfLiteError;
}