Skip to content

Commit

Permalink
Update tutorials/docs-10-using-turing-autodiff/index.qmd
Browse files Browse the repository at this point in the history
Co-authored-by: Guillaume Dalle <[email protected]>
  • Loading branch information
willtebbutt and gdalle authored Nov 8, 2024
1 parent f6c8a4d commit cbe8efa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tutorials/docs-10-using-turing-autodiff/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ For `ReverseDiff`, pass `adtype=AutoReverseDiff()` to the sampler constructor. A



Cached tapes should only be used if you are absolutely certain that the sequence of operations performed in your code does not change between different executions of your model.
Pre-recorded tapes should only be used if you are absolutely certain that the sequence of operations performed in your code does not change between different executions of your model.

Thus, e.g., in the model definition and all implicitly and explicitly called functions in the model, all loops should be of fixed size, and `if`-statements should consistently execute the same branches.
For instance, `if`-statements with conditions that can be determined at compile time or conditions that depend only on fixed properties of the data will always execute the same branches during sampling (if the data is constant throughout sampling and, e.g., no mini-batching is used).
However, `if`-statements that depend on the model parameters can take different branches during sampling; hence, the compiled tape might be incorrect.
Expand Down

0 comments on commit cbe8efa

Please sign in to comment.