'next_inputs_fn for GreedyEmbeddingHelper.'

def next_inputs(self, time, outputs, state, sample_ids, name=None):

    del time, outputs
    finished = math_ops.equal(sample_ids, self._end_token)
    all_finished = math_ops.reduce_all(finished)
    next_inputs = control_flow_ops.cond(all_finished, (lambda : self._start_inputs), (lambda : self._embedding_fn(sample_ids)))
    return (finished, next_inputs, state)
