Sampling from a tensor in Torch

Might be helpful? Torch equivalent of numpy.random.choice?