Commit 7c6770e
Return tunable vector for Enzyme tangent instead of NamedTuple (#1358)
For EnzymeOriginator with SciMLStructure parameters, return the tunable
gradient vector directly from steadystatebackpass instead of the
Zygote-repacked NamedTuple. The NonlinearSolveBaseEnzymeExt reverse
rule uses SciMLStructures.replace! to accumulate it into the parameter
shadow, going through the proper SciMLStructures interface.
This avoids the NamedTuple broadcasting error and ensures all tangent
accumulation uses SciMLStructures.canonicalize/replace! rather than
making assumptions about the NamedTuple field structure.
Companion PR: NonlinearSolve.jl#879
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 1a9e18e commit 7c6770e
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2418 | 2418 | | |
2419 | 2419 | | |
2420 | 2420 | | |
| 2421 | + | |
| 2422 | + | |
| 2423 | + | |
| 2424 | + | |
| 2425 | + | |
| 2426 | + | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
| 2430 | + | |
2421 | 2431 | | |
2422 | 2432 | | |
2423 | 2433 | | |
2424 | | - | |
| 2434 | + | |
2425 | 2435 | | |
2426 | 2436 | | |
2427 | 2437 | | |
2428 | 2438 | | |
2429 | 2439 | | |
2430 | | - | |
| 2440 | + | |
2431 | 2441 | | |
2432 | 2442 | | |
2433 | 2443 | | |
| |||
0 commit comments