Hi,
I need to have trainable variables in the backward hooks of a feed forward net. To give more information, I am manipulating the gradients coming from multiple branches (tasks) of a single net. My apologies for not able to give more information. In a simple example, I tried having a variable and a separate optimizer (opt2) for that (so that I can update independent of the net parameters tied to opt1), but, the loss is giving None gradients for my variable (opt2). I tried searching for some help , couldn’t find any, please point to some useful discussions if any.

I see that variable is not participating in the graph (forward operation). If this is the reason why the gradient is not computed, how I can formulate my objective as a direct function of this special variables?
Thanks in advance.