Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.

Commit 0591d94

Browse files
lazylife7157lukaszkaiser
authored andcommitted
Change confusing function name (#1669)
1 parent 4289bcf commit 0591d94

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tensor2tensor/utils/beam_search.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -724,8 +724,9 @@ def inner_loop(i, alive_seq, alive_log_probs, finished_seq, finished_scores,
724724
return (i + 1, alive_seq, alive_log_probs, finished_seq, finished_scores,
725725
finished_flags, states)
726726

727-
def _is_finished(i, unused_alive_seq, alive_log_probs, unused_finished_seq,
728-
finished_scores, unused_finished_in_finished, unused_states):
727+
def _is_not_finished(i, unused_alive_seq, alive_log_probs,
728+
unused_finished_seq, finished_scores,
729+
unused_finished_in_finished, unused_states):
729730
"""Checking termination condition.
730731
731732
We terminate when we decoded up to decode_length or the lowest scoring item
@@ -781,7 +782,7 @@ def _is_finished(i, unused_alive_seq, alive_log_probs, unused_finished_seq,
781782
state_struc = nest.map_structure(get_state_shape_invariants, states)
782783
(_, alive_seq, alive_log_probs, finished_seq, finished_scores,
783784
finished_flags, states) = tf.while_loop(
784-
_is_finished,
785+
_is_not_finished,
785786
inner_loop, [
786787
tf.constant(0), alive_seq, alive_log_probs, finished_seq,
787788
finished_scores, finished_flags, states

0 commit comments

Comments
 (0)