API 相关说明
Random variable with uniform distribution $U(0, 1)$.
low (float) – lower range. Default: 0
float
high (float) – upper range. Default: 1
size (Optional[Iterable[int]]) – the size of output tensor. Default: None
Optional
Iterable
int
the output tensor.
实际案例
import megengine as mge import megengine.random as rand x = rand.uniform(size=(2, 2)) print(x.numpy())
Outputs:
[[0.91600335 0.6680226 ] [0.2046729 0.2769141 ]]
上一页
megengine.random.RNG.poisson
下一页
megengine.random.seed