'Computes the probability distribution of the next sample based on
all samples in the input waveform.
If you want to generate audio by feeding the output of the network back
as an input, see predict_proba_incremental for a faster alternative.'

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

    with tf.name_scope(name):
        if self.scalar_input:
            encoded = tf.cast(waveform, tf.float32)
            encoded = tf.reshape(encoded, [(-1), 1])
        else:
            encoded = self._one_hot(waveform)
        gc_embedding = self._embed_gc(global_condition)
        raw_output = self._create_network(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)])
