commit | aa7ea6b45cf23db37365edde18498fb98a367f77 | [log] [tgz] |
---|---|---|
author | Michael Lazos <mlazos@meta.com> | Tue Jul 02 18:24:02 2024 +0000 |
committer | PyTorch MergeBot <pytorchmergebot@users.noreply.github.com> | Tue Jul 02 18:24:02 2024 +0000 |
tree | 8ac373d74e4ff272dfb07f07231f4ea16f8d4230 | |
parent | ec789a3c9ddd4e550b3dea6934ce2d41deb98784 [diff] |
Add wraps back (#129933) Fixes https://github.com/pytorch/pytorch/issues/129922 Pull Request resolved: https://github.com/pytorch/pytorch/pull/129933 Approved by: https://github.com/eqy, https://github.com/janeyx99
diff --git a/torch/optim/lr_scheduler.py b/torch/optim/lr_scheduler.py index ef197b6..11bfff3 100644 --- a/torch/optim/lr_scheduler.py +++ b/torch/optim/lr_scheduler.py
@@ -5,7 +5,7 @@ import warnings from bisect import bisect_right from collections import Counter -from functools import partial +from functools import partial, wraps from typing import ( Any, Callable, @@ -129,6 +129,7 @@ opt_ref = ref(self.optimizer) func = step_fn.__func__ + @wraps(func) def wrapper(*args, **kwargs): opt = opt_ref() opt._opt_called = True # type: ignore[union-attr]