File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 22 OnlyAccsVarInfo
33
44This 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
78Note 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
1012Conceptually, 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"""
1416struct OnlyAccsVarInfo{Accs<: AccumulatorTuple } <: AbstractVarInfo
1517 accs:: Accs
@@ -19,7 +21,7 @@ function OnlyAccsVarInfo(accs::NTuple{N,AbstractAccumulator}) where {N}
1921 return OnlyAccsVarInfo (AccumulatorTuple (accs))
2022end
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 ) =
You can’t perform that action at this time.
0 commit comments