Skip to content

Commit

Permalink
Use default_rng (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion authored Feb 21, 2023
1 parent 6f05a87 commit b48fcd1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Bijectors"
uuid = "76274a88-744f-5084-9051-94815aaf08c4"
version = "0.10.6"
version = "0.10.7"

[deps]
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
Expand Down
2 changes: 2 additions & 0 deletions src/Bijectors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ import IrrationalConstants
import LogExpFunctions
import Roots

import Random

export TransformDistribution,
PositiveDistribution,
UnitDistribution,
Expand Down
6 changes: 2 additions & 4 deletions src/transformed_distribution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,6 @@ end


# forward function
const GLOBAL_RNG = Distributions.GLOBAL_RNG

function _forward(d::UnivariateDistribution, x)
y, logjac = with_logabsdet_jacobian(Identity{0}(), x)
return (x = x, y = y, logabsdetjac = logjac, logpdf = logpdf.(d, x))
Expand Down Expand Up @@ -265,8 +263,8 @@ In the case where `d isa Distribution`, this means
- `logabsdetjac = 0.0`
- `logpdf` is logpdf of `x`
"""
forward(d::Distribution) = forward(GLOBAL_RNG, d)
forward(d::Distribution, num_samples::Int) = forward(GLOBAL_RNG, d, num_samples)
forward(d::Distribution) = forward(Random.default_rng(), d)
forward(d::Distribution, num_samples::Int) = forward(Random.default_rng(), d, num_samples)

# utility stuff
Distributions.params(td::Transformed) = Distributions.params(td.dist)
Expand Down

2 comments on commit b48fcd1

@torfjelde
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/78177

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.10.7 -m "<description of version>" b48fcd1b5ab4472cf0ecfbf129a5074dddccf090
git push origin v0.10.7

Please sign in to comment.