Grad is None for nn.Parameter that is used outside nn.module

Hi!

I have defined a nn.Parameter, but the value is not updating. I wonder if this in because some of the calculations done with this parameter are outside the forward loop of the module. I have classes that are not nn.Modules, which I call from the forward loop and give the parameter as variable. Can this be a cause for the gradient being none?

Hi @verku,

You need to share your code, and make sure to wrap it in 3 backticks ``` !