Slices¶
-
namespace
ndarray
-
namespace
slices
¶ Functions
-
ndarray::Slices
filledSlices
(const ndarray::Shape &in_shape, const ndarray::Slices &slices)¶ return proper format 2D slices vector
Example:
in_shape{3,4,2}, slices{{0,2}, {1,-1,2}} => out_slices{{0,2,1},{1,3,2},{0,2,1}}
in_shape{3,4,2}, slices{{0,none}, {none,-1,2}, {none,none,-1}} => out_slices{{0,4,1},{0,3,2},{1,-1,-1}}
- Return
2D slices vector with proper value and size must be equal in_shape size.
- Parameters
in_shape
: actual shape of the Slices ndarray.slices
: 2D vector with slices value. all inner vector must be size less than or equal one.
-
ndarray::Shape
getSliceOutShape
(const ndarray::Slices &slices)¶ return primary output shape of filtered slices
Example: slices{{0,2,1},{1,3,2},{0,2,1}} => out_shape{2,1,2}
- Return
shape of the output ndarray.
- Parameters
slices
: 2D slices vector
-
ndarray::LL
getSliceStartIndex
(const ndarray::Slices &slices, const ndarray::Stride &stride)¶ return slices base index. from where index will be start.
Example: slices{{2,5,1},{0,3,2}} , stride{6,1} => out = 6*2+0*1 = 12
- Return
start index where from slices will be start.
- Parameters
slices
: 2D slices vectorstride
: actual stride of slices ndarray
-
ndarray::Slices
-
namespace