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 --- .../operatorMappings/AvgPool2DIgnoreValueOperator.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/backends/tosaCommon/operatorMappings/AvgPool2DIgnoreValueOperator.cpp') diff --git a/src/backends/tosaCommon/operatorMappings/AvgPool2DIgnoreValueOperator.cpp b/src/backends/tosaCommon/operatorMappings/AvgPool2DIgnoreValueOperator.cpp index a7ca873831..bd198e2d5a 100644 --- a/src/backends/tosaCommon/operatorMappings/AvgPool2DIgnoreValueOperator.cpp +++ b/src/backends/tosaCommon/operatorMappings/AvgPool2DIgnoreValueOperator.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2024 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -10,7 +10,7 @@ TosaSerializationBasicBlock* ConvertAvgPool2DIgnoreValueToTosaOperator(const Lay const std::vector& outputs, const Pooling2dDescriptor* poolDescriptor) { - std::string padInputName = std::string("input0_"); + std::string padInputName = std::string("input_"); std::string padOutputName = std::string("intermediate0_") + GetUniqueTosaMappingID(); std::string poolOutputName = std::string("output0_"); std::string blockName = std::string("Op_AVG_POOL2D_block_") + GetUniqueTosaMappingID(); @@ -19,12 +19,8 @@ TosaSerializationBasicBlock* ConvertAvgPool2DIgnoreValueToTosaOperator(const Lay // using the previous and following layers so the graph is connected correctly. For validation this doesn't matter. if(layer != nullptr) { - // Get the layers connected to the input slots and determine unique tensors names. - Layer& connectedInputLayer = layer->GetInputSlot(0).GetConnectedOutputSlot()->GetOwningLayer(); - padInputName = GenerateUniqueName(connectedInputLayer, 0); - - // Determine unique output tensor name. - poolOutputName = GenerateUniqueOutputName(*layer, 0); + padInputName = GenerateUniqueInputName(layer->GetInputSlot(0)); + poolOutputName = GenerateUniqueOutputName(*layer); } std::vector paddings; @@ -81,7 +77,7 @@ TosaSerializationBasicBlock* ConvertAvgPool2DIgnoreValueToTosaOperator(const Lay // Only add input tensors if connected layer is an input layer. // As intermediate or constant tensors will be created separately. // There also can't be duplicate tensor. - if(padInputName.find("input0_") != std::string::npos) + if(padInputName.find("input_") != std::string::npos) { tensors.push_back(new TosaSerializationTensor(padInputName, inputShape, inputDType, {})); } -- cgit v1.2.1