pytorch
09c2b2af - [MPS] Solve contiguos view tensors using arrayViews instead of blits (#146) (#91743)

Commit
2 years ago
[MPS] Solve contiguos view tensors using arrayViews instead of blits (#146) (#91743) Solve contiguous view tensors using arrayViews directly instead of performing blit or gather. E.g in case of the following example: ``` x = torch.tensor([1,2,3,4], device="mps') y = x[2:] r = y + 2 ``` Previously, `y` would be materialized using a gather or a blit. With this change, the memory of `y` is aliased directly using arrayViews, thus skipping the need for blit or gather. Fixes pytorch#85297, pytorch#86048 Pull Request resolved: https://github.com/pytorch/pytorch/pull/91743 Approved by: https://github.com/razarmehr, https://github.com/kulinseth
Author
Committer
Parents
Loading