Samples from a uniform distribution in the open interval (lower, upper).
Arguments
- shape
(
integer())
Shape.- initial_state
(
tensorish)
RNG state (ui64[2]).- dtype
(
character(1)|stablehlo::TensorDataType)
Data type.- lower, upper
(
numeric(1))
Lower and upper bound.
See also
Other rng:
nv_rbinom(),
nv_rdunif(),
nv_rng_state(),
nv_rnorm()
Examples
jit_eval({
state <- nv_rng_state(42L)
result <- nv_runif(c(2, 3), state)
result[[2]]
})
#> AnvilTensor
#> 0.8690 0.1506 0.5203
#> 0.3103 0.9928 0.1065
#> [ CPUf32{2,3} ]