andresy/torch — pull request #129 by jucor (2013-05-20 18:48:22+00:00)
Title: Get and set full state of Random Number Generator

Hi Ronan, Koray, Clement

Working with Andreas, we implemented two functions torch.getRNGState() and torch.setRNGState() to manipulate the whole internal state of the Random Number Generator (RNG). This is in complement to the initial seed, for which functions already exist: the initial seed requires to re-do the whole sequence of calls to random() until the point of interest, whereas the state before the last call to random() is enough to reproduce without re-running through everything. Very useful for debugging of Monte-Carlo code!

Koray helped us a lot for moving the headers around. This was mandatory to allow our new functions in Random.c to return a Tensor.

Please let me know if I can be of any help getting this accepted!
Cheers,

Julien