class_docstr: Accumulates annotations by batches that correspond to objects detected on
  individual images. Can pack them together into single tensors.
docstr: Pack data into tensors
code: def pack(self) -> Optional[PackedCseAnnotations]:
      """
      Pack data into tensors
      """
      if not len(self.x_gt):
          # TODO:
          # returning proper empty annotations would require
          # creating empty tensors of appropriate shape and
          # type on an appropriate device;
          # we return None so far to indicate empty annotations
          return None
      return PackedCseAnnotations(
          x_gt=torch.cat(self.x_gt, 0),
          y_gt=torch.cat(self.y_gt, 0),
          vertex_mesh_ids_gt=torch.cat(self.vertex_mesh_ids_gt, 0),
          vertex_ids_gt=torch.cat(self.vertex_ids_gt, 0),
          # ignore segmentation annotations, if not all the instances contain those
          coarse_segm_gt=torch.cat(self.s_gt, 0)
          if len(self.s_gt) == len(self.bbox_xywh_gt)
          else None,
          bbox_xywh_gt=torch.cat(self.bbox_xywh_gt, 0),
          bbox_xywh_est=torch.cat(self.bbox_xywh_est, 0),
          point_bbox_with_dp_indices=torch.cat(
              self.point_bbox_with_dp_indices, 0
          ),
          point_bbox_indices=torch.cat(self.point_bbox_indices, 0),
          bbox_indices=torch.as_tensor(
              self.bbox_indices,
              dtype=torch.long,
              device=self.x_gt[0].device,
          ),
      )
  
file_path: detectron2/projects/DensePose/densepose/modeling/losses/embed_utils.py
imports: from dataclasses import dataclass
  from typing import Any, Optional
  import torch
  from detectron2.structures import BoxMode, Instances
  from .utils import AnnotationsAccumulator
label_desc: Use image node_id 4 for calling the CseAnnotationsAccumulator obj's underlying member method code with example usage: obj.pack() and returns: PackedCseAnnotations, None