slice

Slices the result of an operation.

slice
(,
size_t[] start
,
size_t[] stop
,
string mod = __MODULE__
,
size_t line = __LINE__
)

Parameters

input Operation

The operation that should be sliced.

start size_t[]

The starting indices for each dimension.

stop size_t[]

The stopping indices for each dimension.

Return Value

Type: Operation

The new Operation.

Examples

import dopt.core : evaluate;

auto s1 = int32([3, 3], [
    1, 2, 3,
    4, 5, 6,
    7, 8, 9
]).slice([1, 1], [3, 3]);

assert(s1.evaluate().get!int == [
    5, 6,
    8, 9
]);

Meta