Skip to content

Commit 17efb8c

Browse files
committed
fixes
1 parent a1837b5 commit 17efb8c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/mcmc/abstractmcmc.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# TODO: Implement additional checks for certain samplers, e.g.
22
# HMC not supporting discrete parameters.
33
function _check_model(model::DynamicPPL.Model)
4-
return DynamicPPL.check_model(model; error_on_failure=true)
4+
# TODO(DPPL0.37/penelopeysm): use InitContext
5+
spl_model = DynamicPPL.contextualize(model, DynamicPPL.SamplingContext(model.context))
6+
return DynamicPPL.check_model(spl_model, VarInfo(); error_on_failure=true)
57
end
68
function _check_model(model::DynamicPPL.Model, alg::InferenceAlgorithm)
79
return _check_model(model)

test/ad.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,14 @@ function DynamicPPL.tilde_assume(
172172
return value, logp, vi
173173
end
174174

175-
function DynamicPPL.tilde_observe(context::ADTypeCheckContext, right, left, vi)
176-
logp, vi = DynamicPPL.tilde_observe(DynamicPPL.childcontext(context), right, left, vi)
175+
function DynamicPPL.tilde_observe!!(context::ADTypeCheckContext, right, left, vi)
176+
logp, vi = DynamicPPL.tilde_observe!!(DynamicPPL.childcontext(context), right, left, vi)
177177
check_adtype(context, vi)
178178
return logp, vi
179179
end
180180

181-
function DynamicPPL.tilde_observe(context::ADTypeCheckContext, sampler, right, left, vi)
182-
logp, vi = DynamicPPL.tilde_observe(
181+
function DynamicPPL.tilde_observe!!(context::ADTypeCheckContext, sampler, right, left, vi)
182+
logp, vi = DynamicPPL.tilde_observe!!(
183183
DynamicPPL.childcontext(context), sampler, right, left, vi
184184
)
185185
check_adtype(context, vi)

0 commit comments

Comments
 (0)