Skip to content

Commit 09d5729

Browse files
authored
[BE] Fix compilation on CentOS-7 with devtoolset-9
As isinf on this platform is not really standard compliant (i.e. it's `int isinf(long double)` )
1 parent 329184a commit 09d5729

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

kernels/portable/cpu/op_isinf.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@ namespace torch {
1414
namespace executor {
1515
namespace native {
1616

17+
namespace {
18+
bool isinf(double x) {
19+
return ::std::isinf(x);
20+
}
21+
}
1722
Tensor& isinf_out(RuntimeContext& ctx, const Tensor& in, Tensor& out) {
18-
return internal::unary_ufunc_realhb_to_bool(std::isinf, ctx, in, out);
23+
return internal::unary_ufunc_realhb_to_bool(isinf, ctx, in, out);
1924
}
2025

2126
} // namespace native

0 commit comments

Comments
 (0)