@@ -76,26 +76,35 @@ Sample from the `model` using the `sampler` with random number generator `rng` a
76
76
The method resets the log joint probability of `varinfo` and increases the evaluation
77
77
number of `sampler`.
78
78
"""
79
- function (model:: Model )(args... )
80
- return model (VarInfo (), args... )
81
- end
82
-
83
- function (model:: Model )(varinfo:: AbstractVarInfo , args... )
84
- return model (Random. GLOBAL_RNG, varinfo, args... )
85
- end
86
-
87
79
function (model:: Model )(
88
80
rng:: Random.AbstractRNG ,
89
- varinfo:: AbstractVarInfo ,
81
+ varinfo:: AbstractVarInfo = VarInfo () ,
90
82
sampler:: AbstractSampler = SampleFromPrior (),
91
- context:: AbstractContext = DefaultContext ()
83
+ context:: AbstractContext = DefaultContext (),
92
84
)
93
85
if Threads. nthreads () == 1
94
86
return evaluate_threadunsafe (rng, model, varinfo, sampler, context)
95
87
else
96
88
return evaluate_threadsafe (rng, model, varinfo, sampler, context)
97
89
end
98
90
end
91
+ function (model:: Model )(args... )
92
+ return model (Random. GLOBAL_RNG, args... )
93
+ end
94
+
95
+ # without VarInfo
96
+ function (model:: Model )(
97
+ rng:: Random.AbstractRNG ,
98
+ sampler:: AbstractSampler ,
99
+ args... ,
100
+ )
101
+ return model (rng, VarInfo (), sampler, args... )
102
+ end
103
+
104
+ # without VarInfo and without AbstractSampler
105
+ function (model:: Model )(rng:: Random.AbstractRNG , context:: AbstractContext )
106
+ return model (rng, VarInfo (), SampleFromPrior (), context)
107
+ end
99
108
100
109
"""
101
110
evaluate_threadunsafe(rng, model, varinfo, sampler, context)
0 commit comments