dpnp.tensor.meshgrid

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

Creates tuple of dpnp.tensor.usm_ndarray coordinate matrices from vectors.

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

  • indexing ({"xy", "ij"}, optional) --

    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:

out -- tuple of N usm_ndarrays, where N is the number of provided one-dimensional input usm_ndarrays. Each returned array must have rank N. For a set of n vectors with lengths N0, N1, N2, ... The cartesian indexing results in usm_ndarrays of shape (N1, N0, N2, ...), while the matrix indexing results in usm_ndarrays of shape (N0, N1, N2, ...).

Return type:

tuple of usm_ndarrays

Raises:

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