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

@ -74,7 +74,7 @@ def _generate_input(shape, dtype, device, with_extremal):
# TODO: replace this with make_tensor() in common_utils.py
def _rand_shape(dim, min_size, max_size):
shape = []
for i in range(dim):
for _ in range(dim):
shape.append(random.randint(min_size, max_size))
return tuple(shape)
@ -1546,7 +1546,7 @@ class TestOldViewOps(TestCase):
def _test_atleast_dim(self, torch_fn, np_fn, device, dtype):
for ndims in range(0, 5):
shape = _rand_shape(ndims, min_size=5, max_size=10)
for n in range(ndims + 1):
for _ in range(ndims + 1):
for with_extremal in [False, True]:
for contiguous in [False, True]:
# Generate Input.