class_docstr: KLDivLoss
code: def forward(self, logits_student, logits_teacher, target, mask=None):
      gt_mask = F.one_hot(
          target.reshape([-1]), num_classes=logits_student.shape[-1]
      )
      other_mask = 1 - gt_mask
      logits_student = logits_student.flatten(0, 1)
      logits_teacher = logits_teacher.flatten(0, 1)
      pred_student = F.softmax(
          logits_student / self.temperature, axis=1
      )
      pred_teacher = F.softmax(
          logits_teacher / self.temperature, axis=1
      )
      pred_student = self._cat_mask(pred_student, gt_mask, other_mask)
      pred_teacher = self._cat_mask(pred_teacher, gt_mask, other_mask)
      log_pred_student = paddle.log(pred_student)
      tckd_loss = self._kl_div(log_pred_student, pred_teacher) * (
          self.temperature**2
      )
      pred_teacher_part2 = F.softmax(
          logits_teacher / self.temperature - 1000.0 * gt_mask, axis=1
      )
      log_pred_student_part2 = F.log_softmax(
          logits_student / self.temperature - 1000.0 * gt_mask, axis=1
      )
      nckd_loss = self._kl_div(
          log_pred_student_part2, pred_teacher_part2
      ) * (self.temperature**2)
  
      loss = self.alpha * tckd_loss + self.beta * nckd_loss
  
      return loss
  
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 4 for calling the DKDLoss obj's underlying member method code with example usage: obj.forward(logits_student, logits_teacher, target, mask) and returns: loss