- paddle. meshgrid ( *args, **kwargs )
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:
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)