mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Revert "[dynamo] context manager/decorator for dynamo config patching during tracing (#150586)"
This reverts commit 40ce4fb24a536d175348df876f61956d4945778e.
Reverted https://github.com/pytorch/pytorch/pull/150586 on behalf of https://github.com/clee2000 due to broke some inductor tests? inductor/test_fuzzer.py::TestConfigFuzzer::test_config_fuzzer_dynamo_bisect [GH job link](https://github.com/pytorch/pytorch/actions/runs/14486513628/job/40635178179) [HUD commit link](40ce4fb24a
), bad TD ([comment](https://github.com/pytorch/pytorch/pull/150586#issuecomment-2810064322))
This commit is contained in:
@ -667,15 +667,12 @@ class ConfigModule(ModuleType):
|
||||
config = self
|
||||
|
||||
class ConfigPatch(ContextDecorator):
|
||||
def __init__(self) -> None:
|
||||
self.changes = changes
|
||||
|
||||
def __enter__(self) -> None:
|
||||
assert not prior
|
||||
for key in self.changes.keys():
|
||||
for key in changes.keys():
|
||||
# KeyError on invalid entry
|
||||
prior[key] = config.__getattr__(key)
|
||||
for k, v in self.changes.items():
|
||||
for k, v in changes.items():
|
||||
config.__setattr__(k, v)
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb): # type: ignore[no-untyped-def]
|
||||
|
Reference in New Issue
Block a user