get_rng_state

paddle.cuda. get_rng_state ( device: DeviceLike | None = None ) core.GeneratorState [source]

Return the random number generator state of the specified device.

Parameters

device (DeviceLike, optional) – The device to retrieve the RNG state from. If not specified, uses the current default device (as returned by paddle.framework._current_expected_place_()). Can be a device object, integer device ID, or device string.

Returns

The current RNG state of the specified device.

Return type

core.GeneratorState

Examples

>>> import paddle
>>> paddle.cuda.get_rng_state()