Skip to content

Commit 8a7986c

Browse files
committed
Fix both and lint
1 parent 4f28b24 commit 8a7986c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

kernels/portable/cpu/op_isinf.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ namespace executor {
1515
namespace native {
1616

1717
Tensor& isinf_out(RuntimeContext& ctx, const Tensor& in, Tensor& out) {
18+
// Lambda is syntactic sugar needed to workaround compilation on some older
19+
// non-compatible distros where isnan is returning int rather than bool
1820
return internal::unary_ufunc_realhb_to_bool(
19-
static_cast<bool (*)(double)>(std::isinf), ctx, in, out);
21+
[](double x) -> bool { return std::isinf(x); }, ctx, in, out);
2022
}
2123

2224
} // namespace native

kernels/portable/cpu/op_isnan.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ namespace executor {
1515
namespace native {
1616

1717
Tensor& isnan_out(RuntimeContext& ctx, const Tensor& in, Tensor& out) {
18-
// Lambda is syntactic sugar needed to workaround compilation on some older non-compatible distros
19-
// where isnan is not defined for double, but either for float or for long double
18+
// Lambda is syntactic sugar needed to workaround compilation on some older
19+
// non-compatible distros where isnan is returning int rather than bool
2020
return internal::unary_ufunc_realhb_to_bool(
2121
[](double x) -> bool { return std::isnan(x); }, ctx, in, out);
2222
}

0 commit comments

Comments
 (0)