hi everyone, I’m trying to update the parameters of a pretrained masked language model with a new custom loss function, but it seems that the gradient of parameters are none. I used a pretrained bert for masked language model and a pretrained classifier. I have concatenated a vector to the batch and made a new batch, when I want to optimize parameters of language model, I see that the gradients of the parameters are none so it can not update the weights. but without concatenation everything seems fine. Can you please advice what should I do with this issue?
loss = loss_function(scores, true_labels)
loss.backward()
for param in maskedlm_.parameters():
    print(param.grad)
update_weights(maskedlm)
optimizer.step()