'Extends a batch of event sequences by a single step each.
This method modifies the event sequences in place.
Args:
pianoroll_sequences: A list of PianorollSequences. The list of event
sequences should have length equal to `self._batch_size()`.
inputs: A Python list of model inputs, with length equal to
`self._batch_size()`.
initial_state: A numpy array containing the initial RNN-NADE state, where
`initial_state.shape[0]` is equal to `self._batch_size()`.
temperature: Unused.
Returns:
final_state: The final RNN-NADE state, the same size as `initial_state`.
loglik: The log-likelihood of the sampled value for each event
sequence, a 1-D numpy array of length
`self._batch_size()`. If `inputs` is a full-length inputs batch, the
log-likelihood of each entire sequence up to and including the
generated step will be computed and returned.'

def _generate_step_for_batch(self, pianoroll_sequences, inputs, initial_state, temperature):

    assert (len(pianoroll_sequences) == self._batch_size())
    graph_inputs = self._session.graph.get_collection('inputs')[0]
    graph_initial_state = tuple(self._session.graph.get_collection('initial_state'))
    graph_final_state = tuple(self._session.graph.get_collection('final_state'))
    graph_sample = self._session.graph.get_collection('sample')[0]
    graph_log_prob = self._session.graph.get_collection('log_prob')[0]
    (sample, loglik, final_state) = self._session.run([graph_sample, graph_log_prob, graph_final_state], {graph_inputs: inputs, graph_initial_state: initial_state})
    self._config.encoder_decoder.extend_event_sequences(pianoroll_sequences, sample)
    return (final_state, loglik[:, 0])
