一、item() input: x = torch.tensor([1.0]) x.item() output: 1.0 二、tolist() input: a = torch.randn(2, 2) a.tolist() a[0,0].tolist() output: [[0.012766935862600803, 0.5415473580360413], [-0.08909505605697632, 0.7729271650314331]] 0.012766935862600803