docstr: Apply transformation `pred_bboxes` to `boxes`.
  
  Args:
      bboxes (torch.Tensor or :obj:`BaseBoxes`): Basic boxes. Shape
          (B, N, 4) or (N, 4)
      pred_bboxes (Tensor): Encoded offsets with respect to each roi.
         Has shape (B, N, num_classes * 4) or (B, N, 4) or
         (N, num_classes * 4) or (N, 4). Note N = num_anchors * W * H
         when rois is a grid of anchors.Offset encoding follows [1]_.
      max_shape (Sequence[int] or torch.Tensor or Sequence[
         Sequence[int]],optional): Maximum bounds for boxes, specifies
         (H, W, C) or (H, W). If bboxes shape is (B, N, 4), then
         the max_shape should be a Sequence[Sequence[int]]
         and the length of max_shape should also be B.
      wh_ratio_clip (float, optional): The allowed ratio between
          width and height.
  
  Returns:
      Union[torch.Tensor, :obj:`BaseBoxes`]: Decoded boxes.
docstr_tok: ["Apply","transformation","`","pred_bboxes","`","to","`","boxes","`",".","Args",":","bboxes","(","torch.Tensor","or",":","obj",":","`","BaseBoxes","`",")",":","Basic","boxes",".","Shape","(","B",",","N",",","4",")","or","(","N",",","4",")","pred_bboxes","(","Tensor",")",":","Encoded","offsets","with","respect","to","each","roi",".","Has","shape","(","B",",","N",",","num_classes","*","4",")","or","(","B",",","N",",","4",")","or","(","N",",","num_classes","*","4",")","or","(","N",",","4",")",".","Note","N","=","num_anchors","*","W","*","H","when","rois","is","a","grid","of","anchors.Offset","encoding","follows","[","1","]","_.","max_shape","(","Sequence","[","int","]","or","torch.Tensor","or","Sequence","[","Sequence","[","int","]","]",",","optional",")",":","Maximum","bounds","for","boxes",",","specifies","(","H",",","W",",","C",")","or","(","H",",","W",")",".","If","bboxes","shape","is","(","B",",","N",",","4",")",",","then","the","max_shape","should","be","a","Sequence","[","Sequence","[","int","]","]","and","the","length","of","max_shape","should","also","be","B.","wh_ratio_clip","(","float",",","optional",")",":","The","allowed","ratio","between","width","and","height",".","Returns",":","Union","[","torch.Tensor",",",":","obj",":","`","BaseBoxes","`","]",":","Decoded","boxes","."]
code: def decode(
      self, bboxes, pred_bboxes, max_shape=None, wh_ratio_clip=16 / 1000
  ):
      """Apply transformation `pred_bboxes` to `boxes`.
  
      Args:
          bboxes (torch.Tensor or :obj:`BaseBoxes`): Basic boxes. Shape
              (B, N, 4) or (N, 4)
          pred_bboxes (Tensor): Encoded offsets with respect to each roi.
             Has shape (B, N, num_classes * 4) or (B, N, 4) or
             (N, num_classes * 4) or (N, 4). Note N = num_anchors * W * H
             when rois is a grid of anchors.Offset encoding follows [1]_.
          max_shape (Sequence[int] or torch.Tensor or Sequence[
             Sequence[int]],optional): Maximum bounds for boxes, specifies
             (H, W, C) or (H, W). If bboxes shape is (B, N, 4), then
             the max_shape should be a Sequence[Sequence[int]]
             and the length of max_shape should also be B.
          wh_ratio_clip (float, optional): The allowed ratio between
              width and height.
  
      Returns:
          Union[torch.Tensor, :obj:`BaseBoxes`]: Decoded boxes.
      """
      bboxes = get_box_tensor(bboxes)
      assert pred_bboxes.size(0) == bboxes.size(0)
      if pred_bboxes.ndim == 3:
          assert pred_bboxes.size(1) == bboxes.size(1)
  
      if pred_bboxes.ndim == 2 and not torch.onnx.is_in_onnx_export():
          # single image decode
          decoded_bboxes = YXdelta2bbox(
              bboxes,
              pred_bboxes,
              self.means,
              self.stds,
              max_shape,
              wh_ratio_clip,
              self.clip_border,
              self.add_ctr_clamp,
              self.ctr_clamp,
          )
      else:
          if (
              pred_bboxes.ndim == 3
              and not torch.onnx.is_in_onnx_export()
          ):
              warnings.warn(
                  "DeprecationWarning: onnx_delta2bbox is deprecated "
                  "in the case of batch decoding and non-ONNX, "
                  "please use “delta2bbox” instead. In order to improve "
                  "the decoding speed, the batch function will no "
                  "longer be supported. "
              )
          decoded_bboxes = YXonnx_delta2bbox(
              bboxes,
              pred_bboxes,
              self.means,
              self.stds,
              max_shape,
              wh_ratio_clip,
              self.clip_border,
              self.add_ctr_clamp,
              self.ctr_clamp,
          )
  
      if self.use_box_type:
          assert decoded_bboxes.size(-1) == 4, (
              "Cannot warp decoded boxes with box type when decoded boxes"
              "have shape of (N, num_classes * 4)"
          )
          decoded_bboxes = HorizontalBoxes(decoded_bboxes)
      return decoded_bboxes
  
file_path: mmdetection/projects/EfficientDet/efficientdet/tensorflow/yxyx_bbox_coder.py
imports: import warnings
  import numpy
  import torch
  from mmdet.models.task_modules.coders.delta_xywh_bbox_coder import DeltaXYWHBBoxCoder
  from mmdet.registry import TASK_UTILS
  from mmdet.structures.bbox import HorizontalBoxes, get_box_tensor
label_desc: Use image node_id 2 for calling the YXYXDeltaXYWHBBoxCoder obj's underlying member method code with example usage: obj.decode(bboxes, pred_bboxes, max_shape, wh_ratio_clip) and returns: decoded_bboxes