|
234 | 234 | function SimpleVarInfo{T}( |
235 | 235 | rng::Random.AbstractRNG, model::Model, init_strategy::AbstractInitStrategy=PriorInit() |
236 | 236 | ) where {T<:Real} |
237 | | - new_context = setleafcontext(model.context, InitContext(rng, init_strategy)) |
238 | | - new_model = contextualize(model, new_context) |
239 | | - return last(evaluate!!(new_model, SimpleVarInfo{T}())) |
| 237 | + return last(init!!(rng, model, SimpleVarInfo{T}(), init_strategy)) |
240 | 238 | end |
241 | 239 | function SimpleVarInfo{T}( |
242 | 240 | model::Model, init_strategy::AbstractInitStrategy=PriorInit() |
@@ -491,8 +489,9 @@ function settrans!!(vi::ThreadSafeVarInfo{<:SimpleVarInfo}, trans) |
491 | 489 | return Accessors.@set vi.varinfo = settrans!!(vi.varinfo, trans) |
492 | 490 | end |
493 | 491 | function settrans!!(vi::SimpleOrThreadSafeSimple, trans::Bool, ::VarName) |
494 | | - # We keep this method around just to obey the AbstractVarInfo interface; however, |
495 | | - # this is only a valid operation if it would be a no-op. |
| 492 | + # We keep this method around just to obey the AbstractVarInfo interface. |
| 493 | + # However, note that this would only be a valid operation if it would be a |
| 494 | + # no-op, which we check here. |
496 | 495 | if trans != istrans(vi) |
497 | 496 | error( |
498 | 497 | "Individual variables in SimpleVarInfo cannot have different `settrans` statuses.", |
|
0 commit comments