(self, time, outputs, state, name=None, **unused_kwargs)
next_inputs_fn for TrainingHelper.
next_inputs_fn for TrainingHelper.
next_inputs_fn for TrainingHelper .
def next_inputs(self, time, outputs, state, name=None, **unused_kwargs):
    """next_inputs_fn for TrainingHelper."""
    with tf.name_scope(name, "TrainingHelperNextInputs",
                       [time, outputs, state]):
      next_time = time + 1
      finished = (next_time >= self._sequence_length)
      all_finished = tf.reduce_all(finished)
      def read_from_ta(inp):
        return inp.read(next_time)
      next_inputs = tf.cond(
          all_finished, lambda: self._zero_inputs,
          lambda: tf.nest.map_structure(read_from_ta, self._input_tas))
      return (finished, next_inputs, state)
def next_inputs ( self , time , outputs , state , name = None , * * unused_kwargs ) : with tf . name_scope ( name , "TrainingHelperNextInputs" , [ time , outputs , state ] ) : next_time = time + 1 finished = ( next_time >= self . _sequence_length ) all_finished = tf . reduce_all ( finished ) def read_from_ta ( inp ) : return inp . read ( next_time ) next_inputs = tf . cond ( all_finished , lambda : self . _zero_inputs , lambda : tf . nest . map_structure ( read_from_ta , self . _input_tas ) ) return ( finished , next_inputs , state )