8000 ENH: np.random.default_gen() by rkern · Pull Request #13840 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: np.random.default_gen() #13840

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jun 28, 2019
Prev Previous commit
Next Next commit
Merge branch 'master' into enh/default-gen
  • Loading branch information
rkern committed Jun 28, 2019
commit 1f2d8b908967b451eeee887e7490b508839f19b9
21 changes: 11 additions & 10 deletions numpy/random/philox.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,17 @@ cdef class Philox(BitGenerator):

**State and Seeding**

The ``Philox`` state vector consists of a 256-bit counter encoded as
a 4-element uint64 array and a 128-bit key encoded as a 2-element uint64
array. The counter is incremented by 1 for every 4 64-bit randoms produced.
The key which determines the sequence produced. Using different keys
produces independent sequences.

By default, providing a ``seed`` value will derive the 128-bit key using
`SeedSequence`; the counter will be initialized to 0. On the other hand,
one may omit the ``seed`` and provide the ``key`` and/or ``counter``
directly if one wishes to manually control the key.
The ``Philox`` state vector consists of a 256-bit value encoded as
a 4-element uint64 array and a 128-bit value encoded as a 2-element uint64
array. The former is a counter which is incremented by 1 for every 4 64-bit
randoms produced. The second is a key which determined the sequence
produced. Using different keys produces independent sequences.

The input seed is processed by `SeedSequence` to generate the key. The
counter is set to 0.

Alternately, one can omit the seed parameter and set the ``key`` and
``counter`` directly.

**Parallel Features**

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0