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
8618bf15
Unverified
Commit
8618bf15
authored
Dec 21, 2019
by
Thomas Wolf
Committed by
GitHub
Dec 21, 2019
Browse files
Merge pull request #1736 from huggingface/fix-tf-xlnet
Fix TFXLNet
parents
2fa8737c
dfb61caf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
transformers/modeling_tf_xlnet.py
transformers/modeling_tf_xlnet.py
+1
-1
No files found.
transformers/modeling_tf_xlnet.py
View file @
8618bf15
...
@@ -552,7 +552,7 @@ class TFXLNetMainLayer(tf.keras.layers.Layer):
...
@@ -552,7 +552,7 @@ class TFXLNetMainLayer(tf.keras.layers.Layer):
assert
input_mask
is
None
or
attention_mask
is
None
,
"You can only use one of input_mask (uses 1 for padding) "
\
assert
input_mask
is
None
or
attention_mask
is
None
,
"You can only use one of input_mask (uses 1 for padding) "
\
"or attention_mask (uses 0 for padding, added for compatbility with BERT). Please choose one."
"or attention_mask (uses 0 for padding, added for compatbility with BERT). Please choose one."
if
input_mask
is
None
and
attention_mask
is
not
None
:
if
input_mask
is
None
and
attention_mask
is
not
None
:
input_mask
=
1.0
-
attention_mask
input_mask
=
1.0
-
tf
.
cast
(
attention_mask
,
dtype
=
dtype_float
)
if
input_mask
is
not
None
and
perm_mask
is
not
None
:
if
input_mask
is
not
None
and
perm_mask
is
not
None
:
data_mask
=
input_mask
[
None
]
+
perm_mask
data_mask
=
input_mask
[
None
]
+
perm_mask
elif
input_mask
is
not
None
and
perm_mask
is
None
:
elif
input_mask
is
not
None
and
perm_mask
is
None
:
...
...
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