All my (BetaML) stochastic functions accept a RNG parameter, defaulting to Random.GLOBAL_RNG
.
Now, in a certain project I am ok to trade off RN production efficiency with stability and use StableRNGs
, but I would like to avoid passing a StableRNG
object to all my functions.
Is there a way to set a StableRNG
as the GLOBAL_RNG
so that all my functions take that one in place of the non-guaranteed by Julia version default RNG ?
Something like this (that obviously doesn’t work):
project_rng = StableRNG(123)
Random.GLOBAL_RNG = project_rng # can't rebind the constant