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

trunk/0ccbf972a39fc88cb17348079bca7332ef022bfc: [BE][MPS] Use `dispatch_sync_with_rethrow` (#196893)

发生了什么

A C++ exception thrown inside an Objective-C block passed to dispatch_sync aborts the process, as it unwinds into libdispatch's frame and ends up in std::terminate . dispatch_sync_with_rethrow exists precisely to avoid that, so use it if block can throw. Test Plan: python -c "import torch; torch.zeros(4, device='mps').clamp_min(1e40)" python -c "import torch; torch.nn.functional.hardshrink(torch.zeros(4, device='mps…

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

为什么在扩散

来源