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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With