code: def bbox2corner(bboxes: torch.Tensor) -> torch.Tensor:
      """Convert bbox coordinates from (x1, y1, x2, y2) to corners ((x1, y1),
      (x2, y1), (x1, y2), (x2, y2)).
  
      Args:
          bboxes (Tensor): Shape (n, 4) for bboxes.
      Returns:
          Tensor: Shape (n*4, 2) for corners.
      """
      x1, y1, x2, y2 = torch.split(bboxes, 1, dim=1)
      return torch.cat([x1, y1, x2, y1, x1, y2, x2, y2], dim=1).reshape(
          -1, 2
      )
  
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 13 for calling a global function with example usage: bbox2corner(bboxes) and returns: torch