From 20508425bb92623862e4b3f0da1adf46fc541f27 Mon Sep 17 00:00:00 2001 From: Teresa Charlin Date: Wed, 26 Oct 2022 14:03:08 +0100 Subject: IVGCVSW-7282 Issues in ExNet when iterations and number of inputs do not match * The intention is to keep the flexibility given by the ExNet before the refactor. * When iteration > inputFiles, we repeat the usage in order * When iteration < inputFiles, we just discard extra files. Signed-off-by: Adam Jalkemo Signed-off-by: Teresa Charlin Change-Id: I2fbe69f8affe0e3a5cc86fc1748164967f0c2d64 --- tests/ExecuteNetwork/ArmNNExecutor.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/tests/ExecuteNetwork/ArmNNExecutor.cpp b/tests/ExecuteNetwork/ArmNNExecutor.cpp index 330a239763..e8b501489e 100644 --- a/tests/ExecuteNetwork/ArmNNExecutor.cpp +++ b/tests/ExecuteNetwork/ArmNNExecutor.cpp @@ -443,24 +443,29 @@ void ArmNNExecutor::SetupInputsAndOutputs() } } - // Fill the remaining iterations with copies - const unsigned int remainingInputSets = m_Params.m_Iterations - noInputSets; - for (unsigned int i = 1; i <= remainingInputSets; i++) - { - m_InputTensorsVec.push_back(m_InputTensorsVec[noInputSets % i]); + // If iterations > noSets fill the remaining iterations repeating the given files + // If iterations < noSets just ignore the extra files + const unsigned int remainingInputSets = (m_Params.m_Iterations > noInputSets) + ? m_Params.m_Iterations - noInputSets + : 0; + for (unsigned int i = 0; i < remainingInputSets; ++i) + { + m_InputTensorsVec.push_back(m_InputTensorsVec[i % noInputSets]); if (m_Params.m_ImportInputsIfAligned) { - m_ImportedInputIds.push_back(m_ImportedInputIds[noInputSets % i]); + m_ImportedInputIds.push_back(m_ImportedInputIds[i % noInputSets]); } } - const unsigned int remainingOutputSets = m_Params.m_Iterations - noOutputSets; - for (unsigned int i = 1; i <= remainingOutputSets; i++) + const unsigned int remainingOutputSets = (m_Params.m_Iterations > noOutputSets) + ? m_Params.m_Iterations - noOutputSets + : 0; + for (unsigned int i = 0; i < remainingOutputSets; ++i) { - m_OutputTensorsVec.push_back(m_OutputTensorsVec[noOutputSets % i]); + m_OutputTensorsVec.push_back(m_OutputTensorsVec[i % noOutputSets]); if (m_Params.m_ImportInputsIfAligned) { - m_ImportedOutputIds.push_back(m_ImportedOutputIds[noOutputSets % i]); + m_ImportedOutputIds.push_back(m_ImportedOutputIds[i % noOutputSets]); } } } -- cgit v1.2.1