dpctl.tensor.meshgrid

dpctl.tensor.meshgrid(*arrays, indexing='xy')[source]

Creates list of dpctl.tensor.usm_ndarray coordinate matrices from vectors.

Parameters:
  • arrays (usm_ndarray) – an arbitrary number of one-dimensional arrays representing grid coordinates. Each array should have the same numeric data type.

  • indexing ("xy", or "ij") – Cartesian ("xy") or matrix ("ij") indexing of output. If provided zero or one one-dimensional vector(s) (i.e., the zero- and one-dimensional cases, respectively), the indexing keyword has no effect and should be ignored. Default: "xy"

Returns:

list of N arrays, where N is the number of provided one-dimensional input arrays. Each returned array must have rank N. For a set of n vectors with lengths N0, N1, N2, … The cartesian indexing results in arrays of shape (N1, N0, N2, ...), while the matrix indexing results in arrays of shape (N0, N1, N2, ...). Default: "xy".

Return type:

List[array]

Raises:

ValueError – If vectors are not of the same data type, or are not one-dimensional.