pytorch 的 reshape((-1, 1)) 是什么意思?
pytorch 的 reshape((-1, 1)) 是什么意思
代码
import torch
print(torch.tensor([1,2,3,4,5,6,7,8]).reshape(-1,1))
tensor([[1],
[2],
[3],
[4],
[5],
[6],
[7],
[8]])
示意图


浙公网安备 33010602011771号