(self)
| 171 | |
| 172 | @deprecated(version="1.0", reason="use clear_grad instead") |
| 173 | def zero_grad(self): |
| 174 | for param_group in self.param_groups: |
| 175 | for param in param_group["params"]: |
| 176 | if param.grad is not None: |
| 177 | param.grad.reset_zero() |
| 178 | |
| 179 | def clear_grad(self): |
| 180 | r"""Set the grad attribute to None for all parameters.""" |
nothing calls this directly
no test coverage detected