fix masked_select for discontiguous outputs (#41841)
Summary:
This fixes https://github.com/pytorch/pytorch/issues/41473 for discontiguous input, mask and out. Tests to follow. Reverting https://github.com/pytorch/pytorch/issues/33269 is not a great solution because I'm told masked_select was needed for printing complex tensors.
cc gchanan , zou3519, ezyang
Pull Request resolved: https://github.com/pytorch/pytorch/pull/41841
Reviewed By: mruberry
Differential Revision: D22706943
Pulled By: ngimel
fbshipit-source-id: 413d7fd3f3308b184de04fd56b8a9aaabcad22fc