ArmNN
 22.05.01
Int32Decoder Class Reference

#include <BaseIterator.hpp>

Inheritance diagram for Int32Decoder:
TypedIterator< const int32_t, Decoder< float > > Decoder< float > BaseIterator

Public Member Functions

 Int32Decoder (const int32_t *data)
 
 Int32Decoder ()
 
float Get () const override
 
std::vector< float > DecodeTensor (const TensorShape &tensorShape, const bool isDepthwise) 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 ()
 
- 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 402 of file BaseIterator.hpp.

Constructor & Destructor Documentation

◆ Int32Decoder() [1/2]

Int32Decoder ( const int32_t *  data)
inline

Definition at line 405 of file BaseIterator.hpp.

406  : TypedIterator(data) {}

◆ Int32Decoder() [2/2]

Int32Decoder ( )
inline

Definition at line 408 of file BaseIterator.hpp.

409  : Int32Decoder(nullptr) {}

Member Function Documentation

◆ DecodeTensor()

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

Implements Decoder< float >.

Definition at line 415 of file BaseIterator.hpp.

References TensorShape::GetNumElements(), armnn::IgnoreUnused(), and BaseIterator::operator[]().

417  {
418  IgnoreUnused(isDepthwise);
419 
420  const unsigned int size = tensorShape.GetNumElements();
421  std::vector<float> decodedTensor;
422  decodedTensor.reserve(size);
423 
424  for (uint32_t i = 0; i < size; ++i)
425  {
426  this->operator[](i);
427  decodedTensor.emplace_back(static_cast<float>(*m_Iterator));
428  }
429 
430  return decodedTensor;
431  }
void IgnoreUnused(Ts &&...)
TypedIterator & operator[](const unsigned int index) override

◆ Get()

float Get ( ) const
inlineoverridevirtual

Implements Decoder< float >.

Definition at line 411 of file BaseIterator.hpp.

412  {
413  return static_cast<float>(*m_Iterator);
414  }

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