dpnp.random.Generator¶
- class dpnp.random.Generator(bit_generator)[source]¶
A container for the bit generator and the distribution samplers.
The analogue of
numpy.random.Generator, drawing all samples on the SYCL queue of its bit generator. Usedpnp.random.default_rng()to create one.For full documentation refer to
numpy.random.Generator.- Parameters:
- bit_generatorBitGenerator
The bit generator, such as
dpnp.random.Philox4x3210.
Limitations
Every method returns a
dpnp.ndarray, zero-dimensional when size isNoneand the parameters are scalars, rather than a Python scalar. The methods take a usm_type keyword, and the floating-point ones a dtype keyword, as in CuPy, whose default is the default floating-point type of the device.Parameters on the host (scalars, lists and NumPy arrays) are checked as in NumPy. Parameters on the device are not, since that would wait for the device. Invalid ones give undefined values, such as NaN, but never make the kernels loop without end or access memory out of bounds.