mlx.core.random.bernoulli#
- mlx.core.random.bernoulli(p: Union[bool, int, float, complex, object] = 0.5, shape: Optional[List[int]] = None, key: Optional[array] = None, stream: Union[None, Stream, Device] = None) array#
Generate Bernoulli random values.
The values are sampled from the bernoulli distribution with parameter
p. The parameterpcan be afloatorarrayand must be broadcastable toshape.