Sample Bernoulli random variables on mlx arrays
mlx_rand_bernoulli.RdSample Bernoulli random variables on mlx arrays
Usage
mlx_rand_bernoulli(dim, prob = 0.5, device = mlx_default_device())Arguments
- dim
- Integer vector specifying the array shape/dimensions. 
- prob
- Probability of a one. 
- device
- Execution target: provide - "gpu",- "cpu", or an- mlx_streamcreated via- mlx_new_stream(). Defaults to the current- mlx_default_device().
Examples
mask <- mlx_rand_bernoulli(c(4, 4), prob = 0.3)