extra layer.
The target that this loss expects should be a class index in the
   range [0, C-1] where C = number of classes; if ignore_index is
   specified, this loss also accepts this class index (this index may
   not necessarily be in the class range).
The unreduced (i.e. with "reduction" set to "'none'") loss can be
   described as:
  \ell(x, y) = L = \{l_1,\dots,l_N\}^\top, \quad l_n = - w_{y_n}
  x_{n,y_n}, \quad w_{c} = \text{weight}[c] \cdot \mathbb{1}\{c
  \not= \text{ignore\_index}\},

where x is the input, y is the target, w is the weight, and N is
   the batch size. If "reduction" is not "'none'" (default "'mean'"),
   then
  \ell(x, y) = \begin{cases}     \sum_{n=1}^N
  \frac{1}{\sum_{n=1}^N w_{y_n}} l_n, &     \text{if reduction} =
  \text{`mean';}\\     \sum_{n=1}^N l_n,  &     \text{if
  reduction} = \text{`sum'.} \end{cases}

Parameters:
      * weight (Tensor, optional) -- a manual rescaling