torch.randn

torch.randn(*sizes, out=None) → Tensor

返回一个张量,包含了从标准正态分布(均值为0,方差为1,即高斯白噪声)中抽取的一组随机数。张量的形状由参数sizes定义。

参数:

sizes (int...) - 整数序列,定义了输出张量的形状
out (Tensor, optinal) - 结果张量
例子:

torch.randn(2, 3)
0.5419 0.1594 -0.0413
-2.7937 0.9534 0.4561
[torch.FloatTensor of size 2x3]
————————————————

原文链接:https://blog.csdn.net/wangwangstone/article/details/89815661

猜你喜欢

转载自blog.csdn.net/weixin_43135178/article/details/115216878
今日推荐