trunk/200b41a7408de59bc55e10c808f26b652b9275a0: [inductor] Handle full randperm in index_add pattern (#196873)
- PyTorch 近 90 天出现 1883 次
- PyTorch 近 90 天第 1859 次发版
- 上一次:同一天稍早 · trunk/94705d5841150618c9de1468727580412bc592f8: [MPS] Fix linalg.lstsq on empty inputs (#199694)
发生了什么
Fixes #196631 Summary TorchInductor already optimizes index_add when the index is a sliced permutation: index = torch . randperm ( x . shape [ 0 ], device = x . device )[: y . shape [ 0 ]] result = torch . index_add ( x , dim = 0 , source = y , index = index ) Because the indices are unique and in bounds, the accumulating update can be rewritten using unsafe indexing and a non-accumulating index_put . The full-permu…
摘要按规则整理自下方来源原文