@@ -73,6 +73,11 @@ object can be passed to any API methods that accept `t`.
7373In many cases, compiling `t` can significantly speed up execution time. Note that the longer
7474the tape, the more time compilation may take. Very long tapes (i.e. when `length(t)` is on
7575the order of 10000 elements) can take a very long time to compile.
76+
77+ Note that this function calls `eval` in the `current_module()` to generate functions
78+ from `t`. Thus, the returned `Compiled*` type will only be useable once the world-age
79+ counter has caught up with the world-age of the `eval`'d functions (i.e. once the call
80+ stack has bubbled up to top level).
7681"""
7782function compile (t:: AbstractTape )
7883 return Compiled (typeof (t), t. func, t. input, t. output,
@@ -93,7 +98,7 @@ The arguments to `ReverseDiff.compile_gradient` are the same as the arguments to
9398
9499The usage restrictions on the returned function are the same as the usage restrictions
95100for calling `gradient!(result, tape, input)` where `tape` is a compiled `GradientTape`;
96- see `ReverseDiff.compile` for details.
101+ see `ReverseDiff.compile` for details (including an important note on world-age) .
97102"""
98103function compile_gradient (f, args... )
99104 tape = compile (GradientTape (f, args... ))
@@ -115,7 +120,7 @@ this means `ReverseDiff.compile_jacobian` also supports target functions of the
115120
116121The usage restrictions on the returned function are the same as the usage restrictions
117122for calling `jacobian!(result, tape, input)` where `tape` is a compiled `JacobianTape`;
118- see `ReverseDiff.compile` for details.
123+ see `ReverseDiff.compile` for details (including an important note on world-age) .
119124"""
120125function compile_jacobian (f, args... )
121126 tape = compile (JacobianTape (f, args... ))
@@ -135,7 +140,7 @@ The arguments to `ReverseDiff.compile_hessian` are the same as the arguments to
135140
136141The usage restrictions on the returned function are the same as the usage restrictions
137142for calling `hessian!(result, tape, input)` where `tape` is a compiled `HessianTape`;
138- see `ReverseDiff.compile` for details.
143+ see `ReverseDiff.compile` for details (including an important note on world-age) .
139144"""
140145function compile_hessian (f, args... )
141146 tape = compile (HessianTape (f, args... ))
0 commit comments