Creates an initial RNG state from a seed. This state is required by all random sampling functions and is updated after each call.
Arguments
- seed
(
arrayish)
Scalar seed. Must be a signed or unsigned integer; it is brought toi32, so a wider one is narrowed to its low 32 bits. An R integer is built ati32directly, whatever the default integer data type is.- 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().
Value
(arrayish)
A ui64 array of length 2, whatever seed's data type was.
See also
Other rng:
nv_normal,
nv_rbinom(),
nv_runif(),
nv_sample(),
nv_sample_int()