class_docstr: This class encodes and decodes a set of bounding boxes into
  the representation used for training the regressors.
  
  Args:
      weights: 4-element tuple or 6-element tuple
      boxes_xform_clip: high threshold to prevent sending too large values into torch.exp()
  
  Example:
      .. code-block:: python
  
          box_coder = BoxCoder(weights=[1., 1., 1., 1., 1., 1.])
          gt_boxes = torch.tensor([[1,2,1,4,5,6],[1,3,2,7,8,9]])
          proposals = gt_boxes + torch.rand(gt_boxes.shape)
          rel_gt_boxes = box_coder.encode_single(gt_boxes, proposals)
          gt_back = box_coder.decode_single(rel_gt_boxes, proposals)
          # We expect gt_back to be equal to gt_boxes
docstr: From a set of original reference_boxes and encoded relative box offsets,
  
  Args:
      rel_codes: encoded boxes, Nx4 or Nx6 torch tensor.
      reference_boxes: a list of reference boxes, each element is Mx4 or Mx6 torch tensor.
          The box mode is assumed to be ``StandardMode``
  
  Return:
      decoded boxes, Nx1x4 or Nx1x6 torch tensor. The box mode will be ``StandardMode``
docstr_tok: ["From","a","set","of","original","reference_boxes","and","encoded","relative","box","offsets",",","Args",":","rel_codes",":","encoded","boxes",",","Nx4","or","Nx6","torch","tensor",".","reference_boxes",":","a","list","of","reference","boxes",",","each","element","is","Mx4","or","Mx6","torch","tensor",".","The","box","mode","is","assumed","to","be","``","StandardMode","``","Return",":","decoded","boxes",",","Nx1x4","or","Nx1x6","torch","tensor",".","The","box","mode","will","be","``","StandardMode","``"]
code: def decode(
      self, rel_codes: Tensor, reference_boxes: Sequence[Tensor]
  ) -> Tensor:
      """
      From a set of original reference_boxes and encoded relative box offsets,
  
      Args:
          rel_codes: encoded boxes, Nx4 or Nx6 torch tensor.
          reference_boxes: a list of reference boxes, each element is Mx4 or Mx6 torch tensor.
              The box mode is assumed to be ``StandardMode``
  
      Return:
          decoded boxes, Nx1x4 or Nx1x6 torch tensor. The box mode will be ``StandardMode``
      """
      if not isinstance(reference_boxes, Sequence) or (
          not isinstance(rel_codes, torch.Tensor)
      ):
          raise ValueError("Input arguments wrong type.")
      boxes_per_image = [b.size(0) for b in reference_boxes]
      # concat the lists to do computation
      concat_boxes = torch.cat(tuple(reference_boxes), dim=0)
      box_sum = 0
      for val in boxes_per_image:
          box_sum += val
      if box_sum > 0:
          rel_codes = rel_codes.reshape(box_sum, -1)
      pred_boxes = self.decode_single(rel_codes, concat_boxes)
      if box_sum > 0:
          pred_boxes = pred_boxes.reshape(
              box_sum, -1, 2 * self.spatial_dims
          )
      return pred_boxes
  
file_path: MONAI/monai/apps/detection/utils/box_coder.py
imports: from __future__ import annotations
  import math
  from collections.abc import Sequence
  import torch
  from torch import Tensor
  from monai.data.box_utils import COMPUTE_DTYPE, CenterSizeMode, StandardMode, convert_box_mode, is_valid_box_values
  from monai.utils.module import look_up_option
label_desc: Use image node_id 4 for calling the BoxCoder obj's underlying member method code with example usage: obj.decode(rel_codes, reference_boxes) and returns: pred_boxes