class_docstr: Build LD distill model.
  Args:
      cfg: The student config.
      slim_cfg: The teacher and distill config.
class_docstr_tok: ["Build","LD","distill","model",".","Args",":","cfg",":","The","student","config",".","slim_cfg",":","The","teacher","and","distill","config","."]
code: def forward(self, inputs):
      if self.training:
          s_body_feats = self.student_model.backbone(inputs)
          s_neck_feats = self.student_model.neck(s_body_feats)
          s_head_outs = self.student_model.head(s_neck_feats)
          with paddle.no_grad():
              t_body_feats = self.teacher_model.backbone(inputs)
              t_neck_feats = self.teacher_model.neck(t_body_feats)
              t_head_outs = self.teacher_model.head(t_neck_feats)
  
          soft_label_list = t_head_outs[0]
          soft_targets_list = t_head_outs[1]
          student_loss = self.student_model.head.get_loss(
              s_head_outs, inputs, soft_label_list, soft_targets_list
          )
          total_loss = paddle.add_n(list(student_loss.values()))
          student_loss["loss"] = total_loss
          return student_loss
      else:
          return self.student_model(inputs)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  import paddle.nn
  from ppdet.core.workspace import register, create, load_config
  from ppdet.utils.checkpoint import load_pretrain_weight
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 2 for calling the LDDistillModel obj's underlying member method code with example usage: obj.forward(inputs) and returns: student_loss, self