'Generate the random number generator on device and on host.
Arguments:
seed (int): random number generator seed
Returns:
seeded numpy RNG'

def gen_rng(self, seed=None):

    self.rng = np.random.RandomState(seed)
    self.pcg = rng_mrg()
    self.init_rng_state = self.rng.get_state()
    self.init_rng_state_dev = self._gen_dev_randstate()
    self.rng_reset()
    ctx = drv.Context.get_current()
    if (ctx in self.context_rand_state_alive):
        self.context_rand_state_alive[ctx] = False
    self._set_rand_state_dev(state=self.init_rng_state_dev)
    return self.rng
