Skip to content

Commit

Permalink
mypy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
felixdittrich92 committed Nov 19, 2024
1 parent 7b4ad9b commit 6ada11b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doctr/models/modules/transformer/pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def scaled_dot_product_attention(
if mask is not None:
# NOTE: to ensure the ONNX compatibility, masked_fill works only with int equal condition
scores = scores.masked_fill(mask == 0, float("-inf")) # type: ignore[attr-defined]
p_attn = torch.softmax(scores, dim=-1)
p_attn = torch.softmax(scores, dim=-1) # type: ignore[call-overload]
return torch.matmul(p_attn, value), p_attn


Expand Down

0 comments on commit 6ada11b

Please sign in to comment.