Fix unused Python variables in test/[e-z]* (#136964)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/136964
Approved by: https://github.com/justinchuby, https://github.com/albanD
This commit is contained in:
Tom Ritchford
2024-12-18 18:14:52 +00:00
committed by PyTorch MergeBot
parent d298bd840f
commit d8c8ba2440
281 changed files with 508 additions and 565 deletions

View File

@ -1275,7 +1275,6 @@ class TestOptimRenewed(TestCase):
torch.randn(2, 3, requires_grad=False, device=device, dtype=dtype)
for _ in range(2)
]
old_params = [p.detach().clone() for p in params]
def closure():
return torch.tensor([1], device=device, dtype=dtype)
@ -1632,7 +1631,6 @@ class TestOptimRenewed(TestCase):
return closure_loss if optim_info.step_requires_closure else None
for optim_input in all_optim_inputs:
kwargs = optim_input.kwargs
optimizer = optim_cls(params, **optim_input.kwargs)
for _ in range(3):
optimizer.step(closure)