mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
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:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user