23#ifndef __NNFW_MISC_TENSOR_INDEX_ENUMERATOR_H__
24#define __NNFW_MISC_TENSOR_INDEX_ENUMERATOR_H__
50 for (uint32_t axis = 0; axis < rank; ++axis)
55 for (_cursor = 0; _cursor < rank; ++_cursor)
97 while ((_cursor < rank) && !(_index.
at(_cursor) + 1 <
_shape.
dim(_cursor)))
108 _index.
at(_cursor) += 1;
110 for (uint32_t axis = 0; axis < _cursor; ++axis)
Class to enumerate index of a tensor.
bool valid(void) const
Check if more enumeration is available.
IndexEnumerator(IndexEnumerator &&)=delete
Prevent constructing IndexEnumerator object by using R-value reference.
void advance(void)
Advance index by +1.
IndexEnumerator(const IndexEnumerator &)=delete
Prevent copy constructor.
const Index & curr(void) const
Get the current index to enumerate.
IndexEnumerator(const Shape &shape)
Construct a new IndexEnumerator object.
const Shape _shape
Shape to enumerate.
Class to represent shape of a tensor.
int32_t dim(uint32_t n) const
Get specific dimension.
uint32_t rank(void) const
Get the rank of this shape.
This file contains nnfw::misc::tensor::Index struct.
This file contains nnfw::misc::tensor::Shape class.
Struct to represent index of each dimension of a tensor.
int32_t at(uint32_t n) const
Get the index n'th dimension.