class_docstr: YOLO BBox coder.
  
  Following `YOLO <https://arxiv.org/abs/1506.02640>`_, this coder divide
  image into grids, and encode bbox (x1, y1, x2, y2) into (cx, cy, dw, dh).
  cx, cy in [0., 1.], denotes relative center position w.r.t the center of
  bboxes. dw, dh are the same as :obj:`DeltaXYWHBBoxCoder`.
  
  Args:
      eps (float): Min value of cx, cy when encoding.
docstr: Apply transformation `pred_bboxes` to `boxes`.
  
  Args:
      boxes (torch.Tensor or :obj:`BaseBoxes`): Basic boxes,
          e.g. anchors.
      pred_bboxes (torch.Tensor): Encoded boxes with shape
      stride (torch.Tensor | int): Strides of bboxes.
  
  Returns:
      Union[torch.Tensor, :obj:`BaseBoxes`]: Decoded boxes.
docstr_tok: ["Apply","transformation","`","pred_bboxes","`","to","`","boxes","`",".","Args",":","boxes","(","torch.Tensor","or",":","obj",":","`","BaseBoxes","`",")",":","Basic","boxes",",","e.g",".","anchors",".","pred_bboxes","(","torch.Tensor",")",":","Encoded","boxes","with","shape","stride","(","torch.Tensor","|","int",")",":","Strides","of","bboxes",".","Returns",":","Union","[","torch.Tensor",",",":","obj",":","`","BaseBoxes","`","]",":","Decoded","boxes","."]
code: def decode(
      self,
      bboxes: Union[Tensor, BaseBoxes],
      pred_bboxes: Tensor,
      stride: Union[Tensor, int],
  ) -> Union[Tensor, BaseBoxes]:
      """Apply transformation `pred_bboxes` to `boxes`.
  
      Args:
          boxes (torch.Tensor or :obj:`BaseBoxes`): Basic boxes,
              e.g. anchors.
          pred_bboxes (torch.Tensor): Encoded boxes with shape
          stride (torch.Tensor | int): Strides of bboxes.
  
      Returns:
          Union[torch.Tensor, :obj:`BaseBoxes`]: Decoded boxes.
      """
      bboxes = get_box_tensor(bboxes)
      assert pred_bboxes.size(-1) == bboxes.size(-1) == 4
      xy_centers = (bboxes[..., :2] + bboxes[..., 2:]) * 0.5 + (
          pred_bboxes[..., :2] - 0.5
      ) * stride
      whs = (
          (bboxes[..., 2:] - bboxes[..., :2])
          * 0.5
          * pred_bboxes[..., 2:].exp()
      )
      decoded_bboxes = torch.stack(
          (
              xy_centers[..., 0] - whs[..., 0],
              xy_centers[..., 1] - whs[..., 1],
              xy_centers[..., 0] + whs[..., 0],
              xy_centers[..., 1] + whs[..., 1],
          ),
          dim=-1,
      )
  
      if self.use_box_type:
          decoded_bboxes = HorizontalBoxes(decoded_bboxes)
      return decoded_bboxes
  
file_path: mmdetection/mmdet/models/task_modules/coders/yolo_bbox_coder.py
imports: from typing import Union
  import torch
  from torch import Tensor
  from mmdet.registry import TASK_UTILS
  from mmdet.structures.bbox import BaseBoxes, HorizontalBoxes, get_box_tensor
  from .base_bbox_coder import BaseBBoxCoder
label_desc: Use image node_id 3 for calling the YOLOBBoxCoder obj's underlying member method code with example usage: obj.decode(bboxes, pred_bboxes, stride) and returns: decoded_bboxes