Mask out embeddings associated with padding (#710)
Summary: Pull Request resolved: https://github.com/pytorch/fairseq/pull/710 Previously there was a bug in how we dealt with padding when computing the input representation from the segment and position embedding. D15144912 fixed this by adding an offset based on the padding id. However this makes assumptions about the padding id which may not hold true for vocabularies built outside of pyText and fairseq. Based on a discussion with barlaso, this diff 0's out all the embeddings associated with the padding. Reviewed By: borguz Differential Revision: D15209395 fbshipit-source-id: 5573020e610f5466e673fe3845c3ed34ebb5c44d
Showing
Please register or sign in to comment