[MPS] Fix the Channels last bug with GradientWithInput. (#94384)
* Fix the Channels last bug with GradientWithInput.
The bug was mentioned in :
https://github.com/pytorch/pytorch/issues/77764#issuecomment-1312241902
Pull Request resolved: https://github.com/pytorch/pytorch/pull/94384
Approved by: https://github.com/razarmehr