14 #include <initializer_list> 28 TensorShape(
unsigned int numDimensions,
const unsigned int* dimensionSizes);
30 TensorShape(std::initializer_list<unsigned int> dimensionSizeList);
47 std::array<unsigned int, MaxNumOfTensorDimensions> m_Dimensions;
48 unsigned int m_NumDimensions;
50 void CheckDimensionIndex(
unsigned int i)
const;
61 float quantizationScale = 0.0f,
62 int32_t quantizationOffset = 0);
65 const unsigned int* dimensionSizes,
67 float quantizationScale = 0.0f,
68 int32_t quantizationOffset = 0);
72 const std::vector<float>& quantizationScales,
73 unsigned int quantizationDim);
76 const unsigned int* dimensionSizes,
78 const std::vector<float>& quantizationScales,
79 unsigned int quantizationDim);
100 bool HasPerAxisQuantization()
const;
102 std::vector<float> GetQuantizationScales()
const;
103 void SetQuantizationScales(
const std::vector<float>& scales);
105 float GetQuantizationScale()
const;
108 int32_t GetQuantizationOffset()
const;
114 bool IsQuantized()
const;
117 bool IsTypeSpaceMatch(
const TensorInfo& other)
const;
119 unsigned int GetNumBytes()
const;
133 bool operator==(
const Quantization& other)
const 135 return ((m_Scales == other.m_Scales) && (m_Offset == other.m_Offset) &&
136 (m_QuantizationDim == other.m_QuantizationDim));
139 std::vector<float> m_Scales;
148 template<
typename MemoryType>
214 template <
template<
typename,
typename...>
class ContainerType,
typename T,
typename...ContainerArgs >
216 :
BaseTensor<const void*>(info, container.data())
218 if (container.size() *
sizeof(T) != info.
GetNumBytes())
225 using InputTensors = std::vector<std::pair<LayerBindingId, class ConstTensor>>;
unsigned int GetNumBytes() const
unsigned int GetNumDimensions() const
DataType GetDataType() const
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
std::vector< std::pair< LayerBindingId, class Tensor > > OutputTensors
unsigned int GetNumDimensions() const
unsigned int GetNumElements() const
ConstTensor(const TensorInfo &info, const ContainerType< T, ContainerArgs... > &container)
std::pair< armnn::LayerBindingId, armnn::TensorInfo > BindingPointInfo
const TensorShape & GetShape() const
bool operator!=(const TensorShape &other) const
TensorShape()
Empty (invalid) constructor.
boxEncodingsInfo SetQuantizationOffset(1)
ConstTensor(const Tensor &other)
Can be implicitly constructed from non-const Tensor.
unsigned int GetNumBytes() const
A tensor defined by a TensorInfo (shape and data type) and a mutable backing store.
bool operator==(const TensorShape &other) const
unsigned int operator[](unsigned int i) const
std::vector< std::pair< LayerBindingId, class ConstTensor > > InputTensors
unsigned int GetNumDimensions() const
unsigned int GetNumElements() const
void SetDataType(DataType type)
void SetShape(const TensorShape &newShape)
bool HasMultipleQuantizationScales() const
const TensorInfo & GetInfo() const
TensorShape & operator=(const TensorShape &other)
boxEncodingsInfo SetQuantizationScale(1.0f)
unsigned int GetNumElements() const
DataType GetDataType() const
MemoryType GetMemoryArea() const
const TensorShape & GetShape() const