forked from vgvassilev/clad
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't create adjoint pullback parameters for non-differentiable argum…
…ents. In most cases, we support non-differentiable variables (i.e. variables that don't have adjoints). Currently, the major application for them is non-independent array parameters. For instance, for ``` double fn17 (double x, double* y) { return x; } ``` a request ``clad::gradient(fn17, "x");`` will produce ``` void fn17_grad_0(double x, double *y, double *_d_x) { goto _label0; _label0: ; } ``` In this example, ``y`` does not have an adjoint. However, calling a function of ``y`` produces an error. After these changes, the non-differentiability of ``y`` is propagated to the pullback. Fixes vgvassilev#765.
- Loading branch information
1 parent
2c07477
commit 5b66f0e
Showing
3 changed files
with
74 additions
and
8 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
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