diff options
Diffstat (limited to 'tests/ExecuteNetwork')
-rw-r--r-- | tests/ExecuteNetwork/ExecuteNetwork.cpp | 15 | ||||
-rw-r--r-- | tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp | 4 |
2 files changed, 16 insertions, 3 deletions
diff --git a/tests/ExecuteNetwork/ExecuteNetwork.cpp b/tests/ExecuteNetwork/ExecuteNetwork.cpp index a0a08d31b0..0d5271158b 100644 --- a/tests/ExecuteNetwork/ExecuteNetwork.cpp +++ b/tests/ExecuteNetwork/ExecuteNetwork.cpp @@ -12,6 +12,7 @@ #include <armnnUtils/Filesystem.hpp> #include <armnnUtils/TContainer.hpp> #include <InferenceTest.hpp> +#include <Half.hpp> #if defined(ARMNN_SERIALIZER) #include "armnnDeserializer/IDeserializer.hpp" @@ -484,7 +485,7 @@ int MainImpl(const ExecuteNetworkParams& params, armnn::DataType type = model.GetOutputBindingInfo(outputIdx).second.GetDataType(); switch (type) { - // --output-type only supports float, int, qasymms8 or qasymmu8. + // --output-type only supports float, float16, int, qasymms8 or qasymmu8. case armnn::DataType::Float32: if (params.m_OutputTypes[outputIdx].compare("float") != 0) { @@ -493,6 +494,14 @@ int MainImpl(const ExecuteNetworkParams& params, ". This may cause unexpected problems or random failures."; } break; + case armnn::DataType::Float16: + if (params.m_OutputTypes[outputIdx].compare("float16") != 0) + { + ARMNN_LOG(warning) << "Model output index: " << outputIdx << " has data type Float16. The " << + "corresponding --output-type is " << params.m_OutputTypes[outputIdx] << + ". This may cause unexpected problems or random failures."; + } + break; case armnn::DataType::QAsymmU8: if (params.m_OutputTypes[outputIdx].compare("qasymmu8") != 0) { @@ -530,6 +539,10 @@ int MainImpl(const ExecuteNetworkParams& params, { outputDataContainers.push_back(std::vector<float>(model.GetOutputSize(i))); } + else if (params.m_OutputTypes[i].compare("float16") == 0) + { + outputDataContainers.push_back(std::vector<armnn::Half>(model.GetOutputSize(i))); + } else if (params.m_OutputTypes[i].compare("int") == 0) { outputDataContainers.push_back(std::vector<int>(model.GetOutputSize(i))); diff --git a/tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp b/tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp index 8ee66cf64b..25dbe91455 100644 --- a/tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp +++ b/tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp @@ -294,13 +294,13 @@ ProgramOptions::ProgramOptions() : m_CxxOptions{"ExecuteNetwork", ("y,input-type", "The type of the input tensors in the network separated by comma. " "If unset, defaults to \"float\" for all defined inputs. " - "Accepted values (float, int, qasymms8 or qasymmu8).", + "Accepted values (float, float16, int, qasymms8 or qasymmu8).", cxxopts::value<std::string>()) ("z,output-type", "The type of the output tensors in the network separated by comma. " "If unset, defaults to \"float\" for all defined outputs. " - "Accepted values (float, int, qasymms8 or qasymmu8).", + "Accepted values (float, float16, int, qasymms8 or qasymmu8).", cxxopts::value<std::string>()) ("T,tflite-executor", |