alabijesujoba:

aLoader(train_data,


Thanks @vdw for the nice answer. I think offsets is required by EmbeddingBag where sequences are concatenated as a long sequence and offsets is used to separate individual sequences. Since you choose to pad sequences, it’s not really necessary to have offset here.
If your vocab comes with <PAD> token, you could get the pad id by
pad_id = train_dataset.get_vocab()['<pad>']

Sometime, you may even want to pad sequences with similar lengths. There is an issue post on torchtext to explain padding link 19.