You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DifferentiationInterface/src/docstrings.jl
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -21,9 +21,12 @@ function docstring_prepare(operator; samepoint=false, inplace=false)
21
21
Depending on the backend, this can have several effects (preallocating memory, recording an execution trace) which are transparent to the user.
22
22
23
23
!!! warning
24
-
The preparation result is only reusable as long as the arguments to `$operator` do not change type or size, and the function and backend themselves are not modified.
25
-
Otherwise, preparation will be invalidated and you will need to run it again.
26
-
The keyword argument `strict` activates automatic type checking, but ensuring size consistency is up to the user.
24
+
The preparation result `prep` is only reusable as long as the arguments to `$operator` do not change type or size, and the function and backend themselves are not modified.
25
+
Otherwise, preparation becomes invalid and you need to run it again.
26
+
In some settings, invalid preparations may still give correct results (e.g. for backends that require no preparation), but this is not a semantic guarantee and should not be relied upon.
27
+
28
+
When `strict=Val(true)`, type checking is enforced between preparation and execution (but size checking is left to the user).
29
+
27
30
$(inplace ?"\nFor in-place functions, `y` is mutated by `f!` during preparation.":"")
0 commit comments