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
6c8ec2a9
Unverified
Commit
6c8ec2a9
authored
Jan 11, 2021
by
Patrick von Platen
Committed by
GitHub
Jan 11, 2021
Browse files
fix tf led pt test (#9513)
parent
1e3c3622
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
tests/test_modeling_tf_led.py
tests/test_modeling_tf_led.py
+7
-1
No files found.
tests/test_modeling_tf_led.py
View file @
6c8ec2a9
...
...
@@ -166,7 +166,13 @@ def prepare_led_inputs_dict(
if
attention_mask
is
None
:
attention_mask
=
tf
.
cast
(
tf
.
math
.
not_equal
(
input_ids
,
config
.
pad_token_id
),
tf
.
int8
)
if
decoder_attention_mask
is
None
:
decoder_attention_mask
=
tf
.
cast
(
tf
.
math
.
not_equal
(
decoder_input_ids
,
config
.
pad_token_id
),
tf
.
int8
)
decoder_attention_mask
=
tf
.
concat
(
[
tf
.
ones
(
decoder_input_ids
[:,
:
1
].
shape
,
dtype
=
tf
.
int8
),
tf
.
cast
(
tf
.
math
.
not_equal
(
decoder_input_ids
[:,
1
:],
config
.
pad_token_id
),
tf
.
int8
),
],
axis
=-
1
,
)
return
{
"input_ids"
:
input_ids
,
"attention_mask"
:
attention_mask
,
...
...
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