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.
is_bad_array
1 parent 02a8d26 commit 924a831Copy full SHA for 924a831
src/Utils.jl
@@ -75,7 +75,7 @@ end
75
76
# Fastest way to check for NaN in an array.
77
# (due to optimizations in sum())
78
-is_bad_array(array) = !isfinite(sum(array))
+is_bad_array(array) = !(isempty(array) || isfinite(sum(array)))
79
isgood(x::T) where {T<:Number} = !(isnan(x) || !isfinite(x))
80
isgood(x) = true
81
isbad(x) = !isgood(x)
0 commit comments