class_docstr: Loss
class_docstr_tok: ["Loss"]
code: def _labelsmoothing(self, target):
      if target.shape[-1] != self._class_dim:
          one_hot_target = F.one_hot(target, self._class_dim)
      else:
          one_hot_target = target
      soft_target = F.label_smooth(
          one_hot_target, epsilon=self._epsilon
      )
      soft_target = paddle.reshape(
          soft_target, shape=[-1, self._class_dim]
      )
      return soft_target
  
imports: import paddle
  import paddle.nn.functional
label_desc: Use image node_id 2 for calling the Loss obj's underlying member method code with example usage: obj._labelsmoothing(target) and returns: soft_target