File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -45,10 +45,10 @@ julia> t()()
45
45
### When to `@thunk`?
46
46
When writing `rrule`s (and to a lesser exent `frule`s), it is important to `@thunk`
47
47
appropriately.
48
- Propagation rule's that return multiple derivatives may not hae all deriviatives used.
48
+ Propagation rules that return multiple derivatives may not have all deriviatives used.
49
49
By `@thunk`ing the work required for each derivative, they then compute only what is needed.
50
50
51
- #### How to thunks prevent work?
51
+ #### How do thunks prevent work?
52
52
If we have `res = pullback(...) = @thunk(f(x)), @thunk(g(x))`
53
53
then if we did `dx + res[1]` then only `f(x)` would be evaluated, not `g(x)`.
54
54
Also if we did `Zero() * res[1]` then the result would be `Zero()` and `f(x)` would not be evaluated.
You can’t perform that action at this time.
0 commit comments