def body(self, time, inp, state, finished, output_ta):
"""Body of the dynamic decoding phase."""
# invoke the decoder step.
output, next_inp, next_state, decoder_finished = self._decoder.step(time, inp, state)
# check the termination status and filter the output.
next_finished = tf.logical_or(finished, decoder_finished)
next_finished = tf.logical_or(next_finished, self._helper.finished(time, output))
output = self.output(output, finished)
output_ta = output_ta.write(time, output)
ntime = tf.add(time, 1)
return ntime, next_inp, next_state, next_finished, output_ta
# pylint: disable=W0613,I0011,R0913
# disable unused arguments (needed for the loop).
评论列表
文章目录