cupy.meshgrid

cupy.meshgrid(*xi, **kwargs)[source]

Return coordinate matrices from coordinate vectors.

Given one-dimensional coordinate arrays x1, x2, …, xn, this function makes N-D grids.

For one-dimensional arrays x1, x2, …, xn with lengths Ni = len(xi), this function returns (N1, N2, N3, ..., Nn) shaped arrays if indexing=’ij’ or (N2, N1, N3, ..., Nn) shaped arrays if indexing=’xy’.

Unlike NumPy, CuPy currently only supports 1-D arrays as inputs. Also, CuPy does not support sparse option yet.

Parameters:
  • xi (tuple of ndarrays) – 1-D arrays representing the coordinates of a grid.
  • indexing ({'xy', 'ij'}, optional) – Cartesian (‘xy’, default) or matrix (‘ij’) indexing of output.
  • copy (bool, optional) – If False, a view into the original arrays are returned. Default is True.
Returns:

list of cupy.ndarray

See also

numpy.meshgrid()