Solved by rasbt in post #2 
              
              
                There is a convention that the labels should be a 1-dimensional array, not a 2-dimensional array. I.e., right now, you have 200x1 as the label array, but it should be simply 200. Try 
loss = loss_fn(outputs, labels.view(-1).long())

instead of 
loss = loss_fn(outputs, labels.long())

This be able to…