docstr: Arguments:
      input: (batch, vocab_size)
      target: (batch,)
  Returns:
      losses: (batch,) if reduction is 'none', else (1,), dtype float
docstr_tok: ["Arguments",":","input",":","(","batch",",","vocab_size",")","target",":","(","batch",",",")","Returns",":","losses",":","(","batch",",",")","if","reduction","is","'none","'",",","else","(","1",",",")",",","dtype","float"]
code: def forward(self, input, target):
      """
      Arguments:
          input: (batch, vocab_size)
          target: (batch,)
      Returns:
          losses: (batch,) if reduction is 'none', else (1,), dtype float
      """
      assert (
          input.is_cuda and target.is_cuda
      ), "Only support CUDA tensors"
      loss = cross_entropy_loss(
          input,
          target,
          label_smoothing=self.label_smoothing,
          logit_scale=self.logit_scale,
          lse_square_scale=self.lse_square_scale,
          ignored_index=self.ignore_index,
          inplace_backward=self.inplace_backward,
          process_group=self.process_group,
      )
      if self.reduction == "mean":
          return loss.sum() / (target != self.ignore_index).sum()
      elif self.reduction == "sum":
          return loss.sum()
      else:
          return loss
  
imports: import torch
  import torch.nn
  from flash_attn.ops.triton.cross_entropy import cross_entropy_loss
label_desc: Use image node_id 2 for calling the CrossEntropyLoss obj's underlying member method code with example usage: obj.forward(input, target) and returns: unknown, loss, loss