Hi, it is solved based on the idea in https://github.com/pytorch/pytorch/issues/2769 289
what I did in my model is
output, self.hidden = self.rnn(inputs, (self.hidden[0].detach(), self.hidden[1].detach()))
I have no idea why this makes a huge difference…
Thanks!