Split a tensor along its first (vertical) axis.
NumPy-style vertical split: cuts the input into pieces along axis 0.
With an integer k, the tensor is divided into k equal pieces;
with a sequence of indices, the cuts occur at those positions.
Parameters
inputTensorInput tensor with at least 2 dimensions.
indices_or_sectionsint | Sequence[int]int: number of equal-sized splits; it must divide the axis length (tensor_splittakes one that does not).Sequence[int]: cut indices along axis 0.
Returns
list[Tensor]Sub-tensors whose stacking along axis 0 reproduces input.
Raises
lucid._C.engine.InvalidArgumentIf
input.ndim < 2, or a section count does not divide axis 0.Notes
For a tensor of shape split into k pieces, each
piece has shape .
Examples
>>> import lucid
>>> x = lucid.arange(12).reshape(4, 3)
>>> [s.shape for s in lucid.vsplit(x, 2)]
[(2, 3), (2, 3)]