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
Merge pull request #325 from probcomp/sml-top-level
Note in docs that definitions of `(static)` generative functions and calls to `@load_generated_functions()` are supported as top-level expressions only
Copy file name to clipboardExpand all lines: docs/src/ref/modeling.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -426,7 +426,10 @@ This will produce a file `test.pdf` in the current working directory containing
426
426
427
427
### Restrictions
428
428
429
-
In order to be able to construct the static graph, Gen restricts the permitted syntax that can be used in functions annotated with `static`.
429
+
First, the definition of a `(static)` generative function is always expected to occur as a [top-level definition](https://docs.julialang.org/en/v1/manual/modules/) (aka global variable); usage in non–top-level scopes is unsupported and may result in incorrect behavior.
430
+
Recall also that the macro [`@load_generated_functions`](@ref) is expected to be called as a top-level expression only.
431
+
432
+
Next, in order to be able to construct the static graph, Gen restricts the permitted syntax that can be used in functions annotated with `static`.
430
433
In particular, each statement in the body must be one of the following:
431
434
432
435
- A `@param` statement specifying any [Trainable parameters](@ref), e.g.:
0 commit comments