Hello,
I got the same problem if I am using a customized loss function. For instance:
def myloss(x):
    return torch.mean(x)

However, I noticed that the output of lstm doesn’t have grad, so could you please tell me what I should do this case?
Thanks