LSTM: Split up different-size sequences of a minibatch into smaller equal-sized

You could have a look at this thread and this thread.