@@ -349,7 +349,7 @@ function initial_varinfo(rng, model, spl, initial_params)
349
349
# This is a quick fix for https://github.com/TuringLang/Turing.jl/issues/1588
350
350
# and https://github.com/TuringLang/Turing.jl/issues/1563
351
351
# to avoid that existing variables are resampled
352
- vi = last (DynamicPPL. evaluate!! (model, vi, DynamicPPL . DefaultContext () ))
352
+ vi = last (DynamicPPL. evaluate!! (model, vi))
353
353
end
354
354
return vi
355
355
end
@@ -534,9 +534,7 @@ function setparams_varinfo!!(
534
534
)
535
535
# The state is already a VarInfo, so we can just return `params`, but first we need to
536
536
# update its logprob.
537
- # NOTE: Using `leafcontext(model.context)` here is a no-op, as it will be concatenated
538
- # with `model.context` before hitting `model.f`.
539
- return last (DynamicPPL. evaluate!! (model, params, DynamicPPL. leafcontext (model. context)))
537
+ return last (DynamicPPL. evaluate!! (model, params))
540
538
end
541
539
542
540
function setparams_varinfo!! (
@@ -546,11 +544,8 @@ function setparams_varinfo!!(
546
544
params:: AbstractVarInfo ,
547
545
)
548
546
# The state is already a VarInfo, so we can just return `params`, but first we need to
549
- # update its logprob. To do this, we have to call evaluate!! with the sampler, rather
550
- # than just a context, because ESS is peculiar in how it uses LikelihoodContext for
551
- # some variables and DefaultContext for others.
552
- # TODO (penelopeysm): Is this still needed?
553
- return last (DynamicPPL. evaluate!! (model, params, DynamicPPL. SamplingContext (sampler)))
547
+ # update its logprob.
548
+ return last (DynamicPPL. evaluate!! (model, params))
554
549
end
555
550
556
551
function setparams_varinfo!! (
0 commit comments