Skip to content

Commit 828a6a3

Browse files
bddppqfacebook-github-bot
authored andcommitted
Use proper isnan check
Summary: Pull Request resolved: #18663 Differential Revision: D14699385 Pulled By: bddppq fbshipit-source-id: 596ad3371e7704802591e49f7e1c55dc6cd2896f
1 parent cb39bd9 commit 828a6a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

aten/src/TH/generic/THTensorMoreMath.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ void THTensor_(diag)(THTensor *r_, THTensor *t, int k)
544544
/* Emulate NumPy behavior of putting NaNs
545545
* at the end of an ascending list. */
546546
#define GT_OR_NAN(x, y) \
547-
((x != x && y == y) || (x > y))
547+
((th_isnan(x) && !(th_isnan(y))) || (x > y))
548548

549549
static void THTensor_(quicksortascend)(scalar_t *arr, int64_t *idx, int64_t elements, int64_t stride)
550550
{

0 commit comments

Comments
 (0)