fix discontiguous inputs/outputs for cummin/cummax (#42507)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/42363
Pull Request resolved: https://github.com/pytorch/pytorch/pull/42507
Reviewed By: mruberry
Differential Revision: D22917876
Pulled By: ngimel
fbshipit-source-id: 05f3f4a55bcddf6a853552184c9fafcef8d36270