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

viable/strict/1792517296: [fx] Make _Patcher's already-patched guard actually fire (#201464)

图:PyTorch Releases

发生了什么

Summary: _Patcher.patch and _Patcher.patch_method mark each new wrapper with new_fn.__fx_already_patched = deduplicate . Inside class _Patcher , Python name-mangles that attribute to _Patcher__fx_already_patched , while the guard reads getattr(..., "__fx_already_patched", False) , so the guard never fires. As a result, a re-entrant trace (one that starts while a module global already holds FX's wrapper for a torch.f…

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

为什么在扩散

来源