ArmNN
 26.01
Loading...
Searching...
No Matches
QASymmS8Decoder Class Reference

#include <BaseIterator.hpp>

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

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) 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 145 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 148 of file BaseIterator.hpp.

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

◆ QASymmS8Decoder() [2/2]

QASymmS8Decoder ( const float scale,
const int32_t offset )
inline

Definition at line 151 of file BaseIterator.hpp.

152 : 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  )
inlineoverridevirtual

Implements Decoder< float >.

Definition at line 158 of file BaseIterator.hpp.

159 {
160 const unsigned int size = tensorShape.GetNumElements();
161 std::vector<float> decodedTensor;
162 decodedTensor.reserve(size);
163
164 for (uint32_t i = 0; i < size; ++i)
165 {
166 this->operator[](i);
167 decodedTensor.emplace_back(armnn::Dequantize(*m_Iterator, m_Scale, m_Offset));
168 }
169
170 return decodedTensor;
171 }
TypedIterator & operator[](const unsigned int index) override

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

◆ Get()

float Get ( ) const
inlineoverridevirtual

Implements Decoder< float >.

Definition at line 154 of file BaseIterator.hpp.

155 {
156 return armnn::Dequantize(*m_Iterator, m_Scale, m_Offset);
157 }

References armnn::Dequantize, and TypedIterator< const int8_t, Decoder< float > >::m_Iterator.


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