Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion kernels/portable/cpu/op_isinf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ namespace executor {
namespace native {

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

} // namespace native
Expand Down
4 changes: 3 additions & 1 deletion kernels/portable/cpu/op_isnan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ namespace executor {
namespace native {

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

} // namespace native
Expand Down