The OpenD Programming Language

uninitSlice

GC-Allocates an uninitialized n-dimensional slice.

uninitSlice
(
T
size_t N
)
(
size_t[N] lengths...
)

Parameters

lengths size_t[N]

list of lengths for each dimension

Return Value

Type: auto

contiguous uninitialized n-dimensional slice

Examples

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

Meta