mlx.core.random.normal#
- normal(shape: Sequence[int] = [], dtype: Dtype | None = float32, loc: scalar | array | None = None, scale: scalar | array | None = None, key: array | None = None, stream: None | Stream | Device = None) array#
Generate normally distributed random numbers.
If
locandscaleare not provided the "standard" normal distribution is used. That means $x sim mathcal{N}(0, 1)$ for real numbers and $text{Re}(x),text{Im}(x) sim mathcal{N}(0, frac{1}{2})$ for complex numbers.- 参数:
shape (list(int), optional) -- Shape of the output. Default:
().dtype (Dtype, optional) -- Type of the output. Default:
float32.loc (scalar or array, optional) -- Mean of the distribution. Default:
None.scale (scalar or array, optional) -- Standard deviation of the distribution. Default:
None.key (array, optional) -- A PRNG key. Default:
None.
- 返回:
The output array of random values.
- 返回类型: