mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
[2/N] More ruff SIM fixes (#165031)
This is follow-up of #164695 to apply ruff SIM rules to more files. Most changes are about simplifying dict.get because None is already the default value. Pull Request resolved: https://github.com/pytorch/pytorch/pull/165031 Approved by: https://github.com/mlazos
This commit is contained in:
committed by
PyTorch MergeBot
parent
1fa11f42b1
commit
fbe0d20a17
@ -783,8 +783,8 @@ class Optimizer:
|
||||
assert param_groups is not None
|
||||
for pg in param_groups:
|
||||
if param_id in pg["params"]:
|
||||
fused = pg["fused"] if "fused" in pg else False
|
||||
capturable = pg["capturable"] if "capturable" in pg else False
|
||||
fused = pg.get("fused", False)
|
||||
capturable = pg.get("capturable", False)
|
||||
break
|
||||
if key == "step":
|
||||
if capturable or fused:
|
||||
|
Reference in New Issue
Block a user