Implementing kernel
C++ engine symbols that back this Python API.Remove dim and return the slices along it.
Equivalent to [x.select(dim, i) for i in range(x.size(dim))] but
implemented as a single op. On the CPU each slice is a view of
x's buffer, so writing to one changes x; on metal each slice
is a copy.
Parameters
inputTensorSource tensor.
dimDimLike= ...Dimension to unbind.
Returns
tuple of Tensorinput.size(dim) views, each of rank input.ndim - 1.
Notes
The inverse operation is stack along the same dim. Useful
for unpacking batched sequences without copying.
Examples
>>> import lucid
>>> x = lucid.tensor([[1, 2], [3, 4]])
>>> a, b = lucid.unbind(x, dim=0)
>>> b
Tensor([3, 4])