Struct to represent index of each dimension of a tensor.
More...
#include <Index.h>
|
| Index (uint32_t rank) |
| Construct a new Index object.
|
|
| Index (std::initializer_list< int32_t > offsets) |
| Construct a new Index object.
|
|
uint32_t | rank (void) const |
| Get the rank.
|
|
int32_t | at (uint32_t n) const |
| Get the index n'th dimension.
|
|
int32_t & | at (uint32_t n) |
| Get the reference of the index n'th dimension.
|
|
Struct to represent index of each dimension of a tensor.
Definition at line 41 of file Index.h.
◆ Index() [1/2]
nnfw::misc::tensor::Index::Index |
( |
uint32_t |
rank | ) |
|
|
inline |
Construct a new Index
object.
- Parameters
-
Definition at line 48 of file Index.h.
48{ _offsets.resize(
rank); }
uint32_t rank(void) const
Get the rank.
References rank().
◆ Index() [2/2]
nnfw::misc::tensor::Index::Index |
( |
std::initializer_list< int32_t > |
offsets | ) |
|
|
inline |
Construct a new Index
object.
- Parameters
-
[in] | offsets | Rank of a tensor of std::initializer_list<int32_t> type |
Definition at line 55 of file Index.h.
55 : _offsets{offsets}
56 {
57
58 }
◆ at() [1/2]
int32_t & nnfw::misc::tensor::Index::at |
( |
uint32_t |
n | ) |
|
|
inline |
Get the reference of the index n'th dimension.
- Parameters
-
- Returns
- reference of index of n'th dimension
Definition at line 82 of file Index.h.
82{ return _offsets.at(n); }
◆ at() [2/2]
int32_t nnfw::misc::tensor::Index::at |
( |
uint32_t |
n | ) |
const |
|
inline |
◆ rank()
uint32_t nnfw::misc::tensor::Index::rank |
( |
void |
| ) |
const |
|
inline |
Get the rank.
- Returns
- Rank that this
Index
object can handle
- Note
- We can use static_cast
because size of _offsets is decieded by constructor's uintt_32 type argument
Definition at line 67 of file Index.h.
67{ return static_cast<uint32_t>(_offsets.size()); }
Referenced by Index().
The documentation for this struct was generated from the following file:
- runtime/libs/misc/include/misc/tensor/Index.h