问题:
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
AttributeError: 'module' object has no attribute 'device'
torch.device
was introduced in PyTorch 0.4.
问题:
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
AttributeError: 'module' object has no attribute 'device'
torch.device
was introduced in PyTorch 0.4.