Skip to content

Commit e5ed96f

Browse files
authored
Merge pull request #383 from SamWitty/patch-2
Typo fix in TraceTranslator doc example
2 parents 7a458b8 + fe560da commit e5ed96f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/src/ref/trace_translators.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ end
4545
The following trace transform DSL program defines a transformation (called `f`) that transforms traces of `p1` into traces of `p2`:
4646
```julia
4747
@transform f (t1) to (t2) begin
48-
r = @read(t1[:r], continuous)
49-
theta = @read(t1[theta], continuous)
50-
@write(t2[:x], r * cos(theta), continuous)
51-
@write(t2[:y], r * sin(theta), continuous)
48+
r = @read(t1[:r], :continuous)
49+
theta = @read(t1[theta], :continuous)
50+
@write(t2[:x], r * cos(theta), :continuous)
51+
@write(t2[:y], r * sin(theta), :continuous)
5252
end
5353
```
5454
This transform reads values of random choices in the input trace (`t1`) at specific addresses (indicated by the syntax `t1[addr]`) using `@read` and writes values to the output trace (`t2`) using `@write`.
@@ -60,11 +60,11 @@ The inverse can provide a dynamic check that the transform truly is a bijection.
6060
The inverse of the above transformation is:
6161
```julia
6262
@transform finv (t2) to (t1) begin
63-
x = @read(t2[:x], continuous)
64-
y = @read(t2[:y], continuous)
63+
x = @read(t2[:x], :continuous)
64+
y = @read(t2[:y], :continuous)
6565
r = sqrt(x^2 + y^2)
66-
@write(t1[:r], sqrt(x^2 + y^2), continuous)
67-
@write(t1[:theta], atan(y, x), continuous)
66+
@write(t1[:r], sqrt(x^2 + y^2), :continuous)
67+
@write(t1[:theta], atan(y, x), :continuous)
6868
end
6969
```
7070
We can inform Gen that two transforms are inverses of one another using [`pair_bijections!`](@ref):

0 commit comments

Comments
 (0)