pytorch
25ee6dd3 - [MPS] Fix fill_ where input tensor has a storage offset (#95113)

Commit
2 years ago
[MPS] Fix fill_ where input tensor has a storage offset (#95113) Fixes #94390 Apart from fixing the issue above, this PR also fixes a bug that when an input tensor can be sliced, a sliced array view is created. This array view seems to be not writable or have a different storage from the original tensor, causing incorrect results with the in-place `fill`. Pull Request resolved: https://github.com/pytorch/pytorch/pull/95113 Approved by: https://github.com/kulinseth
Author
Committer
Parents
  • aten/src/ATen/native/mps/operations
    • File
      ConstantOps.mm
  • test
    • File
      test_mps.py