How do you structure a stateful LSTM with PyTorch?

I think you can refer to this link here

  1. Confusion regarding PyTorch LSTMs compared to Keras stateful LSTM - #4 by deividbotina