The OpenD Programming Language

mininitRcslice

Allocates a minimally initialized n-dimensional reference-counted (thread-safe) slice.

Slice!(RCI!T, N)
mininitRcslice
(
T
size_t N
)
(
size_t[N] lengths...
)

Parameters

lengths size_t[N]

list of lengths for each dimension

Return Value

Type: Slice!(RCI!T, N)

contiguous minimally initialized n-dimensional reference-counted (thread-safe) slice

Examples

import mir.ndslice.slice: Slice;
import mir.rc.array: RCI;
auto tensor = mininitRcslice!int(5, 6, 7);
assert(tensor.length == 5);
assert(tensor.elementCount == 5 * 6 * 7);
static assert(is(typeof(tensor) == Slice!(RCI!int, 3)));

Meta