def test_seed_same():
 skip_if_no_scipy()
 rng = np.random.RandomState([1, 2, 3])
 seed = rng.randint(2147462579)
 dim = 3
 mu = rng.randn(dim)
 rank = dim
 X = rng.randn(rank, dim)
 cov = np.dot(X.T, X)
 mnd1 = MND(sigma=cov, mu=mu, seed=seed)
 num_samples = 5
 rd1 = mnd1.random_design_matrix(num_samples)
 rd1 = function([], rd1)()
 mnd2 = MND(sigma=cov, mu=mu, seed=seed)
 rd2 = mnd2.random_design_matrix(num_samples)
 rd2 = function([], rd2)()
 assert np.all((rd1 == rd2))

def test_seed_same ( ) : skip_if_no_scipy ( ) rng = np . random . RandomState ( [ 1 , 2 , 3 ] ) seed = rng . randint ( 2147462579 ) dim = 3 mu = rng . randn ( dim ) rank = dim X = rng . randn ( rank , dim ) cov = np . dot ( X . T , X ) mnd1 = MND ( sigma = cov , mu = mu , seed = seed ) num_samples = 5 rd1 = mnd1 . random_design_matrix ( num_samples ) rd1 = function ( [ ] , rd1 ) ( ) mnd2 = MND ( sigma = cov , mu = mu , seed = seed ) rd2 = mnd2 . random_design_matrix ( num_samples ) rd2 = function ( [ ] , rd2 ) ( ) assert np . all ( ( rd1 == rd2 ) )
verifies that two mnds initialized with the same seed produce the same samples .