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
23b7138a
Commit
23b7138a
authored
Oct 09, 2019
by
thomwolf
Browse files
fix #1378 and #1453
parent
d688af19
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
transformers/modeling_tf_distilbert.py
transformers/modeling_tf_distilbert.py
+3
-2
No files found.
transformers/modeling_tf_distilbert.py
View file @
23b7138a
...
...
@@ -226,8 +226,9 @@ class TFMultiHeadSelfAttention(tf.keras.layers.Layer):
dim_per_head
=
self
.
dim
//
self
.
n_heads
assert
2
<=
len
(
tf
.
shape
(
mask
))
<=
3
causal
=
(
len
(
tf
.
shape
(
mask
))
==
3
)
mask_shape
=
shape_list
(
mask
)
assert
2
<=
len
(
mask_shape
)
<=
3
causal
=
(
mask_shape
)
==
3
)
mask_reshape
=
[
bs
,
1
,
1
,
k_length
]
def
shape
(
x
):
...
...
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