mlx.core.random.normal#

mlx.core.random.normal(shape: List[int] = [], dtype: Optional[Dtype] = mlx.core.float32, loc: float = 0.0, scale: float = 1.0, key: Optional[array] = None, stream: Union[None, Stream, Device] = None) array#

Generate normally distributed random numbers.

Parameters:
  • shape (list(int), optional) – Shape of the output. Default is ().

  • dtype (Dtype, optional) – Type of the output. Default is float32.

  • loc (float, optional) – Mean of the distribution. Default is 0.0.

  • scale (float, optional) – Standard deviation of the distribution. Default is 1.0.

  • key (array, optional) – A PRNG key. Default: None.

Returns:

The output array of random values.

Return type:

array