From 710802f4240df7b5cb46135bd5b885d92f664fe2 Mon Sep 17 00:00:00 2001 From: Tor Erlend Fjelde Date: Mon, 29 Jan 2024 14:02:50 +0000 Subject: [PATCH 1/2] defer `acclogp_assume!!` and `acclogp_observe!!` to child context if not overloaded --- src/context_implementations.jl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/context_implementations.jl b/src/context_implementations.jl index 2b28b44a9..49605832a 100644 --- a/src/context_implementations.jl +++ b/src/context_implementations.jl @@ -16,10 +16,22 @@ require_particles(spl::Sampler) = false # Allows samplers, etc. to hook into the final logp accumulation in the tilde-pipeline. function acclogp_assume!!(context::AbstractContext, vi::AbstractVarInfo, logp) + return acclogp_assume!!(NodeTrait(acclogp_assume!!, context), context, vi, logp) +end +function acclogp_assume!!(::IsParent, context::AbstractContext, vi::AbstractVarInfo, logp) + return acclogp_assume!!(childcontext(context), vi, logp) +end +function acclogp_assume!!(::IsLeaf, context::AbstractContext, vi::AbstractVarInfo, logp) return acclogp!!(context, vi, logp) end function acclogp_observe!!(context::AbstractContext, vi::AbstractVarInfo, logp) + return acclogp_observe!!(NodeTrait(acclogp_observe!!, context), context, vi, logp) +end +function acclogp_observe!!(::IsParent, context::AbstractContext, vi::AbstractVarInfo, logp) + return acclogp_observe!!(childcontext(context), vi, logp) +end +function acclogp_observe!!(::IsLeaf, context::AbstractContext, vi::AbstractVarInfo, logp) return acclogp!!(context, vi, logp) end From 9775e49188e429368d1ad4fcccdb1e4b4a606e4c Mon Sep 17 00:00:00 2001 From: Tor Erlend Fjelde Date: Mon, 29 Jan 2024 14:17:44 +0000 Subject: [PATCH 2/2] bump patch version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index c6d662c44..305b1c52c 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "DynamicPPL" uuid = "366bfd00-2699-11ea-058f-f148b4cae6d8" -version = "0.24.5" +version = "0.24.6" [deps] AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"