Skip to content

Commit c874ded

Browse files
committed
Add assert for isfinite.
1 parent 128a204 commit c874ded

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
@@ -112,6 +112,7 @@ function ksvd(Y::AbstractMatrix{T}, n_atoms::Int, max_nnz=max(3, n_atoms ÷ 100)
112112
verbose=false,
113113
timer::TimerOutput=TimerOutput()
114114
) where {T}
115+
@assert all(isfinite, Y) "All elements in Y must be finite. Probably there are some NaN or Inf."
115116
emb_dim, n_samples = size(Y)
116117

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

0 commit comments

Comments
 (0)