Fix E714 flake8 warning (x8).

This commit is contained in:
Aymeric Augustin
2019-12-21 18:07:03 +01:00
parent 5eab3cf6bc
commit fd2f17a7a1
8 changed files with 8 additions and 8 deletions

View File

@@ -519,7 +519,7 @@ class MultiHeadedAttention(nn.Module):
attn = self.softmax(scores)
if not predefined_graph_1 is None:
if predefined_graph_1 is not None:
attn_masked = attn[:, -1] * predefined_graph_1
attn_masked = attn_masked / (torch.sum(attn_masked, 2).unsqueeze(2) + 1e-9)