1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| x is: tensor([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]) tensor([[2, 1, 4, 3], [1, 2, 3, 4], [4, 3, 2, 1]]) ---------------------------------------- x is: tensor([[[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]],
[[12, 13, 14, 15], [16, 17, 18, 19], [20, 21, 22, 23]]]) ---------------------------------------- The shape of x is: torch.Size([2, 3, 4]) The size of x[0] is: 2 24 ---------------------------------------- tensor([[[0., 0., 0., 0.], [0., 0., 0., 0.], [0., 0., 0., 0.]],
[[0., 0., 0., 0.], [0., 0., 0., 0.], [0., 0., 0., 0.]]]) tensor([[[1., 1., 1., 1.], [1., 1., 1., 1.], [1., 1., 1., 1.]],
[[1., 1., 1., 1.], [1., 1., 1., 1.], [1., 1., 1., 1.]]]) tensor([[ 1.4646, -0.6201, 0.6223, 1.7981], [-2.5379, -1.5198, 0.2865, 1.6249], [-0.3724, 0.7659, 2.1007, -1.8540]]) tensor([2, 9, 6, 4, 0, 1, 7, 5, 8, 3]) tensor([[ 0.8090, -0.2894], [-0.3646, -0.4624]])
|