Bugs in Translation tutorial for PyTorch 1.8.1

Not sure if this is the best place to post!
I’ve worked with this tut for a couple hours and I found the following bugs:

  1. The tutorial below contains a broken link under “View on GitHub”.
  2. The collate_fn=generate_batch is broken as torch.nn.utils.rnn.pad_sequence swaps the dimensions of data, yielding batches where the 0th element is full of <sos> tokens etc. The correct way would be to use batch_first=True in pad_sequence.

Hope it helps!

1 Like

Thanks for reporting this!
I assume you mean this tutorial.
CC @vincentqb for visibility

Yep, this one. No worries, happy to help!