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/ResizeOperator.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/backends/tosaCommon/operatorMappings/ResizeOperator.cpp') diff --git a/src/backends/tosaCommon/operatorMappings/ResizeOperator.cpp b/src/backends/tosaCommon/operatorMappings/ResizeOperator.cpp index 72c7352a65..bb1eabd27b 100644 --- a/src/backends/tosaCommon/operatorMappings/ResizeOperator.cpp +++ b/src/backends/tosaCommon/operatorMappings/ResizeOperator.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2023 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2023-2024 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // // Copyright © 2020, 2023 The TensorFlow Authors. All Rights Reserved. @@ -37,7 +37,7 @@ TosaSerializationBasicBlock* ConvertResizeToTosaOperator(const Layer* layer, throw armnn::InvalidArgumentException("ConvertResizeToTosaOperator: Unsupported Resize method."); } - std::string inputName = std::string("input0_"); + std::string inputName = std::string("input_"); std::string outputName = std::string("output0_"); std::string blockName = std::string("Op_RESIZE_block_") + GetUniqueTosaMappingID(); @@ -45,12 +45,8 @@ TosaSerializationBasicBlock* ConvertResizeToTosaOperator(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 layers connected to the input slots and determine unique tensor names. - Layer& connectedLayer = layer->GetInputSlot(0).GetConnectedOutputSlot()->GetOwningLayer(); - inputName = GenerateUniqueName(connectedLayer, 0); - - // Determine unique output tensor name. - outputName = GenerateUniqueOutputName(*layer, 0); + inputName = GenerateUniqueInputName(layer->GetInputSlot(0)); + outputName = GenerateUniqueOutputName(*layer); } int32_t inputHeight = static_cast(inputs[0]->GetShape()[1]); @@ -149,7 +145,7 @@ TosaSerializationBasicBlock* ConvertResizeToTosaOperator(const Layer* layer, // 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(inputName.find("input0_") != std::string::npos) + if(inputName.find("input_") != std::string::npos) { std::vector inputShape = GetTosaTensorShape(inputs[0]->GetShape()); DType inputDType = ArmNNToDType(inputs[0]->GetDataType()); -- cgit v1.2.1