parameters: (
      input: Tensor,
      target: Tensor,
      weight: Optional[Tensor] = None,
      size_average: Optional[bool] = None,
      ignore_index: int = -100,
      reduce: Optional[bool] = None,
      reduction: str = "mean",
  )
return_statement: return torch._C._nn.nll_loss_nd(input, target, weight, _Reduction.get_enum(reduction), ignore_index)
docstring: r"""The negative log likelihood loss.
  
      See :class:`~torch.nn.NLLLoss` for details.
  
      Args:
          input: :math:`(N, C)` where `C = number of classes` or :math:`(N, C, H, W)`
              in case of 2D Loss, or :math:`(N, C, d_1, d_2, ..., d_K)` where :math:`K \geq 1`
              in the case of K-dimensional loss. `input` is expected to be log-probabilities.
          target: :math:`(N)` where each value is :math:`0 \leq \text{targets}[i] \leq C-1`,
              or :math:`(N, d_1, d_2, ..., d_K)` where :math:`K \geq 1` for
              K-dimensional loss.
          weight (Tensor, optional): a manual rescaling weight given to each
              class. If given, has to be a Tensor of size `C`
          size_average (bool, optional): Deprecated (see :attr:`reduction`). By default,
              the losses are averaged over each loss element in the batch. Note that for
              some losses, there multiple elements per sample. If the field :attr:`size_average`
              is set to ``False``, the losses are instead summed for each minibatch. Ignored
              when reduce is ``False``. Default: ``True``
          ignore_index (int, optional): Specifies a target value that is ignored
              and does not contribute to the input gradient. When :attr:`size_average` is
              ``True``, the loss is averaged over non-ignored targets. Default: -100
          reduce (bool, optional): Deprecated (see :attr:`reduction`). By default, the
              losses are averaged or summed over observations for each minibatch depending
              on :attr:`size_average`. When :attr:`reduce` is ``False``, returns a loss per
              batch element instead and ignores :attr:`size_average`. Default: ``True``
          reduction (string, optional): Specifies the reduction to apply to the output:
              ``'none'`` | ``'mean'`` | ``'sum'``. ``'none'``: no reduction will be applied,
              ``'mean'``: the sum of the output will be divided by the number of
              elements in the output, ``'sum'``: the output will be summed. Note: :attr:`size_average`
              and :attr:`reduce` are in the process of being deprecated, and in the meantime,
              specifying either of those two args will override :attr:`reduction`. Default: ``'mean'``
  
      Example::
  
          >>> # input is of size N x C = 3 x 5
          >>> input = torch.randn(3, 5, requires_grad=True)
          >>> # each element in target has to have 0 <= value < C
          >>> target = torch.tensor([1, 0, 4])
          >>> output = F.nll_loss(F.log_softmax(input), target)
          >>> output.backward()
docstring_summary: r"""The negative log likelihood loss.
docstring_tokens: r The negative log likelihood loss .
function: def nll_loss(
      input: Tensor,
      target: Tensor,
      weight: Optional[Tensor] = None,
      size_average: Optional[bool] = None,
      ignore_index: int = -100,
      reduce: Optional[bool] = None,
      reduction: str = "mean",
  ) -> Tensor:
      r"""The negative log likelihood loss.
  
      See :class:`~torch.nn.NLLLoss` for details.
  
      Args:
          input: :math:`(N, C)` where `C = number of classes` or :math:`(N, C, H, W)`
              in case of 2D Loss, or :math:`(N, C, d_1, d_2, ..., d_K)` where :math:`K \geq 1`
              in the case of K-dimensional loss. `input` is expected to be log-probabilities.
          target: :math:`(N)` where each value is :math:`0 \leq \text{targets}[i] \leq C-1`,
              or :math:`(N, d_1, d_2, ..., d_K)` where :math:`K \geq 1` for
              K-dimensional loss.
          weight (Tensor, optional): a manual rescaling weight given to each
              class. If given, has to be a Tensor of size `C`
          size_average (bool, optional): Deprecated (see :attr:`reduction`). By default,
              the losses are averaged over each loss element in the batch. Note that for
              some losses, there multiple elements per sample. If the field :attr:`size_average`
              is set to ``False``, the losses are instead summed for each minibatch. Ignored
              when reduce is ``False``. Default: ``True``
          ignore_index (int, optional): Specifies a target value that is ignored
              and does not contribute to the input gradient. When :attr:`size_average` is
              ``True``, the loss is averaged over non-ignored targets. Default: -100
          reduce (bool, optional): Deprecated (see :attr:`reduction`). By default, the
              losses are averaged or summed over observations for each minibatch depending
              on :attr:`size_average`. When :attr:`reduce` is ``False``, returns a loss per
              batch element instead and ignores :attr:`size_average`. Default: ``True``
          reduction (string, optional): Specifies the reduction to apply to the output:
              ``'none'`` | ``'mean'`` | ``'sum'``. ``'none'``: no reduction will be applied,
              ``'mean'``: the sum of the output will be divided by the number of
              elements in the output, ``'sum'``: the output will be summed. Note: :attr:`size_average`
              and :attr:`reduce` are in the process of being deprecated, and in the meantime,
              specifying either of those two args will override :attr:`reduction`. Default: ``'mean'``
  
      Example::
  
          >>> # input is of size N x C = 3 x 5
          >>> input = torch.randn(3, 5, requires_grad=True)
          >>> # each element in target has to have 0 <= value < C
          >>> target = torch.tensor([1, 0, 4])
          >>> output = F.nll_loss(F.log_softmax(input), target)
          >>> output.backward()
      """
      if has_torch_function_variadic(input, target, weight):
          return handle_torch_function(
              nll_loss,
              (input, target, weight),
              input,
              target,
              weight=weight,
              size_average=size_average,
              ignore_index=ignore_index,
              reduce=reduce,
              reduction=reduction,
          )
      if size_average is not None or reduce is not None:
          reduction = _Reduction.legacy_get_string(size_average, reduce)
      return torch._C._nn.nll_loss_nd(input, target, weight, _Reduction.get_enum(reduction), ignore_index)
function_tokens: def nll_loss ( input : Tensor , target : Tensor , weight : Optional [ Tensor ] = None , size_average : Optional [ bool ] = None , ignore_index : int = - 100 , reduce : Optional [ bool ] = None , reduction : str = "mean" , ) -> Tensor : if has_torch_function_variadic ( input , target , weight ) : return handle_torch_function ( nll_loss , ( input , target , weight ) , input , target , weight = weight , size_average = size_average , ignore_index = ignore_index , reduce = reduce , reduction = reduction , ) if size_average is not None or reduce is not None : reduction = _Reduction . legacy_get_string ( size_average , reduce ) return torch . _C . _nn . nll_loss_nd ( input , target , weight , _Reduction . get_enum ( reduction ) , ignore_index )