[python][pytorch]torch.Tensor数值类型转换

a = torch.tensor([1,2,3])
b = a.float()
c = a.double()
d = a.long()
print(b.dtype)
print(c.dtype)
print(d.dtype)



 

你可能感兴趣的:(Python,python,pytorch,深度学习)