trunk/0ccbf972a39fc88cb17348079bca7332ef022bfc: [BE][MPS] Use `dispatch_sync_with_rethrow` (#196893)
- PyTorch 近 90 天出现 873 次
- PyTorch 近 90 天第 862 次发版
- 上一次:同一天稍早 · trunk/36d813411f98c73ba65b56cdc4f950df6dfed2de
发生了什么
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…
摘要按规则整理自下方来源原文