[MPS] Fix median_out_mps caching (#90326)
We should cache graph based on input tensor type
Fixes https://github.com/pytorch/pytorch/issues/90311
Pull Request resolved: https://github.com/pytorch/pytorch/pull/90326
Approved by: https://github.com/kulinseth