pytorch
e3ac1096 - [MPS] Fallback on gather code to solve view tensors when a slice is followed by a reshape (#94278)

Commit
1 year ago
[MPS] Fallback on gather code to solve view tensors when a slice is followed by a reshape (#94278) There are cases when the arrayViewTensor API cannot be used to solve the view operations, such as when a view dimension is bigger than the base dimension of the tensor, e.g: ``` base shape: [1, 768, 512, 2] // we cannot slice the base shape in any way to result in first dimension `2` view shape: [2, 384, 512, 1] ``` On such cases, we need to fallback on the gather code (that detects this is a slice followed by a reshape) to solve this issue. Pull Request resolved: https://github.com/pytorch/pytorch/pull/94278 Approved by: https://github.com/razarmehr
Author
Committer
Parents
Loading