[MPS] Squeeze last dimensions if possible for 5D (or bigger) reductions (#99856)
Summary of changes:
- Reduction ops optimization - squeeze all dimensions after 4th dim if they are all 1
- Disable type inference only for 1D unary ops
Pull Request resolved: https://github.com/pytorch/pytorch/pull/99856
Approved by: https://github.com/kulinseth