accelerate
145a98fc
- Update the default behavior of `zero_grad(set_to_none=None)` (#2472)
Go
Login via GitHub
Home
Pricing
FAQ
Install
Login
via GitHub
Commit
View On
GitHub
Commit
2 years ago
Update the default behavior of `zero_grad(set_to_none=None)` (#2472) Now, the behavior of the wrapped optimizer is that the gradient is cleared by default when `set_to_none=None`. This aligns with `torch.optim.Optimizer` and saves memory.
References
#2472 - Update the default behavior of `zero_grad(set_to_none=None)` to align with PyTorch
Author
yongchanghao
Parents
64ae9ea3
Loading