How to use double as the default type for floating numbers in PyTorch
I want all the floating numbers in my PyTorch code double type by default, how can I do that?

You are looking for torch.set_default_tensor_type:

torch.set_default_tensor_type(torch.DoubleTensor)


Aletrnatively, you can use torch.set_default_dtype:

torch.set_default_dtype(torch.float64)

