trunk/9186b190a054d20bb060de831eb04008f55c61fd: [CUDA] Fix arange overflow for N >= 2**32 (#197713)
- PyTorch 近 90 天出现 1363 次
- PyTorch 近 90 天第 1346 次发版
- 上一次:同一天稍早 · trunk/41d371030d5075f7da60831759bfff8041395f21
发生了什么
Fixes #197673 block_work_size * blockIdx.x in elementwise_kernel_with_index is int * unsigned int , so it's computed in 32 bits and wraps before widening to index_t . For N >= 2**32, threads meant for index 2**32 + k write to index k instead, and the tail is never written. The fix casts to index_t before multiplying. This affects arange, range, linspace and logspace, since they share this helper. Test: the >2**32 ca…
摘要按规则整理自下方来源原文