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
1c507995
Commit
1c507995
authored
Oct 09, 2019
by
thomwolf
Browse files
simpler distilbert mask - fix tf tests
parent
58b302ca
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
5 deletions
+0
-5
transformers/modeling_distilbert.py
transformers/modeling_distilbert.py
+0
-2
transformers/modeling_tf_distilbert.py
transformers/modeling_tf_distilbert.py
+0
-3
No files found.
transformers/modeling_distilbert.py
View file @
1c507995
...
@@ -159,8 +159,6 @@ class MultiHeadSelfAttention(nn.Module):
...
@@ -159,8 +159,6 @@ class MultiHeadSelfAttention(nn.Module):
dim_per_head
=
self
.
dim
//
self
.
n_heads
dim_per_head
=
self
.
dim
//
self
.
n_heads
assert
2
<=
mask
.
dim
()
<=
3
causal
=
(
mask
.
dim
()
==
3
)
mask_reshp
=
(
bs
,
1
,
1
,
k_length
)
mask_reshp
=
(
bs
,
1
,
1
,
k_length
)
def
shape
(
x
):
def
shape
(
x
):
...
...
transformers/modeling_tf_distilbert.py
View file @
1c507995
...
@@ -226,9 +226,6 @@ class TFMultiHeadSelfAttention(tf.keras.layers.Layer):
...
@@ -226,9 +226,6 @@ class TFMultiHeadSelfAttention(tf.keras.layers.Layer):
dim_per_head
=
self
.
dim
//
self
.
n_heads
dim_per_head
=
self
.
dim
//
self
.
n_heads
mask_shape
=
shape_list
(
mask
)
assert
2
<=
len
(
mask_shape
)
<=
3
causal
=
(
mask_shape
)
==
3
)
mask_reshape
=
[
bs
,
1
,
1
,
k_length
]
mask_reshape
=
[
bs
,
1
,
1
,
k_length
]
def
shape
(
x
):
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