Skip to contents

Sample from a binomial distribution with $n$ trials and success probability $p$.

Usage

nv_rbinom(shape, initial_state, n = 1L, prob = 0.5, dtype = "i32")

Arguments

shape

(integer())
Shape.

initial_state

([ui64[2]][tensorish])
RNG state.

n

(integer(1))
Number of trials. Default is 1 (Bernoulli).

prob

(numeric(1))
Probability of success on each trial. Default is 0.5.

dtype

(character(1) | stablehlo::TensorDataType)
Data type.

Value

(list() of tensorish)
List of two tensors: the new RNG state and the generated random samples.