def sample(self, shape):
        if self.use_gpu:
            return self.sample_gpu(shape)
        else:
            return self.sample_cpu(shape)
Generates a random sample based on given probabilities.
dataset/ETHPy150Open pfnet/chainer/chainer/utils/walker_alias.py/WalkerAlias.sample