code: def forward_for_single_feature_map(
      self,
      locations,
      logits_pred,
      reg_pred,
      ctrness_pred,
      image_sizes,
      top_feat=None,
  ):
      N, C, H, W = logits_pred.shape
  
      # put in the same format as locations
      logits_pred = logits_pred.view(N, C, H, W).permute(0, 2, 3, 1)
      logits_pred = logits_pred.reshape(N, -1, C).sigmoid()
      box_regression = reg_pred.view(N, 4, H, W).permute(0, 2, 3, 1)
      box_regression = box_regression.reshape(N, -1, 4)
      ctrness_pred = ctrness_pred.view(N, 1, H, W).permute(0, 2, 3, 1)
      ctrness_pred = ctrness_pred.reshape(N, -1).sigmoid()
      if top_feat is not None:
          top_feat = top_feat.view(N, -1, H, W).permute(0, 2, 3, 1)
          top_feat = top_feat.reshape(N, H * W, -1)
  
      # if self.thresh_with_ctr is True, we multiply the classification
      # scores with centerness scores before applying the threshold.
      if self.thresh_with_ctr:
          logits_pred = logits_pred * ctrness_pred[:, :, None]
      candidate_inds = logits_pred > self.pre_nms_thresh
      pre_nms_top_n = candidate_inds.view(N, -1).sum(1)
      pre_nms_top_n = pre_nms_top_n.clamp(max=self.pre_nms_topk)
  
      if not self.thresh_with_ctr:
          logits_pred = logits_pred * ctrness_pred[:, :, None]
  
      results = []
      for i in range(N):
          per_box_cls = logits_pred[i]
          per_candidate_inds = candidate_inds[i]
          per_box_cls = per_box_cls[per_candidate_inds]
  
          per_candidate_nonzeros = per_candidate_inds.nonzero()
          per_box_loc = per_candidate_nonzeros[:, 0]
          per_class = per_candidate_nonzeros[:, 1]
  
          per_box_regression = box_regression[i]
          per_box_regression = per_box_regression[per_box_loc]
          per_locations = locations[per_box_loc]
          if top_feat is not None:
              per_top_feat = top_feat[i]
              per_top_feat = per_top_feat[per_box_loc]
  
          per_pre_nms_top_n = pre_nms_top_n[i]
  
          if per_candidate_inds.sum().item() > per_pre_nms_top_n.item():
              per_box_cls, top_k_indices = per_box_cls.topk(
                  per_pre_nms_top_n, sorted=False
              )
              per_class = per_class[top_k_indices]
              per_box_regression = per_box_regression[top_k_indices]
              per_locations = per_locations[top_k_indices]
              if top_feat is not None:
                  per_top_feat = per_top_feat[top_k_indices]
  
          detections = torch.stack(
              [
                  per_locations[:, 0] - per_box_regression[:, 0],
                  per_locations[:, 1] - per_box_regression[:, 1],
                  per_locations[:, 0] + per_box_regression[:, 2],
                  per_locations[:, 1] + per_box_regression[:, 3],
              ],
              dim=1,
          )
  
          boxlist = Instances(image_sizes[i])
          boxlist.pred_boxes = Boxes(detections)
          boxlist.scores = torch.sqrt(per_box_cls)
          boxlist.pred_classes = per_class
          boxlist.locations = per_locations
          if top_feat is not None:
              boxlist.top_feat = per_top_feat
          results.append(boxlist)
  
      return results
  
imports: import logging
  import math
  from typing import List, Dict
  import torch
  from torch import nn
  from torch.nn import functional
  from ...nn.shape_spec import ShapeSpec
  from ...nn.deform_conv import DeformConvWithChangeableStride
  from ...nn.group_norm import NaiveGroupNorm
  from ...data.structures import Instances, Boxes
  from ...nn.focal_loss import sigmoid_focal_loss_jit
  from ...nn.nms import ml_nms
  from ...utils.loss import IOULoss
  from ...utils.comm import get_world_size, reduce_sum, compute_locations
label_desc: Use image node_id 9 for calling the FCOSOutputs obj's underlying member method code with example usage: obj.forward_for_single_feature_map(locations, logits_pred, reg_pred, ctrness_pred, image_sizes, top_feat) and returns: results