@@ -35,7 +35,14 @@ function tilde(ctx::MiniBatchContext, sampler, right, left::VarName, inds, vi)
35
35
return tilde (ctx. ctx, sampler, right, left, inds, vi)
36
36
end
37
37
38
+ """
39
+ tilde_assume(ctx, sampler, right, vn, inds, vi)
38
40
41
+ This method is applied in the generated code for assumed variables, e.g., `x ~ Normal()` where
42
+ `x` does not occur in the model inputs.
43
+
44
+ Falls back to `tilde(ctx, sampler, right, vn, inds, vi)`.
45
+ """
39
46
function tilde_assume (ctx, sampler, right, vn, inds, vi)
40
47
return tilde (ctx, sampler, right, vn, inds, vi)
41
48
end
@@ -74,9 +81,25 @@ function tilde(ctx::MiniBatchContext, sampler, right, left, vi)
74
81
return ctx. loglike_scalar * tilde (ctx. ctx, sampler, right, left, vi)
75
82
end
76
83
84
+ """
85
+ tilde_observe(ctx, sampler, right, left, vname, vinds, vi)
86
+
87
+ This method is applied in the generated code for observed variables, e.g., `x ~ Normal()` where
88
+ `x` does occur the model inputs.
89
+
90
+ Falls back to `tilde(ctx, sampler, right, left, vi)` ignoring the information about variable
91
+ name and indices; if needed, these can be accessed through this function, though.
92
+ """
77
93
function tilde_observe (ctx, sampler, right, left, vname, vinds, vi)
78
94
return tilde (ctx, sampler, right, left, vi)
79
95
end
96
+
97
+ """
98
+ tilde_observe(ctx, sampler, right, left, vi)
99
+
100
+ This method is applied in the generated code for observed constants, e.g., `1.0 ~ Normal()`.
101
+ Falls back to `tilde(ctx, sampler, right, left, vi)`.
102
+ """
80
103
function tilde_observe (ctx, sampler, right, left, vi)
81
104
return tilde (ctx, sampler, right, left, vi)
82
105
end
@@ -177,6 +200,14 @@ function dot_tilde(
177
200
return _dot_tilde (sampler, dist, left, vns, vi)
178
201
end
179
202
203
+ """
204
+ dot_tilde_assume(ctx, sampler, right, left, vn, inds, vi)
205
+
206
+ This method is applied in the generated code for assumed vectorized variables, e.g., `x .~
207
+ MvNormal()` where `x` does not occur in the model inputs.
208
+
209
+ Falls back to `dot_tilde(ctx, sampler, right, left, vn, inds, vi)`.
210
+ """
180
211
function dot_tilde_assume (ctx, sampler, right, left, vn, inds, vi)
181
212
return dot_tilde (ctx, sampler, right, left, vn, inds, vi)
182
213
end
@@ -356,9 +387,25 @@ function dot_tilde(ctx::MiniBatchContext, sampler, right, left, vi)
356
387
return ctx. loglike_scalar * dot_tilde (ctx. ctx, sampler, right, left, left, vi)
357
388
end
358
389
390
+ """
391
+ dot_tilde_observe(ctx, sampler, right, left, vname, vinds, vi)
392
+
393
+ This method is applied in the generated code for vectorized observed variables, e.g., `x .~
394
+ MvNormal()` where `x` does occur the model inputs.
395
+
396
+ Falls back to `dot_tilde(ctx, sampler, right, left, vi)` ignoring the information about variable
397
+ name and indices; if needed, these can be accessed through this function, though.
398
+ """
359
399
function dot_tilde_observe (ctx, sampler, right, left, vn, inds, vi)
360
400
return dot_tilde (ctx, sampler, right, left, vi)
361
401
end
402
+
403
+ """
404
+ dot_tilde_observe(ctx, sampler, right, left, vi)
405
+
406
+ This method is applied in the generated code for vectorized observed constants, e.g., `[1.0] .~
407
+ MvNormal()`. Falls back to `dot_tilde(ctx, sampler, right, left, vi)`.
408
+ """
362
409
function dot_tilde_observe (ctx, sampler, right, left, vi)
363
410
return dot_tilde (ctx, sampler, right, left, vi)
364
411
end
0 commit comments