fine tuning bert use wikitext2
in probability_matrix.masked_fill_(torch.tensor(special_tokens_mask, dtype=torch.bool), value=0.0)
Please, describe your environment, post the source code for reproducibility and the error.
in probability_matrix.masked_fill_(torch.tensor(special_tokens_mask, dtype=torch.bool), value=0.0)
Please upgrade your Pytorch version to 1.2.0+.
You're probably passing in a boolean tensor (true or false) instead of a byte tensor (0 or 1) for your attention mask.
Try changing
probability_matrix.masked_fill_(torch.tensor(special_tokens_mask, dtype=torch.bool), value=0.0)
to
probability_matrix.masked_fill_(torch.tensor(special_tokens_mask, dtype=torch.uint8), value=0.0)
Most helpful comment
Please upgrade your Pytorch version to 1.2.0+.