code: def _convert_outputs_to_batch(
      outputs: List[Dict[str, torch.Tensor]],
  ) -> Dict[str, List[torch.Tensor]]:
      """Batch detection model outputs.
  
      TorchVision detection models return `List[Dict[Tensor]]`. Each `Dict` contain
      'boxes', 'labels, and 'scores'.
  
      This function batches values and returns a `Dict[str, List[Tensor]]`.
      """  # noqa: E501
      batch = collections.defaultdict(list)
      for output in outputs:
          for key, value in output.items():
              batch[key].append(value.cpu().detach())
      return batch
  
file_path: ray/python/ray/train/torch/torch_detection_predictor.py
imports: import collections
  from typing import Dict, List, Optional, Union
  import numpy
  import torch
  from ray.train._internal.dl_predictor import TensorDtype
  from ray.train.torch.torch_predictor import TorchPredictor
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 1 for calling a global function with example usage: _convert_outputs_to_batch(outputs) and returns: batch