API 相关说明
服从高斯分布的随机变量 \(N(\mu, \sigma)\)
mean (float) – the mean or expectation of the distribution. Default: 0
float
std (float) – the standard deviation of the distribution (variance = \(\sigma ^ 2\)). Default: 1
size (Optional[Iterable[int]]) – the size of output tensor. Default: None
Optional
Iterable
int
输出张量
实际案例
import megengine as mge import megengine.random as rand x = rand.normal(mean=0, std=1, size=(2, 2)) print(x.numpy())
输出:
[[-1.4010863 -0.9874344 ] [ 0.56373274 0.79656655]]
上一页
megengine.random.permutation
下一页
megengine.random.uniform