@@ -282,7 +282,8 @@ function AbstractMCMC.sample(
282
282
initial_params = get (kwargs, :initial_params , nothing )
283
283
link = requires_unconstrained_space (spl)
284
284
vi = initialise_varinfo (rng, model, spl, initial_params, link)
285
- ldf = LogDensityFunction (model, vi; adtype= get_adtype (spl))
285
+ ctx = SamplingContext (rng, spl)
286
+ ldf = LogDensityFunction (model, vi, ctx; adtype= get_adtype (spl))
286
287
# No need to run check_model again
287
288
return AbstractMCMC. sample (rng, ldf, spl, N; kwargs... , check_model= false )
288
289
end
@@ -380,7 +381,8 @@ function AbstractMCMC.sample(
380
381
initial_params = get (kwargs, :initial_params , nothing )
381
382
link = requires_unconstrained_space (spl)
382
383
vi = initialise_varinfo (rng, model, spl, initial_params, link)
383
- ldf = LogDensityFunction (model, vi; adtype= get_adtype (spl))
384
+ ctx = SamplingContext (rng, spl)
385
+ ldf = LogDensityFunction (model, vi, ctx; adtype= get_adtype (spl))
384
386
# No need to run check_model again
385
387
return AbstractMCMC. sample (
386
388
rng, ldf, spl, ensemble, N, n_chains; kwargs... , check_model= false
0 commit comments