ohh, I see… I thought I could just create a function with return value something like
lambda grad: func(grad) to update weights, because I need to perform actions on the gradient that are not attribute functions. Is this possible with register hooks?
Function would be a series of different matrix manipulations.