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
886ef35c
Unverified
Commit
886ef35c
authored
Sep 30, 2020
by
Lysandre Debut
Committed by
GitHub
Sep 30, 2020
Browse files
Fix LXMERT with DataParallel (#7471)
parent
35e94c68
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/modeling_lxmert.py
src/transformers/modeling_lxmert.py
+1
-1
No files found.
src/transformers/modeling_lxmert.py
View file @
886ef35c
...
...
@@ -958,7 +958,7 @@ class LxmertModel(LxmertPreTrainedModel):
# positions we want to attend and -10000.0 for masked positions.
# Since we are adding it to the raw scores before the softmax, this is
# effectively the same as removing these entirely.
extended_attention_mask
=
extended_attention_mask
.
to
(
dtype
=
next
(
self
.
parameters
())
.
dtype
)
extended_attention_mask
=
extended_attention_mask
.
to
(
dtype
=
self
.
dtype
)
extended_attention_mask
=
(
1.0
-
extended_attention_mask
)
*
-
10000.0
# Process the visual attention mask
...
...
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