Open
Description
π The doc issue
The doc of torch.set_default_device()
explains device
parameter but it doesn't have int
type as shown below:
device (device or string) β the device to set as default
Actually, device
parameter with int
type works as shown below:
import torch
torch.set_default_device(device=0) # Here
torch.tensor([0, 1, 2]).device
# device(type='cuda', index=0)
Suggest a potential alternative/fix
The doc should also say int
type as shown below:
device (device, string or
int
) β the device to set as default