ArmNN
 24.08
QASymm8Decoder Class Reference

#include <BaseIterator.hpp>

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

Public Member Functions

 QASymm8Decoder (const uint8_t *data, const float scale, const int32_t offset)
 
 QASymm8Decoder (const float scale, const int32_t offset)
 
float Get () const override
 
std::vector< float > DecodeTensor (const TensorShape &tensorShape, const bool) override
 
- Public Member Functions inherited from TypedIterator< const uint8_t, Decoder< float > >
 TypedIterator (const uint8_t *data=nullptr)
 
void Reset (void *data) override
 
TypedIteratoroperator++ () override
 
TypedIteratoroperator+= (const unsigned int increment) override
 
TypedIteratoroperator-= (const unsigned int increment) override
 
TypedIteratoroperator[] (const unsigned int index) override
 
- Public Member Functions inherited from Decoder< float >
 Decoder ()
 
virtual ~Decoder ()
 
virtual float Get () const=0
 
- Public Member Functions inherited from BaseIterator
 BaseIterator ()
 
virtual ~BaseIterator ()
 

Additional Inherited Members

- Protected Attributes inherited from TypedIterator< const uint8_t, Decoder< float > >
const uint8_t * m_Iterator
 
const uint8_t * m_Start
 

Detailed Description

Definition at line 111 of file BaseIterator.hpp.

Constructor & Destructor Documentation

◆ QASymm8Decoder() [1/2]

QASymm8Decoder ( const uint8_t *  data,
const float  scale,
const int32_t  offset 
)
inline

Definition at line 114 of file BaseIterator.hpp.

115  : TypedIterator(data), m_Scale(scale), m_Offset(offset) {}

◆ QASymm8Decoder() [2/2]

QASymm8Decoder ( const float  scale,
const int32_t  offset 
)
inline

Definition at line 117 of file BaseIterator.hpp.

118  : QASymm8Decoder(nullptr, scale, offset) {}

Member Function Documentation

◆ DecodeTensor()

std::vector<float> DecodeTensor ( const TensorShape tensorShape,
const bool   
)
inlineoverridevirtual

Implements Decoder< float >.

Definition at line 124 of file BaseIterator.hpp.

125  {
126  const unsigned int size = tensorShape.GetNumElements();
127  std::vector<float> decodedTensor;
128  decodedTensor.reserve(size);
129 
130  for (uint32_t i = 0; i < size; ++i)
131  {
132  this->operator[](i);
133  decodedTensor.emplace_back(armnn::Dequantize(*m_Iterator, m_Scale, m_Offset));
134  }
135 
136  return decodedTensor;
137  }

References armnn::Dequantize(), TensorShape::GetNumElements(), TypedIterator< const uint8_t, Decoder< float > >::m_Iterator, and TypedIterator< const uint8_t, Decoder< float > >::operator[]().

◆ Get()

float Get ( ) const
inlineoverride

Definition at line 120 of file BaseIterator.hpp.

121  {
122  return armnn::Dequantize(*m_Iterator, m_Scale, m_Offset);
123  }

References armnn::Dequantize(), and TypedIterator< const uint8_t, Decoder< float > >::m_Iterator.


The documentation for this class was generated from the following file:
armnn::TypedIterator< const uint8_t, Decoder< float > >::m_Iterator
const uint8_t * m_Iterator
Definition: BaseIterator.hpp:107
armnn::TypedIterator< const uint8_t, Decoder< float > >::TypedIterator
TypedIterator(const uint8_t *data=nullptr)
Definition: BaseIterator.hpp:68
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::TypedIterator< const uint8_t, Decoder< float > >::operator[]
TypedIterator & operator[](const unsigned int index) override
Definition: BaseIterator.hpp:99
armnn::QASymm8Decoder::QASymm8Decoder
QASymm8Decoder(const uint8_t *data, const float scale, const int32_t offset)
Definition: BaseIterator.hpp:114