Bernoulli¶

Draws binary random numbers (0 or 1) from a Bernoulli distribution. The input tensor should be a tensor containing probabilities p (a value in the range [0,1]) to be used for drawing the binary random number, where an output of 1 is produced with probability p and an output of 0 is produced with pro…

Abstract Signature:

Bernoulli(input, dtype: int, seed: float)

Apple MLX

API: mlx.core.random.bernoulli
Strategy: Direct Mapping

Flax NNX

API: nnx.rnglib.Rngs.bernoulli
Strategy: Direct Mapping