-
Notifications
You must be signed in to change notification settings - Fork 228
Closed
Description
Lines 104 to 124 in 05110bd
# has and get | |
function has_conditioned_gibbs(context::GibbsContext, vn::VarName) | |
return DynamicPPL.haskey(get_global_varinfo(context), vn) | |
end | |
function has_conditioned_gibbs(context::GibbsContext, vns::AbstractArray{<:VarName}) | |
num_conditioned = count(Iterators.map(Base.Fix1(has_conditioned_gibbs, context), vns)) | |
if (num_conditioned != 0) && (num_conditioned != length(vns)) | |
error( | |
"Some but not all of the variables in `vns` have been conditioned on. " * | |
"Having mixed conditioning like this is not supported in GibbsContext.", | |
) | |
end | |
return num_conditioned > 0 | |
end | |
function get_conditioned_gibbs(context::GibbsContext, vn::VarName) | |
return get_global_varinfo(context)[vn] | |
end | |
function get_conditioned_gibbs(context::GibbsContext, vns::AbstractArray{<:VarName}) | |
return map(Base.Fix1(get_conditioned_gibbs, context), vns) | |
end |
Following #2535 this is probably wrong and should be checked
Metadata
Metadata
Assignees
Labels
No labels