def forward(self, body_feats=None, rois=None, rois_num=None, inputs=None, cot=False):
        """
        body_feats (list[Tensor]): Feature maps from backbone
        rois (list[Tensor]): RoIs generated from RPN module
        rois_num (Tensor): The number of RoIs in each image
        inputs (dict{Tensor}): The ground-truth of image
        """
        if self.training:
            rois, rois_num, targets = self.bbox_assigner(rois, rois_num, inputs)
            self.assigned_rois = (rois, rois_num)
            self.assigned_targets = targets

        rois_feat = self.roi_extractor(body_feats, rois, rois_num)
        bbox_feat = self.head(rois_feat)
        if self.with_pool:
            feat = F.adaptive_avg_pool2d(bbox_feat, output_size=1)
            feat = paddle.squeeze(feat, axis=[2, 3])
        else:
            feat = bbox_feat
        if self.use_cot:
            scores = self.cot_bbox_score(feat)
            cot_scores = self.bbox_score(feat)
        else:
            scores = self.bbox_score(feat)
        deltas = self.bbox_delta(feat)

        if self.training:
            loss = self.get_loss(
                scores,
                deltas,
                targets,
                rois,
                self.bbox_weight,
                loss_normalize_pos=self.loss_normalize_pos)
            loss['loss_bbox_cls'] *= self.cls_loss_weight

            if self.cot_relation is not None:
                loss_cot = self.loss_cot(cot_scores, targets, self.cot_relation)
                loss.update(loss_cot)
                
            target_labels, target_bboxs, _ = targets
            # get pos_coords
            ori_proposals, ori_labels, ori_bbox_targets, ori_bbox_feats = [], [], [], []
            roi_start_idx = 0
            for i in range(len(rois)):
                ori_proposal = rois[i].unsqueeze(0)
                ori_label = target_labels[i].unsqueeze(0)
                ori_bbox_target = target_bboxs[i].unsqueeze(0)
                ori_bbox_feat = rois_feat[roi_start_idx:roi_start_idx+rois_num[i]].mean(-1).mean(-1)
                ori_bbox_feat = ori_bbox_feat.unsqueeze(0)

                ori_proposals.append(ori_proposal) 
                ori_labels.append(ori_label)
                ori_bbox_targets.append(ori_bbox_target)
                ori_bbox_feats.append(ori_bbox_feat)

                roi_start_idx += rois_num[i]
                
            ori_coords = paddle.concat(ori_proposals, axis=0)
            ori_labels = paddle.concat(ori_labels, axis=0)
            ori_bbox_targets = paddle.concat(ori_bbox_targets, axis=0)
            ori_bbox_feats = paddle.concat(ori_bbox_feats, axis=0)
            pos_coords = (ori_coords, ori_labels, ori_bbox_targets, ori_bbox_feats, 'rcnn')
            loss.update(pos_coords=pos_coords)
            return loss, bbox_feat
        else:
            if cot:
                pred = self.get_prediction(cot_scores, deltas)
            else:
                pred = self.get_prediction(scores, deltas)
            return pred, self.head

        body_feats (list[Tensor]): Feature maps from backbone
        rois (list[Tensor]): RoIs generated from RPN module
        rois_num (Tensor): The number of RoIs in each image
        inputs (dict{Tensor}): The ground-truth of image
        
ppdet/modeling/heads/co_roi_head.py