@@ -53,10 +53,11 @@ function accumulate_observe!! end
53
53
54
54
Update `acc` in a `tilde_assume!!` call. Returns the updated `acc`.
55
55
56
- `vn` is the name of the variable being assumed, `val` is the value of the variable, and
57
- `right` is the distribution on the RHS of the tilde statement. `logjac` is the log
58
- determinant of the Jacobian of the transformation that was done to convert the value of `vn`
59
- as it was given (e.g. by sampler operating in linked space) to `val`.
56
+ `vn` is the name of the variable being assumed, `val` is the value of the variable (in the
57
+ original, unlinked space), and `right` is the distribution on the RHS of the tilde
58
+ statement. `logjac` is the log determinant of the Jacobian of the transformation that was
59
+ done to convert the value of `vn` as it was given to `val`: for example, if the sampler is
60
+ operating in linked (Euclidean) space, then logjac will be nonzero.
60
61
61
62
`accumulate_assume!!` may mutate `acc`, but not any of the other arguments.
62
63
@@ -71,16 +72,16 @@ Return a new accumulator like `acc` but empty.
71
72
72
73
The precise meaning of "empty" is that that the returned value should be such that
73
74
`combine(acc, split(acc))` is equal to `acc`. This is used in the context of multi-threading
74
- where different threads may accumulate independently and the results are the combined.
75
+ where different threads may accumulate independently and the results are then combined.
75
76
76
77
See also: [`combine`](@ref)
77
78
"""
78
79
function split end
79
80
80
81
"""
81
- combine(acc::AbstractAccumulator , acc2::AbstractAccumulator)
82
+ combine(acc::TAcc , acc2::TAcc) where {TAcc<:AbstractAccumulator}
82
83
83
- Combine two accumulators of the same type. Returns a new accumulator.
84
+ Combine two accumulators of the same type. Returns a new accumulator of the same type .
84
85
85
86
See also: [`split`](@ref)
86
87
"""
126
127
AccumulatorTuple (accs:: Vararg{AbstractAccumulator} ) = AccumulatorTuple (accs)
127
128
AccumulatorTuple (nt:: NamedTuple ) = AccumulatorTuple (tuple (nt... ))
128
129
129
- # When showing with text/plain, leave out information about the wrapper AccumulatorTuple.
130
- Base. show (io:: IO , mime:: MIME"text/plain" , at:: AccumulatorTuple ) = show (io, mime, at. nt)
130
+ # When showing with text/plain, leave out type information about the wrapper AccumulatorTuple.
131
+ function Base. show (io:: IO , mime:: MIME"text/plain" , at:: AccumulatorTuple )
132
+ return " AccumulatorTuple(" * show (io, mime, at. nt) * " )"
133
+ end
131
134
Base. getindex (at:: AccumulatorTuple , idx) = at. nt[idx]
132
135
Base. length (:: AccumulatorTuple{N} ) where {N} = N
133
136
Base. iterate (at:: AccumulatorTuple , args... ) = iterate (at. nt, args... )
0 commit comments