How to combine variable length sequences in PyTorch DataLoaders
If you're getting started with PyTorch for text, you've probably encountered an error that looks something like:
Sizes of tensors must match except in dimension 0.
The short explanation for this error is that sequences are often different lengths, but tensors are required to be rectangular. The fix for this …