24.02
|
#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.
References armnn::Specified.
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.
References armnn::Specified.
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.
References armnn::Specified.
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 armnn_driver::DumpTensor(), armnn_driver::IsDynamicTensor(), ConstantLayer::ValidateTensorShapesFromInputs(), and Layer::VerifyShapeInferenceType().
|
inline |
Function that returns the tensor type.
Definition at line 92 of file Tensor.hpp.
Referenced by armnn_driver::ComputeShape(), GatherNdLayer::InferOutputShapes(), GatherLayer::InferOutputShapes(), armnn_driver::IsDynamicTensor(), armnn::operator<<(), 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 armnn::operator<<(), and Layer::ValidateAndCopyShape().
unsigned int GetNumDimensions | ( | ) | const |
Function that returns the tensor rank.
Definition at line 174 of file Tensor.cpp.
Referenced by ShapesAreBroadcastCompatible::CalcInputSize(), armnnDeserializer::CheckShape(), ClStackWorkload::ClStackWorkload(), armnn::ClUnidirectionalSequenceLstmFloatWorkloadValidate(), armnn_driver::ComputeShape(), armnn_driver::ConvertPaddings(), armnnUtils::ConvertTensorShapeToString(), armnn::CoordinatesToIndex(), armnn::CopyTensorContentsGeneric(), ClRankWorkload::Execute(), NeonRankWorkload::Execute(), armnnUtils::ExpandDims(), armnnUtils::ExpandDimsToRank(), BatchMatMulDescriptor::GetAxesNotMul(), BatchMatMulDescriptor::GetAxesToMul(), TensorInfo::GetNumDimensions(), armnnUtils::GetNumElementsAfter(), armnnUtils::GetNumElementsBetween(), armnn::GetOffset(), BatchMatMulDescriptor::GetPermuteVec(), GetTosaTensorShape(), armnn::GetUnpaddedTensorStrides(), ElementwiseBaseLayer::InferOutputShapes(), GatherNdLayer::InferOutputShapes(), BatchMatMulLayer::InferOutputShapes(), TileLayer::InferOutputShapes(), ElementwiseBinaryLayer::InferOutputShapes(), GatherLayer::InferOutputShapes(), ArgMinMaxLayer::InferOutputShapes(), StridedSliceLayer::InferOutputShapes(), LogicalBinaryLayer::InferOutputShapes(), ComparisonLayer::InferOutputShapes(), PreluLayer::InferOutputShapes(), ReduceLayer::InferOutputShapes(), Pooling2dLayer::InferOutputShapes(), Pooling3dLayer::InferOutputShapes(), StackLayer::InferOutputShapes(), MeanLayer::InferOutputShapes(), PadLayer::InferOutputShapes(), Convolution2dLayer::InferOutputShapes(), Convolution3dLayer::InferOutputShapes(), DepthwiseConvolution2dLayer::InferOutputShapes(), TransposeConvolution2dLayer::InferOutputShapes(), armnn::LogSoftmax(), armnn::MirrorPad(), NeonStackWorkload::NeonStackWorkload(), armnn::NeonUnidirectionalSequenceLstmFloatWorkloadValidate(), armnn::NeonUnidirectionalSequenceLstmWorkloadValidate(), armnn::Offset(), armnn::operator<<(), armnn::Pad(), armnnUtils::Permuted(), armnnUtils::ReduceDims(), ShapesAreBroadcastCompatible::ShapesAreBroadcastCompatible(), ShapesAreSameRank::ShapesAreSameRank(), armnn::Slice(), armnn::Softmax(), armnnUtils::SqueezeDims(), TensorBufferArrayView< DataType >::TensorBufferArrayView(), 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 armnn_driver::ConvertPaddings(), QASymm8Decoder::DecodeTensor(), QASymmS8Decoder::DecodeTensor(), QSymmS8Decoder::DecodeTensor(), QSymm16Decoder::DecodeTensor(), Float16Decoder::DecodeTensor(), Float32Decoder::DecodeTensor(), ScaledInt32Decoder::DecodeTensor(), Int32Decoder::DecodeTensor(), Int32ToInt32tDecoder::DecodeTensor(), Int64Decoder::DecodeTensor(), BooleanDecoder::DecodeTensor(), BooleanDecoderBool::DecodeTensor(), QSymm8PerAxisDecoder::DecodeTensor(), ScaledInt32PerAxisDecoder::DecodeTensor(), armnn::DepthToSpace(), armnn_driver::DumpTensor(), armnn::Fill(), armnnUtils::FindMinMax(), TensorInfo::GetNumElements(), 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.
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.
bool operator== | ( | const TensorShape & | other | ) | const |
Equality comparison operator.
other | - TensorShape to compare with. |
Definition at line 160 of file Tensor.cpp.
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.
unsigned int operator[] | ( | unsigned int | i | ) | const |
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.
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.