I was going through the transfer learning tutorial , and I noticed this
_ , prediction = torch.max(outputs.data , 1)
So I wondered what the first return data was.
I ran the following code , can someone help me understand the output difference
a = Variable(tt.Tensor([[1,2,.01],
...: [5,0.1,2],
...: [4,5,6]]))
In [16]: a
Out[16]:
Variable containing:
1.0000 2.0000 0.0100
5.0000 0.1000 2.0000
4.0000 5.0000 6.0000
[torch.FloatTensor of size 3x3]
p = torch.max(a.data , 1)
print(p)
(
2
5
6
[torch.FloatTensor of size 3x1]
,
1
0
2
[torch.LongTensor of size 3x1]
)
I understood the first output , but can not understand the second result ( LongTensor)