megengine.random.normal¶
- normal(mean=0, std=1, size=None)¶
服从高斯分布的随机变量 \(N(\mu, \sigma)\)
- 参数
- 返回
tensor. The random variable with Gaussian distribution.
- 返回类型
Return type
实际案例
>>> 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)