-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make_zero! for immutable #1958
make_zero! for immutable #1958
Conversation
Hi, just want to mention that I've spent a lot of time with make_zero! lately for #1852, which is almost ready. There are several bugs (missing branches in some You can check out this commit on a branch in my fork for fixes to all the bugs I found in |
If
in the generic handler will fail. |
That's only the case if the immutable contains immutable differentiable values, like I.e., the test case added in this PR would never hit the However, if you have a MixedState NamedTuple contained within a mutable container, such as Is this what you've been running into? |
Just realized the proposed fix here could also be a way to mask #1935 (because the bug in |
Pretty sure the underlying issues here were fixed by #1961. The test suite introduced there should cover every failure mode this PR aimed to address. @vchuravy please let me know if you have an MWE that still fails. That said, I was a bit too confident in the discussion above. The issue was a bit more nuanced and #1961 didn't get it right until after the full combinatorial nested wrapper testset was added, which was after this discussion. (The solution was to use |
okay, I'll close this for now then (and definitely reopen if needed) |
We definilty need one of the PRs that @danielwe is working on. |
Recurse through the immutable and set the mutable fields to zero.