fix INTERNAL ASSERT FAILED for maximum (#48446)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/48393
Pull Request resolved: https://github.com/pytorch/pytorch/pull/48446
Reviewed By: zhangguanheng66
Differential Revision: D25240270
Pulled By: ngimel
fbshipit-source-id: 57fc223b98f2b6f96f2f24e1d9041644e3187262