class_docstr: FCOSHead
  Args:
      num_classes (int): Number of classes
      fcos_feat (object): Instance of 'FCOSFeat'
      fpn_stride (list): The stride of each FPN Layer
      prior_prob (float): Used to set the bias init for the class prediction layer
      norm_reg_targets (bool): Normalization the regression target if true
      centerness_on_reg (bool): The prediction of centerness on regression or clssification branch
      num_shift (float): Relative offset between the center of the first shift and the top-left corner of img
      fcos_loss (object): Instance of 'FCOSLoss'
      nms (object): Instance of 'MultiClassNMS'
      trt (bool): Whether to use trt in nms of deploy
docstr: Compute locations of anchor points of each FPN layer
  Args:
      fpn_stride (int): The stride of current FPN feature map
      feature (Tensor): Tensor of current FPN feature map
  Return:
      Anchor points locations of current FPN feature map
docstr_tok: ["Compute","locations","of","anchor","points","of","each","FPN","layer","Args",":","fpn_stride","(","int",")",":","The","stride","of","current","FPN","feature","map","feature","(","Tensor",")",":","Tensor","of","current","FPN","feature","map","Return",":","Anchor","points","locations","of","current","FPN","feature","map"]
code: def _compute_locations_by_level(
      self, fpn_stride, feature, num_shift=0.5
  ):
      """
      Compute locations of anchor points of each FPN layer
      Args:
          fpn_stride (int): The stride of current FPN feature map
          feature (Tensor): Tensor of current FPN feature map
      Return:
          Anchor points locations of current FPN feature map
      """
      h, w = feature.shape[2], feature.shape[3]
      shift_x = paddle.arange(0, w * fpn_stride, fpn_stride)
      shift_y = paddle.arange(0, h * fpn_stride, fpn_stride)
      shift_x = paddle.unsqueeze(shift_x, axis=0)
      shift_y = paddle.unsqueeze(shift_y, axis=1)
      shift_x = paddle.expand(shift_x, shape=[h, w])
      shift_y = paddle.expand(shift_y, shape=[h, w])
  
      shift_x = paddle.reshape(shift_x, shape=[-1])
      shift_y = paddle.reshape(shift_y, shape=[-1])
      location = paddle.stack([shift_x, shift_y], axis=-1) + float(
          fpn_stride * num_shift
      )
      return location
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle import ParamAttr
  from paddle.nn.initializer import Normal, Constant
  from ppdet.core.workspace import register
  from ppdet.modeling.layers import ConvNormLayer, MultiClassNMS
label_desc: Use image node_id 2 for calling the FCOSHead obj's underlying member method code with example usage: obj._compute_locations_by_level(fpn_stride, feature, num_shift) and returns: location