ArmNN
 24.08
QSymm8PerAxisEncoder Class Reference

#include <BaseIterator.hpp>

Inheritance diagram for QSymm8PerAxisEncoder:
[legend]
Collaboration diagram for QSymm8PerAxisEncoder:
[legend]

Public Member Functions

 QSymm8PerAxisEncoder (int8_t *data, const armnn::TensorInfo &tensorInfo)
 
void Set (float right)
 
float Get () const
 
float GetScale () const
 
- Public Member Functions inherited from PerAxisIterator< int8_t, Encoder< float > >
 PerAxisIterator (int8_t *data=nullptr, unsigned int axisFactor=0, unsigned int axisDimensionality=0)
 
 PerAxisIterator (int8_t *data=nullptr, const armnn::TensorShape &tensorShape=TensorShape(), const unsigned int axis=0)
 
void Reset (void *data) override
 
PerAxisIteratoroperator++ () override
 
PerAxisIteratoroperator+= (const unsigned int increment) override
 
PerAxisIteratoroperator-= (const unsigned int decrement) override
 
PerAxisIteratorSetIndexOnMem (const unsigned int index)
 
PerAxisIteratoroperator[] (const unsigned int index) override
 
- Public Member Functions inherited from Encoder< float >
 Encoder ()
 
virtual ~Encoder ()
 
virtual float Get () const=0
 
- Public Member Functions inherited from BaseIterator
 BaseIterator ()
 
virtual ~BaseIterator ()
 

Additional Inherited Members

- Protected Attributes inherited from PerAxisIterator< int8_t, Encoder< float > >
int8_t * m_Iterator
 
int8_t * m_Start
 
unsigned int m_AxisIndex
 
unsigned int m_AxisDimensionality
 
unsigned int m_AxisFactor
 
unsigned int m_Index
 

Detailed Description

Definition at line 832 of file BaseIterator.hpp.

Constructor & Destructor Documentation

◆ QSymm8PerAxisEncoder()

QSymm8PerAxisEncoder ( int8_t *  data,
const armnn::TensorInfo tensorInfo 
)
inline

Definition at line 835 of file BaseIterator.hpp.

836  : PerAxisIterator(data, tensorInfo.GetShape(), tensorInfo.GetQuantizationDim().value()),
837  m_Scale(tensorInfo.GetQuantizationScales()), m_Offset(tensorInfo.GetQuantizationOffset())
838  {}

Member Function Documentation

◆ Get()

float Get ( ) const
inline

◆ GetScale()

float GetScale ( ) const
inline

Definition at line 851 of file BaseIterator.hpp.

852  {
853  return m_Scale[m_AxisIndex];
854  }

References PerAxisIterator< int8_t, Encoder< float > >::m_AxisIndex.

◆ Set()

void Set ( float  right)
inlinevirtual

Implements Encoder< float >.

Definition at line 840 of file BaseIterator.hpp.

841  {
842  *m_Iterator = armnn::Quantize<int8_t>(right, m_Scale[m_AxisIndex], m_Offset);
843  }

References PerAxisIterator< int8_t, Encoder< float > >::m_AxisIndex, and PerAxisIterator< int8_t, Encoder< float > >::m_Iterator.


The documentation for this class was generated from the following file:
armnn::TensorInfo::GetQuantizationScales
std::vector< float > GetQuantizationScales() const
Definition: Tensor.cpp:451
armnn::PerAxisIterator< int8_t, Encoder< float > >::m_AxisIndex
unsigned int m_AxisIndex
Definition: BaseIterator.hpp:788
armnn::TensorInfo::GetQuantizationDim
Optional< unsigned int > GetQuantizationDim() const
Definition: Tensor.cpp:498
armnn::Dequantize
float Dequantize(QuantizedType value, float scale, int32_t offset)
Dequantize an 8-bit data type into a floating point data type.
Definition: TypesUtils.cpp:48
armnn::PerAxisIterator< int8_t, Encoder< float > >::m_Iterator
int8_t * m_Iterator
Definition: BaseIterator.hpp:786
armnn::TensorInfo::GetShape
const TensorShape & GetShape() const
Definition: Tensor.hpp:193
armnn::TensorInfo::GetQuantizationOffset
int32_t GetQuantizationOffset() const
Definition: Tensor.cpp:482
armnn::PerAxisIterator< int8_t, Encoder< float > >::PerAxisIterator
PerAxisIterator(int8_t *data=nullptr, unsigned int axisFactor=0, unsigned int axisDimensionality=0)
Definition: BaseIterator.hpp:710
armnn::OptionalReferenceSwitch::value
const T & value() const
Definition: Optional.hpp:146