From 8cfd059026dafe65977ddab63350763657cb12c2 Mon Sep 17 00:00:00 2001 From: Teresa Charlin Date: Tue, 23 Apr 2024 16:22:47 +0100 Subject: IVGCVSW-8206 In TOSACommon, modify the way the Unique name for the inputs were generated. * input_ * constant_ * intermediate_ * output_ Input and constant do not need output slot as input layers as well as constants only have one output slot, therefore with the GUID is enough to make them unique. This was the case for constants, but for inputs we were adding the input slot, which is not needed. Signed-off-by: Teresa Charlin Signed-off-by: Cathal Corbett Change-Id: I07393fc60f3135337b59a9780aa3a263a995fc9c --- .../tosaCommon/operatorMappings/ElementwiseUnaryOperator.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/backends/tosaCommon/operatorMappings/ElementwiseUnaryOperator.cpp') diff --git a/src/backends/tosaCommon/operatorMappings/ElementwiseUnaryOperator.cpp b/src/backends/tosaCommon/operatorMappings/ElementwiseUnaryOperator.cpp index 02dddab8bc..d0eac0b4f4 100644 --- a/src/backends/tosaCommon/operatorMappings/ElementwiseUnaryOperator.cpp +++ b/src/backends/tosaCommon/operatorMappings/ElementwiseUnaryOperator.cpp @@ -10,7 +10,7 @@ TosaSerializationBasicBlock* ConvertElementwiseUnaryOperator(const Layer* layer, const std::vector& outputs, const ElementwiseUnaryDescriptor* unaryDescriptor) { - std::string input0Name = std::string("input0_"); + std::string input0Name = std::string("input_"); std::string outputName = std::string("output0_"); std::string blockName = std::string("Op_ELEMENTWISEUNARY_block_") + GetUniqueTosaMappingID(); @@ -19,12 +19,8 @@ TosaSerializationBasicBlock* ConvertElementwiseUnaryOperator(const Layer* layer, // using the previous and following layers so the graph is connected correctly. For validation this doesn't matter. if(layer != nullptr) { - // Get the layer connected to the input slot and determine unique the tensor name. - Layer& connectedLayer0 = layer->GetInputSlot(0).GetConnectedOutputSlot()->GetOwningLayer(); - input0Name = GenerateUniqueName(connectedLayer0, 0); - - // Determine unique output tensor name. - outputName = GenerateUniqueOutputName(*layer, 0); + input0Name = GenerateUniqueInputName(layer->GetInputSlot(0)); + outputName = GenerateUniqueOutputName(*layer); } TosaSerializationOperator* op = nullptr; @@ -48,7 +44,7 @@ TosaSerializationBasicBlock* ConvertElementwiseUnaryOperator(const Layer* layer, // Only add input tensor if connected layer is an input layer. // As intermediate or constant tensors will be created separately. // There also can't be duplicate tensor. - if(input0Name.find("input0_") != std::string::npos) + if(input0Name.find("input_") != std::string::npos) { std::vector inputShape0 = GetTosaTensorShape(inputs[0]->GetShape()); DType inputDType0 = ArmNNToDType(inputs[0]->GetDataType()); -- cgit v1.2.1