Skip to content

Commit

Permalink
disable test for demo_assume_index_observe on Julia 1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
torfjelde committed May 18, 2024
1 parent 9467dc5 commit 642bf9c
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions test/mcmc/abstractmcmc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,28 @@ end
# @testset "initial_params" begin
# test_initial_params(model, sampler_ext; n_adapts=0)
# end

sample_kwargs = (
n_adapts=1_000,
discard_initial=1_000,
# FIXME: Remove this once we can run `test_initial_params` above.
initial_params=DynamicPPL.VarInfo(model)[:],
)

@testset "inference" begin
DynamicPPL.TestUtils.test_sampler(
[model],
sampler_ext,
5_000;
n_adapts=1_000,
discard_initial=1_000,
# FIXME: Remove this once we can run `test_initial_params` above.
initial_params=DynamicPPL.VarInfo(model)[:],
rtol=0.2,
sampler_name="AdvancedHMC"
)
if adtype isa AutoReverseDiff && model.f === DynamicPPL.TestUtils.demo_assume_index_observe && VERSION < v"1.8"
# Ref: https://github.com/TuringLang/DynamicPPL.jl/issues/612
@test_throws UndefRefError sample(model, sampler_ext, 5_000; sample_kwargs...)
else
DynamicPPL.TestUtils.test_sampler(
[model],
sampler_ext,
5_000;
rtol=0.2,
sampler_name="AdvancedHMC",
sample_kwargs...,
)
end
end
end
end
Expand Down

0 comments on commit 642bf9c

Please sign in to comment.