Skip to contents

Sample Bernoulli random variables on mlx arrays

Usage

mlx_rand_bernoulli(dim, prob = 0.5)

Arguments

dim

Integer vector specifying array dimensions (shape).

prob

Probability of a one.

Value

An mlx boolean array.

Examples

mask <- mlx_rand_bernoulli(c(4, 4), prob = 0.3)