Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
7298a54
Add multivariate distributions and permutations to dpnp.random.Generator
ndgrigorian Nov 4, 2026
77c68ec
Pass dpnp arrays straight to the asserts of the multivariate tests
ndgrigorian Nov 7, 2026
007153b
Pass the dpnp array straight to assert_array_equal in the permuted test
ndgrigorian Nov 7, 2026
dd67832
Break the stick for dirichlet up to alpha of 1 in single precision
ndgrigorian Nov 13, 2026
52ed7c5
Give the sample of choice the requested USM type for a dpnp array
ndgrigorian Nov 13, 2026
2ef0e19
Draw small samples without replacement without permuting the population
ndgrigorian Nov 13, 2026
d38c2fb
Draw fewer samples in the choice and permutation tests that call one …
ndgrigorian Nov 13, 2026
48ae42e
Accept a usm_ndarray in Generator.shuffle
ndgrigorian Nov 13, 2026
4ad3979
Say which out types permuted takes
ndgrigorian Nov 13, 2026
0ebd54a
Say that multinomial checks pvals only on the host
ndgrigorian Nov 13, 2026
290e29c
List the differences of the multivariate methods in the random docs
ndgrigorian Nov 13, 2026
178ae81
Break a stick in float32 dirichlet only for a small sum of alpha
ndgrigorian Nov 17, 2026
fb583eb
Move the choice messages comment back above its table
ndgrigorian Nov 17, 2026
d72474b
Merge branch 'feature/device-rng-discrete' into feature/device-rng-mu…
ndgrigorian Nov 20, 2026
6ee249f
Merge branch 'feature/device-rng-discrete' into feature/device-rng-mu…
ndgrigorian Nov 20, 2026
0fcb7e9
Merge branch 'feature/device-rng-discrete' into feature/device-rng-mu…
ndgrigorian Nov 20, 2026
4ba2f5b
Draw float32 Dirichlet samples from the logarithms of gamma variates
ndgrigorian Nov 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This release drops support for Python 3.10, making Python 3.11 the minimum requi
* Added the `dpnp.random.Generator` API with `default_rng`, `BitGenerator`, `SeedSequence` and the `Philox4x3210` bit generator, sampling on the device with the device RNG API of oneMKL or oneMath [#3157](https://github.com/IntelPython/dpnp/pull/3157)
* Added the continuous distributions of `numpy.random.Generator`, such as `gamma`, `beta` and `vonmises`, to `dpnp.random.Generator` [#3158](https://github.com/IntelPython/dpnp/pull/3158)
* Added `integers` and the discrete distributions of `numpy.random.Generator`, such as `poisson`, `binomial` and `hypergeometric`, to `dpnp.random.Generator`, along with `noncentral_chisquare` and `noncentral_f` [#3159](https://github.com/IntelPython/dpnp/pull/3159)
* Added the multivariate distributions, `permutation`, `shuffle`, `permuted`, `choice` and `bytes` to `dpnp.random.Generator` [#3160](https://github.com/IntelPython/dpnp/pull/3160)

### Changed

Expand Down
27 changes: 26 additions & 1 deletion doc/reference/random.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,15 @@ Differences from NumPy
* ``zipf`` follows the Zipf distribution truncated to the largest ``int64``.
NumPy's rejection test rounds to accepting every sample above ``2**53``,
which makes its tail too heavy for ``a`` close to 1.
* ``hypergeometric`` requires ``ngood`` and ``nbad`` below ``10**9``.
* ``hypergeometric`` requires ``ngood`` and ``nbad`` below ``10**9``, and
``multivariate_hypergeometric`` requires ``sum(colors)`` below ``10**9``
for the ``"count"`` method too.
* ``choice`` always returns a sample without replacement in random order,
so its ``shuffle`` parameter has no effect.
* ``p`` of ``choice`` and ``pvals`` of ``multinomial`` are only checked when
they are on the host, as the other parameters are.
* :meth:`Generator.shuffle` only accepts an array on the device, a
:class:`dpnp.ndarray` or :class:`dpnp.tensor.usm_ndarray`, as in CuPy.
* Generators and bit generators cannot be pickled or deep-copied, and the
bit generators have no ``advance`` or ``jumped`` method.

Expand Down Expand Up @@ -101,6 +109,19 @@ Simple random data

Generator.integers
Generator.random
Generator.choice
Generator.bytes

Permutations
^^^^^^^^^^^^

.. autosummary::
:toctree: generated/
:nosignatures:

Generator.shuffle
Generator.permutation
Generator.permuted

Distributions
^^^^^^^^^^^^^
Expand All @@ -112,6 +133,7 @@ Distributions
Generator.beta
Generator.binomial
Generator.chisquare
Generator.dirichlet
Generator.exponential
Generator.f
Generator.gamma
Expand All @@ -122,6 +144,9 @@ Distributions
Generator.logistic
Generator.lognormal
Generator.logseries
Generator.multinomial
Generator.multivariate_hypergeometric
Generator.multivariate_normal
Generator.negative_binomial
Generator.noncentral_chisquare
Generator.noncentral_f
Expand Down
Loading
Loading