Practical_RL icon indicating copy to clipboard operation
Practical_RL copied to clipboard

PyTorch notebooks should detect GPU and run on it if it's available

Open dniku opened this issue 5 years ago • 0 comments

device = 'cuda' if torch.cuda.is_available() else 'cpu'
...
model = model.to(device)

dniku avatar May 19 '20 00:05 dniku