a slice to pack
import mir.ndslice.slice: sliced, Slice; auto a = iota(3, 4, 5, 6); auto b = a.ipack!2; static immutable res1 = [3, 4]; static immutable res2 = [5, 6]; assert(b.shape == res1); assert(b[0, 0].shape == res2); assert(a.ipack!2 == b); static assert(is(typeof(b) == typeof(a.ipack!2)));
Creates a packed slice, i.e. slice of slices. Packs the last N - P dimensions. The function does not allocate any data.