20.08
|
#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 26 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 31 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 41 of file Tensor.cpp.
TensorShape | ( | std::initializer_list< unsigned int > | dimensionSizeList | ) |
Constructor for TensorShape.
dimensionSizeList | - Size of each of dimension. |
Definition at line 55 of file Tensor.cpp.
TensorShape | ( | const TensorShape & | other | ) |
Copy Constructor for TensorShape.
other | - TensorShape to copy from. |
Definition at line 117 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 60 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 81 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 93 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 242 of file Tensor.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), 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 BOOST_AUTO_TEST_CASE(), Layer::ValidateAndCopyShape(), ConstantLayer::ValidateTensorShapesFromInputs(), Layer::VerifyShapeInferenceType(), and SerializerVisitor::VisitQuantizedLstmLayer().
bool GetDimensionSpecificity | ( | unsigned int | i | ) | const |
Gets information about if the dimension size has been specified or not.
i | - Dimension index. |
Definition at line 212 of file Tensor.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), TensorShape::GetDimensionality(), and Layer::ValidateAndCopyShape().
unsigned int GetNumDimensions | ( | ) | const |
Function that returns the tensor rank.
Definition at line 175 of file Tensor.cpp.
Referenced by armnn::BatchToSpaceNd(), BOOST_AUTO_TEST_CASE(), armnn::boost_test_print_type(), ShapesAreBroadcastCompatible::CalcInputSize(), armnnDeserializer::CheckShape(), ClStackWorkload::ClStackWorkload(), armnnUtils::ConvertTensorShapeToString(), armnn::CopyTensorContentsGeneric(), OnnxParser::CreateNetworkFromString(), RefL2NormalizationWorkload::Execute(), armnnUtils::ExpandDims(), ExpandTensorShapeTo3dForPermute(), armnnUtils::GetNumElementsAfter(), armnnUtils::GetNumElementsBetween(), ArgMinMaxLayer::InferOutputShapes(), ComparisonLayer::InferOutputShapes(), PreluLayer::InferOutputShapes(), StackLayer::InferOutputShapes(), PadLayer::InferOutputShapes(), armnn::LogSoftmax(), NeonStackWorkload::NeonStackWorkload(), armnn::operator<<(), armnnTfParser::OutputShapeOfExpandDims(), armnnTfParser::OutputShapeOfSqueeze(), armnn::Pad(), armnnUtils::Permuted(), ParserPrototxtFixture< armnnOnnxParser::IOnnxParser >::RunTest(), ShapesAreBroadcastCompatible::ShapesAreBroadcastCompatible(), ShapesAreSameRank::ShapesAreSameRank(), armnn::Slice(), armnn::Softmax(), TensorBufferArrayView< DataType >::TensorBufferArrayView(), TfParser::TfParser(), armnnUtils::TransposeTensorShape(), StackQueueDescriptor::Validate(), ArgMinMaxQueueDescriptor::Validate(), Layer::ValidateAndCopyShape(), SerializerVisitor::VisitQuantizedLstmLayer(), SerializerVisitor::VisitReshapeLayer(), and SerializerVisitor::VisitStackLayer().
unsigned int GetNumElements | ( | ) | const |
Function that calculates the tensor elements by multiplying all dimension size which are Specified.
Definition at line 182 of file Tensor.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), 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 258 of file Tensor.cpp.
References CHECK_LOCATION, armnn::MaxNumOfTensorDimensions, armnn::NotSpecified, armnn::Scalar, and armnn::Specified.
Referenced by BOOST_AUTO_TEST_CASE(), and TensorShape::GetDimensionality().
bool operator!= | ( | const TensorShape & | other | ) | const |
Inequality comparison operator.
other | - TensorShape to compare with. |
Definition at line 170 of file Tensor.cpp.
TensorShape & operator= | ( | const TensorShape & | other | ) |
Assignation function.
other | - TensorShape to copy from. |
Definition at line 125 of file Tensor.cpp.
bool operator== | ( | const TensorShape & | other | ) | const |
Equality comparison operator.
other | - TensorShape to compare with. |
Definition at line 161 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 146 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 233 of file Tensor.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), and 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 220 of file Tensor.cpp.
References armnn::Specified.
Referenced by BOOST_AUTO_TEST_CASE(), and TensorShape::GetDimensionality().