(self)
return rand_init
Generate a list of random uint32 numbers to seed the LFSR
        states on device.

        Returns:
            np.array: return a vector of uint32 numbers
Generate a list of random uint32 numbers to seed the LFSR
        states on device.
Generate a list of random uint32 numbers to seed the LFSR states on device .
def _gen_dev_randstate(self):
        """
        Generate a list of random uint32 numbers to seed the LFSR
        states on device.

        Returns:
            np.array: return a vector of uint32 numbers
        """
        # will use the numpy rng to generate the states
        # but want to reset it after this is done
        state_save = self.rng.get_state()

        # smaller number for 32bit systems
        maxexp = 32 if sys.maxsize > 2**32 else 30

        # draw _RNG_POOL_SIZE 32 bit ints to seed LFSR on device
        # lower bound 1 to avoid seeding LFSR with 0
        rand_init = self.rng.random_integers(1, 2**maxexp - 1, NervanaGPU._RNG_POOL_SIZE)
        rand_init = rand_init.astype(np.uint32)

        # put the numpy (on host) RNG back to its state before
        self.rng.set_state(state_save)

        return rand_init
def _gen_dev_randstate ( self ) : # will use the numpy rng to generate the states # but want to reset it after this is done state_save = self . rng . get_state ( ) # smaller number for 32bit systems maxexp = 32 if sys . maxsize > 2 ** 32 else 30 # draw _RNG_POOL_SIZE 32 bit ints to seed LFSR on device # lower bound 1 to avoid seeding LFSR with 0 rand_init = self . rng . random_integers ( 1 , 2 ** maxexp - 1 , NervanaGPU . _RNG_POOL_SIZE ) rand_init = rand_init . astype ( np . uint32 ) # put the numpy (on host) RNG back to its state before self . rng . set_state ( state_save ) return rand_init