ValueError: only one element tensors can be converted to Python scalars
Pytorch出现这个错误。起初原因是我想要把装着tensor的list转为tensor类型,即[tensor(),tensor(),tensor()]转为tensor,然后我是这样写的,a=torch.randn(1,2)#tensor([[-0.4962,0.6034]])d=[a,a,a]#[tensor([[-0.4962,0.6034]]),tensor([[-0.4962,0.6034