n-dimensional slice
dimension to be unsqueezed (add new dimension), default values is 0, the first dimension
unsqueezed n+1-dimensional slice of the same slice kind
// [0, 1, 2] -> [[0, 1, 2]] assert([3].iota.unsqueeze == [1, 3].iota); assert([3].iota.universal.unsqueeze == [1, 3].iota); assert([3, 4].iota.unsqueeze == [1, 3, 4].iota); assert([3, 4].iota.canonical.unsqueeze == [1, 3, 4].iota); assert([3, 4].iota.universal.unsqueeze == [1, 3, 4].iota); // [0, 1, 2] -> [[0], [1], [2]] assert([3].iota.unsqueeze(-1) == [3, 1].iota); assert([3].iota.unsqueeze!(-1) == [3, 1].iota); assert([3].iota.universal.unsqueeze(-1) == [3, 1].iota); assert([3].iota.universal.unsqueeze!(-1) == [3, 1].iota); assert([3, 4].iota.unsqueeze(-1) == [3, 4, 1].iota); assert([3, 4].iota.unsqueeze!(-1) == [3, 4, 1].iota); assert([3, 4].iota.canonical.unsqueeze(-1) == [3, 4, 1].iota); assert([3, 4].iota.canonical.unsqueeze!(-1) == [3, 4, 1].iota); assert([3, 4].iota.universal.unsqueeze(-1) == [3, 4, 1].iota); assert([3, 4].iota.universal.unsqueeze!(-1) == [3, 4, 1].iota);
Constructs a view of an n-dimensional slice with a dimension added at axis. Used to unsqueeze a squeezed slice.