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
6b242812
Unverified
Commit
6b242812
authored
Sep 02, 2020
by
Prajjwal Bhargava
Committed by
GitHub
Sep 02, 2020
Browse files
fix typo in comments (#6838)
parent
7351ef83
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/transformers/modeling_bert.py
src/transformers/modeling_bert.py
+2
-2
No files found.
src/transformers/modeling_bert.py
View file @
6b242812
...
...
@@ -803,8 +803,8 @@ class BertModel(BertPreTrainedModel):
# ourselves in which case we just need to make it broadcastable to all heads.
extended_attention_mask
:
torch
.
Tensor
=
self
.
get_extended_attention_mask
(
attention_mask
,
input_shape
,
device
)
# If a 2D o
u
3D attention mask is provided for the cross-attention
# we need to make broadcastabe to [batch_size, num_heads, seq_length, seq_length]
# If a 2D o
r
3D attention mask is provided for the cross-attention
# we need to make broadcastab
l
e to [batch_size, num_heads, seq_length, seq_length]
if
self
.
config
.
is_decoder
and
encoder_hidden_states
is
not
None
:
encoder_batch_size
,
encoder_sequence_length
,
_
=
encoder_hidden_states
.
size
()
encoder_hidden_shape
=
(
encoder_batch_size
,
encoder_sequence_length
)
...
...
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