I’m glad it’s working!
The computation graph keeps growing as you never detach or reset the hidden states.
If I’m not mistaken your original implementation would treat the sequential epochs as one long time series.