Fix MHA with bias=False (fixes
Summary: Pull Request resolved:
@@ -79,6 +79,7 @@ class MultiheadAttention(nn.Module):
nn.init.xavier_uniform_(self.q_proj.weight)
nn.init.xavier_uniform_(self.out_proj.weight)
+ if self.out_proj.bias is not None:
nn.init.constant_(self.out_proj.bias, 0.)
if self.bias_k is not None:
nn.init.xavier_normal_(self.bias_k)
