code: def bbox_xyxy_to_cxcywh(bbox: Tensor) -> Tensor:
      """Convert bbox coordinates from (x1, y1, x2, y2) to (cx, cy, w, h).
  
      Args:
          bbox (Tensor): Shape (n, 4) for bboxes.
  
      Returns:
          Tensor: Converted bboxes.
      """
      x1, y1, x2, y2 = bbox.split((1, 1, 1, 1), dim=-1)
      bbox_new = [(x1 + x2) / 2, (y1 + y2) / 2, (x2 - x1), (y2 - y1)]
      return torch.cat(bbox_new, dim=-1)
  
imports: from typing import List, Optional, Sequence, Tuple, Union
  import numpy
  import torch
  from torch import Tensor
  from mmdet.structures.bbox import BaseBoxes
label_desc: Use image node_id 12 for calling a global function with example usage: bbox_xyxy_to_cxcywh(bbox) and returns: torch