代码示例:
import torch #生成50大组512小组二维7x7包含7x7x512x50个符合(0,1)正态分布的随机填充数 x1_in=torch.randn(50,512,7,7) #生成一维包含两个符合(0,1)正态分布的随机填充数 x2_in=torch.randn(2) #生成二维4x5包含二十个符合(0,1)正态分布的随机填充数 x3_in=torch.randn(4,5) #生成三组二维4x5包含六十个个符合(0,1)正态分布的随机填充数 x4_in=torch.randn(3,4,5) #生成两大组三小组二维4x4包含4x4x3x2个符合(0,1)正态分布的随机填充数 x5_in=torch.randn(2,3,4,4) print("x1_in:",x1_in) print("x2_in:",x2_in) print("x3_in:",x3_in) print("x4_in:",x4_in) print("x5_in:",x5_in)
print结果:
x1_in: tensor([[[[ 1.7454, 0.8782, 1.6728, ..., 0.1684, -1.7408, 0.1600], [-1.0368, 0.9847, 0.0500, ..., -0.5160, -0.2998, -0.4423], [ 0.9164, 1.0202, 1.1760, ..., -0.1564, -0.5347, 0.1310], ..., [ 2.1361, 1.3924, -0.2182, ..., 0.7746, 0.3772, -1.1199], [-0.8169, -0.2967, 0.1111, ..., -0.5327, 0.9986, -0.1513], [ 0.5656, -1.1563, -1.3359, ..., -0.9387, 0.7073, -0.7490]], [[ 0.1434, -0.2466, 0.6090, ..., 0.9931, -1.2460, -1.1927], [-0.7059, 1.2082, 0.8042, ..., 0.9772, -0.7238, 0.2011], [ 0.8891, 1.4986, 0.1157, ..., 1.7327, 1.3839, -0.8143], ..., [ 0.5401, 1.2937, -1.1726, ..., -0.1189, 1.2624, -0.2370], [ 1.4247, 0.7499, 0.2236, ..., 0.2448, 0.7639, 0.5500], [-0.9817, 0.3624, 0.5702, ..., -1.2316, -1.8187, 0.2925]], [[-0.0915, -0.1586, -0.9817, ..., -0.5704, 2.7343, -0.4924], [-0.1847, 0.0229, -0.2459, ..., 1.0555, -1.4772, -1.1890], [ 1.3803, -0.5316, 0.4557, ..., -0.5290, 0.4724, -0.7107], ..., [-0.8352, 1.9083, 0.6633, ..., -0.1649, 1.5149, -1.0894], [ 0.1396, 1.3533, -1.5172, ..., 1.9332, 1.6397, -0.8932], [ 0.4905, 0.8503, 0.7227, ..., 0.0541, -0.9842, -0.1336]], ..., [[-1.3857, 0.4005, 0.7501, ..., 0.0760, 1.4803, -0.4279], [-0.8068, -0.7110, 0.8974, ..., 0.4537, -0.9439, -0.3301], [ 1.1397, 0.1333, -1.4307, ..., -0.2478, -0.8197, -0.2227], ..., [-0.6109, 0.7189, -0.5240, ..., -0.1412, -0.7808, -2.6745], [-0.5880, 2.7838, 1.9978, ..., -0.7840, -0.4827, -1.2049], [-0.1200, -0.1622, 0.6586, ..., 0.8143, 0.6858, 1.0543]], [[-0.7638, 1.2591, -0.4134, ..., 1.2102, 0.4270, -1.1430], [-1.3308, 0.9998, 0.0212, ..., 0.5211, -0.3871, 0.6866], [ 1.5665, 1.5653, 0.7695, ..., 1.2509, 0.3183, -0.7664], ..., [ 0.6499, 0.5165, 1.4806, ..., 0.0615, 0.3427, -0.8258], [-0.0139, 0.2698, -0.4113, ..., -1.7856, -0.2388, 0.9964], [-1.3326, 0.5830, 0.0372, ..., 0.7190, 0.1995, -1.4480]], [[-0.8058, 1.9920, -0.0450, ..., 0.9309, 0.4605, -1.6921], [ 0.7091, -0.6140, 2.3033, ..., -0.3034, -1.1922, 1.0982], [ 0.0810, -0.2119, 1.3016, ..., -1.3732, -0.2698, 0.2130], ..., [-2.3322, 0.3496, -1.0933, ..., -1.6860, -1.2909, 0.5996], [ 0.4774, -2.8229, 0.2433, ..., -0.8994, 0.3952, 0.1412], [ 0.5002, -0.3481, 0.0306, ..., -0.7435, -0.9963, 0.7912]]], [[[ 0.1688, -1.8932, -0.5485, ..., 0.3295, -0.5984, -0.3339], [-1.1540, -0.1114, -0.5004, ..., -0.8534, 0.0681, 0.2068], [-1.2418, 1.0615, 1.6032, ..., 0.3152, 0.6663, -0.2733], ..., [ 0.4738, -1.3607, -0.6225, ..., 1.2276, -0.2013, 0.1079], [-0.9307, -1.1314, 0.6661, ..., -0.0688, -0.1746, 0.6869], [ 2.2133, 0.6738, 0.1338, ..., -0.9506, -1.0585, 0.7372]], [[ 0.8396, -0.2311, -0.6378, ..., -0.4897, -0.3219, -0.7142], [-1.2708, 0.6226, -1.0448, ..., -1.1531, 0.6801, -0.1303], [-0.7789, 0.7246, -1.3045, ..., -1.0427, 0.7316, 0.3920], ..., [-1.2673, 2.1732, 1.1074, ..., 2.0817, -0.6846, 0.1548], [ 1.2208, -0.5271, 0.9221, ..., 0.4287, -2.3816, 0.2877], [-0.3331, 1.0695, 0.8445, ..., -1.0340, -1.3959, -2.4444]], [[-2.6530, 1.2272, 1.3093, ..., -0.4021, 1.3145, 1.4409], [ 0.8818, 0.3111, 0.8786, ..., 0.3593, -0.4166, 0.5793], [-0.7583, 1.0402, -0.5562, ..., 0.3265, -0.3237, -0.7747], ..., [ 0.6773, -1.0658, 1.0398, ..., -1.0949, 0.6790, -3.2872], [ 0.6234, 1.5488, -0.0974, ..., -0.9583, 0.3780, 1.4146], [ 0.0648, 0.9402, -0.3770, ..., -1.6331, -0.3709, -0.2192]], ..., [[ 2.5173, -1.6144, 0.0174, ..., -1.1193, -0.5326, -1.5151], [-0.4284, -1.5663, 0.5380, ..., -0.1613, 0.7422, -1.0939], [-1.1450, 0.9541, 0.2368, ..., -0.0531, 0.2065, 1.7249], ..., [ 2.4042, 1.4114, -1.1173, ..., -1.2016, -1.0726, 2.0388], [-1.2668, -0.8565, 1.5024, ..., -0.2419, -1.2217, 0.3068], [-0.1530, 0.2527, -0.8473, ..., -0.0332, 0.9385, -0.2472]], [[-0.8126, -0.3097, 0.3057, ..., -0.6568, 1.6498, -0.4214], [ 1.3743, -0.5977, -0.5802, ..., 0.6989, -0.5189, -0.7073], [ 1.0181, -0.7489, -0.1974, ..., 1.8651, 1.0360, 0.8177], ..., [-0.7623, -1.6022, -1.4261, ..., -0.6800, 1.4421, -0.4900], [ 0.6897, 1.5749, 0.3715, ..., 0.1747, -0.2982, -0.1143], [-0.6584, 0.8910, 0.1761, ..., 1.4655, 1.0257, -0.6948]], [[-0.7859, -1.1038, 0.4299, ..., 0.6366, -0.2922, -0.8949], [ 2.1500, -0.5774, 0.2169, ..., 0.3392, -0.0735, 0.8007], [-0.5814, 0.3783, -1.1715, ..., -0.7933, 0.1588, -0.0585], ..., [-1.2530, -0.7799, -0.6718, ..., -0.1531, -1.3501, -0.7888], [ 1.8514, -0.0319, -1.4656, ..., 0.8848, -0.5120, 2.1070], [-1.3659, -1.0116, -0.0185, ..., -0.4806, 0.5645, 0.5956]]], [[[ 0.4408, 0.9618, -2.0779, ..., 0.6015, 0.8434, -2.1059], [ 0.4795, 0.3012, -0.0162, ..., -0.9262, -0.6428, -0.4625], [-1.1128, -0.1427, -0.0349, ..., -1.8010, 0.0582, -0.9441], ..., [-0.3014, 0.1829, 0.6501, ..., -0.3681, -1.0451, -0.4152], [ 1.0320, -0.2139, -1.1677, ..., 0.5045, 0.0427, 0.0403], [ 0.9821, -0.7039, -0.0937, ..., 0.0380, 1.1516, -1.0518]], [[ 0.8867, 0.0593, 1.4235, ..., 1.4943, -0.2407, -0.7954], [ 1.5275, 1.1723, -1.1460, ..., 0.4753, -0.2335, -0.6258], [-1.6464, 1.7812, -1.5084, ..., 0.1440, -1.0171, 0.0258], ..., [ 0.8615, 0.5634, 1.0898, ..., 1.4721, 0.8801, 0.5063], [-0.6971, -1.5602, 0.8740, ..., 0.2671, 0.6380, 0.7757], [ 0.9630, 0.1316, 1.8482, ..., -1.7779, 0.6919, 1.0967]], [[ 0.0369, -0.8268, 0.2304, ..., -2.2884, -1.8186, -1.6970], [-0.7290, 0.6610, 0.2342, ..., -0.6904, -0.2544, -0.4614], [ 0.8022, 0.3114, 0.6711, ..., 1.0207, -0.1437, -1.2855], ..., [-1.4603, -0.3400, -1.1473, ..., -0.0200, -0.9827, -0.4309], [-0.5388, 0.3763, 0.2852, ..., 0.5500, -0.6796, 0.5887], [ 0.0932, 0.6995, -1.5253, ..., -0.6557, 1.4232, 1.0134]], ..., [[-0.2294, 1.4867, -0.1892, ..., 0.7544, -0.8058, -0.1176], [-0.4909, -0.1732, -1.7691, ..., -0.6297, -0.4350, -0.0843], [-0.1508, -0.3151, 1.1489, ..., 0.4816, -0.9902, 1.1280], ..., [ 0.0421, 0.8478, 1.1167, ..., -0.3402, -1.2637, 0.1185], [-0.6358, -1.6356, -0.9784, ..., -1.2315, 0.3109, 0.5419], [-0.5680, 1.8234, 1.5281, ..., 0.7701, 0.6682, -1.4756]], [[-1.6182, -0.2980, -2.7406, ..., -0.2664, -0.1438, 1.8371], [ 0.1766, 1.0012, -0.3601, ..., 1.1660, -0.2563, 0.5654], [ 0.0725, 0.3965, -1.3104, ..., -1.6284, -0.2445, -0.2794], ..., [-0.9069, 0.5041, 0.7829, ..., 0.5471, 0.3347, 1.3445], [-0.3712, 1.4373, 1.1399, ..., -0.2443, -0.5530, -0.6848], [ 1.3737, -0.2554, 0.9247, ..., -0.1142, -3.1700, -0.5459]], [[-0.2699, -2.5329, 1.4392, ..., 0.5242, -1.3365, -0.7232], [-1.1773, 1.3156, 1.0847, ..., -0.5454, 0.0267, 0.4147], [-0.5781, -0.2274, -0.7889, ..., 0.4762, 1.3744, 0.4319], ..., [-0.3430, 1.5029, 0.3510, ..., -0.3993, 0.7933, -1.3692], [ 1.9541, 0.4492, -0.0328, ..., 1.4745, -1.9768, 0.7118], [ 0.6009, 0.7994, 0.5481, ..., -0.0104, -1.5141, 0.6669]]], ..., [[[ 1.7889, -1.2852, 0.2855, ..., 1.3271, -0.2774, -0.0442], [-0.8503, -0.1748, -0.5550, ..., 1.9257, 1.6368, 0.2563], [-0.2329, -1.2819, 1.9728, ..., -0.6298, -1.8842, 1.7169], ..., [ 1.9550, -0.0053, 0.1733, ..., -0.8558, -0.3385, 1.0125], [ 0.0683, 1.2190, 0.4186, ..., 0.7289, 1.5282, 0.0133], [ 0.5995, 0.1469, 0.7490, ..., -0.4283, 0.7269, 0.9955]], [[-0.7792, -0.0102, 0.4343, ..., 0.9345, 0.3029, 0.5431], [-0.0154, -0.0365, 0.3013, ..., 0.2600, 0.2622, 0.0076], [ 0.0938, 0.9012, 0.8128, ..., -0.0736, -0.4519, 1.1700], ..., [ 2.0655, 0.5247, -0.0512, ..., 1.6676, -2.3780, -0.1699], [-1.3438, -0.3609, 0.0726, ..., -0.3975, 0.0893, 0.1073], [-1.7036, -0.0151, 0.8821, ..., -1.5179, 0.4621, -0.9447]], [[ 0.6881, -0.3419, -0.8837, ..., -0.6340, 2.8614, 0.3902], [-0.0565, 0.9710, 1.2016, ..., 0.1882, -0.0049, -0.6259], [-0.0552, -0.1700, -0.6677, ..., -1.1240, 3.1751, 0.7703], ..., [-1.4301, 0.0468, -0.0934, ..., -0.6983, 0.0047, -0.4909], [-1.0083, 1.0563, 0.5354, ..., 1.0506, 0.6558, 1.3131], [ 1.6326, -0.1894, 0.3504, ..., -0.1104, 0.4200, 0.7334]], ..., [[-0.1877, -0.5724, 0.7521, ..., -2.0296, 1.5242, 0.1129], [ 0.0185, 0.5108, 1.5844, ..., -0.1328, 2.1106, -0.5459], [-1.7801, -1.5317, 0.5464, ..., 1.6971, -0.7352, 0.0458], ..., [ 1.6143, -1.1078, 0.4376, ..., -0.2020, -0.3057, -0.5325], [ 0.1552, 0.4375, 0.9727, ..., 0.0929, 0.4402, 0.0090], [-0.1810, -0.1242, -0.2989, ..., 0.1766, -0.2953, -0.0185]], [[ 2.5203, -1.8813, 0.9032, ..., -0.3506, 0.7292, -0.5740], [-0.4772, 0.3876, -0.8760, ..., 0.4059, 0.8760, 0.2769], [ 0.6253, 0.7472, -0.5005, ..., 0.6881, -0.3539, -0.7939], ..., [ 0.4387, 0.9582, 0.8949, ..., -0.9474, 0.6435, 0.0321], [ 0.2290, 1.4785, -0.3228, ..., 0.7860, 0.4238, -1.4287], [ 0.8634, 0.0600, -1.0596, ..., -0.0222, -0.4413, -1.0798]], [[-0.3836, 0.1837, -1.7240, ..., 1.3981, -0.9159, 0.7231], [ 1.1067, 0.6112, 0.2463, ..., -0.6723, 0.7164, 0.6187], [-0.8864, 1.6681, 0.2316, ..., 0.6413, -1.4762, -0.8241], ..., [ 1.2250, -0.2128, 0.8181, ..., -1.5536, 0.1048, -0.8966], [ 0.1963, -2.3990, 0.4150, ..., 0.7504, -1.1505, -1.5265], [ 1.8793, -0.2243, -0.5514, ..., 0.0739, 0.2633, 1.2708]]], [[[-1.2934, 1.7455, -1.3081, ..., 0.7461, 1.9811, 1.4779], [-0.7434, -0.8742, 1.9982, ..., 0.0874, -0.4885, 1.9772], [-0.1860, -1.3434, 1.1387, ..., -2.1676, -2.1551, 0.0407], ..., [-0.8304, -1.1478, 1.6321, ..., 0.3079, 2.3527, 0.0510], [ 0.1030, -0.5638, -0.2189, ..., 0.1606, 2.7043, 0.6960], [-1.3503, -0.9735, -1.8608, ..., 1.8709, 0.1290, -1.6848]], [[-0.1221, -0.1294, -1.5653, ..., 0.6312, 0.3913, 0.6744], [-0.1409, -1.1080, 0.1583, ..., 0.0232, 1.7543, 1.0293], [ 2.5377, 0.5609, -0.7730, ..., 1.3475, -1.3326, 0.9864], ..., [-0.5527, 0.1911, 0.2745, ..., 0.6758, -0.2832, 0.9720], [ 0.5473, 0.0322, -2.3345, ..., 1.3136, -0.1341, 1.7109], [ 0.9228, 0.8619, -0.7816, ..., 1.2887, 0.6378, -1.3283]], [[-0.6675, -0.2000, 1.3713, ..., -0.3516, 0.3729, -0.6131], [-0.0057, -0.2775, 1.7090, ..., 0.8388, -0.7092, 0.7135], [ 0.4804, -1.1250, -0.0638, ..., 0.0239, -0.1237, -0.4946], ..., [ 0.1314, -0.7106, -2.3725, ..., -0.8120, -0.2099, -1.3791], [-1.5433, 0.6229, -1.8607, ..., -1.9794, 1.6749, -0.9608], [ 0.6432, 0.9185, -1.6375, ..., -0.9767, -0.7173, 0.0890]], ..., [[ 1.1394, 2.0039, -1.2120, ..., 0.7285, 0.9014, 1.5099], [ 0.0351, 0.9317, 0.0317, ..., -0.8071, 0.3007, -1.4229], [-0.5118, 0.5034, -0.2135, ..., 0.2281, 0.5065, 0.1678], ..., [ 0.4053, 0.4769, -0.5091, ..., -1.8192, 0.2233, -0.6876], [-0.8210, 0.1195, -0.0992, ..., -0.1676, 2.4992, 0.9584], [-0.2485, -0.7776, -1.3045, ..., 0.8966, -0.8692, -0.8480]], [[ 1.2483, 1.0789, -3.7963, ..., -1.3447, 1.4603, 1.7545], [ 0.1200, -0.5395, -0.7675, ..., 0.6976, 0.0272, 1.4075], [-1.2519, -0.4307, 1.2915, ..., 0.7661, -0.1287, -1.4874], ..., [-0.1292, 1.6755, 1.0917, ..., -1.4055, 0.7274, 2.0195], [-0.0844, 2.4880, -2.0437, ..., -0.8990, 0.3238, -1.8488], [-0.6795, -0.1332, -0.4245, ..., -0.8416, -0.8784, -0.0377]], [[-0.3086, -1.5101, -1.8272, ..., 0.0808, 0.3371, -0.5077], [-0.3436, 0.1148, 0.6322, ..., 0.7118, -0.6007, 1.2339], [-0.7438, -0.1099, 0.1870, ..., 1.0060, -1.3611, 1.0669], ..., [-1.5795, 0.5555, -1.1968, ..., -1.4874, -0.1742, 0.8286], [ 0.5681, 1.1346, 1.8588, ..., 1.5913, -1.2323, 0.1194], [ 1.6610, -1.1315, 0.4626, ..., 1.5711, -1.3653, -0.6038]]], [[[-0.8408, 1.4026, 2.6726, ..., 1.0158, 0.2110, 1.3209], [ 0.5672, -1.0211, -0.1957, ..., 1.1582, 1.2959, 1.3736], [-1.0656, 0.2201, -0.2187, ..., -0.9950, -1.6265, 1.5287], ..., [-0.2459, 0.8721, -1.6565, ..., -2.3333, 0.7891, 0.4637], [ 0.2457, 0.9041, -1.8453, ..., 0.9615, 1.7210, -0.0711], [-1.0443, -0.0783, -0.4890, ..., 1.3732, 1.0353, -1.8917]], [[-0.8518, -0.8097, -0.2241, ..., -0.1535, -1.3366, -0.3374], [ 1.1188, 0.2649, 0.1257, ..., -0.3590, -0.8390, 0.2620], [-0.0887, 0.1431, -2.5532, ..., 2.0927, -0.0420, -0.9621], ..., [-0.6382, -1.3602, 0.3252, ..., -1.4943, -0.0396, -0.6998], [ 0.2981, 1.2781, -0.7588, ..., -0.0869, -1.4094, 0.2760], [ 1.4663, 0.5394, -0.3452, ..., 0.0686, -0.8326, -0.6874]], [[ 0.0700, -0.6850, -1.4527, ..., -0.0422, -0.0847, 1.4640], [ 0.6389, -0.0907, -0.1559, ..., -1.7986, 1.5564, -0.6470], [ 1.5626, 0.5888, -1.1531, ..., 0.3095, -0.2340, 0.2125], ..., [ 0.7370, 0.6708, 0.6172, ..., -0.0594, -1.9932, -0.6100], [ 0.6401, -0.4611, 0.6020, ..., 0.4166, 1.0984, 0.1005], [-0.3753, -0.1947, 0.9036, ..., 0.3784, -1.0664, -0.8691]], ..., [[ 0.7610, 0.7789, 0.8597, ..., -0.7669, 0.6992, 0.1295], [-0.6929, 0.5584, 1.5814, ..., -0.4985, -1.1723, 1.5631], [ 0.1116, 0.0217, -0.4406, ..., 0.0339, -0.2922, 0.9229], ..., [-0.0428, 0.0407, 0.8943, ..., -0.3286, 1.1558, -1.0157], [ 1.2544, 0.6414, 0.8057, ..., -0.0169, 0.7583, 0.8983], [-0.1382, 0.8659, 0.2941, ..., 0.1325, 1.5548, 0.5179]], [[ 0.4180, 0.2519, -0.5072, ..., -0.5201, 0.9176, -0.3892], [ 2.3042, -0.4738, 0.9704, ..., 0.6010, -0.4749, -1.0481], [ 1.8827, -0.1004, -1.1151, ..., -0.4274, -1.2221, 0.5019], ..., [-0.2675, -0.2059, 0.0451, ..., -0.1587, -1.0824, -0.4331], [ 0.6718, 0.7435, 0.2755, ..., -1.5098, 0.5762, 1.6706], [-3.0294, -1.7092, -0.1286, ..., -0.4861, -0.9726, -0.6048]], [[ 0.3811, 0.1280, -0.4814, ..., 0.0972, -0.5797, -1.0351], [-1.4548, -2.9472, -0.0109, ..., -0.2694, 1.8851, -0.1673], [ 1.5832, 0.4441, 0.9859, ..., 0.4969, 0.3469, -0.6842], ..., [-0.1411, -1.7080, 0.1085, ..., -0.1156, -0.5956, -1.0813], [ 0.6253, 0.2965, 0.1044, ..., 0.6124, -0.2590, 0.1002], [-1.0634, 1.1976, -0.0226, ..., 0.6754, -2.1125, 0.1257]]]]) x2_in: tensor([ 0.3464, -0.9395]) x3_in: tensor([[ 0.8034, -1.1712, -0.8723, -0.1186, 0.0465], [-1.0856, 0.8180, -0.8594, -1.3289, -0.1302], [-0.2157, 0.6270, -1.5790, -1.2711, -1.2015], [-0.4765, 0.4498, 1.4304, -0.4482, -2.3286]]) x4_in:tensor([[[-1.5256, -0.7502, -0.6540, -1.6095, -0.1002], [-0.6092, -0.9798, -1.6091, -0.7121, 0.3037], [-0.7773, -0.2515, -0.2223, 1.6871, 0.2284], [ 0.4676, -0.6970, -1.1608, 0.6995, 0.1991]], [[ 0.8657, 0.2444, -0.6629, 0.8073, 1.1017], [-0.1759, -2.2456, -1.4465, 0.0612, -0.6177], [-0.7981, -0.1316, 1.8793, -0.0721, 0.1578], [-0.7735, 0.1991, 0.0457, 0.1530, -0.4757]], [[-0.1110, 0.2927, -0.1578, -0.0288, 0.4533], [ 1.1422, 0.2486, -1.7754, -0.0255, -1.0233], [-0.5962, -1.0055, 0.4285, 1.4761, -1.7869], [ 1.6103, -0.7040, -0.1853, -0.9962, -0.8313]]]) x5_in: tensor([[[[ 1.2181, -0.7148, 1.2496, -0.9748], [ 2.4227, -0.4538, -1.0087, 1.8930], [ 0.2523, 0.2582, -0.2023, 0.4873], [-0.4227, 1.1041, 1.6260, 1.1036]], [[ 0.0452, -0.7082, -0.5420, -0.0793], [-0.1880, 0.6495, -0.8732, -1.2387], [-0.6335, -0.2866, 0.1000, -0.9080], [ 0.8533, 1.2052, 0.5747, 0.4838]], [[ 0.2345, 0.0885, 0.0054, -0.6436], [ 0.0851, -0.6933, -0.1087, -0.9820], [ 0.4562, -0.5452, 0.5487, -0.2515], [-0.8670, -0.3287, -1.3087, 0.8148]]], [[[-0.0572, -0.0137, -0.0604, -0.0046], [ 1.2476, 2.2631, -0.3260, -0.3937], [ 0.0775, 0.9615, 0.5876, -0.0126], [-1.1889, 0.5603, 0.6134, -0.5175]], [[-0.2433, 0.9760, -0.1672, 0.9676], [-1.1105, -0.1573, -1.4780, 2.7073], [ 0.4100, -0.6585, 0.6132, -0.0640], [-0.0143, 0.0479, -0.9606, 0.5987]], [[ 0.5094, -1.0369, -1.1725, -1.6241], [-1.0714, 0.8802, -2.2408, 0.8185], [ 1.0005, 1.6844, 0.7631, 0.6200], [-0.3645, 1.0294, -1.3372, -0.7936]]]]) Process finished with exit code 0 Process finished with exit code 0
torch.randn()函数讲解:
1.使用:import torch
2.参数:
torch.randn(*size, *, out=None, dtype=None, layout=torch.strided,device=None,requires_grad=False)
3.返回一个符合均值为0,方差为1的正态分布(标准正态分布)中填充随机数的张量
4.具体参数了解:https://blog.csdn.net/qq_42119367/article/details/110004734
5.使用方法:pytorch
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)