Skip to content

Commit 275072c

Browse files
committed
Fix some missing imports
1 parent f8d87cb commit 275072c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
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.

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)