-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't pass derived args to forw pass unless they are references or po…
…inters. ``_reverse_forward`` functions only contain the forward pass, which only affects the derivatives on references/pointers. For other types, there is no point in passing the adjoint. Moreover, doing so is often incorrect because derived arguments are generated for the reverse pass, e.g. ``` // forward pass operator_subscript_reverse_forw(&vec, 0, &_d_vec, _r0); // `_r0` is declared later ... // reverse pass size_type _r0 = 0UL; operator_subscript_pullback(&_t2, 0, 1, &_d_vec, &_r0); ``` In this example, replacing the first occurrence of _r0 with 0 will still be correct.
- Loading branch information
1 parent
825396d
commit fcd60fd
Showing
3 changed files
with
51 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.