File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -39,8 +39,18 @@ using Random: Random
3939
4040Evaluate a model using parameters obtained via `strategy`, and only computing the results in
4141the provided accumulators.
42+
43+ It is assumed that the accumulators passed in have been initialised to appropriate values,
44+ as this function will not reset them. The default constructors for each accumulator will do
45+ this for you correctly.
46+
47+ Returns a tuple of the model's return value, plus an `OnlyAccsVarInfo`. Note that the `accs`
48+ argument may be mutated (depending on how the accumulators are implemented); hence the `!!`
49+ in the function name.
4250"""
4351@inline function fast_evaluate!! (
52+ # Note that this `@inline` is mandatory for performance. If it's not inlined, it leads
53+ # to extra allocations (even for trivial models) and much slower runtime.
4454 rng:: Random.AbstractRNG ,
4555 model:: Model ,
4656 strategy:: AbstractInitStrategy ,
6979@inline function fast_evaluate!! (
7080 model:: Model , strategy:: AbstractInitStrategy , accs:: AccumulatorTuple
7181)
82+ # This `@inline` is also mandatory for performance
7283 return fast_evaluate!! (Random. default_rng (), model, strategy, accs)
7384end
7485
You can’t perform that action at this time.
0 commit comments