24.08
|
#include <Types.hpp>
Public Types | |
using | ValueType = unsigned int |
using | SizeType = unsigned int |
using | ArrayType = std::array< ValueType, MaxNumOfTensorDimensions > |
using | ConstIterator = typename ArrayType::const_iterator |
Public Member Functions | |
PermutationVector (const ValueType *dimMappings, SizeType numDimMappings) | |
PermutationVector (std::initializer_list< ValueType > dimMappings) | |
ValueType | operator[] (SizeType i) const |
Indexing method with out-of-bounds error checking for the m_DimMappings array. More... | |
SizeType | GetSize () const |
ConstIterator | begin () const |
ConstIterator | end () const |
bool | IsEqual (const PermutationVector &other) const |
bool | IsInverse (const PermutationVector &other) const |
using ArrayType = std::array<ValueType, MaxNumOfTensorDimensions> |
using ConstIterator = typename ArrayType::const_iterator |
PermutationVector | ( | const ValueType * | dimMappings, |
SizeType | numDimMappings | ||
) |
dimMappings | - Indicates how to translate tensor elements from a given source into the target destination, when source and target potentially have different memory layouts. |
E.g. For a 4-d tensor laid out in a memory with the format (Batch Element, Height, Width, Channels), which is to be passed as an input to ArmNN, each source dimension is mapped to the corresponding ArmNN dimension. The Batch dimension remains the same (0 -> 0). The source Height dimension is mapped to the location of the ArmNN Height dimension (1 -> 2). Similar arguments are made for the Width and Channels (2 -> 3 and 3 -> 1). This will lead to m_DimMappings pointing to the following array: [ 0, 2, 3, 1 ].
Note that the mapping should be reversed if considering the case of ArmNN 4-d outputs (Batch Element, Channels, Height, Width) being written to a destination with the format mentioned above. We now have 0 -> 0, 2 -> 1, 3 -> 2, 1 -> 3, which, when reordered, lead to the following m_DimMappings contents: [ 0, 3, 1, 2 ].
Definition at line 20 of file Descriptors.cpp.
References armnn::MaxNumOfTensorDimensions.
PermutationVector | ( | std::initializer_list< ValueType > | dimMappings | ) |
Definition at line 77 of file Descriptors.cpp.
|
inline |
Definition at line 359 of file Types.hpp.
Referenced by ConvertTransposeToTosaOperator().
|
inline |
Definition at line 364 of file Types.hpp.
Referenced by ConvertTransposeToTosaOperator().
|
inline |
Definition at line 357 of file Types.hpp.
Referenced by ConstTensorPin::ConstTensorPin(), armnnOnnxParser::CreateConstTensorImpl(), PermutationVector::IsInverse(), PermutationVector::operator[](), armnnUtils::Permuted(), armnn::PermuteTensor(), armnnUtils::TransposeTensorShape(), PermuteQueueDescriptor::Validate(), and TransposeQueueDescriptor::Validate().
|
inline |
Definition at line 366 of file Types.hpp.
Referenced by TransposeLayer::IsEqual(), PermuteLayer::IsEqual(), PermuteDescriptor::operator==(), and TransposeDescriptor::operator==().
|
inline |
Definition at line 376 of file Types.hpp.
References PermutationVector::GetSize().
Referenced by TransposeLayer::IsInverse(), and PermuteLayer::IsInverse().
Indexing method with out-of-bounds error checking for the m_DimMappings array.
i | - integer value corresponding to index of m_DimMappings array to retrieve element from. |
InvalidArgumentException | when indexing out-of-bounds index of m_DimMappings array. |
Definition at line 347 of file Types.hpp.
References PermutationVector::GetSize().