Let’s check the docs http://pytorch.org/docs/0.3.1/tensors.html#torch.Tensor.max 625
y.max(1) takes the max over dimension 1 and returns two values. an example would help.
Supposing we have a tensor y of shape (3, 4) containing
 0.6857  0.1098  0.4687  0.7822
 0.4170  0.2476  0.1339  0.5563
 0.9425  0.8433  0.1335  0.3169

y.max(1) returns two tensors…
# 1. the max value in each row of y
 0.7822
 0.5563
 0.9425
# 2. the column index at which the max value is found.
 3
 3
 0