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
10989715
Commit
10989715
authored
Mar 09, 2020
by
Patrick von Platen
Browse files
rename variable
parent
cf062905
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/modeling_tf_utils.py
src/transformers/modeling_tf_utils.py
+1
-1
No files found.
src/transformers/modeling_tf_utils.py
View file @
10989715
...
@@ -990,7 +990,7 @@ class TFPreTrainedModel(tf.keras.Model, TFModelUtilsMixin):
...
@@ -990,7 +990,7 @@ class TFPreTrainedModel(tf.keras.Model, TFModelUtilsMixin):
next_scores
,
(
batch_size
,
num_beams
*
vocab_size
)
next_scores
,
(
batch_size
,
num_beams
*
vocab_size
)
)
# (batch_size, num_beams * vocab_size)
)
# (batch_size, num_beams * vocab_size)
next_scores
,
next_tokens
=
tf
.
math
.
top_k
(
next_scores
,
2
*
num_beams
,
sorted
=
True
)
next_scores
,
next_tokens
=
tf
.
math
.
top_k
(
next_scores
,
k
=
2
*
num_beams
,
sorted
=
True
)
assert
shape_list
(
next_scores
)
==
shape_list
(
next_tokens
)
==
[
batch_size
,
2
*
num_beams
]
assert
shape_list
(
next_scores
)
==
shape_list
(
next_tokens
)
==
[
batch_size
,
2
*
num_beams
]
...
...
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