Skip to content

Commit d55fc00

Browse files
committed
Fix docs, workaround Zygote issue
1 parent f35eca6 commit d55fc00

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

docs/src/internals/varinfo.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ For example, with the model above we have
8585

8686
```@example varinfo-design
8787
# Type-unstable `VarInfo`
88-
varinfo_untyped = DynamicPPL.untyped_varinfo(demo())
88+
varinfo_untyped = DynamicPPL.untyped_varinfo(
89+
demo(), SampleFromPrior(), DefaultContext(), DynamicPPL.Metadata
90+
)
8991
typeof(varinfo_untyped.metadata)
9092
```
9193

src/utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ from_vec_transform_for_size(::Tuple{<:Any}) = identity
297297
Return the transformation from the vector representation of a realization from
298298
distribution `dist` to the original representation compatible with `dist`.
299299
"""
300-
from_vec_transform(::UnivariateDistribution) = UnwrapSingletonTransform()
301300
from_vec_transform(dist::Distribution) = from_vec_transform_for_size(size(dist))
301+
from_vec_transform(::UnivariateDistribution) = UnwrapSingletonTransform()
302302
from_vec_transform(dist::LKJCholesky) = ToChol(dist.uplo) ReshapeTransform(size(dist))
303303

304304
"""

src/varinfo.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ function untyped_varinfo(
184184
varinfo = VarInfo(metadata_type())
185185
return last(evaluate!!(model, varinfo, SamplingContext(rng, sampler, context)))
186186
end
187-
function untyped_varinfo(model::Model, args::Union{AbstractSampler,AbstractContext}...)
187+
function untyped_varinfo(model::Model, args::Union{AbstractSampler,AbstractContext,Type}...)
188188
return untyped_varinfo(Random.default_rng(), model, args...)
189189
end
190190

0 commit comments

Comments
 (0)