Use std::isnan instead of self-comparison. (#18021)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18021
ghimport-source-id: 03423ba47ba5900c2b400c4457b148147ce8b35e
Stack:
* **#18021 Use std::isnan instead of self-comparison.**
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Reviewed By: soumith
Differential Revision: D14460699
fbshipit-source-id: d8feb7f3f0e93996bd1b4f4aea163548b1d12437