On a side note, is there any reason you’re disposing of the hidden state and cell state during your forward pass? I’m not even sure how you got that forward pass to run, to be honest, if you even got that far. See the example at the bottom here regarding hidden and cell state:
https://pytorch.org/docs/1.9.1/generated/torch.nn.LSTM.html 1