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

needs_grad and has_grad not longer work #5258

Closed
ifsheldon opened this issue Jun 25, 2022 · 2 comments
Closed

needs_grad and has_grad not longer work #5258

ifsheldon opened this issue Jun 25, 2022 · 2 comments
Labels
potential bug Something that looks like a bug but not yet confirmed

Comments

@ifsheldon
Copy link

Describe the bug
field.snode.needs_grad and field.snode.ptr.has_grad do not longer work but my library stannum depends on one of these two to perform checks.

Breaking PRs
#4308 removed field.snode.needs_grad and #5083 removed has_grad from CPP SNode class.

This is not a bug but a breaking change that silently breaks my library. I understand you are preparing for forward differentiation and thus doing a lot of refactoring but I need an API to tell me if a field need gradient or not in the conventional backward mode (because it works with Autograd in PyTorch)

@ifsheldon ifsheldon added the potential bug Something that looks like a bug but not yet confirmed label Jun 25, 2022
@strongoier
Copy link
Contributor

Hi @ifsheldon. Thanks for reporting this! Does field.snode.ptr.has_adjoint() work for you?

@ifsheldon
Copy link
Author

OK, fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
potential bug Something that looks like a bug but not yet confirmed
Projects
Status: Done
Development

No branches or pull requests

2 participants