@@ -73,6 +73,11 @@ object can be passed to any API methods that accept `t`.
73
73
In many cases, compiling `t` can significantly speed up execution time. Note that the longer
74
74
the tape, the more time compilation may take. Very long tapes (i.e. when `length(t)` is on
75
75
the 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).
76
81
"""
77
82
function compile (t:: AbstractTape )
78
83
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
93
98
94
99
The usage restrictions on the returned function are the same as the usage restrictions
95
100
for 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) .
97
102
"""
98
103
function compile_gradient (f, args... )
99
104
tape = compile (GradientTape (f, args... ))
@@ -115,7 +120,7 @@ this means `ReverseDiff.compile_jacobian` also supports target functions of the
115
120
116
121
The usage restrictions on the returned function are the same as the usage restrictions
117
122
for 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) .
119
124
"""
120
125
function compile_jacobian (f, args... )
121
126
tape = compile (JacobianTape (f, args... ))
@@ -135,7 +140,7 @@ The arguments to `ReverseDiff.compile_hessian` are the same as the arguments to
135
140
136
141
The usage restrictions on the returned function are the same as the usage restrictions
137
142
for 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) .
139
144
"""
140
145
function compile_hessian (f, args... )
141
146
tape = compile (HessianTape (f, args... ))
0 commit comments