Hello,
I am trying to run the first model in https://pytorch.org/tutorials/beginner/nn_tutorial.html 10 on GPU, but could not.
The notebook is at https://github.com/soumitrak/nn_tutorial_cuda/blob/master/nn_tutorial_cuda.ipynb 10
The code works if ‘dev = torch.device(“cpu”)’, but for ‘dev = torch.device(“cuda”)’, weights.grad is None.
I browsed around and found that for non-leaf Variables grad is not stored, but here bias, and weights are leaf level Tensors, so don’t know why it fails.
Thanks in advance.
-Soumitra.