通过创建四种模式的正态分布张量

时间:2025-03-18 14:42:35
  • mean为标量,std为标量
  • mean为标量,std为张量
  • mean为张量,std为标量
  • mean为张量,std为张量
    (0,1,size=(1,5))
    tensor([[ 0.5548,  0.1402,  0.5849,  1.2391, -0.2564]])
    
    (0,std=(1, 0, -0.1))
    tensor([-0.6172, -0.1014,  0.0054, -0.0847,  0.2791, -0.0295, -0.1140, -0.3000,
            -0.2172,  0.0075])
    
    (mean=(1., 11.),std = 10)
    tensor([  0.0548,  33.3666,   6.6326,  -3.3032,  16.0448,  18.3752, -12.6373,
             -0.1594,  16.0896,  12.4073])
    
    (mean=(1., 11.), std=(1, 0, -0.1))
    tensor([-0.1131,  2.1779,  2.9984,  3.9909,  4.2449,  6.1312,  6.7345,  7.6574,
             8.8338, 10.1323])