class_docstr: DistanceLoss:
      mode: loss mode
code: def __init__(self, mode="l2", **kargs):
      super().__init__()
      assert mode in ["l1", "l2", "smooth_l1"]
      if mode == "l1":
          self.loss_func = nn.L1Loss(**kargs)
      elif mode == "l2":
          self.loss_func = nn.MSELoss(**kargs)
      elif mode == "smooth_l1":
          self.loss_func = nn.SmoothL1Loss(**kargs)
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn import L1Loss
  from paddle.nn import MSELoss
  from paddle.nn import SmoothL1Loss
label_desc: Use image node_id 1 to create a new DistanceLoss object from inherited base classes: nn with example: obj = DistanceLoss(mode)