tensor view 使用与常见报错: shape ‘[4]‘ is invalid for input of size 6 +not compatible x.contiguous().view
查看大小Tensor.shapeTensor.size()AttributeError:‘list’objecthasnoattribute‘shape’len(list)或np.array(a).shape或print(list[0].shape)viewif__name__=='__main__':x=torch.tensor([[1,2,3,4],[5,6,7,8],[9,10,11,12]