ONE - On-device Neural Engine
|
Index class for 4D tensor to calculate linear index from multi-dimensional indices. More...
#include <ArrayIndex.h>
Public Member Functions | |
Array4DIndex (uint32_t d0, uint32_t d1, uint32_t d2, uint32_t d3) | |
uint32_t | operator() (uint32_t i0, uint32_t i1, uint32_t i2, uint32_t i3) const |
Calculate linear index from multi-dimensional indices. | |
uint32_t | size (void) const |
Get total number of elements in the tensor. | |
uint32_t | stride (uint32_t axis) const |
Get stride of the given axis. | |
Index class for 4D tensor to calculate linear index from multi-dimensional indices.
Definition at line 26 of file ArrayIndex.h.
luci::Array4DIndex::Array4DIndex | ( | uint32_t | d0, |
uint32_t | d1, | ||
uint32_t | d2, | ||
uint32_t | d3 | ||
) |
Definition at line 29 of file ArrayIndex.cpp.
References THROW_UNLESS.
uint32_t luci::Array4DIndex::operator() | ( | uint32_t | i0, |
uint32_t | i1, | ||
uint32_t | i2, | ||
uint32_t | i3 | ||
) | const |
Calculate linear index from multi-dimensional indices.
Definition at line 43 of file ArrayIndex.cpp.
References THROW_UNLESS.
uint32_t luci::Array4DIndex::size | ( | void | ) | const |
Get total number of elements in the tensor.
Definition at line 50 of file ArrayIndex.cpp.
References THROW_UNLESS.
uint32_t luci::Array4DIndex::stride | ( | uint32_t | axis | ) | const |
Get stride of the given axis.
Definition at line 61 of file ArrayIndex.cpp.