Zador:

However, you mentioned that there are difficulties in executing the LSTM in the DataLoader. Is there I way to do this?


I’m sure the is a way to achieve what you want by writing a custom dataset, sampler, etc.
The main complication I see is that the common workflow of using indices to load and process a data sample wouldn’t work anymore, as your LSTM would need to get the previous states as well.
I.e. assuming you want to use multiple workers in the DataLoader, I guess you want to track and provide the last LSTM state in each copy of the dataset instance or are you woring on a way to use a “global” state and share it between each worker?