Skip to contents

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)
Scalar i32 seed value.

device

( character(1) | PJRTDevice | quickr_device | NULL)
Device for data to live on.

Value

nv_array of dtype ui64 and shape (2).

See also

Examples

state <- nv_rng_state(42L)
state
#> AnvlArray
#>  42
#>   0
#> [ CPUui64{2} ]