mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Fixes for 123400 (#123406)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/123406 Approved by: https://github.com/janeyx99 ghstack dependencies: #123324, #123404, #123405, #124309
This commit is contained in:
committed by
PyTorch MergeBot
parent
5050e627dc
commit
68a027f144
@ -1607,7 +1607,11 @@ class TestOptimRenewed(TestCase):
|
||||
|
||||
# Make some state
|
||||
for _ in range(3):
|
||||
optimizer.step(closure)
|
||||
if optim_info.step_requires_closure:
|
||||
optimizer.step(closure)
|
||||
else:
|
||||
closure()
|
||||
optimizer.step()
|
||||
|
||||
self.assertEqual(getPublicAttrs(optimizer), getPublicAttrs(deepcopy(optimizer)))
|
||||
|
||||
|
Reference in New Issue
Block a user