'Computes the probability distribution of the next sample
incrementally, based on a single sample and all previously passed
samples.'

def predict_proba_incremental(self, waveform, global_condition=None, name='wavenet'):

    if (self.filter_width > 2):
        raise NotImplementedError('Incremental    generation    does    not    support    filter_width    >    2.')
    if self.scalar_input:
        raise NotImplementedError('Incremental    generation    does    not    support    scalar    input    yet.')
    with tf.name_scope(name):
        encoded = tf.one_hot(waveform, self.quantization_channels)
        encoded = tf.reshape(encoded, [(-1), self.quantization_channels])
        gc_embedding = self._embed_gc(global_condition)
        raw_output = self._create_generator(encoded, gc_embedding)
        out = tf.reshape(raw_output, [(-1), self.quantization_channels])
        proba = tf.cast(tf.nn.softmax(tf.cast(out, tf.float64)), tf.float32)
        last = tf.slice(proba, [(tf.shape(proba)[0] - 1), 0], [1, self.quantization_channels])
        return tf.reshape(last, [(-1)])
