Skip to content

Commit

Permalink
Fix safe_randn in tests (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat authored Jan 12, 2025
1 parent 9e4637a commit 4d92fdb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/projection_gradients.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ A multivariate Gaussian generator without points too close to 0
function safe_randn(n)
v = 2 * randn(n)
for i in eachindex(v)
while v[i] 0
v[i] = 2 * randn()
while abs(v[i]) < 1e-6
v[i] *= 2
end
end
return v
Expand Down

0 comments on commit 4d92fdb

Please sign in to comment.