Match NumPy by considering NaNs to be larger than any number when sorting#15886
Match NumPy by considering NaNs to be larger than any number when sorting#15886umanwizard wants to merge 3 commits into
Conversation
facebook-github-bot
left a comment
There was a problem hiding this comment.
@umanwizard has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
Thanks for working on this! With |
|
@ailzhang What is the problem with |
|
Actually the problem was indeed caused by |
ailzhang
left a comment
There was a problem hiding this comment.
LGTM! CI failures seem unrelated except the clang-tidy one. Good to go once CI is green.
|
Both thrust and quicksort in TH require strict weak ordering comparator https://thrust.github.io/doc/group__sorting.html#ga3f47925d80f4970d5730051dba1c5603. is not strict weak order. |
|
@ngimel yea I agree on the solution is not strict weak order. Hmmm why do we enforce strict weak ordering btw (could you give an example) ? Thanks! |
|
@ngimel Thank you for the hint. If I understand correctly, I can fix this by making those macros/functions return false if both the arguments are NaN. |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@umanwizard has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
…ting (#15886) Summary: Fixes #15764 Pull Request resolved: pytorch/pytorch#15886 Differential Revision: D13612971 Pulled By: umanwizard fbshipit-source-id: 91f552a25d1fd108f2f0b10e09a0ce0364f8c21e
…ting (pytorch#15886) Summary: Fixes pytorch#15764 Pull Request resolved: pytorch#15886 Differential Revision: D13612971 Pulled By: umanwizard fbshipit-source-id: 91f552a25d1fd108f2f0b10e09a0ce0364f8c21e
Fixes #15764