Torch.device Tutorial Typo

I am new to PyTorch and was intrigued by Jeremy Howard of fast.ai to learn. His Deep Learning videos are simply great and completely free.

The tutorial says to uncomment this to run on GPU but it assigns to dtype whereas it should assign to device. This typo is repeated on all examples.

dtype = torch.float
device = torch.device(“cpu”)
# dtype = torch.device(“cuda:0”) # Uncomment this to run on GPU

Looks like a bug. Could you post a link to the tutorial where you have found it?
I just skimmed through them and couldn’t find the line.

Here is the link and it starts from here. Screenshot below.

Hope this helps!

https://pytorch.org/tutorials/beginner/pytorch_with_examples.html#warm-up-numpy

Mail](https://go.microsoft.com/fwlink/?LinkId=550986) for Windows 10

It seems that it has been fixed in the master branch.