Skip to content

Commit 00f303e

Browse files
committed
Add assert for isfinite.
1 parent 5f7e83b commit 00f303e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/KSVD.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ function ksvd(Y::AbstractMatrix{T}, n_atoms::Int, max_nnz=max(3, n_atoms ÷ 100)
114114
verbose=false,
115115
timer::TimerOutput=TimerOutput()
116116
) where {T}
117+
@assert all(isfinite, Y) "All elements in Y must be finite. Probably there are some NaN or Inf."
117118
emb_dim, n_samples = size(Y)
118119

119120
# D is a dictionary matrix that contains atoms for columns.

0 commit comments

Comments
 (0)