code: def compute_ctrness_targets(reg_targets):
      if len(reg_targets) == 0:
          return reg_targets.new_zeros(len(reg_targets))
      left_right = reg_targets[:, [0, 2]]
      top_bottom = reg_targets[:, [1, 3]]
      ctrness = (
          left_right.min(dim=-1)[0] / left_right.max(dim=-1)[0]
      ) * (top_bottom.min(dim=-1)[0] / top_bottom.max(dim=-1)[0])
      return torch.sqrt(ctrness)
  
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 2 for calling a global function with example usage: compute_ctrness_targets(reg_targets) and returns: torch, reg_targets