diff options
Diffstat (limited to 'src/backends/tosaCommon/operatorMappings/ReshapeOperator.cpp')
-rw-r--r-- | src/backends/tosaCommon/operatorMappings/ReshapeOperator.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/backends/tosaCommon/operatorMappings/ReshapeOperator.cpp b/src/backends/tosaCommon/operatorMappings/ReshapeOperator.cpp index 55d66806b7..e7e5dc77d9 100644 --- a/src/backends/tosaCommon/operatorMappings/ReshapeOperator.cpp +++ b/src/backends/tosaCommon/operatorMappings/ReshapeOperator.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* ConvertReshapeToTosaOperator(const Layer* layer, const std::vector<const TensorInfo*>& outputs, const ReshapeDescriptor* reshapeDescriptor) { - std::string inputName = std::string("input0_"); + std::string inputName = std::string("input_"); std::string outputName = std::string("output0_"); std::string blockName = std::string("Op_RESHAPE_block_") + GetUniqueTosaMappingID(); @@ -18,12 +18,8 @@ TosaSerializationBasicBlock* ConvertReshapeToTosaOperator(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); } TosaReshapeAttribute attribute(GetTosaTensorShape(reshapeDescriptor->m_TargetShape)); @@ -39,7 +35,7 @@ TosaSerializationBasicBlock* ConvertReshapeToTosaOperator(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<int32_t> inputShape = GetTosaTensorShape(inputs[0]->GetShape()); DType inputDType = ArmNNToDType(inputs[0]->GetDataType()); |