ArmNN
 24.02
QSymm16Decoder Class Reference

#include <BaseIterator.hpp>

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

Public Member Functions

 QSymm16Decoder (const int16_t *data, const float scale, const int32_t offset)
 
 QSymm16Decoder (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 int16_t, Decoder< float > >
 TypedIterator (const int16_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 int16_t, Decoder< float > >
const int16_t * m_Iterator
 
const int16_t * m_Start
 

Detailed Description

Definition at line 214 of file BaseIterator.hpp.

Constructor & Destructor Documentation

◆ QSymm16Decoder() [1/2]

QSymm16Decoder ( const int16_t *  data,
const float  scale,
const int32_t  offset 
)
inline

Definition at line 217 of file BaseIterator.hpp.

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

◆ QSymm16Decoder() [2/2]

QSymm16Decoder ( const float  scale,
const int32_t  offset 
)
inline

Definition at line 220 of file BaseIterator.hpp.

221  : QSymm16Decoder(nullptr, scale, offset) {}

Member Function Documentation

◆ DecodeTensor()

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

Implements Decoder< float >.

Definition at line 227 of file BaseIterator.hpp.

228  {
229  const unsigned int size = tensorShape.GetNumElements();
230  std::vector<float> decodedTensor;
231  decodedTensor.reserve(size);
232 
233  for (uint32_t i = 0; i < size; ++i)
234  {
235  this->operator[](i);
236  decodedTensor.emplace_back(armnn::Dequantize(*m_Iterator, m_Scale, m_Offset));
237  }
238 
239  return decodedTensor;
240  }

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

◆ Get()

float Get ( ) const
inlineoverride

Definition at line 223 of file BaseIterator.hpp.

224  {
225  return armnn::Dequantize(*m_Iterator, m_Scale, m_Offset);
226  }

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


The documentation for this class was generated from the following file:
armnn::TypedIterator< const int16_t, Decoder< float > >::m_Iterator
const int16_t * m_Iterator
Definition: BaseIterator.hpp:108
armnn::TypedIterator< const int16_t, Decoder< float > >::TypedIterator
TypedIterator(const int16_t *data=nullptr)
Definition: BaseIterator.hpp:69
armnn::QSymm16Decoder::QSymm16Decoder
QSymm16Decoder(const int16_t *data, const float scale, const int32_t offset)
Definition: BaseIterator.hpp:217
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:52
armnn::TypedIterator< const int16_t, Decoder< float > >::operator[]
TypedIterator & operator[](const unsigned int index) override
Definition: BaseIterator.hpp:100