update regarding torch 1.2

This commit is contained in:
Eren Golge
2019-08-13 12:14:34 +02:00
parent 3cbbd8d6e0
commit 64f2b95c31
+1 -1
View File
@@ -240,7 +240,7 @@ class Attention(nn.Module):
attention_hidden_state, processed_inputs)
# apply masking
if mask is not None:
attention.data.masked_fill_(1 - mask, self._mask_value)
attention.data.masked_fill_(torch.bitwise_not(mask), self._mask_value)
# apply windowing - only in eval mode
if not self.training and self.windowing:
attention = self.apply_windowing(attention, inputs)