Skip to content

Commit a05a58b

Browse files
authored
Update tutorials/docs-10-using-turing-autodiff/index.qmd
1 parent 3d76c99 commit a05a58b

File tree

1 file changed

+2
-1
lines changed
  • tutorials/docs-10-using-turing-autodiff

1 file changed

+2
-1
lines changed

tutorials/docs-10-using-turing-autodiff/index.qmd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ As of Turing version v0.30, the global configuration flag for the AD backend has
2020
Users can pass the `adtype` keyword argument to the sampler constructor to select the desired AD backend, with the default being `AutoForwardDiff(; chunksize=0)`.
2121

2222
For `ForwardDiff`, pass `adtype=AutoForwardDiff(; chunksize)` to the sampler constructor. A `chunksize` of 0 permits the chunk size to be automatically determined. For more information regarding the selection of `chunksize`, please refer to [related section of `ForwardDiff`'s documentation](https://juliadiff.org/ForwardDiff.jl/dev/user/advanced/#Configuring-Chunk-Size).
23-
For `ReverseDiff`, pass `adtype=AutoReverseDiff()` to the sampler constructor. An additional argument can be provided to `AutoReverseDiff` to specify whether to to cache the tape only once and reuse it later use (`false` by default, which means no caching tape). This can substantially improve performance, but risks silently incorrect results if not used with care.
23+
For `ReverseDiff`, pass `adtype=AutoReverseDiff()` to the sampler constructor. An additional argument can be provided to `AutoReverseDiff` to specify whether to to cache the tape only once and reuse it later use (`false` by default, which means no caching). This can substantially improve performance, but risks silently incorrect results if not used with care.
24+
2425

2526
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.
2627
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.

0 commit comments

Comments
 (0)