22.05
|
#include <Tensor.hpp>
Public Member Functions | |
TensorShape () | |
Empty (invalid) constructor. More... | |
TensorShape (unsigned int numDimensions, bool initDimensionsSpecificity=true) | |
Constructor for TensorShape. More... | |
TensorShape (unsigned int numDimensions, const unsigned int *dimensionSizes) | |
Constructor for TensorShape. More... | |
TensorShape (std::initializer_list< unsigned int > dimensionSizeList) | |
Constructor for TensorShape. More... | |
TensorShape (const TensorShape &other) | |
Copy Constructor for TensorShape. More... | |
TensorShape (unsigned int numDimensions, const unsigned int *dimensionSizes, const bool *dimensionsSpecificity) | |
Constructor for TensorShape. More... | |
TensorShape (std::initializer_list< unsigned int > dimensionSizeList, std::initializer_list< bool > dimensionsSpecificityList) | |
Constructor for TensorShape. More... | |
TensorShape (Dimensionality dimensionality) | |
Constructor for TensorShape. More... | |
TensorShape & | operator= (const TensorShape &other) |
Assignation function. More... | |
unsigned int | operator[] (unsigned int i) const |
Read only operator. More... | |
unsigned int & | operator[] (unsigned int i) |
Read and write operator. More... | |
bool | operator== (const TensorShape &other) const |
Equality comparison operator. More... | |
bool | operator!= (const TensorShape &other) const |
Inequality comparison operator. More... | |
unsigned int | GetNumDimensions () const |
Function that returns the tensor rank. More... | |
unsigned int | GetNumElements () const |
Function that calculates the tensor elements by multiplying all dimension size which are Specified. More... | |
Dimensionality | GetDimensionality () const |
Function that returns the tensor type. More... | |
bool | GetDimensionSpecificity (unsigned int i) const |
Gets information about if the dimension size has been specified or not. More... | |
void | SetNumDimensions (unsigned int numDimensions, bool initDimensionsSpecificity=false) |
Sets the tensor rank and therefore the Dimensionality is set to Specified if it was not. More... | |
void | SetDimensionSize (unsigned int i, unsigned int dimensionSize) |
Sets the size of the indicated dimension and Specificity for that dimension is set to true. More... | |
bool | AreAllDimensionsSpecified () const |
Checks if there is at least one dimension not specified. More... | |
bool | IsAtLeastOneDimensionSpecified () const |
Checks if there is at least one dimension specified. More... | |
Definition at line 20 of file Tensor.hpp.
TensorShape | ( | ) |
Empty (invalid) constructor.
Definition at line 25 of file Tensor.cpp.
References armnn::Specified.
Referenced by TensorShape::TensorShape().
|
explicit |
Constructor for TensorShape.
numDimensions | - Tensor rank. |
initDimensionsSpecificity | (optional) - value to initialize the specificity of each dimension size. |
Definition at line 30 of file Tensor.cpp.
TensorShape | ( | unsigned int | numDimensions, |
const unsigned int * | dimensionSizes | ||
) |
Constructor for TensorShape.
numDimensions | - Tensor rank. |
dimensionSizes | - Size of each of dimension. |
Definition at line 40 of file Tensor.cpp.
TensorShape | ( | std::initializer_list< unsigned int > | dimensionSizeList | ) |
Constructor for TensorShape.
dimensionSizeList | - Size of each of dimension. |
Definition at line 54 of file Tensor.cpp.
TensorShape | ( | const TensorShape & | other | ) |
Copy Constructor for TensorShape.
other | - TensorShape to copy from. |
Definition at line 116 of file Tensor.cpp.
TensorShape | ( | unsigned int | numDimensions, |
const unsigned int * | dimensionSizes, | ||
const bool * | dimensionsSpecificity | ||
) |
Constructor for TensorShape.
numDimensions | - Tensor rank. |
dimensionSizes | - Size of each of dimension. |
dimensionsSpecificity | - Flags to indicate which dimension has its size specified. |
Definition at line 59 of file Tensor.cpp.
TensorShape | ( | std::initializer_list< unsigned int > | dimensionSizeList, |
std::initializer_list< bool > | dimensionsSpecificityList | ||
) |
Constructor for TensorShape.
dimensionSizeList | - Size of each of dimension. |
dimensionsSpecificityList | - Flags to indicate which dimension size is specified. |
Definition at line 80 of file Tensor.cpp.
References TensorShape::TensorShape().
|
explicit |
Constructor for TensorShape.
dimensionality | - Parameter to indicate if the Tensor is a Scalar, a Tensor of known dimensionality or a Tensor of unknown dimensionality. |
Definition at line 92 of file Tensor.cpp.
References armnn::NotSpecified, armnn::Scalar, and armnn::Specified.
bool AreAllDimensionsSpecified | ( | ) | const |
Checks if there is at least one dimension not specified.
AND of all array elements.
Definition at line 241 of file Tensor.cpp.
Referenced by armnnTfLiteParser::AsFloatArray(), TensorShape::GetDimensionality(), ConstantLayer::ValidateTensorShapesFromInputs(), and Layer::VerifyShapeInferenceType().
|
inline |
Function that returns the tensor type.
Definition at line 92 of file Tensor.hpp.
References TensorShape::AreAllDimensionsSpecified(), TensorShape::GetDimensionSpecificity(), TensorShape::IsAtLeastOneDimensionSpecified(), TensorShape::SetDimensionSize(), TensorShape::SetNumDimensions(), and armnn::Specified.
Referenced by OnnxParserImpl::CreateNetworkFromString(), armnnSerializer::GetFlatBufferArgMinMaxFunction(), GatherNdLayer::InferOutputShapes(), GatherLayer::InferOutputShapes(), Layer::ValidateAndCopyShape(), ConstantLayer::ValidateTensorShapesFromInputs(), and Layer::VerifyShapeInferenceType().
bool GetDimensionSpecificity | ( | unsigned int | i | ) | const |
Gets information about if the dimension size has been specified or not.
i | - Dimension index. |
Definition at line 211 of file Tensor.cpp.
Referenced by TensorShape::GetDimensionality(), armnnSerializer::GetFlatBufferArgMinMaxFunction(), and Layer::ValidateAndCopyShape().
unsigned int GetNumDimensions | ( | ) | const |
Function that returns the tensor rank.
Definition at line 174 of file Tensor.cpp.
Referenced by armnnTfLiteParser::AsFloatArray(), armnn::BatchToSpaceNd(), ShapesAreBroadcastCompatible::CalcInputSize(), armnnDeserializer::CheckShape(), ClStackWorkload::ClStackWorkload(), CompareTensors(), armnnUtils::ConvertTensorShapeToString(), armnn::CopyTensorContentsGeneric(), OnnxParserImpl::CreateNetworkFromString(), ClRankWorkload::Execute(), NeonRankWorkload::Execute(), RefChannelShuffleWorkload::ExecuteAsync(), RefL2NormalizationWorkload::ExecuteAsync(), armnnUtils::ExpandDims(), ExpandTensorShapeTo3dForPermute(), armnnSerializer::GetFlatBufferArgMinMaxFunction(), armnnUtils::GetNumElementsAfter(), armnnUtils::GetNumElementsBetween(), ElementwiseBaseLayer::InferOutputShapes(), GatherNdLayer::InferOutputShapes(), ArgMinMaxLayer::InferOutputShapes(), GatherLayer::InferOutputShapes(), LogicalBinaryLayer::InferOutputShapes(), ComparisonLayer::InferOutputShapes(), PreluLayer::InferOutputShapes(), StackLayer::InferOutputShapes(), PadLayer::InferOutputShapes(), armnn::LogSoftmax(), armnn::MirrorPad(), NeonStackWorkload::NeonStackWorkload(), armnn::operator<<(), TfLiteParserImpl::OutputShapeOfReshape(), TfLiteParserImpl::OutputShapeOfSqueeze(), armnn::Pad(), armnnUtils::Permuted(), ParserPrototxtFixture< TParser >::RunTest(), ShapesAreBroadcastCompatible::ShapesAreBroadcastCompatible(), ShapesAreSameRank::ShapesAreSameRank(), armnn::Slice(), armnn::Softmax(), armnnUtils::SqueezeDims(), TensorBufferArrayView< DataType >::TensorBufferArrayView(), TEST_SUITE(), armnnUtils::TransposeTensorShape(), StackQueueDescriptor::Validate(), ArgMinMaxQueueDescriptor::Validate(), and Layer::ValidateAndCopyShape().
unsigned int GetNumElements | ( | ) | const |
Function that calculates the tensor elements by multiplying all dimension size which are Specified.
Definition at line 181 of file Tensor.cpp.
Referenced by CompareTensors(), CompareVector(), QASymm8Decoder::DecodeTensor(), QASymmS8Decoder::DecodeTensor(), QSymmS8Decoder::DecodeTensor(), QSymm16Decoder::DecodeTensor(), BFloat16Decoder::DecodeTensor(), Float16Decoder::DecodeTensor(), Float32Decoder::DecodeTensor(), ScaledInt32Decoder::DecodeTensor(), Int32Decoder::DecodeTensor(), Int32ToInt32tDecoder::DecodeTensor(), BooleanDecoder::DecodeTensor(), BooleanDecoderBool::DecodeTensor(), QSymm8PerAxisDecoder::DecodeTensor(), ScaledInt32PerAxisDecoder::DecodeTensor(), armnn::DepthToSpace(), armnn::Fill(), armnnUtils::FindMinMax(), and armnn::TransposeConvolution2dImpl().
bool IsAtLeastOneDimensionSpecified | ( | ) | const |
Checks if there is at least one dimension specified.
OR of all array elements.
Definition at line 257 of file Tensor.cpp.
References CHECK_LOCATION, armnn::MaxNumOfTensorDimensions, armnn::NotSpecified, armnn::Scalar, and armnn::Specified.
Referenced by TensorShape::GetDimensionality().
bool operator!= | ( | const TensorShape & | other | ) | const |
Inequality comparison operator.
other | - TensorShape to compare with. |
Definition at line 169 of file Tensor.cpp.
TensorShape & operator= | ( | const TensorShape & | other | ) |
Assignation function.
other | - TensorShape to copy from. |
Definition at line 124 of file Tensor.cpp.
Referenced by TensorInfo::HasMultipleQuantizationScales().
bool operator== | ( | const TensorShape & | other | ) | const |
Equality comparison operator.
other | - TensorShape to compare with. |
Definition at line 160 of file Tensor.cpp.
Referenced by TensorInfo::HasMultipleQuantizationScales().
unsigned int operator[] | ( | unsigned int | i | ) | const |
unsigned int & operator[] | ( | unsigned int | i | ) |
Read and write operator.
i | - Dimension index. |
Definition at line 145 of file Tensor.cpp.
References CHECK_LOCATION, and armnn::Scalar.
void SetDimensionSize | ( | unsigned int | i, |
unsigned int | dimensionSize | ||
) |
Sets the size of the indicated dimension and Specificity for that dimension is set to true.
i | - Dimension index. |
dimensionSize | - size of one dimension. |
Definition at line 232 of file Tensor.cpp.
Referenced by TensorShape::GetDimensionality().
void SetNumDimensions | ( | unsigned int | numDimensions, |
bool | initDimensionsSpecificity = false |
||
) |
Sets the tensor rank and therefore the Dimensionality is set to Specified if it was not.
numDimensions | - Tensor rank. |
initDimensionsSpecificity | (optional) - value to initialize the specificity of each dimension size. |
Definition at line 219 of file Tensor.cpp.
References armnn::Specified.
Referenced by TensorShape::GetDimensionality().