diff options
author | Teresa Charlin <teresa.charlinreyes@arm.com> | 2024-04-23 16:22:47 +0100 |
---|---|---|
committer | Teresa Charlin <teresa.charlinreyes@arm.com> | 2024-04-25 11:28:19 +0100 |
commit | 8cfd059026dafe65977ddab63350763657cb12c2 (patch) | |
tree | b84d6cac61a65a470828b99c79054c38f7ec4dd3 /src/backends/tosaCommon/operatorMappings/ActivationOperator.cpp | |
parent | ce48d1dda2d6b32477de129a05ca3adee0f87690 (diff) | |
download | armnn-8cfd059026dafe65977ddab63350763657cb12c2.tar.gz |
IVGCVSW-8206 In TOSACommon, modify the way the Unique name for the inputs were generated.
* input_<GUID>
* constant_<GUID>
* intermediate<output slot>_<GUID>
* output<output slot>_<GUID>
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 <teresa.charlinreyes@arm.com>
Signed-off-by: Cathal Corbett <cathal.corbett@arm.com>
Change-Id: I07393fc60f3135337b59a9780aa3a263a995fc9c
Diffstat (limited to 'src/backends/tosaCommon/operatorMappings/ActivationOperator.cpp')
-rw-r--r-- | src/backends/tosaCommon/operatorMappings/ActivationOperator.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/backends/tosaCommon/operatorMappings/ActivationOperator.cpp b/src/backends/tosaCommon/operatorMappings/ActivationOperator.cpp index 480cdf5b86..c13555da6a 100644 --- a/src/backends/tosaCommon/operatorMappings/ActivationOperator.cpp +++ b/src/backends/tosaCommon/operatorMappings/ActivationOperator.cpp @@ -29,7 +29,7 @@ TosaSerializationBasicBlock* ConvertActivationToTosaOperator(const Layer* layer, throw armnn::Exception("ConvertActivationToTosaOperator: 1 output tensor required."); } - std::string inputName = std::string("input0_"); + std::string inputName = std::string("input_"); std::string outputNameAlpha = std::string("intermediate1_") + GetUniqueTosaMappingID(); std::string outputNameMul = std::string("intermediate2_") + GetUniqueTosaMappingID(); std::string outputName = std::string("output0_"); @@ -39,12 +39,8 @@ TosaSerializationBasicBlock* ConvertActivationToTosaOperator(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 tensors names. - Layer& connectedInputLayer = layer->GetInputSlot(0).GetConnectedOutputSlot()->GetOwningLayer(); - inputName = GenerateUniqueName(connectedInputLayer, 0); - - // Determine unique output tensor name. - outputName = GenerateUniqueOutputName(*layer, 0); + inputName = GenerateUniqueInputName(layer->GetInputSlot(0)); + outputName = GenerateUniqueOutputName(*layer); } std::vector<TosaSerializationTensor*> tensors; @@ -54,7 +50,7 @@ TosaSerializationBasicBlock* ConvertActivationToTosaOperator(const Layer* layer, // There also can't be duplicate tensor. std::vector<int32_t> inputShape0; DType inputDType0 = DType::DType_UNKNOWN; - if(inputName.find("input0_") != std::string::npos) + if(inputName.find("input_") != std::string::npos) { inputShape0 = GetTosaTensorShape(inputs[0]->GetShape()); inputDType0 = ArmNNToDType(inputs[0]->GetDataType()); |