Skip to content

Commit 24b07f3

Browse files
committed
Fixes for Turing 0.37 compatibility
1 parent b45eef0 commit 24b07f3

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

developers/compiler/model-manual/index.qmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ However, models can be constructed by hand without the use of a macro.
2828
Taking the `gdemo` model above as an example, the macro-based definition can be implemented also (a bit less generally) with the macro-free version
2929

3030
```{julia}
31+
using DynamicPPL
32+
3133
# Create the model function.
3234
function gdemo2(model, varinfo, context, x)
3335
# Assume s² has an InverseGamma distribution.

tutorials/infinite-mixture-models/index.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,10 @@ In Turing we can implement an infinite Gaussian mixture model using the Chinese
188188
H = Normal(μ0, σ0)
189189
190190
# Latent assignment.
191-
z = tzeros(Int, length(x))
191+
z = zeros(Int, length(x))
192192
193193
# Locations of the infinitely many clusters.
194-
μ = tzeros(Float64, 0)
194+
μ = zeros(Float64, 0)
195195
196196
for i in 1:length(x)
197197

usage/probability-interface/index.qmd

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Let's use a simple model of normally-distributed data as an example.
1818

1919
```{julia}
2020
using Turing
21-
using LinearAlgebra: I
21+
using DynamicPPL
2222
using Random
2323
2424
@model function gdemo(n)
@@ -98,11 +98,9 @@ logjoint(model, sample)
9898
```
9999

100100
For models with many variables `rand(model)` can be prohibitively slow since it returns a `NamedTuple` of samples from the prior distribution of the unconditioned variables.
101-
We recommend working with samples of type `DataStructures.OrderedDict` in this case:
101+
We recommend working with samples of type `DataStructures.OrderedDict` in this case (which Turing re-exports, so can be used directly):
102102

103103
```{julia}
104-
using DataStructures: OrderedDict
105-
106104
Random.seed!(124)
107105
sample_dict = rand(OrderedDict, model)
108106
```

0 commit comments

Comments
 (0)