megengine.random.normal¶
- normal(mean=0, std=1, size=None)¶
Random variable with Gaussian distribution \(N(\mu, \sigma)\).
- Parameters
- Returns
tensor. The random variable with Gaussian distribution.
- Return type
Return type
Examples
>>> import megengine.random as rand >>> x = rand.normal(mean=0, std=1, size=(2, 2)) >>> x.numpy() array([[ 1.5534291 , -0.28356555], [ 2.2230418 , -0.92425716]], dtype=float32)