【Pytorch】torch.reshape torch.reshape(input, shape) 返回一个张量,其与input的元素和元素个数相同。 >>> a = torch.arange(4.) >>> torch.reshape(a, (2, 2)