Microsoft Windows [版本 10.0.18363.1256]
(c) 2019 Microsoft Corporation。保留所有权利。
C:\Users\chenxuqi>
C:\Users\chenxuqi>conda activate ssd4pytorch1_2_0
(ssd4pytorch1_2_0) C:\Users\chenxuqi>python
Python 3.7.7 (default, May 6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.manual_seed(seed=20200910)
<torch._C.Generator object at 0x000001F4CA9CD330>
>>>
>>> a = torch.randn(2,3,4,5)
>>> a
tensor([[[[ 0.5816, 2.0060, 1.6013, -0.6379, -1.1943],
[ 0.1426, 1.3612, -1.4171, -2.7679, 2.1961],
[ 1.3462, -0.7650, 1.5528, 0.7210, -0.1314],
[ 0.1448, 1.5570, 1.0334, 0.2356, 0.6646]],
[[-0.4996, 0.2791, -0.5900, 0.2527, 0.6736],
[-3.4868, 1.0735, -0.0428, -0.2797, -1.3232],
[-0.8263, -0.4343, -1.0501, 1.5451, 2.1098],
[ 0.1178, -0.4273, -0.4440, -0.4213, -0.9365]],
[[ 1.8106, -0.1812, 1.0847, 0.3907, -0.0930],
[-0.2310, -1.0834, 0.5063, -0.9051, -0.3735],
[ 0.2595, 0.1206, 2.2853, 0.2603, 0.1335],
[ 1.2936, -0.2749, -0.1537, -1.7483, -0.6197]]],
[[[-1.1531, 2.7293, 0.7709, 0.4667, -1.2770],
[ 0.8514, 1.2402, -1.6003, 0.0838, -3.0623],
[ 0.0307, -0.5324, 0.1468, -0.5430, 0.1792],
[ 0.0895, -1.4942, -0.6869, 0.7789, -0.2965]],
[[-0.0348, -0.7077, -0.5609, 0.4333, 0.9239],
[ 0.8626, 0.5517, -1.1063, 0.3968, 0.7896],
[ 1.0745, -0.2427, 0.0455, -1.0957, -0.5606],
[-0.7125, 0.3049, -1.2543, -0.3930, -0.6342]],
[[-0.2926, -1.0527, 0.3143, -0.0558, -0.5113],
[ 1.1426, 1.3465, -0.1905, -0.7836, -0.2961],
[ 0.1632, 0.3234, 0.2556, -0.1240, -0.6639],
[-0.4489, 1.3092, 0.6531, 0.2648, 0.9527]]]])
>>>
>>> a.ndim
4
>>> a.dim()
4
>>> a.size()
torch.Size([2, 3, 4, 5])
>>> a.shape
torch.Size([2, 3, 4, 5])
>>>
>>>
>>>