torch.meshgrid
torch.meshgrid(*tensors, indexing=None)
Creates grids of coordinates specified by the 1D inputs in
   attr:tensors.
This is helpful when you want to visualize data over some range of
   inputs. See below for a plotting example.
Given N 1D tensors T_0 \ldots T_{N-1} as inputs with corresponding
   sizes S_0 \ldots S_{N-1}, this creates N N-dimensional tensors G_0
   \ldots G_{N-1}, each with shape (S_0, ..., S_{N-1}) where the
   output G_i is constructed by expanding T_i to the result shape.
Note:
 0D inputs are treated equivalently to 1D inputs of a single
 element.

Warning:
 *torch.meshgrid(*tensors)* currently has the same behavior as
 calling *numpy.meshgrid(*arrays, indexing='ij')*.In the future
 *torch.meshgrid* will transition to *indexing='xy'* as the
 default.https://github.com/pytorch/pytorch/issues/50276 tracks
 this issue with the goal of migrating to NumPy's behavior.

See also: