Solved by fyjl in post #3 
              
              
                Okay, the mistake is in nn.LogSoftmax(dim=1) during model definition. 
Since the input to the layer is now in shape of (batch_size, seq_len, n_label), 
setting dim=2 leads to the expected outputs.