From cbe8efaa83bf4ffc183cfe77802bda898ba585da Mon Sep 17 00:00:00 2001 From: Will Tebbutt Date: Fri, 8 Nov 2024 11:54:56 +0000 Subject: [PATCH] Update tutorials/docs-10-using-turing-autodiff/index.qmd Co-authored-by: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> --- tutorials/docs-10-using-turing-autodiff/index.qmd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tutorials/docs-10-using-turing-autodiff/index.qmd b/tutorials/docs-10-using-turing-autodiff/index.qmd index dce9975b1..c5050fc7c 100755 --- a/tutorials/docs-10-using-turing-autodiff/index.qmd +++ b/tutorials/docs-10-using-turing-autodiff/index.qmd @@ -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.