unsqueeze

unsqueeze/add redundant size-1 dimension (axis) d

unsqueeze
(
size_t d
T
size_t dim
alias Storage
)
(
Variable!(T, dim, Storage) x
)

Examples

import mir.ndslice;
auto x = iota(3, 4, 5).as!double.slice.variable;
assert(x.unsqueeze!2.shape == [3, 4, 1, 5]);

Meta