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
7ff7c493
Unverified
Commit
7ff7c493
authored
Oct 26, 2020
by
Stas Bekman
Committed by
GitHub
Oct 26, 2020
Browse files
fixing crash (#8057)
parent
cbad90d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/transformers/modeling_deberta.py
src/transformers/modeling_deberta.py
+2
-2
No files found.
src/transformers/modeling_deberta.py
View file @
7ff7c493
...
@@ -571,8 +571,8 @@ class DisentangledSelfAttention(torch.nn.Module):
...
@@ -571,8 +571,8 @@ class DisentangledSelfAttention(torch.nn.Module):
k
,
v
=
[
linear
(
qkvw
[
i
],
qkvb
[
i
],
hidden_states
)
for
i
in
range
(
1
,
3
)]
k
,
v
=
[
linear
(
qkvw
[
i
],
qkvb
[
i
],
hidden_states
)
for
i
in
range
(
1
,
3
)]
query_layer
,
key_layer
,
value_layer
=
[
self
.
transpose_for_scores
(
x
)
for
x
in
[
q
,
k
,
v
]]
query_layer
,
key_layer
,
value_layer
=
[
self
.
transpose_for_scores
(
x
)
for
x
in
[
q
,
k
,
v
]]
query_layer
+
=
self
.
transpose_for_scores
(
self
.
q_bias
[
None
,
None
,
:])
query_layer
=
query_layer
+
self
.
transpose_for_scores
(
self
.
q_bias
[
None
,
None
,
:])
value_layer
+
=
self
.
transpose_for_scores
(
self
.
v_bias
[
None
,
None
,
:])
value_layer
=
value_layer
+
self
.
transpose_for_scores
(
self
.
v_bias
[
None
,
None
,
:])
rel_att
=
None
rel_att
=
None
# Take the dot product between "query" and "key" to get the raw attention scores.
# Take the dot product between "query" and "key" to get the raw attention scores.
...
...
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