'See parent class.'

def compute_sample(self, state_below, temp=1, additional_inputs=None, use_noise=False):

    class_probs = self.fprop(state_below, temp=temp, additional_inputs=additional_inputs, use_noise=use_noise)
    pvals = class_probs
    if (pvals.ndim == 1):
        pvals = pvals.dimshuffle('x', 0)
    sample = self.trng.binomial(pvals.shape, p=pvals, dtype='int64')
    if (class_probs.ndim == 1):
        sample = sample[0]
    self.sample = sample
    return sample
