← 返回事件
持续讨论AI发版

trunk/23341ddcfe7cc4813eb7ef760847d9b786336e1e: [dynamo] Restore autocast state between tests in TestCase (#195662)

图:PyTorch Releases

发生了什么

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…

摘要按规则整理自下方来源原文

为什么在扩散

来源