Solved by Maghoumi in post #2 
              
              
                I figured this out myself a while back. I posted a detailed solution here: 
https://www.codefull.org/2018/11/use-pytorchs-dataloader-with-variable-length-sequences-for-lstm-gru/