'next_inputs_fn for TrainingHelper.'

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

    with ops.name_scope(name, 'TrainingHelperNextInputs', [time, outputs, state]):
        next_time = (time + 1)
        finished = (next_time >= self._sequence_length)
        all_finished = math_ops.reduce_all(finished)
        def read_from_ta(inp):
            return inp.read(next_time)
        next_inputs = control_flow_ops.cond(all_finished, (lambda : self._zero_inputs), (lambda : nest.map_structure(read_from_ta, self._input_tas)))
        return (finished, next_inputs, state)
