Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
3e1cd824
Commit
3e1cd824
authored
Oct 10, 2019
by
Rémi Louf
Browse files
fix stupid (re)naming issue
parent
81ee29ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
transformers/modeling_bert.py
transformers/modeling_bert.py
+3
-3
No files found.
transformers/modeling_bert.py
View file @
3e1cd824
...
...
@@ -333,12 +333,12 @@ class BertLayer(nn.Module):
if
encoder_hidden_state
:
try
:
cross
attention_outputs
=
self
.
crossattention
(
attention_output
,
attention_mask
,
head_mask
,
encoder_hidden_state
)
attention_outputs
=
self
.
crossattention
(
attention_output
,
attention_mask
,
head_mask
,
encoder_hidden_state
)
except
AttributeError
as
ae
:
raise
ae
(
"you need to set `is_encoder` to True in the configuration to instantiate an encoder layer"
)
cross
attention_output
=
cross
attention_outputs
[
0
]
intermediate_output
=
self
.
intermediate
(
cross
attention_output
)
attention_output
=
attention_outputs
[
0
]
intermediate_output
=
self
.
intermediate
(
attention_output
)
layer_output
=
self
.
output
(
intermediate_output
,
attention_output
)
outputs
=
(
layer_output
,)
+
attention_outputs
[
1
:]
# add attentions if we output them
return
outputs
...
...
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