diff options
author | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-08-29 16:26:10 +0100 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-08-29 17:56:18 +0000 |
commit | 08b518687d2bf2683a2c5f571d3e76d71d67d048 (patch) | |
tree | 1aa9c4b6c5b906f23c930014f49bfb4c696b8b9d /tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp | |
parent | edd6fdcede66da73179170443978adeca073c7be (diff) | |
download | armnn-08b518687d2bf2683a2c5f571d3e76d71d67d048.tar.gz |
Add a check for the number of output types to ExecuteNetwork
* If the number of the declared output types does not match
the number of outputs, throw an error (just like we do for
the inputs)
Change-Id: I1cb873bf443a31ecdbc11195462e9614ae3a6637
Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
Diffstat (limited to 'tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp')
-rw-r--r-- | tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp b/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp index ddf797b3fe..92aa5066c0 100644 --- a/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp +++ b/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp @@ -470,14 +470,20 @@ int RunTest(const std::string& format, //Defaults the value of all inputs to "float" inputTypesVector.assign(inputNamesVector.size(), "float"); } + else if ((inputTypesVector.size() != 0) && (inputTypesVector.size() != inputNamesVector.size())) + { + BOOST_LOG_TRIVIAL(fatal) << "input-name and input-type must have the same amount of elements."; + return EXIT_FAILURE; + } + if (outputTypesVector.size() == 0) { //Defaults the value of all outputs to "float" outputTypesVector.assign(outputNamesVector.size(), "float"); } - else if ((inputTypesVector.size() != 0) && (inputTypesVector.size() != inputNamesVector.size())) + else if ((outputTypesVector.size() != 0) && (outputTypesVector.size() != outputNamesVector.size())) { - BOOST_LOG_TRIVIAL(fatal) << "input-name and input-type must have the same amount of elements."; + BOOST_LOG_TRIVIAL(fatal) << "output-name and output-type must have the same amount of elements."; return EXIT_FAILURE; } |