Unverified Commit 057411c5 authored by Patrick von Platen's avatar Patrick von Platen Committed by GitHub
Browse files

fix longformer slow down (#5811)

parent 89a78be5
...@@ -311,7 +311,7 @@ class LongformerSelfAttention(nn.Module): ...@@ -311,7 +311,7 @@ class LongformerSelfAttention(nn.Module):
# is index masked or global attention # is index masked or global attention
is_index_masked = attention_mask < 0 is_index_masked = attention_mask < 0
is_index_global_attn = attention_mask > 0 is_index_global_attn = attention_mask > 0
is_global_attn = any(is_index_global_attn.flatten()) is_global_attn = is_index_global_attn.flatten().any().item()
hidden_states = hidden_states.transpose(0, 1) hidden_states = hidden_states.transpose(0, 1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment