code: def samplelist_boxtype2tensor(
      batch_data_samples: SampleList,
  ) -> SampleList:
      for data_samples in batch_data_samples:
          if "gt_instances" in data_samples:
              bboxes = data_samples.gt_instances.get("bboxes", None)
              if isinstance(bboxes, BaseBoxes):
                  data_samples.gt_instances.bboxes = bboxes.tensor
          if "pred_instances" in data_samples:
              bboxes = data_samples.pred_instances.get("bboxes", None)
              if isinstance(bboxes, BaseBoxes):
                  data_samples.pred_instances.bboxes = bboxes.tensor
          if "ignored_instances" in data_samples:
              bboxes = data_samples.ignored_instances.get(
                  "bboxes", None
              )
              if isinstance(bboxes, BaseBoxes):
                  data_samples.ignored_instances.bboxes = bboxes.tensor
  
imports: from functools import partial
  from typing import List, Optional, Sequence, Tuple, Union
  import numpy
  import torch
  from mmengine.structures import InstanceData
  from mmengine.utils import digit_version
  from six.moves import map, zip
  from torch import Tensor
  from torch.autograd import Function
  from torch.nn import functional
  from mmdet.structures import SampleList
  from mmdet.structures.bbox import BaseBoxes, get_box_type, stack_boxes
  from mmdet.structures.mask import BitmapMasks, PolygonMasks
  from mmdet.utils import OptInstanceList
label_desc: Use image node_id 14 for calling a global function with example usage: samplelist_boxtype2tensor(batch_data_samples) without return types