[dynamo] fix potential circular import error in decorators.py (#153217)

Differential Revision: [D74442043](https://our.internmc.facebook.com/intern/diff/D74442043)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/153217
Approved by: https://github.com/jansel
This commit is contained in:
William Wen 2025-05-12 17:48:40 +00:00 committed by PyTorch MergeBot
parent e6a9067260
commit 8521a690f7

View File

@ -779,8 +779,12 @@ _allowed_config_patches = (
"dont_skip_tracing",
)
from . import config
for name in _allowed_config_patches:
assert hasattr(torch._dynamo.config, name), "nonexistent config"
assert hasattr(config, name), "nonexistent config"
del config
def _patch_dynamo_config_check(changes: dict[str, Any]):