code: def cross_entropy_loss(
      g: jit_utils.GraphContext,
      self,
      target,
      weight,
      reduction,
      ignore_index,
      label_smoothing,
  ):
      # none reduction : onnx::Constant[value={0}]
      # mean reduction : onnx::Constant[value={1}]
      # sum reduction : onnx::Constant[value={2}]
      reduction = symbolic_helper._maybe_get_const(reduction, "i")
      reduction_vals = ["none", "mean", "sum"]
      reduction = reduction_vals[reduction]
  
      label_smoothing = symbolic_helper._maybe_get_const(
          label_smoothing, "f"
      )
      if label_smoothing is not None and label_smoothing > 0.0:
          raise errors.SymbolicValueError(
              "Unsupported: ONNX does not support label_smoothing", self
          )
  
      # in onnx SoftmaxCrossEntropyLoss specification, ignore_index is optional without default value.
      # therefore we need to set ignore_index attribute even if it is not specified (e.g. ignore_index=-100).
      ignore_index = symbolic_helper._maybe_get_const(ignore_index, "i")
      if weight.node().mustBeNone():
          celoss = g.op(
              "SoftmaxCrossEntropyLoss",
              self,
              target,
              reduction_s=reduction,
              ignore_index_i=ignore_index,
          )
      else:
          celoss = g.op(
              "SoftmaxCrossEntropyLoss",
              self,
              target,
              weight,
              reduction_s=reduction,
              ignore_index_i=ignore_index,
          )
  
      return celoss
  
imports: from __future__ import annotations
  import functools
  import sys
  from typing import Optional, Tuple
  import torch
  from torch._C import _onnx
  from torch.onnx import _type_utils, errors, symbolic_helper, symbolic_opset9, utils
  from torch.onnx._internal import _beartype, jit_utils, registration
label_desc: Use image node_id 10 for calling a global function with example usage: cross_entropy_loss(g, target, weight, reduction, ignore_index, label_smoothing) and returns: celoss