torch.meshgrid()

x1, y1 = torch.meshgrid (x, y)
parameters are two, the first parameter we assume is x, the second parameter assumes that y
outputs two tensor, size is x.size * y.size The number of rows is the number of x, and the number of columns is the number of y) The
specific output is shown below:

Note: The data types of the two parameters must be the same, either float or int, otherwise an error will be reported.
Insert picture description here

Published 943 original articles · Like 136 · Visit 330,000+

Guess you like

Origin blog.csdn.net/weixin_36670529/article/details/105350139