I’d like to pass a variable length batch to an module that has LSTMCells in it.
I can see that one can directly pass a PackedSequence into the LSTM layer, but there is no such functionality in LSTMCell.
Inspecting the output of the PackedSequence object, I can understand the way the batch_sizes variable would be used: I’d iterate my cube feeding slices to my LSTMCell as I usually would, passing the same input tensor but setting the batch size at each iteration. Rows outside of the batch size would then be copied forward so that the final results would be aligned.
However, I don’t understand what the shape of the data in PackedSequence parameter is doing and what purpose it serves. It seems to be serializing the data and I’m not sure I understand why this is desirable, especially since what we really want is paralellized data.
I’m trying to avoid rewriting code that already exists or is likely to be written in the near future, so any guidance on this would be appreciated.