patrickloeber/pytorchTutorial

03_autograd.py L100

kevinjyh opened this issue · 1 comments

torch.version => '2.0.0+cu118'
L100: weights.grad.zero_()
show error "AttributeError: 'Tensor' object has no attribute 'grad_zero_'"

I was wrong, the reason for the above error message is because I wrote the code as: w.grad_zero_(), so the original source code is correct.