docstr: Forward features of a single scale level.
  
  Args:
      x (Tensor): FPN feature maps of the specified stride.
      scale (:obj: `mmcv.cnn.Scale`): Learnable scale module to resize
          the bbox prediction.
      stride (int): The corresponding stride for feature maps, only
          used to normalize the bbox prediction when self.norm_on_bbox
          is True.
  
  Returns:
      tuple: scores for each class, bbox predictions and centerness                 predictions of input feature maps. If ``with_bezier`` is True,
          Bezier prediction will also be returned.
docstr_tok: ["Forward","features","of","a","single","scale","level",".","Args",":","x","(","Tensor",")",":","FPN","feature","maps","of","the","specified","stride",".","scale","(",":","obj",":","`","mmcv.cnn.Scale","`",")",":","Learnable","scale","module","to","resize","the","bbox","prediction",".","stride","(","int",")",":","The","corresponding","stride","for","feature","maps",",","only","used","to","normalize","the","bbox","prediction","when","self.norm_on_bbox","is","True",".","Returns",":","tuple",":","scores","for","each","class",",","bbox","predictions","and","centerness","predictions","of","input","feature","maps",".","If","``","with_bezier","``","is","True",",","Bezier","prediction","will","also","be","returned","."]
code: def forward_single(self, x, scale, stride):
      """Forward features of a single scale level.
  
          Args:
              x (Tensor): FPN feature maps of the specified stride.
              scale (:obj: `mmcv.cnn.Scale`): Learnable scale module to resize
                  the bbox prediction.
              stride (int): The corresponding stride for feature maps, only
                  used to normalize the bbox prediction when self.norm_on_bbox
                  is True.
  
          Returns:
              tuple: scores for each class, bbox predictions and centerness \
                  predictions of input feature maps. If ``with_bezier`` is True,
                  Bezier prediction will also be returned.
          """
      cls_feat = x
      reg_feat = x
  
      for cls_layer in self.cls_convs:
          cls_feat = cls_layer(cls_feat)
      cls_score = self.conv_cls(cls_feat)
  
      for reg_layer in self.reg_convs:
          reg_feat = reg_layer(reg_feat)
      bbox_pred = self.conv_reg(reg_feat)
      if self.with_bezier:
          bezier_pred = self.conv_bezier(reg_feat)
  
      if self.centerness_on_reg:
          centerness = self.conv_centerness(reg_feat)
      else:
          centerness = self.conv_centerness(cls_feat)
      # scale the bbox_pred of different level
      # float to avoid overflow when enabling FP16
      if self.use_scale:
          bbox_pred = scale(bbox_pred).float()
      else:
          bbox_pred = bbox_pred.float()
      if self.norm_on_bbox:
          # bbox_pred needed for gradient computation has been modified
          # by F.relu(bbox_pred) when run with PyTorch 1.10. So replace
          # F.relu(bbox_pred) with bbox_pred.clamp(min=0)
          bbox_pred = bbox_pred.clamp(min=0)
      else:
          bbox_pred = bbox_pred.exp()
  
      if self.with_bezier:
          return cls_score, bbox_pred, centerness, bezier_pred
      else:
          return cls_score, bbox_pred, centerness
  
file_path: mmocr/projects/ABCNet/abcnet/model/abcnet_det_head.py
imports: import torch.nn
  from mmcv.cnn import ConvModule, Scale
  from mmdet.models.utils import multi_apply
  from mmocr.models.textdet.heads.base import BaseTextDetHead
  from mmocr.registry import MODELS
label_desc: Use image node_id 7 for calling the ABCNetDetHead obj's underlying member method code with example usage: obj.forward_single(x, scale, stride) and returns: cls_score,  bbox_pred,  centerness,  bezier_pred, cls_score,  bbox_pred,  centerness