GPU acceleration is great. However, when I want to use this feature, I have to specify this every time when I create tensors, like
dev = torch.device("cuda")
torch.ones(2, 3, device=dev)
How can I set device
globally to make it the default value, so that I don’t need to specify device
in the following codes ?