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
07708793
Unverified
Commit
07708793
authored
Nov 06, 2020
by
Patrick von Platen
Committed by
GitHub
Nov 06, 2020
Browse files
fix encoder outputs (#8368)
parent
bc0d26d1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
src/transformers/generation_tf_utils.py
src/transformers/generation_tf_utils.py
+1
-2
No files found.
src/transformers/generation_tf_utils.py
View file @
07708793
...
@@ -348,8 +348,7 @@ class TFGenerationMixin:
...
@@ -348,8 +348,7 @@ class TFGenerationMixin:
shape
=
(
-
1
,),
shape
=
(
-
1
,),
)
)
# expand encoder_outputs
# expand encoder_outputs
encoder_outputs
=
(
tf
.
gather
(
encoder_outputs
[
0
],
expanded_batch_idxs
,
axis
=
0
),
*
encoder_outputs
[
1
:])
encoder_outputs
=
(
tf
.
gather
(
encoder_outputs
[
0
],
expanded_batch_idxs
,
axis
=
0
),)
else
:
else
:
encoder_outputs
=
None
encoder_outputs
=
None
cur_len
=
shape_list
(
input_ids
)[
-
1
]
cur_len
=
shape_list
(
input_ids
)[
-
1
]
...
...
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