- paddle. meshgrid ( *args, **kwargs ) [source]
Takes a list of N tensors as input
*args, each of which is 1-dimensional vector, and creates N-dimensional grids.
*args (Tensor|list of Tensor) – tensors (tuple(list) of tensor): the shapes of input k tensors are (N1,), (N2,),…, (Nk,). Support data types:
**kwargs (optional) – Currently, only accept name in **kwargs The default value is None. Normally there is no need for user to set this property. For more information, please refer to Name.
k tensors. The shape of each tensor is (N1, N2, …, Nk)
- Return type
import paddle x = paddle.randint(low=0, high=100, shape=) y = paddle.randint(low=0, high=100, shape=) grid_x, grid_y = paddle.meshgrid(x, y) print(grid_x.shape) print(grid_y.shape) #the shape of res_1 is (100, 200) #the shape of res_2 is (100, 200)