Remove unused Python variables in torch/[_-a]* (#133492)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/133492
Approved by: https://github.com/albanD
This commit is contained in:
Tom Ritchford
2024-12-12 12:11:20 +00:00
committed by PyTorch MergeBot
parent 7667235a23
commit dc23f1944a
143 changed files with 275 additions and 455 deletions

View File

@ -75,8 +75,8 @@ def check_tensor_metadata_matches(nv, rv, desc):
def check_metadata_matches(n, r, desc):
assert callable(desc)
n_vals, n_spec = pytree.tree_flatten(n)
r_vals, r_spec = pytree.tree_flatten(r)
n_vals, _n_spec = pytree.tree_flatten(n)
r_vals, _r_spec = pytree.tree_flatten(r)
# TODO: test the specs match; empirically sometimes we have a tuple
# on one side and a list on the other
assert len(n_vals) == len(r_vals), f"{len(n_vals)} != {len(r_vals)}"