The error is being raised in the forward pass, directly with the following line:

_, (hidden, _) = self.lstm(x)

I don’t know how to build an executable code snippet to reproduce the issue here, but I trimmed all unnecessary parts in the Colab link below. The error is present there and if you want, you can quickly run it again (I gathered into 2 cells):
Google Colab model.ipnyb 2
Thank you for the effort!