24.02
|
Namespaces | |
Filesystem | |
Classes | |
class | DataLayoutIndexed |
Provides access to the appropriate indexes for Channels, Height and Width based on DataLayout. More... | |
class | FloatingPointConverter |
struct | IsFloatingPointIterator |
class | ModelAccuracyChecker |
struct | ParserPrototxtFixture |
struct | SelectiveQuantizer |
struct | SelectiveQuantizer< armnn::BFloat16, false > |
struct | SelectiveQuantizer< armnn::Half, false > |
struct | SelectiveQuantizer< T, false > |
Typedefs | |
using | TContainer = mapbox::util::variant< std::vector< float >, std::vector< int >, std::vector< unsigned char >, std::vector< int8_t > > |
using | LabelCategoryNames = std::vector< std::string > |
Functions | |
template<typename T > | |
bool | CompatibleTypes (armnn::DataType) |
bool | operator== (const armnn::DataLayout &dataLayout, const DataLayoutIndexed &indexed) |
Equality methods. More... | |
bool | operator== (const DataLayoutIndexed &indexed, const armnn::DataLayout &dataLayout) |
bool | within_percentage_tolerance (float a, float b, float tolerancePercent=1.0f) |
Compare two floats and return true if their values are within a specified tolerance of each other. More... | |
armnn::TensorShape | Permuted (const armnn::TensorShape &srcShape, const armnn::PermutationVector &mappings) |
armnn::TensorInfo | Permuted (const armnn::TensorInfo &info, const armnn::PermutationVector &mappings) |
void | Permute (const armnn::TensorShape &dstShape, const armnn::PermutationVector &mappings, const void *src, void *dst, size_t dataTypeSize) |
template<typename T > | |
T | SelectiveQuantize (float value, float scale, int32_t offset) |
template<typename T > | |
float | SelectiveDequantize (T value, float scale, int32_t offset) |
template<typename T , typename FloatIt , typename std::enable_if< IsFloatingPointIterator< FloatIt >::value, int >::type = 0> | |
std::vector< T > | QuantizedVector (FloatIt first, FloatIt last, float qScale, int32_t qOffset) |
template<typename T > | |
std::vector< T > | QuantizedVector (const std::vector< float > &array, float qScale=1.f, int32_t qOffset=0) |
template<typename T > | |
std::vector< T > | QuantizedVector (std::initializer_list< float > array, float qScale=1.f, int32_t qOffset=0) |
armnn::TensorShape | GetTensorShape (unsigned int numberOfBatches, unsigned int numberOfChannels, unsigned int height, unsigned int width, const armnn::DataLayout dataLayout) |
armnn::TensorInfo | GetTensorInfo (unsigned int numberOfBatches, unsigned int numberOfChannels, unsigned int height, unsigned int width, const armnn::DataLayout dataLayout, const armnn::DataType dataType) |
armnn::TensorInfo | GetTensorInfo (unsigned int numberOfBatches, unsigned int numberOfChannels, unsigned int depth, unsigned int height, unsigned int width, const armnn::DataLayout dataLayout, const armnn::DataType dataType) |
std::pair< float, float > | FindMinMax (armnn::ITensorHandle *tensorHandle) |
armnn::TensorShape | ReduceDims (const armnn::TensorShape &tensorInfo, unsigned int dimensions) |
armnn::TensorInfo | ReduceDims (const armnn::TensorInfo &tensorInfo, unsigned int dimensions) |
armnn::TensorShape | ExpandDims (const armnn::TensorShape &tensorShape, int axis) |
armnn::TensorShape | ExpandDimsToRank (const armnn::TensorShape &tensorShape, unsigned int rank) |
std::vector< unsigned int > | SqueezeDims (const armnn::TensorShape &tensorShape) |
unsigned int | GetNumElementsBetween (const armnn::TensorShape &shape, unsigned int firstAxisInclusive, unsigned int lastAxisExclusive) |
unsigned int | GetUnsignedAxis (const unsigned int inputDimension, const int axis) |
unsigned int | GetNumElementsAfter (const armnn::TensorShape &shape, unsigned int axis) |
std::pair< unsigned int, std::vector< float > > | GetPerAxisParams (const armnn::TensorInfo &info) |
template<typename PrimitiveType > | |
std::unique_ptr< float[]> | ToFloatArray (const std::vector< PrimitiveType > &data, const armnn::TensorInfo &tensorInfo) |
std::unique_ptr< float[]> | ToFloatArray (const std::vector< uint8_t > &data, const armnn::TensorInfo &tensorInfo) |
armnn::TensorShape | TransposeTensorShape (const armnn::TensorShape &srcShape, const armnn::PermutationVector &mappings) |
armnn::TensorInfo | TransposeTensorShape (const armnn::TensorInfo &info, const armnn::PermutationVector &mappings) |
void | Transpose (const armnn::TensorShape &dstShape, const armnn::PermutationVector &mappings, const void *src, void *dst, size_t dataTypeSize) |
template<> | |
bool | CompatibleTypes< float > (DataType dataType) |
template<> | |
bool | CompatibleTypes< Half > (DataType dataType) |
template<> | |
bool | CompatibleTypes< BFloat16 > (DataType dataType) |
template<> | |
bool | CompatibleTypes< uint8_t > (DataType dataType) |
template<> | |
bool | CompatibleTypes< int8_t > (DataType dataType) |
template<> | |
bool | CompatibleTypes< int16_t > (DataType dataType) |
template<> | |
bool | CompatibleTypes< int32_t > (DataType dataType) |
template<typename TNodeId , typename TTargetNodes > | |
bool | GraphTopologicalSort (const TTargetNodes &targetNodes, std::function< std::vector< TNodeId >(TNodeId)> getIncomingEdges, std::vector< TNodeId > &outSorted) |
std::vector< std::string > | SplitBy (const std::string &originalString, const std::string &delimiter=" ", bool includeEmptyToken=false) |
Split a string into tokens by a delimiter. More... | |
std::string | Strip (const std::string &originalString, const std::string &characterSet=" ") |
Remove any preceding and trailing character specified in the characterSet. More... | |
void | ProcessConcatInputTensorInfo (armnn::TensorInfo &inputTensorInfo, armnn::OriginsDescriptor &concatDescriptor, const unsigned int &concatAxis, unsigned int inputIndex, unsigned int &mergeDimOrigin) |
void | CalculateReducedOutputTensoInfo (const armnn::TensorInfo &inputTensorInfo, const std::set< unsigned int > &axisSet, bool keepDims, armnn::TensorInfo &outputTensorInfo) |
Creates a tensor info after reducing the dimensions mentioned in axisData. More... | |
void | CalculateStridedSliceOutputTensorInfo (const armnn::TensorInfo &inputTensorInfo, const armnn::StridedSliceDescriptor &desc, armnn::TensorInfo &outputTensorInfo) |
Create output tensor info for a StridedSlice operator. More... | |
std::string | ConvertInt32ToOctalString (int value) |
Converts an int value into the Prototxt octal representation. More... | |
std::string | ConvertTensorShapeToString (const armnn::TensorShape &shape) |
Converts an TensorShape into Prototxt representation. More... | |
template<typename TContainer > | |
armnn::InputTensors | MakeInputTensors (const std::vector< armnn::BindingPointInfo > &inputBindings, const std::vector< TContainer > &inputDataContainers) |
template<typename TContainer > | |
armnn::OutputTensors | MakeOutputTensors (const std::vector< armnn::BindingPointInfo > &outputBindings, std::vector< TContainer > &outputDataContainers) |
template<typename PrimitiveType > | |
void | CheckSizes (const std::vector< PrimitiveType > &data, const armnn::TensorInfo &tensorInfo, unsigned int size=1) |
void | CheckValidSize (std::initializer_list< size_t > validInputCounts, size_t actualValue, const char *validExpr, const char *actualExpr, const CheckLocation &location) |
uint32_t | NonNegative (const char *expr, int32_t value, const CheckLocation &location) |
int32_t | VerifyInt32 (const char *expr, int64_t value, const armnn::CheckLocation &location) |
Variables | |
const armnn::PermutationVector | NHWCToArmNN = { 0, 2, 3, 1 } |
const armnn::PermutationVector | ArmNNToNHWC = { 0, 3, 1, 2 } |
using LabelCategoryNames = std::vector<std::string> |
Definition at line 25 of file ModelAccuracyChecker.hpp.
using TContainer = mapbox::util::variant<std::vector<float>, std::vector<int>, std::vector<unsigned char>, std::vector<int8_t> > |
Definition at line 18 of file TContainer.hpp.
void CalculateReducedOutputTensoInfo | ( | const armnn::TensorInfo & | inputTensorInfo, |
const std::set< unsigned int > & | axisSet, | ||
bool | keepDims, | ||
armnn::TensorInfo & | outputTensorInfo | ||
) |
Creates a tensor info after reducing the dimensions mentioned in axisData.
Definition at line 52 of file ParserHelper.cpp.
References TensorInfo::GetDataType(), TensorInfo::GetNumDimensions(), and TensorInfo::GetShape().
void CalculateStridedSliceOutputTensorInfo | ( | const armnn::TensorInfo & | inputTensorInfo, |
const armnn::StridedSliceDescriptor & | desc, | ||
armnn::TensorInfo & | outputTensorInfo | ||
) |
Create output tensor info for a StridedSlice operator.
Definition at line 103 of file ParserHelper.cpp.
References TensorInfo::GetDataType(), TensorInfo::GetNumDimensions(), TensorInfo::GetShape(), StridedSliceDescriptor::GetStartForAxis(), StridedSliceDescriptor::GetStopForAxis(), StridedSliceDescriptor::m_ShrinkAxisMask, and StridedSliceDescriptor::m_Stride.
void armnnUtils::CheckSizes | ( | const std::vector< PrimitiveType > & | data, |
const armnn::TensorInfo & | tensorInfo, | ||
unsigned int | size = 1 |
||
) |
Definition at line 296 of file TensorUtils.cpp.
References CHECK_LOCATION, and TensorInfo::GetNumElements().
Referenced by ToFloatArray().
void CheckValidSize | ( | std::initializer_list< size_t > | validInputCounts, |
size_t | actualValue, | ||
const char * | validExpr, | ||
const char * | actualExpr, | ||
const CheckLocation & | location | ||
) |
bool CompatibleTypes | ( | armnn::DataType | ) |
Definition at line 17 of file CompatibleTypes.cpp.
bool armnnUtils::CompatibleTypes< BFloat16 > | ( | DataType | dataType | ) |
Definition at line 35 of file CompatibleTypes.cpp.
References armnn::BFloat16.
bool armnnUtils::CompatibleTypes< float > | ( | DataType | dataType | ) |
Definition at line 23 of file CompatibleTypes.cpp.
References armnn::Float32.
bool armnnUtils::CompatibleTypes< Half > | ( | DataType | dataType | ) |
Definition at line 29 of file CompatibleTypes.cpp.
References armnn::Float16.
bool armnnUtils::CompatibleTypes< int16_t > | ( | DataType | dataType | ) |
Definition at line 54 of file CompatibleTypes.cpp.
References armnn::QSymmS16.
bool armnnUtils::CompatibleTypes< int32_t > | ( | DataType | dataType | ) |
Definition at line 60 of file CompatibleTypes.cpp.
References armnn::Signed32.
bool armnnUtils::CompatibleTypes< int8_t > | ( | DataType | dataType | ) |
Definition at line 47 of file CompatibleTypes.cpp.
References armnn::QAsymmS8, and armnn::QSymmS8.
bool armnnUtils::CompatibleTypes< uint8_t > | ( | DataType | dataType | ) |
Definition at line 41 of file CompatibleTypes.cpp.
References armnn::Boolean, and armnn::QAsymmU8.
std::string ConvertInt32ToOctalString | ( | int | value | ) |
Converts an int value into the Prototxt octal representation.
Definition at line 17 of file PrototxtConversions.cpp.
std::string ConvertTensorShapeToString | ( | const armnn::TensorShape & | shape | ) |
Converts an TensorShape into Prototxt representation.
Definition at line 32 of file PrototxtConversions.cpp.
References TensorShape::GetNumDimensions().
TensorShape ExpandDims | ( | const armnn::TensorShape & | tensorShape, |
int | axis | ||
) |
Definition at line 142 of file TensorUtils.cpp.
References CHECK_LOCATION, and TensorShape::GetNumDimensions().
TensorShape ExpandDimsToRank | ( | const armnn::TensorShape & | tensorShape, |
unsigned int | rank | ||
) |
std::pair< float, float > FindMinMax | ( | armnn::ITensorHandle * | tensorHandle | ) |
Definition at line 81 of file TensorUtils.cpp.
References TensorShape::GetNumElements(), ITensorHandle::GetShape(), ITensorHandle::Map(), and ITensorHandle::Unmap().
unsigned int GetNumElementsAfter | ( | const armnn::TensorShape & | shape, |
unsigned int | axis | ||
) |
Definition at line 261 of file TensorUtils.cpp.
References TensorShape::GetNumDimensions().
Referenced by GetPerAxisParams(), PerAxisIterator< const int8_t, Decoder< float > >::PerAxisIterator(), and ToFloatArray().
unsigned int GetNumElementsBetween | ( | const armnn::TensorShape & | shape, |
unsigned int | firstAxisInclusive, | ||
unsigned int | lastAxisExclusive | ||
) |
Definition at line 209 of file TensorUtils.cpp.
References TensorShape::GetNumDimensions().
Referenced by armnn::ArgMinMax(), armnn::LogSoftmax(), and armnn::Softmax().
std::pair< unsigned int, std::vector< float > > GetPerAxisParams | ( | const armnn::TensorInfo & | info | ) |
Definition at line 280 of file TensorUtils.cpp.
References CHECK_LOCATION, armnn::GetDataTypeName(), GetNumElementsAfter(), armnn::info, and OptionalReferenceSwitch< IsReference, T >::value().
Referenced by armnn::MakeDecoder(), and armnn::MakeEncoder().
TensorInfo GetTensorInfo | ( | unsigned int | numberOfBatches, |
unsigned int | numberOfChannels, | ||
unsigned int | depth, | ||
unsigned int | height, | ||
unsigned int | width, | ||
const armnn::DataLayout | dataLayout, | ||
const armnn::DataType | dataType | ||
) |
Definition at line 60 of file TensorUtils.cpp.
References CHECK_LOCATION, armnn::NCDHW, and armnn::NDHWC.
TensorInfo GetTensorInfo | ( | unsigned int | numberOfBatches, |
unsigned int | numberOfChannels, | ||
unsigned int | height, | ||
unsigned int | width, | ||
const armnn::DataLayout | dataLayout, | ||
const armnn::DataType | dataType | ||
) |
Definition at line 40 of file TensorUtils.cpp.
References CHECK_LOCATION, armnn::NCHW, and armnn::NHWC.
TensorShape GetTensorShape | ( | unsigned int | numberOfBatches, |
unsigned int | numberOfChannels, | ||
unsigned int | height, | ||
unsigned int | width, | ||
const armnn::DataLayout | dataLayout | ||
) |
Definition at line 21 of file TensorUtils.cpp.
References CHECK_LOCATION, armnn::NCHW, and armnn::NHWC.
unsigned int GetUnsignedAxis | ( | const unsigned int | inputDimension, |
const int | axis | ||
) |
Definition at line 236 of file TensorUtils.cpp.
Referenced by armnn::ArgMinMax(), ClArgMinMaxWorkload::ClArgMinMaxWorkload(), armnn::ComputeSplitAxis(), ArgMinMaxLayer::InferOutputShapes(), NeonArgMinMaxWorkload::NeonArgMinMaxWorkload(), and ArgMinMaxQueueDescriptor::Validate().
bool armnnUtils::GraphTopologicalSort | ( | const TTargetNodes & | targetNodes, |
std::function< std::vector< TNodeId >(TNodeId)> | getIncomingEdges, | ||
std::vector< TNodeId > & | outSorted | ||
) |
Definition at line 110 of file GraphTopologicalSort.hpp.
|
inline |
|
inline |
Definition at line 56 of file TensorIOUtils.hpp.
uint32_t NonNegative | ( | const char * | expr, |
int32_t | value, | ||
const CheckLocation & | location | ||
) |
bool operator== | ( | const armnn::DataLayout & | dataLayout, |
const DataLayoutIndexed & | indexed | ||
) |
Equality methods.
Definition at line 46 of file DataLayoutIndexed.cpp.
References DataLayoutIndexed::GetDataLayout().
bool operator== | ( | const DataLayoutIndexed & | indexed, |
const armnn::DataLayout & | dataLayout | ||
) |
Definition at line 51 of file DataLayoutIndexed.cpp.
References DataLayoutIndexed::GetDataLayout().
void Permute | ( | const armnn::TensorShape & | dstShape, |
const armnn::PermutationVector & | mappings, | ||
const void * | src, | ||
void * | dst, | ||
size_t | dataTypeSize | ||
) |
Definition at line 164 of file Permute.cpp.
Referenced by armnnOnnxParser::CreateConstTensorImpl(), armnn::DepthToSpace(), PermuteLayer::PermuteLayer(), armnn::PermuteTensor(), and armnn_driver::SwizzleAndroidNn4dTensorToArmNn().
armnn::TensorInfo Permuted | ( | const armnn::TensorInfo & | info, |
const armnn::PermutationVector & | mappings | ||
) |
Definition at line 148 of file Permute.cpp.
References armnn::info, Permuted(), TensorInfo::SetQuantizationDim(), and TensorInfo::SetShape().
armnn::TensorShape Permuted | ( | const armnn::TensorShape & | srcShape, |
const armnn::PermutationVector & | mappings | ||
) |
Definition at line 125 of file Permute.cpp.
References TensorShape::GetNumDimensions(), PermutationVector::GetSize(), and armnn::MaxNumOfTensorDimensions.
Referenced by armnn::Convert1HWOTensorInfoToAcl(), armnn::ConvertWeightTensorInfoFromArmnnToAcl(), armnnOnnxParser::CreateConstTensorImpl(), BatchMatMulLayer::InferOutputShapes(), PermuteLayer::InferOutputShapes(), Permuted(), armnn::PermuteTensor(), MovePermuteUpImpl::Run(), armnn_driver::SwizzleAndroidNn4dTensorToArmNn(), and BatchMatMulQueueDescriptor::Validate().
void ProcessConcatInputTensorInfo | ( | armnn::TensorInfo & | inputTensorInfo, |
armnn::OriginsDescriptor & | concatDescriptor, | ||
const unsigned int & | concatAxis, | ||
unsigned int | inputIndex, | ||
unsigned int & | mergeDimOrigin | ||
) |
Definition at line 19 of file ParserHelper.cpp.
References CHECK_LOCATION, TensorInfo::GetNumDimensions(), OriginsDescriptor::GetNumDimensions(), TensorInfo::GetShape(), and OriginsDescriptor::SetViewOriginCoord().
std::vector<T> armnnUtils::QuantizedVector | ( | const std::vector< float > & | array, |
float | qScale = 1.f , |
||
int32_t | qOffset = 0 |
||
) |
Definition at line 121 of file QuantizeHelper.hpp.
std::vector<T> armnnUtils::QuantizedVector | ( | FloatIt | first, |
FloatIt | last, | ||
float | qScale, | ||
int32_t | qOffset | ||
) |
Definition at line 105 of file QuantizeHelper.hpp.
std::vector<T> armnnUtils::QuantizedVector | ( | std::initializer_list< float > | array, |
float | qScale = 1.f , |
||
int32_t | qOffset = 0 |
||
) |
Definition at line 127 of file QuantizeHelper.hpp.
TensorInfo ReduceDims | ( | const armnn::TensorInfo & | tensorInfo, |
unsigned int | dimensions | ||
) |
Definition at line 134 of file TensorUtils.cpp.
References TensorInfo::GetShape(), ReduceDims(), and TensorInfo::SetShape().
TensorShape ReduceDims | ( | const armnn::TensorShape & | tensorInfo, |
unsigned int | dimensions | ||
) |
Definition at line 108 of file TensorUtils.cpp.
References TensorShape::GetNumDimensions().
Referenced by ReduceDims().
float armnnUtils::SelectiveDequantize | ( | T | value, |
float | scale, | ||
int32_t | offset | ||
) |
Definition at line 91 of file QuantizeHelper.hpp.
T armnnUtils::SelectiveQuantize | ( | float | value, |
float | scale, | ||
int32_t | offset | ||
) |
Definition at line 85 of file QuantizeHelper.hpp.
std::vector< std::string > SplitBy | ( | const std::string & | originalString, |
const std::string & | delimiter = " " , |
||
bool | includeEmptyToken = false |
||
) |
Split a string into tokens by a delimiter.
[in] | originalString | Original string to be split |
[in] | delimiter | Delimiter used to split originalString |
[in] | includeEmptyToekn | If true, include empty tokens in the result |
originalString
by \delimiter Definition at line 41 of file ModelAccuracyChecker.cpp.
std::vector< unsigned int > SqueezeDims | ( | const armnn::TensorShape & | tensorShape | ) |
Definition at line 195 of file TensorUtils.cpp.
References TensorShape::GetNumDimensions().
Referenced by Layer::ValidateAndCopyShape().
std::string Strip | ( | const std::string & | originalString, |
const std::string & | characterSet = " " |
||
) |
Remove any preceding and trailing character specified in the characterSet.
[in] | originalString | Original string to be stripped |
[in] | characterSet | Set of characters to be stripped from originalString |
characterSet
from originalString
Definition at line 65 of file ModelAccuracyChecker.cpp.
std::unique_ptr< float[]> ToFloatArray | ( | const std::vector< PrimitiveType > & | data, |
const armnn::TensorInfo & | tensorInfo | ||
) |
Definition at line 307 of file TensorUtils.cpp.
References CheckSizes(), TensorInfo::GetNumElements(), GetNumElementsAfter(), TensorInfo::GetQuantizationDim(), TensorInfo::GetQuantizationOffset(), TensorInfo::GetQuantizationScale(), TensorInfo::GetQuantizationScales(), TensorInfo::GetShape(), TensorInfo::HasPerAxisQuantization(), and OptionalReferenceSwitch< IsReference, T >::value().
std::unique_ptr< float[]> ToFloatArray | ( | const std::vector< uint8_t > & | data, |
const armnn::TensorInfo & | tensorInfo | ||
) |
Definition at line 348 of file TensorUtils.cpp.
References CHECK_LOCATION, CheckSizes(), TensorInfo::GetDataType(), armnn::GetDataTypeName(), TensorInfo::GetNumElements(), armnn::QAsymmS8, armnn::QAsymmU8, armnn::QSymmS8, armnn::Signed32, and armnn::Signed64.
void Transpose | ( | const armnn::TensorShape & | dstShape, |
const armnn::PermutationVector & | mappings, | ||
const void * | src, | ||
void * | dst, | ||
size_t | dataTypeSize | ||
) |
Definition at line 153 of file Transpose.cpp.
Referenced by TransposeLayer::TransposeLayer().
armnn::TensorInfo TransposeTensorShape | ( | const armnn::TensorInfo & | info, |
const armnn::PermutationVector & | mappings | ||
) |
Definition at line 146 of file Transpose.cpp.
References armnn::info, TensorInfo::SetShape(), and TransposeTensorShape().
armnn::TensorShape TransposeTensorShape | ( | const armnn::TensorShape & | srcShape, |
const armnn::PermutationVector & | mappings | ||
) |
Definition at line 125 of file Transpose.cpp.
References TensorShape::GetNumDimensions(), PermutationVector::GetSize(), and armnn::MaxNumOfTensorDimensions.
Referenced by TransposeLayer::InferOutputShapes(), MoveTransposeUpImpl::Run(), and TransposeTensorShape().
int32_t VerifyInt32 | ( | const char * | expr, |
int64_t | value, | ||
const armnn::CheckLocation & | location | ||
) |
Definition at line 52 of file VerificationHelpers.cpp.
References CheckLocation::AsString().
|
inline |
Compare two floats and return true if their values are within a specified tolerance of each other.
a | |
b | |
tolerancePercentage | If not supplied default will be 1% tolerance (1.0f) |
Definition at line 20 of file FloatingPointComparison.hpp.
const armnn::PermutationVector ArmNNToNHWC = { 0, 3, 1, 2 } |
Definition at line 17 of file ParserHelper.cpp.
const armnn::PermutationVector NHWCToArmNN = { 0, 2, 3, 1 } |
Definition at line 16 of file ParserHelper.cpp.