Updates for PyTorch 1.2 masking/bool behavior
Summary: Pull Request resolved:
@@ -127,7 +127,7 @@ class MaskTokensDataset(BaseWrapperDataset):
if self.mask_whole_words is not None:
mask = np.repeat(mask, word_lens)
new_item = np.full(len(mask), self.pad_idx)
- new_item[mask] = item[torch.from_numpy(mask.astype(np.uint8))]
+ new_item[mask] = item[torch.from_numpy(mask.astype(np.uint8)) == 1]
return torch.from_numpy(new_item)
# decide unmasking and random replacement
