pytorch
61263255 - Fix `torch.median` crash on empty tensor (#61698)

Commit
4 years ago
Fix `torch.median` crash on empty tensor (#61698) Summary: `torch.tensor([]).median()` returns `nan`, which mimics the behavior of `np.median` Add test to `TestReductions.test_median_corner_cases` Fixes https://github.com/pytorch/pytorch/issues/61656 Pull Request resolved: https://github.com/pytorch/pytorch/pull/61698 Reviewed By: heitorschueroff Differential Revision: D29706912 Pulled By: malfet fbshipit-source-id: ea5f58327fbff371f3fb8786b269430c7a10d05f
Author
Parents
Loading