code: def __init__(
      self,
      task,
      sentence_avg,
      label_smoothing,
      ignore_prefix_size=0,
      # report_accuracy=False,
  ):
      super().__init__(task)
      self.sentence_avg = sentence_avg
      self.eps = label_smoothing
      self.ignore_prefix_size = ignore_prefix_size
      # self.report_accuracy = report_accuracy
      config = LSCrossEntropyLayer.get_config(
          max_batch_tokens=task.args.max_tokens,
          padding_idx=self.padding_idx,
          epsilon=label_smoothing,
          fp16=task.args.fp16,
          local_rank=task.args.device_id,
      )
      self.ls_cross_entropy = LSCrossEntropyLayer(config)
  
file_path: lightseq/lightseq/training/cli/fs_modules/ls_label_smoothed_cross_entropy.py
imports: import math
  from dataclasses import dataclass, field
  import torch
  from fairseq import metrics, utils
  from fairseq.criterions import FairseqCriterion, register_criterion
  from fairseq.dataclass import FairseqDataclass
  from omegaconf import II
  from lightseq.training.ops.pytorch.cross_entropy_layer import LSCrossEntropyLayer
label_desc: Use image node_id 1 to create a new LSLabelSmoothedCrossEntropyCriterion object from inherited base classes: FairseqCriterion with example: obj = LSLabelSmoothedCrossEntropyCriterion(task, sentence_avg, label_smoothing, ignore_prefix_size)