mlx.core.unstack

Contents

mlx.core.unstack#

unstack(x: array, /, *, axis: int = 0, stream: None | Stream | Device = None) list[array]#

Split an array into a sequence of arrays along the given axis.

The inverse of stack(). The given axis is removed from each of the returned arrays.

Parameters:
  • x (array) – Input array.

  • axis (int, optional) – Axis along which to unstack. Default: 0.

Returns:

A list of arrays, one for each index along axis.

Return type:

list(array)