Class to iterate indexes available for given shape.
More...
#include <IndexIterator.h>
Class to iterate indexes available for given shape.
Definition at line 40 of file IndexIterator.h.
◆ IndexIterator() [1/3]
nnfw::misc::tensor::IndexIterator::IndexIterator |
( |
const Shape & |
shape | ) |
|
|
inline |
Construct a new IndexIterator
object.
- Parameters
-
[in] | shape | Shape of tensor of which index will be iterated |
Definition at line 47 of file IndexIterator.h.
47 : _shape(shape)
48 {
49
50 }
◆ IndexIterator() [2/3]
nnfw::misc::tensor::IndexIterator::IndexIterator |
( |
IndexIterator && |
| ) |
|
|
default |
Construct a new IndexIterator object using reference.
- Parameters
-
[in] | IndexIterator | IndexIterator object to move |
◆ IndexIterator() [3/3]
nnfw::misc::tensor::IndexIterator::IndexIterator |
( |
const IndexIterator & |
| ) |
|
|
delete |
Prevent copy constructor.
◆ iter()
template<typename Callable >
IndexIterator & nnfw::misc::tensor::IndexIterator::iter |
( |
Callable |
fn | ) |
|
|
inline |
Iterate all available indexes and run a function for each index.
- Parameters
-
[in] | fn | Function that requires an index as a parameter. |
- Returns
IndexIterator
object
Definition at line 70 of file IndexIterator.h.
71 {
72 for (IndexEnumerator e{_shape}; e.valid(); e.advance())
73 {
74 fn(e.curr());
75 }
76
77 return (*this);
78 }
Referenced by nnfw::misc::tensor::operator<<().
The documentation for this class was generated from the following file: