Creates an initial RNG state from a seed. This state is required by all random sampling functions and is updated after each call.
Usage
nv_rng_state(seed, device = default_device())Arguments
- seed
(
arrayish)
Scalari32seed value.- device
(
NULL|character(1)| device)
The device the data lives on, given either as:a device string naming the platform (e.g.
"cpu","cuda","cuda:<n>"), which is resolved against the backend in use, ora device object as returned by
nv_device(): aPJRTDevicefor the"pjrt"backend or aquickr_devicefor the"quickr"backend. Because a device object is backend-specific, it also determines the backend.
The default (
NULL) usesdefault_device(): the CPU, or the platform named by thePJRT_PLATFORMenvironment variable on the"pjrt"backend.
Value
nv_array of dtype ui64 and shape (2).
See also
Other rng:
nv_normal,
nv_rbinom(),
nv_runif(),
nv_sample(),
nv_sample_int()