def get_random_state():
 global _random_states
 dev = cuda.Device()
 rs = _random_states.get(dev.id, None)
 if (rs is None):
  rs = RandomState(os.getenv('CHAINER_SEED'))
  _random_states[dev.id] = rs
 return rs

def get_random_state ( ) : global _random_states dev = cuda . Device ( ) rs = _random_states . get ( dev . id , None ) if ( rs is None ) : rs = RandomState ( os . getenv ( 'CHAINER_SEED' ) ) _random_states [ dev . id ] = rs return rs
gets the state of the random number generator for the current device .