You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/getting_started.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,15 +128,15 @@ end
128
128
129
129
## Instantiating the model
130
130
131
-
To instantiate the model we need to pass the data `x`. We can do that with the [`GraphPPL.create_model`](@ref) function in combination with [`GraphPPL.LazyIndex`](@ref).
131
+
To instantiate the model we need to pass the data `x`. We can do that with the [`GraphPPL.create_model`](@ref) function in combination with [`GraphPPL.datalabel`](@ref).
132
132
133
133
```@example getting-started
134
-
xdata = [ 1.0, 0.0, 0.0, 1.0 ]
134
+
data_for_x = [ 1.0, 0.0, 0.0, 1.0 ]
135
135
136
136
model = GraphPPL.create_model(coin_toss()) do model, context
137
137
return (;
138
138
# This expression creates data handle for `x` in the model using the `xdata` as the underlying collection
139
-
x = GraphPPL.getorcreate!(model, context, GraphPPL.NodeCreationOptions(kind = :data), :x, GraphPPL.LazyIndex(xdata))
139
+
x = GraphPPL.datalabel(model, context, GraphPPL.NodeCreationOptions(kind = GraphPPL.VariableKindData), :x, data_for_x)
@assertlength(interface_values) ==length(interfaces) "Distribution $t has $(length(interfaces)) fields $(interfaces) but $(length(interface_values)) values were provided."
0 commit comments