Skip to content

Commit 0e82a60

Browse files
committed
removed export of to_sampleable since it currently has no purpose +
fixed docs for `returned`
1 parent f645259 commit 0e82a60

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

docs/src/api.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ One can include models and call another model inside the model function with `le
112112
to_submodel
113113
```
114114

115-
Note that a `[returned(::DynamicPPL.Model)](@ref)` is only sampleable; one cannot compute `logpdf` for its realizations.
115+
Note that a `[to_submodel](@ref)` is only sampleable; one cannot compute `logpdf` for its realizations.
116116

117117
In the past, one would instead embed sub-models using [`@submodel`](@ref), which has been deprecated since the introduction of [`to_submodel(model)`](@ref)
118118

@@ -126,6 +126,11 @@ In the context of including models within models, it's also useful to prefix the
126126
prefix
127127
```
128128

129+
Under the hood, [`to_submodel`](@ref) makes use of the following method to indicate that the model it's wrapping is a model over its return-values rather than something else
130+
131+
```@docs
132+
returned(::Model)
133+
```
129134

130135
## Utilities
131136

src/DynamicPPL.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ export AbstractVarInfo,
123123
unfix,
124124
prefix,
125125
returned,
126-
to_sampleable,
127126
to_submodel,
128127
# Convenience macros
129128
@addlogprob!,

src/model.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,7 @@ end
12741274

12751275
is_rhs_model(x::Sampleable) = true
12761276

1277+
# TODO: Export this if it end up having a purpose beyond `to_submodel`.
12771278
"""
12781279
to_sampleable(model)
12791280
@@ -1315,10 +1316,11 @@ function rand_like!!(
13151316
return _evaluate!!(model_wrap.model, varinfo, context)
13161317
end
13171318

1319+
13181320
"""
1319-
returned(model::Model)
1321+
returned(model)
13201322
1321-
Return a `model` wrapper indicating that this a model over the return-values.
1323+
Return a `model` wrapper indicating that it is a model over its return-values.
13221324
"""
13231325
returned(model::Model) = ReturnedModelWrapper(model)
13241326

0 commit comments

Comments
 (0)