We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f27582 commit 8c8918cCopy full SHA for 8c8918c
aten/src/ATen/Half.cpp
@@ -33,6 +33,10 @@ template<> AT_API int64_t convert(Half f) {
33
}
34
35
template<> bool overflows<Half, double>(double f) {
36
+ using limit = std::numeric_limits<double>;
37
+ if (limit::has_infinity && std::isinf(f)) {
38
+ return false;
39
+ }
40
return f > 65504 || f < -65504;
41
42
template<> bool overflows<Half, int64_t>(int64_t f) {
0 commit comments