@@ -116,10 +116,7 @@ extract_priors(args::Union{Model,AbstractVarInfo}...) =
116
116
extract_priors (Random. default_rng (), args... )
117
117
function extract_priors (rng:: Random.AbstractRNG , model:: Model )
118
118
varinfo = VarInfo ()
119
- # TODO (mhauru) This doesn't actually need the NumProduceAccumulator, it's only a
120
- # workaround for the fact that `order` is still hardcoded in VarInfo, and hence you
121
- # can't push new variables without knowing the num_produce. Remove this when possible.
122
- varinfo = setaccs!! (varinfo, (PriorDistributionAccumulator (), NumProduceAccumulator ()))
119
+ varinfo = setaccs!! (varinfo, (PriorDistributionAccumulator (),))
123
120
varinfo = last (evaluate_and_sample!! (rng, model, varinfo))
124
121
return getacc (varinfo, Val (:PriorDistributionAccumulator )). priors
125
122
end
@@ -133,12 +130,7 @@ This is done by evaluating the model at the values present in `varinfo`
133
130
and recording the distributions that are present at each tilde statement.
134
131
"""
135
132
function extract_priors (model:: Model , varinfo:: AbstractVarInfo )
136
- # TODO (mhauru) This doesn't actually need the NumProduceAccumulator, it's only a
137
- # workaround for the fact that `order` is still hardcoded in VarInfo, and hence you
138
- # can't push new variables without knowing the num_produce. Remove this when possible.
139
- varinfo = setaccs!! (
140
- deepcopy (varinfo), (PriorDistributionAccumulator (), NumProduceAccumulator ())
141
- )
133
+ varinfo = setaccs!! (deepcopy (varinfo), (PriorDistributionAccumulator (),))
142
134
varinfo = last (evaluate!! (model, varinfo))
143
135
return getacc (varinfo, Val (:PriorDistributionAccumulator )). priors
144
136
end
0 commit comments