[Numpy-discussion] SeedSequence.spawn()

Stig Korsnes stigkorsnes at gmail.com
Sun Aug 29 13:41:14 EDT 2021


Agreed, I already have a flag on the class to toggle fixed "state". Could
just set self._rng instead of its state. Will check it out.
Must say, had not in my wildest dreams expected such help on any given
Sunday. Have a great day and week, sir.
Best,
Stig


søn. 29. aug. 2021, 18:29 skrev Robert Kern <robert.kern at gmail.com>:

> On Sun, Aug 29, 2021 at 10:55 AM Stig Korsnes <stigkorsnes at gmail.com>
> wrote:
>
>> 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.
>>
>
> Nominally, but it's overwhelmed by the actual computation. You will have
> less to juggle if you just compute it from the key each time.
>
> --
> 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/5baf56e1/attachment.html>


More information about the NumPy-Discussion mailing list