ArmNN
 24.02
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 248 of file BaseIterator.hpp.

Constructor & Destructor Documentation

◆ Float16Decoder() [1/2]

Float16Decoder ( const Half data)
inline

Definition at line 251 of file BaseIterator.hpp.

252  : TypedIterator(data) {}

◆ Float16Decoder() [2/2]

Float16Decoder ( )
inline

Definition at line 254 of file BaseIterator.hpp.

255  : Float16Decoder(nullptr) {}

Member Function Documentation

◆ DecodeTensor()

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

Implements Decoder< float >.

Definition at line 263 of file BaseIterator.hpp.

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

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 257 of file BaseIterator.hpp.

258  {
259  float val = 0.f;
261  return val;
262  }

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:108
armnn::TypedIterator< const Half, Decoder< float > >::TypedIterator
TypedIterator(const Half *data=nullptr)
Definition: BaseIterator.hpp:69
armnn::Float16Decoder::Float16Decoder
Float16Decoder()
Definition: BaseIterator.hpp:254
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:100