Skip to content

Commit

Permalink
fix: pass in RNG to shuffle
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Jan 7, 2025
1 parent d2dc63f commit 4125770
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/WeightInitializers/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "WeightInitializers"
uuid = "d49dbf32-c5c2-4618-8acc-27bb2598ef2d"
authors = ["Avik Pal <[email protected]> and contributors"]
version = "1.0.4"
version = "1.0.5"

[deps]
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
Expand Down
2 changes: 1 addition & 1 deletion lib/WeightInitializers/src/initializers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ function sparse_init(rng::AbstractRNG, ::Type{T}, dims::Integer...;
sparse_array .*= T(std)
fill!(view(sparse_array, 1:num_zeros, :), zero(T))

return @allowscalar mapslices(shuffle, sparse_array; dims=1)
return @allowscalar mapslices(Base.Fix1(shuffle, rng), sparse_array; dims=1)
end

"""
Expand Down

0 comments on commit 4125770

Please sign in to comment.