class_docstr: The linear box-to-box transform defined in FCOS. The transformation is parameterized
  by the distance from the center of (square) src box to 4 edges of the target box.
class_docstr_tok: ["The","linear","box-to-box","transform","defined","in","FCOS",".","The","transformation","is","parameterized","by","the","distance","from","the","center","of","(","square",")","src","box","to","4","edges","of","the","target","box","."]
docstr: From a set of original boxes and encoded relative box offsets,
  get the decoded boxes.
  
  Args:
      rel_codes (Tensor): encoded boxes
      boxes (Tensor): reference boxes.
  
  Returns:
      Tensor: the predicted boxes with the encoded relative box offsets.
  
  .. note::
      This method assumes that ``rel_codes`` and ``boxes`` have same size for 0th dimension. i.e. ``len(rel_codes) == len(boxes)``.
docstr_tok: ["From","a","set","of","original","boxes","and","encoded","relative","box","offsets",",","get","the","decoded","boxes",".","Args",":","rel_codes","(","Tensor",")",":","encoded","boxes","boxes","(","Tensor",")",":","reference","boxes",".","Returns",":","Tensor",":","the","predicted","boxes","with","the","encoded","relative","box","offsets",".","..","note",":",":","This","method","assumes","that","``","rel_codes","``","and","``","boxes","``","have","same","size","for","0th","dimension",".","i.e",".","``","len","(","rel_codes",")","==","len","(","boxes",")","``","."]
code: def decode(self, rel_codes: Tensor, boxes: Tensor) -> Tensor:
      """
      From a set of original boxes and encoded relative box offsets,
      get the decoded boxes.
  
      Args:
          rel_codes (Tensor): encoded boxes
          boxes (Tensor): reference boxes.
  
      Returns:
          Tensor: the predicted boxes with the encoded relative box offsets.
  
      .. note::
          This method assumes that ``rel_codes`` and ``boxes`` have same size for 0th dimension. i.e. ``len(rel_codes) == len(boxes)``.
  
      """
  
      boxes = boxes.to(dtype=rel_codes.dtype)
  
      ctr_x = 0.5 * (boxes[..., 0] + boxes[..., 2])
      ctr_y = 0.5 * (boxes[..., 1] + boxes[..., 3])
  
      if self.normalize_by_size:
          boxes_w = boxes[..., 2] - boxes[..., 0]
          boxes_h = boxes[..., 3] - boxes[..., 1]
  
          list_box_size = torch.stack(
              (boxes_w, boxes_h, boxes_w, boxes_h), dim=-1
          )
          rel_codes = rel_codes * list_box_size
  
      pred_boxes1 = ctr_x - rel_codes[..., 0]
      pred_boxes2 = ctr_y - rel_codes[..., 1]
      pred_boxes3 = ctr_x + rel_codes[..., 2]
      pred_boxes4 = ctr_y + rel_codes[..., 3]
  
      pred_boxes = torch.stack(
          (pred_boxes1, pred_boxes2, pred_boxes3, pred_boxes4), dim=-1
      )
      return pred_boxes
  
imports: import math
  from collections import OrderedDict
  from typing import Dict, List, Optional, Tuple
  import torch
  from torch import nn, Tensor
  from torch.nn import functional
  from torchvision.ops import complete_box_iou_loss, distance_box_iou_loss, FrozenBatchNorm2d, generalized_box_iou_loss
label_desc: Use image node_id 3 for calling the BoxLinearCoder obj's underlying member method code with example usage: obj.decode(rel_codes, boxes) and returns: pred_boxes