@@ -28,12 +28,13 @@ same seed will produce the same outputs.
28
28
threads = multiprocessing.cpu_count()
29
29
self.threads = threads
30
30
31
- self._random_states = [rs ]
32
- for _ in range(1 , threads):
31
+ self._random_states = []
32
+ for _ in range(0 , threads-1 ):
33
33
_rs = randomstate.prng.xorshift1024.RandomState()
34
- rs.jump()
35
34
_rs.set_state(rs.get_state())
36
35
self._random_states.append(_rs)
36
+ rs.jump()
37
+ self._random_states.append(rs)
37
38
38
39
self.n = n
39
40
self.executor = concurrent.futures.ThreadPoolExecutor(threads)
@@ -68,12 +69,13 @@ same seed will produce the same outputs.
68
69
... .: if threads is None :
69
70
... .: threads = multiprocessing.cpu_count()
70
71
... .: self .threads = threads
71
- ... .: self ._random_states = [rs ]
72
- ... .: for _ in range (1 , threads):
72
+ ... .: self ._random_states = []
73
+ ... .: for _ in range (0 , threads- 1 ):
73
74
... .: _rs = randomstate.prng.xorshift1024.RandomState()
74
- ... .: rs.jump()
75
75
... .: _rs.set_state(rs.get_state())
76
76
... .: self ._random_states.append(_rs)
77
+ ... .: rs.jump()
78
+ ... .: self ._random_states.append(rs)
77
79
... .: self .n = n
78
80
... .: self .executor = concurrent.futures.ThreadPoolExecutor(threads)
79
81
... .: self .values = np.empty(n)
0 commit comments