mlx.core.meshgrid

Contents

mlx.core.meshgrid#

meshgrid(*arrays: array, sparse: bool | None = False, indexing: str | None = 'xy', stream: None | Stream | Device = None) array#

Generate multidimensional coordinate grids from 1-D coordinate arrays

Parameters:
  • arrays (array) – Input arrays.

  • sparse (bool, optional) – If True, a sparse grid is returned in which each output array has a single non-zero element. If False, a dense grid is returned. Defaults to False.

  • indexing (str, optional) – Cartesian (‘xy’) or matrix (‘ij’) indexing of the output arrays. Defaults to 'xy'.

Returns:

The output arrays.

Return type:

list(array)