If the gradients you were seeing are all zeros for self.prior, then its parameters won’t get updated (unless previous gradients were non-zero and the optimizer uses momentum etc.).
If this is not expected, you would have to dig into the model architecture and narrow down why these gradients are all zeros. Initially I would try to scale the loss artificially and check how this would influence these gradients.