Revert "[2/N] More ruff SIM fixes (#165031)"

This reverts commit 38095fbd1323ee4a9541fbcbb9b28bd20f2cd956.

Reverted https://github.com/pytorch/pytorch/pull/165031 on behalf of https://github.com/albanD due to One of the changed line started to fail on trunk ([comment](https://github.com/pytorch/pytorch/pull/165031#issuecomment-3390190870))
This commit is contained in:
PyTorch MergeBot
2025-10-10 13:42:14 +00:00
parent 238dd5517d
commit b8be796a57
53 changed files with 141 additions and 100 deletions

View File

@ -482,11 +482,15 @@ def get_wrapper_codegen_for_device(
def get_custom_backend_pass_for_device(device: str) -> Optional[CustomGraphModulePass]:
return custom_backend_passes.get(device)
return custom_backend_passes[device] if device in custom_backend_passes else None
def get_custom_backend_config_for_device(device: str) -> Optional[ConfigModule]:
return custom_backend_codegen_configs.get(device)
return (
custom_backend_codegen_configs[device]
if device in custom_backend_codegen_configs
else None
)
@functools.cache