Update the MockOptimizer set_to_none default to match PyTorch (#17463)

Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
This commit is contained in:
Jane (Yuan) Xu 2023-04-25 12:46:45 -04:00 committed by GitHub
parent b0af0eede2
commit 68b56ba7f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -379,7 +379,7 @@ class _MockOptimizer(Optimizer):
if closure is not None:
closure()
def zero_grad(self, set_to_none: Optional[bool] = False) -> None:
def zero_grad(self, set_to_none: Optional[bool] = True) -> None:
pass # Do Nothing
def __repr__(self) -> str: