I am indeed making ~200-1000 generator instances.As many as I have processes. Each process is an instance of a component class , which has a generator. Every time i ask this process for 1m numbers, i need the same 1m numbers. I could instead make a new generator with same seed every time I ask for for the 1m numbers, but presumed that this would be more computationally expensive than setting state on an existing generator.
Thank your Robert. Best Stig søn. 29. aug. 2021 kl. 16:08 skrev Robert Kern <robert.k...@gmail.com>: > On Sun, Aug 29, 2021 at 6:58 AM Stig Korsnes <stigkors...@gmail.com> > wrote: > >> Thanks again Robert! >> Got rid of dict(state). >> >> Not sure I followed you completely on the test case. >> > > In the code that you showed, you were pulling out and storing the `.state` > dict and then punching that back into a single `Generator` instance. > Instead, you can just make the ~200-1000 `Generator` instances. > > -- > Robert Kern > _______________________________________________ > NumPy-Discussion mailing list > NumPy-Discussion@python.org > https://mail.python.org/mailman/listinfo/numpy-discussion >
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion