code: def _get_ground_truth(self, locations, gt_instances):
      num_loc_list = [len(loc) for loc in locations]
  
      # compute locations to size ranges
      loc_to_size_range = []
      for l, loc_per_level in enumerate(locations):
          loc_to_size_range_per_level = loc_per_level.new_tensor(
              self.sizes_of_interest[l]
          )
          loc_to_size_range.append(
              loc_to_size_range_per_level[None].expand(
                  num_loc_list[l], -1
              )
          )
  
      loc_to_size_range = torch.cat(loc_to_size_range, dim=0)
      locations = torch.cat(locations, dim=0)
  
      training_targets = self.compute_targets_for_locations(
          locations, gt_instances, loc_to_size_range, num_loc_list
      )
  
      training_targets["locations"] = [
          locations.clone() for _ in range(len(gt_instances))
      ]
      training_targets["im_inds"] = [
          locations.new_ones(locations.size(0), dtype=torch.long) * i
          for i in range(len(gt_instances))
      ]
  
      # transpose im first training_targets to level first ones
      training_targets = {
          k: self._transpose(v, num_loc_list)
          for k, v in training_targets.items()
      }
  
      training_targets["fpn_levels"] = [
          loc.new_ones(len(loc), dtype=torch.long) * level
          for level, loc in enumerate(training_targets["locations"])
      ]
  
      # we normalize reg_targets by FPN's strides here
      reg_targets = training_targets["reg_targets"]
      for l in range(len(reg_targets)):
          reg_targets[l] = reg_targets[l] / float(self.strides[l])
  
      return training_targets
  
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 3 for calling the FCOSOutputs obj's underlying member method code with example usage: obj._get_ground_truth(locations, gt_instances) and returns: training_targets