ArmNN
 24.02
Int32Decoder Class Reference

#include <BaseIterator.hpp>

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

Public Member Functions

 Int32Decoder (const int32_t *data)
 
 Int32Decoder ()
 
float Get () const override
 
std::vector< float > DecodeTensor (const TensorShape &tensorShape, const bool) override
 
- Public Member Functions inherited from TypedIterator< const int32_t, Decoder< float > >
 TypedIterator (const int32_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 int32_t, Decoder< float > >
const int32_t * m_Iterator
 
const int32_t * m_Start
 

Detailed Description

Definition at line 341 of file BaseIterator.hpp.

Constructor & Destructor Documentation

◆ Int32Decoder() [1/2]

Int32Decoder ( const int32_t *  data)
inline

Definition at line 344 of file BaseIterator.hpp.

345  : TypedIterator(data) {}

◆ Int32Decoder() [2/2]

Int32Decoder ( )
inline

Definition at line 347 of file BaseIterator.hpp.

348  : Int32Decoder(nullptr) {}

Member Function Documentation

◆ DecodeTensor()

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

Implements Decoder< float >.

Definition at line 354 of file BaseIterator.hpp.

355  {
356  const unsigned int size = tensorShape.GetNumElements();
357  std::vector<float> decodedTensor;
358  decodedTensor.reserve(size);
359 
360  for (uint32_t i = 0; i < size; ++i)
361  {
362  this->operator[](i);
363  decodedTensor.emplace_back(static_cast<float>(*m_Iterator));
364  }
365 
366  return decodedTensor;
367  }

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

◆ Get()

float Get ( ) const
inlineoverride

Definition at line 350 of file BaseIterator.hpp.

351  {
352  return static_cast<float>(*m_Iterator);
353  }

The documentation for this class was generated from the following file:
armnn::TypedIterator< const int32_t, Decoder< float > >::m_Iterator
const int32_t * m_Iterator
Definition: BaseIterator.hpp:108
armnn::TypedIterator< const int32_t, Decoder< float > >::TypedIterator
TypedIterator(const int32_t *data=nullptr)
Definition: BaseIterator.hpp:69
armnn::Int32Decoder::Int32Decoder
Int32Decoder()
Definition: BaseIterator.hpp:347
armnn::TypedIterator< const int32_t, Decoder< float > >::operator[]
TypedIterator & operator[](const unsigned int index) override
Definition: BaseIterator.hpp:100