ArmNN
 24.08
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 340 of file BaseIterator.hpp.

Constructor & Destructor Documentation

◆ Int32Decoder() [1/2]

Int32Decoder ( const int32_t *  data)
inline

Definition at line 343 of file BaseIterator.hpp.

344  : TypedIterator(data) {}

◆ Int32Decoder() [2/2]

Int32Decoder ( )
inline

Definition at line 346 of file BaseIterator.hpp.

347  : Int32Decoder(nullptr) {}

Member Function Documentation

◆ DecodeTensor()

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

Implements Decoder< float >.

Definition at line 353 of file BaseIterator.hpp.

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

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

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

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:107
armnn::TypedIterator< const int32_t, Decoder< float > >::TypedIterator
TypedIterator(const int32_t *data=nullptr)
Definition: BaseIterator.hpp:68
armnn::Int32Decoder::Int32Decoder
Int32Decoder()
Definition: BaseIterator.hpp:346
armnn::TypedIterator< const int32_t, Decoder< float > >::operator[]
TypedIterator & operator[](const unsigned int index) override
Definition: BaseIterator.hpp:99