Skip to content

Commit 62a8746

Browse files
committed
Update comment
1 parent 6e8c146 commit 62a8746

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/onlyaccs.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
OnlyAccsVarInfo
33
44
This is a wrapper around an `AccumulatorTuple` that implements the minimal `AbstractVarInfo`
5-
interface to work with the `accumulate_assume!!` and `accumulate_observe!!` functions.
5+
interface to work with the `tilde_assume!!` and `tilde_observe!!` functions for
6+
`InitContext`.
67
78
Note that this does not implement almost every other AbstractVarInfo interface function, and
8-
so using this outside of FastLDF will lead to errors.
9+
so using attempting to use this with a different leaf context such as `DefaultContext` will
10+
result in errors.
911
1012
Conceptually, one can also think of this as a VarInfo that doesn't contain a metadata field.
11-
That is because values for random variables are obtained by reading from a separate entity
12-
(such as a `FastLDFContext`), rather than from the VarInfo itself.
13+
This is also why it only works with `InitContext`: in this case, the parameters used for
14+
evaluation are supplied by the context instead of the metadata.
1315
"""
1416
struct OnlyAccsVarInfo{Accs<:AccumulatorTuple} <: AbstractVarInfo
1517
accs::Accs
@@ -19,7 +21,7 @@ function OnlyAccsVarInfo(accs::NTuple{N,AbstractAccumulator}) where {N}
1921
return OnlyAccsVarInfo(AccumulatorTuple(accs))
2022
end
2123

22-
# AbstractVarInfo interface
24+
# Minimal AbstractVarInfo interface
2325
@inline DynamicPPL.maybe_invlink_before_eval!!(vi::OnlyAccsVarInfo, ::Model) = vi
2426
@inline DynamicPPL.getaccs(vi::OnlyAccsVarInfo) = vi.accs
2527
@inline DynamicPPL.setaccs!!(::OnlyAccsVarInfo, accs::AccumulatorTuple) =

0 commit comments

Comments
 (0)