Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
torfjelde committed Nov 28, 2024
1 parent f716296 commit 76aebc5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/context_implementations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ probability of `vi` with the returned value.
function tilde_assume!!(context, right, vn, vi)
return if is_rhs_model(right)
# Prefix the variables using the `vn`.
rand_like!!(right, should_auto_prefix(right) ? PrefixContext{Symbol(vn)}(context) : context, vi)
rand_like!!(
right,
should_auto_prefix(right) ? PrefixContext{Symbol(vn)}(context) : context,
vi,
)
else
value, logp, vi = tilde_assume(context, right, vn, vi)
value, acclogp_assume!!(context, vi, logp)
Expand Down Expand Up @@ -338,11 +342,11 @@ Falls back to `dot_tilde_assume(context, right, left, vn, vi)`.
function dot_tilde_assume!!(context, right, left, vn, vi)
is_rhs_model(right) && throw(
ArgumentError(
"`.~` with a model on the right-hand side is not supported; please use `~`",
"`.~` with a model on the right-hand side is not supported; please use `~`"
),
)
value, logp, vi = dot_tilde_assume(context, right, left, vn, vi)
value, acclogp_assume!!(context, vi, logp)
return value, acclogp_assume!!(context, vi, logp)
end

# `dot_assume`
Expand Down
3 changes: 2 additions & 1 deletion src/model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1485,4 +1485,5 @@ julia> model()
ERROR: ArgumentError: `~` with a model on the right-hand side of an observe statement is not supported
[...]
"""
to_submodel(model::Model, auto_prefix::Bool=true) = to_sampleable(returned(model), auto_prefix)
to_submodel(model::Model, auto_prefix::Bool=true) =
to_sampleable(returned(model), auto_prefix)

0 comments on commit 76aebc5

Please sign in to comment.