class_docstr: Computer loss at one time step.
class_docstr_tok: ["Computer","loss","at","one","time","step","."]
docstr: Label Smoothing module
  args:
      size: vocab_size
      padding_idx: index for symbol `padding`
      smoothing: smoothing ratio
docstr_tok: ["Label","Smoothing","module","args",":","size",":","vocab_size","padding_idx",":","index","for","symbol","`","padding","`","smoothing",":","smoothing","ratio"]
code: def __init__(self, size, padding_idx, smoothing=0.0):
      """Label Smoothing module
      args:
          size: vocab_size
          padding_idx: index for symbol `padding`
          smoothing: smoothing ratio
      """
      super(LabelSmoothing, self).__init__()
      self.criterion = nn.KLDivLoss(reduction="sum")
      self.size = size
      self.padding_idx = padding_idx
      self.smoothing = smoothing
  
imports: import torch
  import torch.distributed
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new LabelSmoothing object from inherited base classes: nn with example: obj = LabelSmoothing(size, padding_idx, smoothing)