tenzr::Slice¶
Per-axis slicing bounds (start, stop, step) used to restrict arrays and layouts.
#include <layout.h>
Public Functions¶
| Name | |
|---|---|
| Slice | All() Select an entire axis. |
| Slice | Index(int64_t idx) Select a single index along an axis. |
| Slice | Range(int64_t start_idx, int64_t stop_idx, int64_t step_size =1) Select the stepped range [start_idx, stop_idx) along an axis. |
Public Attributes¶
| Name | |
|---|---|
| std::optional< int64_t > | start Start index; nullopt means from the beginning. |
| std::optional< int64_t > | stop Stop index (exclusive); nullopt means through the end. |
| int64_t | step Stride between selected elements. |
Public Functions Documentation¶
function All¶
Select an entire axis.
function Index¶
Select a single index along an axis.
function Range¶
Select the stepped range [start_idx, stop_idx) along an axis.
Public Attributes Documentation¶
variable start¶
Start index; nullopt means from the beginning.
variable stop¶
Stop index (exclusive); nullopt means through the end.
variable step¶
Stride between selected elements.