mlx.core.random.truncated_normal#
- truncated_normal(lower: Union[scalar, array], upper: Union[scalar, array], shape: Optional[Sequence[int]] = None, dtype: float32, key: Optional[array] = None, stream: Union[None, Stream, Device] = None) array #
Generate values from a truncated normal distribution.
The values are sampled from the truncated normal distribution on the domain
(lower, upper)
. The boundslower
andupper
can be scalars or arrays and must be broadcastable toshape
.- Parameters:
- Returns:
The output array of random values.
- Return type: