ArmNN
 24.08
Float16Decoder Class Reference

#include <BaseIterator.hpp>

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

Public Member Functions

 Float16Decoder (const Half *data)
 
 Float16Decoder ()
 
float Get () const override
 
std::vector< float > DecodeTensor (const TensorShape &tensorShape, const bool) override
 
- Public Member Functions inherited from TypedIterator< const Half, Decoder< float > >
 TypedIterator (const Half *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 Half, Decoder< float > >
const Halfm_Iterator
 
const Halfm_Start
 

Detailed Description

Definition at line 247 of file BaseIterator.hpp.

Constructor & Destructor Documentation

◆ Float16Decoder() [1/2]

Float16Decoder ( const Half data)
inline

Definition at line 250 of file BaseIterator.hpp.

251  : TypedIterator(data) {}

◆ Float16Decoder() [2/2]

Float16Decoder ( )
inline

Definition at line 253 of file BaseIterator.hpp.

254  : Float16Decoder(nullptr) {}

Member Function Documentation

◆ DecodeTensor()

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

Implements Decoder< float >.

Definition at line 262 of file BaseIterator.hpp.

263  {
264  const unsigned int size = tensorShape.GetNumElements();
265  std::vector<float> decodedTensor;
266  decodedTensor.reserve(size);
267 
268  for (uint32_t i = 0; i < size; ++i)
269  {
270  float val = 0.f;
271  this->operator[](i);
273  decodedTensor.emplace_back(val);
274  }
275 
276  return decodedTensor;
277  }

References FloatingPointConverter::ConvertFloat16To32(), TensorShape::GetNumElements(), TypedIterator< const Half, Decoder< float > >::m_Iterator, and TypedIterator< const Half, Decoder< float > >::operator[]().

◆ Get()

float Get ( ) const
inlineoverride

Definition at line 256 of file BaseIterator.hpp.

257  {
258  float val = 0.f;
260  return val;
261  }

References FloatingPointConverter::ConvertFloat16To32(), and TypedIterator< const Half, Decoder< float > >::m_Iterator.


The documentation for this class was generated from the following file:
armnn::TypedIterator< const Half, Decoder< float > >::m_Iterator
const Half * m_Iterator
Definition: BaseIterator.hpp:107
armnn::TypedIterator< const Half, Decoder< float > >::TypedIterator
TypedIterator(const Half *data=nullptr)
Definition: BaseIterator.hpp:68
armnn::Float16Decoder::Float16Decoder
Float16Decoder()
Definition: BaseIterator.hpp:253
armnnUtils::FloatingPointConverter::ConvertFloat16To32
static void ConvertFloat16To32(const void *srcFloat16Buffer, size_t numElements, float *dstFloat32Buffer)
Definition: FloatingPointConverter.cpp:43
armnn::TypedIterator< const Half, Decoder< float > >::operator[]
TypedIterator & operator[](const unsigned int index) override
Definition: BaseIterator.hpp:99