class_docstr: Build FGD distill model.
  Args:
      cfg: The student config.
      slim_cfg: The teacher and distill config.
class_docstr_tok: ["Build","FGD","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)
  
          loss_dict = {}
          for idx, k in enumerate(self.distill_loss):
              loss_dict[k] = self.distill_loss[k](
                  s_neck_feats[idx], t_neck_feats[idx], inputs
              )
          if self.arch == "RetinaNet":
              loss = self.student_model.head(s_neck_feats, inputs)
          elif self.arch == "PicoDet":
              head_outs = self.student_model.head(
                  s_neck_feats, self.student_model.export_post_process
              )
              loss_gfl = self.student_model.head.get_loss(
                  head_outs, inputs
              )
              total_loss = paddle.add_n(list(loss_gfl.values()))
              loss = {}
              loss.update(loss_gfl)
              loss.update({"loss": total_loss})
          else:
              raise ValueError(f"Unsupported model {self.arch}")
  
          for k in loss_dict:
              loss["loss"] += loss_dict[k]
              loss[k] = loss_dict[k]
          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 == "PicoDet":
              head_outs = self.student_model.head(
                  neck_feats, self.student_model.export_post_process
              )
              scale_factor = inputs["scale_factor"]
              bboxes, bbox_num = self.student_model.head.post_process(
                  head_outs,
                  scale_factor,
                  export_nms=self.student_model.export_nms,
              )
              return {"bbox": bboxes, "bbox_num": bbox_num}
          else:
              raise ValueError(f"Unsupported model {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 3 for calling the FGDDistillModel obj's underlying member method code with example usage: obj.forward(inputs) and returns: loss, dict, dict