Skip to content

Commit

Permalink
test: add test for default rng
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimrais committed Jan 25, 2024
1 parent d6d94ae commit 0131153
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/distributions/distributions_setuptests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ function run_test_basic_functions(distribution; nsamples = 10, test_gradients =
@test @inferred(mean(ef)) mean(distribution)
@test @inferred(var(ef)) var(distribution)
@test @inferred(std(ef)) std(distribution)
@test size(ExponentialFamily.check_logpdf(variate_form(typeof(ef)), typeof(x), eltype(x), ef, rand(ef, 10))[2])[end] === 10
@test rand(StableRNG(42), ef) rand(StableRNG(42), distribution)
@test all(rand(StableRNG(42), ef, 10) .≈ rand(StableRNG(42), distribution, 10))
@test all(rand!(StableRNG(42), ef, [deepcopy(x) for _ in 1:10]) .≈ rand!(StableRNG(42), distribution, [deepcopy(x) for _ in 1:10]))
Expand Down

0 comments on commit 0131153

Please sign in to comment.