21.08
|
#include <ParserPrototxtFixture.hpp>
Public Member Functions | |
ParserPrototxtFixture () | |
template<std::size_t NumOutputDimensions> | |
void | RunTest (const std::vector< float > &inputData, const std::vector< float > &expectedOutputData) |
Executes the network with the given input tensor and checks the result against the given output tensor. More... | |
template<std::size_t NumOutputDimensions> | |
void | RunComparisonTest (const std::map< std::string, std::vector< float >> &inputData, const std::map< std::string, std::vector< uint8_t >> &expectedOutputData) |
Executes the network with the given input tensor and checks the result against the given output tensor. More... | |
template<std::size_t NumOutputDimensions, typename T = float> | |
void | RunTest (const std::map< std::string, std::vector< float >> &inputData, const std::map< std::string, std::vector< T >> &expectedOutputData) |
Executes the network with the given input tensors and checks the results against the given output tensors. More... | |
void | SetupSingleInputSingleOutput (const std::string &inputName, const std::string &outputName) |
Parses and loads the network defined by the m_Prototext string. More... | |
void | SetupSingleInputSingleOutput (const armnn::TensorShape &inputTensorShape, const std::string &inputName, const std::string &outputName) |
void | SetupSingleInputSingleOutput (const armnn::TensorShape &inputTensorShape, const armnn::TensorShape &outputTensorShape, const std::string &inputName, const std::string &outputName) |
void | Setup (const std::map< std::string, armnn::TensorShape > &inputShapes, const std::vector< std::string > &requestedOutputs) |
void | Setup () |
armnn::IOptimizedNetworkPtr | SetupOptimizedNetwork (const std::map< std::string, armnn::TensorShape > &inputShapes, const std::vector< std::string > &requestedOutputs) |
Public Attributes | |
std::string | m_Prototext |
std::unique_ptr< TParser, void(*)(TParser *parser)> | m_Parser |
armnn::IRuntimePtr | m_Runtime |
armnn::NetworkId | m_NetworkIdentifier |
armnn::TensorShape | m_SingleOutputShape |
This will store the output shape so it don't need to be passed to the single-input-single-output overload of RunTest(). More... | |
std::string | m_SingleInputName |
If the single-input-single-output overload of Setup() is called, these will store the input and output name so they don't need to be passed to the single-input-single-output overload of RunTest(). More... | |
std::string | m_SingleOutputName |
Definition at line 24 of file ParserPrototxtFixture.hpp.
|
inline |
Definition at line 26 of file ParserPrototxtFixture.hpp.
References ParserPrototxtFixture< TParser >::RunComparisonTest(), ParserPrototxtFixture< TParser >::RunTest(), ParserPrototxtFixture< TParser >::Setup(), ParserPrototxtFixture< TParser >::SetupOptimizedNetwork(), and ParserPrototxtFixture< TParser >::SetupSingleInputSingleOutput().
void RunComparisonTest | ( | const std::map< std::string, std::vector< float >> & | inputData, |
const std::map< std::string, std::vector< uint8_t >> & | expectedOutputData | ||
) |
Executes the network with the given input tensor and checks the result against the given output tensor.
Calls RunTest with output type of uint8_t for checking comparison operators.
Definition at line 176 of file ParserPrototxtFixture.hpp.
Referenced by ParserPrototxtFixture< TParser >::ParserPrototxtFixture().
void RunTest | ( | const std::vector< float > & | inputData, |
const std::vector< float > & | expectedOutputData | ||
) |
Executes the network with the given input tensor and checks the result against the given output tensor.
This overload assumes that the network has a single input and a single output.
Definition at line 168 of file ParserPrototxtFixture.hpp.
References ParserPrototxtFixture< TParser >::m_SingleInputName, and ParserPrototxtFixture< TParser >::m_SingleOutputName.
Referenced by ParserPrototxtFixture< TParser >::ParserPrototxtFixture().
void RunTest | ( | const std::map< std::string, std::vector< float >> & | inputData, |
const std::map< std::string, std::vector< T >> & | expectedOutputData | ||
) |
Executes the network with the given input tensors and checks the results against the given output tensors.
This overload supports multiple inputs and multiple outputs, identified by name.
Definition at line 185 of file ParserPrototxtFixture.hpp.
References CHECK_LOCATION, CompareTensors(), TensorShape::GetNumDimensions(), ParserPrototxtFixture< TParser >::m_NetworkIdentifier, ParserPrototxtFixture< TParser >::m_Parser, ParserPrototxtFixture< TParser >::m_Runtime, and ParserPrototxtFixture< TParser >::m_SingleOutputShape.
void Setup | ( | const std::map< std::string, armnn::TensorShape > & | inputShapes, |
const std::vector< std::string > & | requestedOutputs | ||
) |
Definition at line 121 of file ParserPrototxtFixture.hpp.
References CHECK_LOCATION, armnn::CpuRef, ParserPrototxtFixture< TParser >::m_NetworkIdentifier, ParserPrototxtFixture< TParser >::m_Parser, ParserPrototxtFixture< TParser >::m_Prototext, ParserPrototxtFixture< TParser >::m_Runtime, armnn::Optimize(), and armnn::Success.
void Setup | ( | ) |
Definition at line 139 of file ParserPrototxtFixture.hpp.
References CHECK_LOCATION, armnn::CpuRef, ParserPrototxtFixture< TParser >::m_NetworkIdentifier, ParserPrototxtFixture< TParser >::m_Parser, ParserPrototxtFixture< TParser >::m_Prototext, ParserPrototxtFixture< TParser >::m_Runtime, armnn::Optimize(), and armnn::Success.
Referenced by ParserPrototxtFixture< TParser >::ParserPrototxtFixture(), ParserPrototxtFixture< TParser >::SetupSingleInputSingleOutput(), and TEST_SUITE().
armnn::IOptimizedNetworkPtr SetupOptimizedNetwork | ( | const std::map< std::string, armnn::TensorShape > & | inputShapes, |
const std::vector< std::string > & | requestedOutputs | ||
) |
Definition at line 156 of file ParserPrototxtFixture.hpp.
References armnn::CpuRef, ParserPrototxtFixture< TParser >::m_Parser, ParserPrototxtFixture< TParser >::m_Prototext, ParserPrototxtFixture< TParser >::m_Runtime, and armnn::Optimize().
Referenced by ParserPrototxtFixture< TParser >::ParserPrototxtFixture().
void SetupSingleInputSingleOutput | ( | const std::string & | inputName, |
const std::string & | outputName | ||
) |
Parses and loads the network defined by the m_Prototext string.
Definition at line 86 of file ParserPrototxtFixture.hpp.
References ParserPrototxtFixture< TParser >::m_SingleInputName, ParserPrototxtFixture< TParser >::m_SingleOutputName, and ParserPrototxtFixture< TParser >::Setup().
Referenced by ParserPrototxtFixture< TParser >::ParserPrototxtFixture().
void SetupSingleInputSingleOutput | ( | const armnn::TensorShape & | inputTensorShape, |
const std::string & | inputName, | ||
const std::string & | outputName | ||
) |
Definition at line 96 of file ParserPrototxtFixture.hpp.
References ParserPrototxtFixture< TParser >::m_SingleInputName, ParserPrototxtFixture< TParser >::m_SingleOutputName, and ParserPrototxtFixture< TParser >::Setup().
void SetupSingleInputSingleOutput | ( | const armnn::TensorShape & | inputTensorShape, |
const armnn::TensorShape & | outputTensorShape, | ||
const std::string & | inputName, | ||
const std::string & | outputName | ||
) |
Definition at line 107 of file ParserPrototxtFixture.hpp.
References ParserPrototxtFixture< TParser >::m_SingleInputName, ParserPrototxtFixture< TParser >::m_SingleOutputName, ParserPrototxtFixture< TParser >::m_SingleOutputShape, and ParserPrototxtFixture< TParser >::Setup().
armnn::NetworkId m_NetworkIdentifier |
Definition at line 71 of file ParserPrototxtFixture.hpp.
Referenced by ParserPrototxtFixture< TParser >::RunTest(), and ParserPrototxtFixture< TParser >::Setup().
std::unique_ptr<TParser, void(*)(TParser* parser)> m_Parser |
Definition at line 69 of file ParserPrototxtFixture.hpp.
Referenced by ParserPrototxtFixture< TParser >::RunTest(), ParserPrototxtFixture< TParser >::Setup(), and ParserPrototxtFixture< TParser >::SetupOptimizedNetwork().
std::string m_Prototext |
Definition at line 68 of file ParserPrototxtFixture.hpp.
Referenced by ParserPrototxtFixture< TParser >::Setup(), and ParserPrototxtFixture< TParser >::SetupOptimizedNetwork().
armnn::IRuntimePtr m_Runtime |
Definition at line 70 of file ParserPrototxtFixture.hpp.
Referenced by ParserPrototxtFixture< TParser >::RunTest(), ParserPrototxtFixture< TParser >::Setup(), and ParserPrototxtFixture< TParser >::SetupOptimizedNetwork().
std::string m_SingleInputName |
If the single-input-single-output overload of Setup() is called, these will store the input and output name so they don't need to be passed to the single-input-single-output overload of RunTest().
Definition at line 76 of file ParserPrototxtFixture.hpp.
Referenced by ParserPrototxtFixture< TParser >::RunTest(), and ParserPrototxtFixture< TParser >::SetupSingleInputSingleOutput().
std::string m_SingleOutputName |
Definition at line 77 of file ParserPrototxtFixture.hpp.
Referenced by ParserPrototxtFixture< TParser >::RunTest(), and ParserPrototxtFixture< TParser >::SetupSingleInputSingleOutput().
armnn::TensorShape m_SingleOutputShape |
This will store the output shape so it don't need to be passed to the single-input-single-output overload of RunTest().
Definition at line 82 of file ParserPrototxtFixture.hpp.
Referenced by ParserPrototxtFixture< TParser >::RunTest(), and ParserPrototxtFixture< TParser >::SetupSingleInputSingleOutput().