Add pyrefly suppressions (#164748)

Adds suppressions to pyrefly will typecheck clean: https://github.com/pytorch/pytorch/issues/163283

Test plan:
dmypy restart && python3 scripts/lintrunner.py -a
pyrefly check

step 1: delete lines in the pyrefly.toml file from the `project-excludes` field
step 2: run pyrefly check
step 3: add suppressions, clean up unused suppressions
before: https://gist.github.com/maggiemoss/4b3bf2037014e116bc00706a16aef199

after:

0 errors (4,263 ignored)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/164748
Approved by: https://github.com/oulgen
This commit is contained in:
Maggie Moss
2025-10-07 17:31:18 +00:00
committed by PyTorch MergeBot
parent 5e47b4dd60
commit b13cd141b3
139 changed files with 504 additions and 30 deletions

View File

@ -958,7 +958,6 @@ class Optimizer:
r"""Make a deep copy of value, casting all tensors to device of param."""
if isinstance(value, torch.Tensor):
return Optimizer._process_value_according_to_param_policy(
# pyrefly: ignore # bad-argument-type
param,
value,
# pyrefly: ignore # bad-argument-type