ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert_micro::core::OMAxisData< IntType > Class Template Reference

#include <OMCustomTensorData.h>

Collaboration diagram for onert_micro::core::OMAxisData< IntType >:

Public Member Functions

 OMAxisData (int32_t *data, const circle::Tensor *tensor)
 
IntType * Get () noexcept override
 
const IntType * Get () const noexcept override
 
- Public Member Functions inherited from onert_micro::core::OMTensorData< TData, TValue >
 OMTensorData (TData *data, const circle::Tensor *tensor)
 
size_t Size () const noexcept
 
bool IsNull () const noexcept
 
template<typename R = TValue>
EnableIfNotConst< R, R > At (size_t idx)
 
TValue At (size_t idx) const
 
template<typename R = TValue>
EnableIfNotConst< R, void > SetAt (size_t idx, R value)
 

Additional Inherited Members

- Protected Member Functions inherited from onert_micro::core::OMTensorData< TData, TValue >
virtual bool CheckIndex (size_t idx) const
 
- Protected Attributes inherited from onert_micro::core::OMTensorData< TData, TValue >
TData * _data = nullptr
 
size_t _size = 0
 

Detailed Description

template<typename IntType = uint32_t>
class onert_micro::core::OMAxisData< IntType >

Definition at line 87 of file OMCustomTensorData.h.

Constructor & Destructor Documentation

◆ OMAxisData()

template<typename IntType = uint32_t>
onert_micro::core::OMAxisData< IntType >::OMAxisData ( int32_t *  data,
const circle::Tensor *  tensor 
)
inline

Definition at line 92 of file OMCustomTensorData.h.

93 : OMTensorData<int32_t, IntType>(data, tensor)
94 {
95 /*
96 Handle negative index.
97 A positive index 'p_idx' can be represented as a negative index 'n_idx' as:
98 n_idx = p_idx - num_dims.
99 eg: For num_dims=3, [0, 1, 2] is the same as [-3, -2, -1].
100 */
101 std::transform(data, data + this->_size, std::back_inserter(_axes), [this](auto axis)
102 {
103 auto offset = this->_size * static_cast<size_t>(axis < 0);
104 return static_cast<IntType>(axis + offset);
105 });
106 }
__global uchar * offset(const Image *img, int x, int y)
Definition helpers.h:540

References onert_micro::core::OMTensorData< TData, TValue >::_size, and offset().

Member Function Documentation

◆ Get() [1/2]

template<typename IntType = uint32_t>
const IntType * onert_micro::core::OMAxisData< IntType >::Get ( ) const
inlineoverridevirtualnoexcept

Reimplemented from onert_micro::core::OMTensorData< TData, TValue >.

Definition at line 114 of file OMCustomTensorData.h.

115 {
116 return _axes.data();
117 }

◆ Get() [2/2]

template<typename IntType = uint32_t>
IntType * onert_micro::core::OMAxisData< IntType >::Get ( )
inlineoverridevirtualnoexcept

Reimplemented from onert_micro::core::OMTensorData< TData, TValue >.

Definition at line 109 of file OMCustomTensorData.h.

110 {
111 return _axes.data();
112 }

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