Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atttribute error when trying to claculate x.grad in class VanillaGrad(object) #5

Open
SmritiGovind opened this issue Nov 17, 2023 · 0 comments

Comments

@SmritiGovind
Copy link

in call(self, x, index)
45 # print('one_hot after backward:', one_hot)
46
---> 47 x.grad.data.zero_() # Reset the gradient to zero
48
49 # print('x=', x)

AttributeError: 'NoneType' object has no attribute 'data'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant