mlx.core.repeat

Contents

mlx.core.repeat#

repeat(array: array, repeats: int, axis: int | None = None, *, stream: None | Stream | Device = None) array#

Repeat an array along a specified axis.

Parameters:
  • array (array) – Input array.

  • repeats (int) – The number of repetitions for each element.

  • axis (int, optional) – The axis in which to repeat the array along. If unspecified it uses the flattened array of the input and repeats along axis 0.

  • stream (Stream, optional) – Stream or device. Defaults to None.

Returns:

The resulting repeated array.

Return type:

array