code: def _xyxy_to_cxcywh(
      xyxy: torch.Tensor, inplace: bool
  ) -> torch.Tensor:
      if not inplace:
          xyxy = xyxy.clone()
  
      # (x2 - x1) = width, same for height
      xyxy[..., 2:].sub_(xyxy[..., :2])
      # (x1 * 2 + width) / 2 = x1 + width / 2 = x1 + (x2-x1)/2 = (x1 + x2)/2 = cx, same for cy
      xyxy[..., :2].mul_(2).add_(xyxy[..., 2:]).div_(
          2, rounding_mode=None if xyxy.is_floating_point() else "floor"
      )
  
      return xyxy
  
imports: from typing import List, Optional, Tuple
  import PIL.Image
  import torch
  from torchvision import tv_tensors
  from torchvision.transforms import _functional_pil
  from torchvision.tv_tensors import BoundingBoxFormat
  from torchvision.utils import _log_api_usage_once
  from ._utils import _get_kernel, _register_kernel_internal, is_pure_tensor
label_desc: Use image node_id 18 for calling a global function with example usage: _xyxy_to_cxcywh(xyxy, inplace) and returns: xyxy