code: def forward_train(self, feats, targets, aux_pred=None):
      (
          anchors,
          anchor_points,
          num_anchors_list,
          stride_tensor,
      ) = generate_anchors_for_grid_cell(
          feats,
          self.fpn_strides,
          self.grid_cell_scale,
          self.grid_cell_offset,
      )
  
      cls_score_list, reg_distri_list = [], []
      contrast_encoder_list = []
      for i, feat in enumerate(feats):
          avg_feat = F.adaptive_avg_pool2d(feat, (1, 1))
          cls_logit = self.pred_cls[i](
              self.stem_cls[i](feat, avg_feat) + feat
          )
          reg_distri = self.pred_reg[i](
              self.stem_reg[i](feat, avg_feat)
          )
          contrast_logit = self.contrast_encoder[i](
              self.stem_cls[i](feat, avg_feat) + feat
          )
          contrast_encoder_list.append(
              contrast_logit.flatten(2).transpose([0, 2, 1])
          )
          # cls and reg
          cls_score = F.sigmoid(cls_logit)
          cls_score_list.append(
              cls_score.flatten(2).transpose([0, 2, 1])
          )
          reg_distri_list.append(
              reg_distri.flatten(2).transpose([0, 2, 1])
          )
      cls_score_list = paddle.concat(cls_score_list, axis=1)
      reg_distri_list = paddle.concat(reg_distri_list, axis=1)
      contrast_encoder_list = paddle.concat(
          contrast_encoder_list, axis=1
      )
  
      return self.get_loss(
          [
              cls_score_list,
              reg_distri_list,
              contrast_encoder_list,
              anchors,
              anchor_points,
              num_anchors_list,
              stride_tensor,
          ],
          targets,
      )
  
file_path: PaddleDetection/ppdet/modeling/heads/ppyoloe_contrast_head.py
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from ppdet.core.workspace import register
  from ..initializer import bias_init_with_prob, constant_
  from ..assigners.utils import generate_anchors_for_grid_cell
  from ppdet.modeling.heads.ppyoloe_head import PPYOLOEHead
label_desc: Use image node_id 3 for calling the PPYOLOEContrastHead obj's underlying member method code with example usage: obj.forward_train(feats, targets, aux_pred) and returns: self