44
55Run a Turing `model` nested inside of a Turing model.
66
7+ !!! warning
8+ This is deprecated and will be removed in a future release.
9+ Use [`@returned_quantities(model)`](@ref) instead.
10+
711# Examples
812
913```jldoctest submodel; setup=:(using Distributions)
@@ -21,6 +25,9 @@ julia> @model function demo2(x, y)
2125When we sample from the model `demo2(missing, 0.4)` random variable `x` will be sampled:
2226```jldoctest submodel
2327julia> vi = VarInfo(demo2(missing, 0.4));
28+ ┌ Warning: `@submodel model` is deprecated, use `@returned_quantities model` instead.
29+ │ caller = ip:0x0
30+ └ @ Core :-1
2431
2532julia> @varname(x) in keys(vi)
2633true
@@ -62,6 +69,10 @@ Valid expressions for `prefix=...` are:
6269The prefix makes it possible to run the same Turing model multiple times while
6370keeping track of all random variables correctly.
6471
72+ !!! warning
73+ This is deprecated and will be removed in a future release.
74+ Use [`@returned_quantities`](@ref) combined with [`@prefix`](@ref) instead.
75+
6576# Examples
6677## Example models
6778```jldoctest submodelprefix; setup=:(using Distributions)
@@ -81,6 +92,9 @@ When we sample from the model `demo2(missing, missing, 0.4)` random variables `s
8192`sub2.x` will be sampled:
8293```jldoctest submodelprefix
8394julia> vi = VarInfo(demo2(missing, missing, 0.4));
95+ ┌ Warning: `@submodel model` is deprecated, use `@returned_quantities model` instead.
96+ │ caller = ip:0x0
97+ └ @ Core :-1
8498
8599julia> @varname(var"sub1.x") in keys(vi)
86100true
@@ -124,6 +138,9 @@ julia> # When `prefix` is unspecified, no prefix is used.
124138submodel_noprefix (generic function with 2 methods)
125139
126140julia> @varname(x) in keys(VarInfo(submodel_noprefix()))
141+ ┌ Warning: `@submodel model` is deprecated, use `@returned_quantities model` instead.
142+ │ caller = ip:0x0
143+ └ @ Core :-1
127144true
128145
129146julia> # Explicitely don't use any prefix.
0 commit comments