-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dr.if_while_loop()
: maintain AD status of unchanged variables in …
…AD-suspended mode Dr.Jit control flow operations (``dr.if_stmt(), drjit.while_loop()``) disable gradient tracking of all variable state when the operation takes place within an AD-disabled scope. This can be surprising when a ``@dr.syntax`` transformation silently passes local variables to such an operation, which then become non-differentiable. This commit carves out an exception: when variables aren't actually modified by the control flow operation, they can retain their AD identity. This is part #2 of the fix for issue #253 reported by @dvicini and targets ``dr.while_lop()`` only. The previous commit fixed the same problem for ``if`` statements.
- Loading branch information
Showing
3 changed files
with
59 additions
and
5 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