pytorch/torch/distributed/_tools
Aaron Gokaslan 53e5b8ac5b [BE]: Update flake8-comprehensions and enable C420 (#130699)
Uses `dict.fromkeys` whenever possible as covered by flake8-comprehensions rule C420. While the ruff rule RUF025 is still in preview, flake8-comprehensions have added a new rule which covers this. Use dict.fromkeys is faster when the value being added to the dictionary is the same at every iteration and is immutable, it also removes an unnecessary dict comprehension.

This rule will be enabled with our current ruleset in RUF in 0.6 as C420.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/130699
Approved by: https://github.com/lezcano, https://github.com/ezyang
2024-07-16 13:47:49 +00:00
..
__init__.py FSDP2 Memory Tracker (#125323) 2024-06-23 05:23:00 +00:00
fsdp2_mem_tracker.py Improved backward tracking and attribution, fixed typing for python < 3.10 (#129400) 2024-06-25 10:54:58 +00:00
mem_tracker.py [BE]: Update flake8-comprehensions and enable C420 (#130699) 2024-07-16 13:47:49 +00:00
memory_tracker.py [BE][Easy] enable UFMT for torch/distributed/ (#128870) 2024-06-22 18:53:28 +00:00
mod_tracker.py Improved backward tracking and attribution, fixed typing for python < 3.10 (#129400) 2024-06-25 10:54:58 +00:00