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

Add signature check for set_to_none in Optimizer.zero_grad #189

Merged
merged 1 commit into from
Oct 20, 2021

Conversation

sgugger
Copy link
Collaborator

@sgugger sgugger commented Oct 20, 2021

This adds a stronger check than just the PyTorch version in the AcceleratedOptimizer.zero_grad method, as other optimizers may override the PyTorch methods and not implement that argument, which was pointed out it in #42

@sgugger sgugger merged commit 39a0b30 into main Oct 20, 2021
@sgugger sgugger deleted the opt_sig_check branch October 20, 2021 14:27
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

Successfully merging this pull request may close these issues.

1 participant