title: nn.crossentropyloss between 3d and 2d
body: <p>The dimension of prediction is [batch, seq_len, emb_dim] and the dimension of label is [batch, seq_len]. I would like to calculate cross entropy between them.</p>
  <pre><code>loss_object = nn.CrossEntropyLoss(reduction='none')
  loss = loss_object(y_pred.permute([0,2,1]), y_true)
  </code></pre>
  <p>When I ran the code as above, the shape of loss is [batch], but I want the shape [batch, seq_len]. How can I get this shape of cross entropy?</p>