Random utilities for Lua and Torch.