diff options
author | Teresa Charlin <teresa.charlinreyes@arm.com> | 2022-10-26 14:03:08 +0100 |
---|---|---|
committer | TeresaARM <teresa.charlinreyes@arm.com> | 2022-10-27 15:33:23 +0000 |
commit | 20508425bb92623862e4b3f0da1adf46fc541f27 (patch) | |
tree | e39f1e26bbca2b5bf5ee6c212d602dde6dd641b3 /tests/ExecuteNetwork | |
parent | 893e603ebee737eec32df4ed42c43a2f57c5fd0f (diff) | |
download | armnn-20508425bb92623862e4b3f0da1adf46fc541f27.tar.gz |
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 <adam.jalkemo@arm.com>
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com>
Change-Id: I2fbe69f8affe0e3a5cc86fc1748164967f0c2d64
Diffstat (limited to 'tests/ExecuteNetwork')
-rw-r--r-- | tests/ExecuteNetwork/ArmNNExecutor.cpp | 25 |
1 files 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]); } } } |