-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RNG: fix Sampler selection for GLOBAL_RNG #33172
Conversation
stdlib/Random/src/Random.jl
Outdated
Sampler(rng::AbstractRNG, ::Type{X}, r::Repetition=Val(Inf)) where {X} = Sampler(_typeof(rng), X, r) | ||
|
||
# GLOBAL_RNG currently represents a MersenneTwister | ||
_typeof(x) = typeof(x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe call this typeof_rng
instead? _typeof
sounds much more general.
3d071ec
to
c981bd2
Compare
stdlib/Random/src/Random.jl
Outdated
|
||
# GLOBAL_RNG currently represents a MersenneTwister | ||
typeof_rng(rng::AbstractRNG) = typeof(rng) | ||
typeof_rng(::_GLOBAL_RNG) = MersenneTwister |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_GLOBAL_RNG
is not defined here yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right, is this why CI didn't build? I couldn't understand CI failures (am still used to travis interface).
c981bd2
to
cbf8e9d
Compare
(cherry picked from commit 4c8cd3b)
Fix #33170.