[Numpy-discussion] SeedSequence.spawn()

Stig Korsnes stigkorsnes at gmail.com
Sun Aug 29 10:54:25 EDT 2021


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.kern at gmail.com>:

> On Sun, Aug 29, 2021 at 6:58 AM Stig Korsnes <stigkorsnes at 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 at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/numpy-discussion/attachments/20210829/62fbb5c0/attachment-0001.html>


More information about the NumPy-Discussion mailing list