@@ -39,22 +39,16 @@ can_be_wrapped(ctx::DynamicPPL.PrefixContext) = can_be_wrapped(ctx.context)
39
39
# - `GibbsContext` allows us to perform conditioning while still hit the `assume` pipeline
40
40
# rather than the `observe` pipeline for the conditioned variables.
41
41
"""
42
- GibbsContext{VNs}( global_varinfo, context)
42
+ GibbsContext(target_varnames, global_varinfo, context)
43
43
44
44
A context used in the implementation of the Turing.jl Gibbs sampler.
45
45
46
46
There will be one `GibbsContext` for each iteration of a component sampler.
47
47
48
- `VNs` is a a tuple of symbols for `VarName`s that the current component
49
- sampler is sampling. For those `VarName`s, `GibbsContext` will just pass `tilde_assume`
50
- calls to its child context. For other variables, their values will be fixed to the values
51
- they have in `global_varinfo`.
52
-
53
- The naive implementation of `GibbsContext` would simply have a field `target_varnames` that
54
- would be a collection of `VarName`s that the current component sampler is sampling. The
55
- reason we instead have a `Tuple` type parameter listing `Symbol`s is to allow
56
- `is_target_varname` to benefit from compile time constant propagation. This is important
57
- for type stability of `tilde_assume`.
48
+ `target_varnames` is a a tuple of `VarName`s that the current component sampler
49
+ is sampling. For those `VarName`s, `GibbsContext` will just pass `tilde_assume`
50
+ calls to its child context. For other variables, their values will be fixed to
51
+ the values they have in `global_varinfo`.
58
52
59
53
# Fields
60
54
$(FIELDS)
@@ -293,9 +287,6 @@ Gibbs(@varname(x) => NUTS(), @varname(y) => MH())
293
287
Gibbs((@varname(x), :y) => NUTS(), :z => MH())
294
288
```
295
289
296
- Currently only variable names without indexing are supported, so for instance
297
- `Gibbs(@varname(x[1]) => NUTS())` does not work. This will hopefully change in the future.
298
-
299
290
# Fields
300
291
$(TYPEDFIELDS)
301
292
"""
0 commit comments