code: def convert_locations_to_boxes(
      pred_locations: Tensor,
      anchor_boxes: Tensor,
      center_variance: float,
      size_variance: float,
  ) -> Tensor:
      """
          This is an inverse of convert_boxes_to_locations function (or Eq.(2) in `SSD paper <https://arxiv.org/pdf/1512.02325.pdf>`_
      Args:
          pred_locations (Tensor): predicted locations from detector
          anchor_boxes (Tensor): prior boxes in center form
          center_variance (float): variance value for centers (c_x and c_y)
          size_variance (float): variance value for size (height and width)
  
      Returns:
          predicted boxes tensor in center form
      """
  
      # priors can have one dimension less.
      if anchor_boxes.dim() + 1 == pred_locations.dim():
          anchor_boxes = anchor_boxes.unsqueeze(0)
  
      # T_w = log(g_w/d_w) / size_variance ==> g_w = exp(T_w * size_variance) * d_w
      # T_h = log(g_h/d_h) / size_variance ==> g_h = exp(T_h * size_variance) * d_h
      pred_size = (
          torch.exp(pred_locations[..., 2:] * size_variance)
          * anchor_boxes[..., 2:]
      )
      # T_cx = ((g_cx - d_cx) / d_w) / center_variance ==> g_cx = ((T_cx * center_variance) * d_w) + d_cx
      # T_cy = ((g_cy - d_cy) / d_w) / center_variance ==> g_cy = ((T_cy * center_variance) * d_h) + d_cy
      pred_center = (
          pred_locations[..., :2]
          * center_variance
          * anchor_boxes[..., 2:]
      ) + anchor_boxes[..., :2]
  
      return torch.cat((pred_center, pred_size), dim=-1)
  
imports: import torch
  from torch import Tensor
label_desc: Use image node_id 1 for calling a global function with example usage: convert_locations_to_boxes(pred_locations, anchor_boxes, center_variance, size_variance) and returns: torch