Closed
Description
I have just installed PyTorch, and this example doesn't work: http://pytorch.org/tutorials/beginner/pytorch_with_examples.html#pytorch-variables-and-autograd
Running the example returns:
0 26220132.0
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-44-6cc21ebb6010> in <module>()
36
37 # Manually zero the gradients before running the backward pass
---> 38 w1.grad.data.zero_()
39 w2.grad.data.zero_()
40
AttributeError: 'NoneType' object has no attribute 'data'
as w1.grad.data
doesn't seem to be defined.
Metadata
Metadata
Assignees
Labels
No labels