21.08
|
#include <ParserFlatbuffersFixture.hpp>
Public Member Functions | |
ParserFlatbuffersFixture () | |
void | Setup (bool testDynamic=true) |
std::unique_ptr< tflite::ModelT > | MakeModelDynamic (std::vector< uint8_t > graphBinary) |
void | loadNetwork (armnn::NetworkId networkId, bool loadDynamic) |
void | SetupSingleInputSingleOutput (const std::string &inputName, const std::string &outputName) |
bool | ReadStringToBinary () |
template<std::size_t NumOutputDimensions, armnn::DataType ArmnnType> | |
void | RunTest (size_t subgraphId, const std::vector< armnn::ResolveType< ArmnnType >> &inputData, const std::vector< armnn::ResolveType< ArmnnType >> &expectedOutputData) |
Executes the network with the given input tensor and checks the result against the given output tensor. More... | |
template<std::size_t NumOutputDimensions, armnn::DataType ArmnnType> | |
void | RunTest (size_t subgraphId, const std::map< std::string, std::vector< armnn::ResolveType< ArmnnType >>> &inputData, const std::map< std::string, std::vector< armnn::ResolveType< ArmnnType >>> &expectedOutputData) |
Executes the network with the given input tensors and checks the results against the given output tensors. More... | |
template<std::size_t NumOutputDimensions, armnn::DataType ArmnnType1, armnn::DataType ArmnnType2> | |
void | RunTest (size_t subgraphId, const std::map< std::string, std::vector< armnn::ResolveType< ArmnnType1 >>> &inputData, const std::map< std::string, std::vector< armnn::ResolveType< ArmnnType2 >>> &expectedOutputData, bool isDynamic=false) |
Multiple Inputs, Multiple Outputs w/ Variable Datatypes and different dimension sizes. More... | |
template<std::size_t NumOutputDimensions, armnn::DataType inputType1, armnn::DataType inputType2, armnn::DataType outputType> | |
void | RunTest (size_t subgraphId, const std::map< std::string, std::vector< armnn::ResolveType< inputType1 >>> &input1Data, const std::map< std::string, std::vector< armnn::ResolveType< inputType2 >>> &input2Data, const std::map< std::string, std::vector< armnn::ResolveType< outputType >>> &expectedOutputData) |
Multiple Inputs with different DataTypes, Multiple Outputs w/ Variable DataTypes Executes the network with the given input tensors and checks the results against the given output tensors. More... | |
template<armnn::DataType ArmnnType1, armnn::DataType ArmnnType2> | |
void | RunTest (std::size_t subgraphId, const std::map< std::string, std::vector< armnn::ResolveType< ArmnnType1 >>> &inputData, const std::map< std::string, std::vector< armnn::ResolveType< ArmnnType2 >>> &expectedOutputData) |
Multiple Inputs, Multiple Outputs w/ Variable Datatypes and different dimension sizes. More... | |
void | CheckTensors (const TensorRawPtr &tensors, size_t shapeSize, const std::vector< int32_t > &shape, tflite::TensorType tensorType, uint32_t buffer, const std::string &name, const std::vector< float > &min, const std::vector< float > &max, const std::vector< float > &scale, const std::vector< int64_t > &zeroPoint) |
Static Public Member Functions | |
static std::string | GenerateDetectionPostProcessJsonString (const armnn::DetectionPostProcessDescriptor &descriptor) |
Public Attributes | |
std::vector< uint8_t > | m_GraphBinary |
std::string | m_JsonString |
armnn::IRuntimePtr | m_Runtime |
armnn::NetworkId | m_NetworkIdentifier |
armnn::NetworkId | m_DynamicNetworkIdentifier |
bool | m_TestDynamic |
std::unique_ptr< armnnTfLiteParser::TfLiteParserImpl > | m_Parser |
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 36 of file ParserFlatbuffersFixture.hpp.
|
inline |
Definition at line 38 of file ParserFlatbuffersFixture.hpp.
References m_Parser.
|
inline |
Definition at line 265 of file ParserFlatbuffersFixture.hpp.
References m_Parser, and armnn::VerifyTensorInfoDataType().
|
inlinestatic |
Definition at line 238 of file ParserFlatbuffersFixture.hpp.
References DetectionPostProcessDescriptor::m_DetectionsPerClass, DetectionPostProcessDescriptor::m_MaxClassesPerDetection, DetectionPostProcessDescriptor::m_MaxDetections, DetectionPostProcessDescriptor::m_NmsIouThreshold, DetectionPostProcessDescriptor::m_NmsScoreThreshold, DetectionPostProcessDescriptor::m_NumClasses, DetectionPostProcessDescriptor::m_ScaleH, DetectionPostProcessDescriptor::m_ScaleW, DetectionPostProcessDescriptor::m_ScaleX, DetectionPostProcessDescriptor::m_ScaleY, and DetectionPostProcessDescriptor::m_UseRegularNms.
|
inline |
Definition at line 121 of file ParserFlatbuffersFixture.hpp.
References armnn::CpuRef, MakeModelDynamic(), armnn::Optimize(), ReadStringToBinary(), and armnn::Success.
Referenced by Setup().
|
inline |
Definition at line 75 of file ParserFlatbuffersFixture.hpp.
References CHECK_LOCATION.
Referenced by loadNetwork().
|
inline |
Definition at line 161 of file ParserFlatbuffersFixture.hpp.
References ARMNN_ASSERT_MSG, g_TfLiteSchemaText, g_TfLiteSchemaText_len, and RunTest().
Referenced by loadNetwork(), and TEST_SUITE().
void RunTest | ( | size_t | subgraphId, |
const std::vector< armnn::ResolveType< armnnType >> & | inputData, | ||
const std::vector< armnn::ResolveType< armnnType >> & | expectedOutputData | ||
) |
Executes the network with the given input tensor and checks the result against the given output tensor.
Single Input, Single Output Executes the network with the given input tensor and checks the result against the given output tensor.
This assumes the network has a single input and a single output.
This overload assumes the network has a single input and a single output.
Definition at line 316 of file ParserFlatbuffersFixture.hpp.
References m_SingleInputName, and m_SingleOutputName.
Referenced by ReadStringToBinary().
void RunTest | ( | size_t | subgraphId, |
const std::map< std::string, std::vector< armnn::ResolveType< armnnType >>> & | inputData, | ||
const std::map< std::string, std::vector< armnn::ResolveType< armnnType >>> & | expectedOutputData | ||
) |
Executes the network with the given input tensors and checks the results against the given output tensors.
Multiple Inputs, Multiple Outputs 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 330 of file ParserFlatbuffersFixture.hpp.
void RunTest | ( | size_t | subgraphId, |
const std::map< std::string, std::vector< armnn::ResolveType< armnnType1 >>> & | inputData, | ||
const std::map< std::string, std::vector< armnn::ResolveType< armnnType2 >>> & | expectedOutputData, | ||
bool | isDynamic = false |
||
) |
Multiple Inputs, Multiple Outputs w/ Variable Datatypes and different dimension sizes.
Multiple Inputs, Multiple Outputs w/ Variable Datatypes Executes the network with the given input tensors and checks the results against the given output tensors.
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 along with the allowance for the input datatype to be different to the output
This overload supports multiple inputs and multiple outputs, identified by name along with the allowance for the input datatype to be different to the output
Definition at line 344 of file ParserFlatbuffersFixture.hpp.
References CompareTensors(), TensorInfo::GetNumDimensions(), TensorInfo::GetNumElements(), m_DynamicNetworkIdentifier, m_NetworkIdentifier, m_Parser, m_Runtime, and armnn::VerifyTensorInfoDataType().
void RunTest | ( | size_t | subgraphId, |
const std::map< std::string, std::vector< armnn::ResolveType< inputType1 >>> & | input1Data, | ||
const std::map< std::string, std::vector< armnn::ResolveType< inputType2 >>> & | input2Data, | ||
const std::map< std::string, std::vector< armnn::ResolveType< outputType >>> & | expectedOutputData | ||
) |
Multiple Inputs with different DataTypes, Multiple Outputs w/ Variable DataTypes 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 along with the allowance for the input datatype to be different to the output
Definition at line 471 of file ParserFlatbuffersFixture.hpp.
References CompareTensors(), TensorInfo::GetNumDimensions(), TensorInfo::GetNumElements(), m_NetworkIdentifier, m_Parser, m_Runtime, and armnn::VerifyTensorInfoDataType().
void RunTest | ( | std::size_t | subgraphId, |
const std::map< std::string, std::vector< armnn::ResolveType< armnnType1 >>> & | inputData, | ||
const std::map< std::string, std::vector< armnn::ResolveType< armnnType2 >>> & | expectedOutputData | ||
) |
Multiple Inputs, Multiple Outputs w/ Variable Datatypes and different dimension sizes.
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 along with the allowance for the input datatype to be different to the output
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 along with the allowance for the input datatype to be different to the output.
Definition at line 423 of file ParserFlatbuffersFixture.hpp.
References m_NetworkIdentifier, m_Parser, m_Runtime, and armnn::VerifyTensorInfoDataType().
|
inline |
Definition at line 64 of file ParserFlatbuffersFixture.hpp.
References loadNetwork().
Referenced by SetupSingleInputSingleOutput(), and TEST_SUITE().
|
inline |
Definition at line 153 of file ParserFlatbuffersFixture.hpp.
References Setup().
Referenced by TEST_SUITE().
armnn::NetworkId m_DynamicNetworkIdentifier |
Definition at line 55 of file ParserFlatbuffersFixture.hpp.
Referenced by RunTest().
std::vector<uint8_t> m_GraphBinary |
Definition at line 51 of file ParserFlatbuffersFixture.hpp.
std::string m_JsonString |
Definition at line 52 of file ParserFlatbuffersFixture.hpp.
armnn::NetworkId m_NetworkIdentifier |
Definition at line 54 of file ParserFlatbuffersFixture.hpp.
Referenced by RunTest().
std::unique_ptr<armnnTfLiteParser::TfLiteParserImpl> m_Parser |
Definition at line 57 of file ParserFlatbuffersFixture.hpp.
Referenced by CheckTensors(), ParserFlatbuffersFixture(), and RunTest().
armnn::IRuntimePtr m_Runtime |
Definition at line 53 of file ParserFlatbuffersFixture.hpp.
Referenced by RunTest().
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 61 of file ParserFlatbuffersFixture.hpp.
Referenced by RunTest().
std::string m_SingleOutputName |
Definition at line 62 of file ParserFlatbuffersFixture.hpp.
Referenced by RunTest().
bool m_TestDynamic |
Definition at line 56 of file ParserFlatbuffersFixture.hpp.