In my code below:
output_var.is_cuda is True.
_, max_probs = torch.max(output_var, 2)
print output_var.size()
print max_probs.size()
print torch.max(max_probs)

the outputs:
(10L, 26L. 37L)
(10L. 26L, 1L)
37

So size of output_var is (10L, 26L. 37L) and with
_, max_probs = torch.max(output_var, 2)

the value of max_probs should be from 0 to 36 according to my understanding. Is it correct?
In my code sometimes torch.max(max_probs) gets 37. It happens randomly.
It is a bug of pytorch?