From 01311533dad1ece63cabd9b3a070d7c5c0b805e1 Mon Sep 17 00:00:00 2001 From: Mykola Lukashchuk Date: Thu, 25 Jan 2024 14:41:22 +0100 Subject: [PATCH] test: add test for default rng --- test/distributions/distributions_setuptests.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/test/distributions/distributions_setuptests.jl b/test/distributions/distributions_setuptests.jl index ecfdd135..a08d0ffa 100644 --- a/test/distributions/distributions_setuptests.jl +++ b/test/distributions/distributions_setuptests.jl @@ -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]))