Skip to content

Commit

Permalink
attention_mask fill with -inf for UnfusedDotProductAttention
Browse files Browse the repository at this point in the history
Signed-off-by: Agoniii <[email protected]>
  • Loading branch information
Agoniii committed Oct 18, 2024
1 parent 41fe1e5 commit 8d27109
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion transformer_engine/pytorch/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def attention_mask_func(
attention_scores: torch.Tensor, attention_mask: torch.Tensor
) -> torch.Tensor:
"""Get attention mask"""
attention_scores.masked_fill_(attention_mask, -10000.0)
attention_scores.masked_fill_(attention_mask, float("-inf"))
return attention_scores


Expand Down

0 comments on commit 8d27109

Please sign in to comment.