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: Encode proposals with respect to ground truth (gt) boxes.
  
  Args:
      gt_boxes: gt boxes, Nx4 or Nx6 torch tensor. The box mode is assumed to be ``StandardMode``
      proposals: boxes to be encoded, Nx4 or Nx6 torch tensor. The box mode is assumed to be ``StandardMode``
  
  Return:
      encoded gt, target of box regression that is used to convert proposals into gt_boxes, Nx4 or Nx6 torch tensor.
docstr_tok: ["Encode","proposals","with","respect","to","ground","truth","(","gt",")","boxes",".","Args",":","gt_boxes",":","gt","boxes",",","Nx4","or","Nx6","torch","tensor",".","The","box","mode","is","assumed","to","be","``","StandardMode","``","proposals",":","boxes","to","be","encoded",",","Nx4","or","Nx6","torch","tensor",".","The","box","mode","is","assumed","to","be","``","StandardMode","``","Return",":","encoded","gt",",","target","of","box","regression","that","is","used","to","convert","proposals","into","gt_boxes",",","Nx4","or","Nx6","torch","tensor","."]
code: def encode_single(
      self, gt_boxes: Tensor, proposals: Tensor
  ) -> Tensor:
      """
      Encode proposals with respect to ground truth (gt) boxes.
  
      Args:
          gt_boxes: gt boxes, Nx4 or Nx6 torch tensor. The box mode is assumed to be ``StandardMode``
          proposals: boxes to be encoded, Nx4 or Nx6 torch tensor. The box mode is assumed to be ``StandardMode``
  
      Return:
          encoded gt, target of box regression that is used to convert proposals into gt_boxes, Nx4 or Nx6 torch tensor.
      """
      dtype = gt_boxes.dtype
      device = gt_boxes.device
      weights = torch.as_tensor(
          self.weights, dtype=dtype, device=device
      )
      targets = encode_boxes(gt_boxes, proposals, weights)
      return targets
  
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 3 for calling the BoxCoder obj's underlying member method code with example usage: obj.encode_single(gt_boxes, proposals) and returns: targets