class_docstr: Build CWD distill model.                                                                                                                               
  Args:                                                                                                                                                  
      cfg: The student config.                                                                                                                           
      slim_cfg: The teacher and distill config.                                                                                                          
class_docstr_tok: ["Build","CWD","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)
          with paddle.no_grad():
              t_body_feats = self.teacher_model.backbone(inputs)
              t_neck_feats = self.teacher_model.neck(t_body_feats)
  
          if self.arch == "RetinaNet":
              loss = self.get_loss_retinanet(
                  s_neck_feats, t_neck_feats, inputs
              )
          elif self.arch == "GFL":
              loss = self.get_loss_gfl(
                  s_neck_feats, t_neck_feats, inputs
              )
          else:
              raise ValueError(f"unsupported arch {self.arch}")
          return loss
      else:
          body_feats = self.student_model.backbone(inputs)
          neck_feats = self.student_model.neck(body_feats)
          head_outs = self.student_model.head(neck_feats)
          if self.arch == "RetinaNet":
              bbox, bbox_num = self.student_model.head.post_process(
                  head_outs, inputs["im_shape"], inputs["scale_factor"]
              )
              return {"bbox": bbox, "bbox_num": bbox_num}
          elif self.arch == "GFL":
              bbox_pred, bbox_num = head_outs
              output = {"bbox": bbox_pred, "bbox_num": bbox_num}
              return output
          else:
              raise ValueError(f"unsupported arch {self.arch}")
  
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 5 for calling the CWDDistillModel obj's underlying member method code with example usage: obj.forward(inputs) and returns: loss, dict, output