Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
057411c5
"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "582f516adb0a2cc175db2a097cbdd4d3cbada9db"
Unverified
Commit
057411c5
authored
Jul 16, 2020
by
Patrick von Platen
Committed by
GitHub
Jul 16, 2020
Browse files
fix longformer slow down (#5811)
parent
89a78be5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/modeling_longformer.py
src/transformers/modeling_longformer.py
+1
-1
No files found.
src/transformers/modeling_longformer.py
View file @
057411c5
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment