Allow passing variables to a function with @custom_gradient. by hertschuh · Pull Request #22069 · keras-team/keras (original) (raw)

@hertschuh

With the JAX backend, passing a variable to a function with a custom gradient would fail.

This adds a wrapper to unwrap variables.

Fixes keras-team#21105

[gemini-code-assist[bot]](/apps/gemini-code-assist)

JyotinderSingh

jerryxyj added a commit to jerryxyj/keras that referenced this pull request

Feb 14, 2026

@jerryxyj

This file contains hidden or 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

[ Show hidden characters]({{ revealButtonHref }})