ArmNN
 22.05.01
QASymmS8Decoder Class Reference

#include <BaseIterator.hpp>

Inheritance diagram for QASymmS8Decoder:
TypedIterator< const int8_t, Decoder< float > > Decoder< float > BaseIterator

Public Member Functions

 QASymmS8Decoder (const int8_t *data, const float scale, const int32_t offset)
 
 QASymmS8Decoder (const float scale, const int32_t offset)
 
float Get () const override
 
std::vector< float > DecodeTensor (const TensorShape &tensorShape, const bool isDepthwise) override
 
- Public Member Functions inherited from TypedIterator< const int8_t, Decoder< float > >
 TypedIterator (const int8_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 ()
 
- Public Member Functions inherited from BaseIterator
 BaseIterator ()
 
virtual ~BaseIterator ()
 

Additional Inherited Members

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

Detailed Description

Definition at line 152 of file BaseIterator.hpp.

Constructor & Destructor Documentation

◆ QASymmS8Decoder() [1/2]

QASymmS8Decoder ( const int8_t *  data,
const float  scale,
const int32_t  offset 
)
inline

Definition at line 155 of file BaseIterator.hpp.

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

◆ QASymmS8Decoder() [2/2]

QASymmS8Decoder ( const float  scale,
const int32_t  offset 
)
inline

Definition at line 158 of file BaseIterator.hpp.

159  : QASymmS8Decoder(nullptr, scale, offset) {}
QASymmS8Decoder(const int8_t *data, const float scale, const int32_t offset)

Member Function Documentation

◆ DecodeTensor()

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

Implements Decoder< float >.

Definition at line 165 of file BaseIterator.hpp.

References armnn::Dequantize, TensorShape::GetNumElements(), armnn::IgnoreUnused(), and BaseIterator::operator[]().

167  {
168  IgnoreUnused(isDepthwise);
169 
170  const unsigned int size = tensorShape.GetNumElements();
171  std::vector<float> decodedTensor;
172  decodedTensor.reserve(size);
173 
174  for (uint32_t i = 0; i < size; ++i)
175  {
176  this->operator[](i);
177  decodedTensor.emplace_back(armnn::Dequantize(*m_Iterator, m_Scale, m_Offset));
178  }
179 
180  return decodedTensor;
181  }
void IgnoreUnused(Ts &&...)
TypedIterator & operator[](const unsigned int index) override

◆ Get()

float Get ( ) const
inlineoverridevirtual

Implements Decoder< float >.

Definition at line 161 of file BaseIterator.hpp.

References armnn::Dequantize.


The documentation for this class was generated from the following file: