trunk/23341ddcfe7cc4813eb7ef760847d9b786336e1e: [dynamo] Restore autocast state between tests in TestCase (#195662)
- PyTorch 近 90 天出现 1030 次
- PyTorch 近 90 天第 1019 次发版
- 上一次:同一天稍早 · trunk/542330ebe79bfc3e9275d7610f9adcf489e3abf9: Fix scaled-MM DeepSeek indexing and contraction validation (#197028)
发生了什么
Fixes #195487 . torch._dynamo.test_case.TestCase.setUp / tearDown already snapshots torch.is_grad_enabled() and restores it (with a warning) in tearDown if a test left it changed, but has no equivalent for autocast. All four pieces of autocast state -- enabled, dtype, cache_enabled, and the nesting counter -- survive past the end of a test into whichever test runs next. A test that leaks this state (e.g. by calling…
摘要按规则整理自下方来源原文