accelerate
145a98fc - Update the default behavior of `zero_grad(set_to_none=None)` (#2472)

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.
Author
Parents
Loading