self.sow
in custom_vjp
function unable to capture gradients
#30125
Unanswered
runiteking1
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to save and analyze the derivatives in the backward pass of a Jacobian for a simple NN (akin to ##5336). I can easily print out the values I want using a
custom_vjp
wrapper around each layer. However, saving it usingself.sow
somehow is not working. My current workaround is to save the values I want in a global list, but this seems extremely un-Pythonic. Below is a MWE where theself.sow
on line 47 doesn't seem to capture anything.If anybody know how to actually use
sow
(or something else that's not just a global list), I greatly appreciate it.The outputs on my end are
Beta Was this translation helpful? Give feedback.
All reactions