yonatansc97:

However, even when I check the .grad during forward, after the first time, it appears that most of my parameters have grad=torch.zeros(some_size), and the parameters which belong to the above method have grad=None.


The zeros would come from zeroing out the gradients via optimizer.zero_grad(). Since your custom module has still None gradients in its parameters, I guess you might have broken the computation graph somehow.
Could you post an executable code snippet using the custom modules with random input tensors, which would show this behavior?