According to my experiment, i found that the dimension of preds (line 75) is 3. After preds.max(2), its dimension is 2. As a result, preds.squeeze(2) throws an exception, since axis 2 exceeds the range of dimension.
So, the command line reminds me that "RuntimeError: dimension out of range (expected to be in range of [-2, 1], but got 2) "
According to my experiment, i found that the dimension of preds (line 75) is 3. After preds.max(2), its dimension is 2. As a result, preds.squeeze(2) throws an exception, since axis 2 exceeds the range of dimension.
So, the command line reminds me that "RuntimeError: dimension out of range (expected to be in range of [-2, 1], but got 2) "