"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "b1c06140f4b2ac188d625fe9d34bc32ec2e36078"
Commit dfb61caf authored by thomwolf's avatar thomwolf
Browse files

fix #1692

parent f1e4db2a
...@@ -539,7 +539,7 @@ class TFXLNetMainLayer(tf.keras.layers.Layer): ...@@ -539,7 +539,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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment