[BE]: Enable ruff rule SIM113 (#147290)

Lint rules that tells the user to avoid keeping track of their own counter and use the builtin enumerate when possible.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/147290
Approved by: https://github.com/jansel
This commit is contained in:
Aaron Gokaslan
2025-02-16 22:41:13 +00:00
committed by PyTorch MergeBot
parent a8fa4bcfd2
commit e738f7ba23
15 changed files with 22 additions and 35 deletions

View File

@ -969,7 +969,7 @@ class TestGradTransform(TestCase):
expected = f"{repr(x)}"
level = 0
for op in op_list:
level += 1
level += 1 # noqa: SIM113
if op == grad:
expected = f"GradTrackingTensor(lvl={level}, value={expected})"
elif op == vmap: