ArmNN
 24.02
Int64Decoder Class Reference

#include <BaseIterator.hpp>

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

Public Member Functions

 Int64Decoder (const int64_t *data)
 
 Int64Decoder ()
 
double_t Get () const override
 
std::vector< float > DecodeTensor (const TensorShape &tensorShape, const bool) override
 
- Public Member Functions inherited from TypedIterator< const int64_t, Decoder< double_t > >
 TypedIterator (const int64_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< double_t >
 Decoder ()
 
virtual ~Decoder ()
 
virtual double_t Get () const=0
 
- Public Member Functions inherited from BaseIterator
 BaseIterator ()
 
virtual ~BaseIterator ()
 

Additional Inherited Members

- Protected Attributes inherited from TypedIterator< const int64_t, Decoder< double_t > >
const int64_t * m_Iterator
 
const int64_t * m_Start
 

Detailed Description

Definition at line 399 of file BaseIterator.hpp.

Constructor & Destructor Documentation

◆ Int64Decoder() [1/2]

Int64Decoder ( const int64_t *  data)
inline

Definition at line 402 of file BaseIterator.hpp.

403  : TypedIterator(data) {}

◆ Int64Decoder() [2/2]

Int64Decoder ( )
inline

Definition at line 405 of file BaseIterator.hpp.

406  : Int64Decoder(nullptr) {}

Member Function Documentation

◆ DecodeTensor()

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

Implements Decoder< double_t >.

Definition at line 412 of file BaseIterator.hpp.

413  {
414  const unsigned int size = tensorShape.GetNumElements();
415  std::vector<float> decodedTensor;
416  decodedTensor.reserve(size);
417 
418  for (uint32_t i = 0; i < size; ++i)
419  {
420  this->operator[](i);
421  decodedTensor.emplace_back(static_cast<float>(*m_Iterator));
422  }
423 
424  return decodedTensor;
425  }

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

◆ Get()

double_t Get ( ) const
inlineoverride

Definition at line 408 of file BaseIterator.hpp.

409  {
410  return static_cast<double_t>(*m_Iterator);
411  }

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