How to cast a tensor to another type?

Can also do tensor.type(torch.DoubleTensor) or tensor.type('torch.DoubleTensor') if you want to use a string

34 Likes