class_docstr: Base postprocessor for text detection models.
  
  Args:
      text_repr_type (str): The boundary encoding type, 'poly' or 'quad'.
          Defaults to 'poly'.
      rescale_fields (list[str], optional): The bbox/polygon field names to
          be rescaled. If None, no rescaling will be performed.
      train_cfg (dict, optional): The parameters to be passed to
          ``self.get_text_instances`` in training. Defaults to None.
      test_cfg (dict, optional): The parameters to be passed to
          ``self.get_text_instances`` in testing. Defaults to None.
class_docstr_tok: ["Base","postprocessor","for","text","detection","models",".","Args",":","text_repr_type","(","str",")",":","The","boundary","encoding","type",",","'poly","'","or","'quad","'",".","Defaults","to","'poly","'",".","rescale_fields","(","list","[","str","]",",","optional",")",":","The","bbox\/polygon","field","names","to","be","rescaled",".","If","None",",","no","rescaling","will","be","performed",".","train_cfg","(","dict",",","optional",")",":","The","parameters","to","be","passed","to","``","self.get_text_instances","``","in","training",".","Defaults","to","None",".","test_cfg","(","dict",",","optional",")",":","The","parameters","to","be","passed","to","``","self.get_text_instances","``","in","testing",".","Defaults","to","None","."]
docstr: Split batched tensor(s) along the first dimension pack split tensors
  into a list.
  
  Args:
      pred_results (tensor or list[tensor]): Raw result tensor(s) from
          detection head. Each tensor usually has the shape of (N, ...)
  
  Returns:
      list[tensor] or list[list[tensor]]: N tensors if ``pred_results``
          is a tensor, or a list of N lists of tensors if
          ``pred_results`` is a list of tensors.
docstr_tok: ["Split","batched","tensor","(","s",")","along","the","first","dimension","pack","split","tensors","into","a","list",".","Args",":","pred_results","(","tensor","or","list","[","tensor","]",")",":","Raw","result","tensor","(","s",")","from","detection","head",".","Each","tensor","usually","has","the","shape","of","(","N",",","...",")","Returns",":","list","[","tensor","]","or","list","[","list","[","tensor","]","]",":","N","tensors","if","``","pred_results","``","is","a","tensor",",","or","a","list","of","N","lists","of","tensors","if","``","pred_results","``","is","a","list","of","tensors","."]
code: def split_results(
      self, pred_results: Union[Tensor, List[Tensor]]
  ) -> Union[List[Tensor], List[List[Tensor]]]:
      """Split batched tensor(s) along the first dimension pack split tensors
      into a list.
  
      Args:
          pred_results (tensor or list[tensor]): Raw result tensor(s) from
              detection head. Each tensor usually has the shape of (N, ...)
  
      Returns:
          list[tensor] or list[list[tensor]]: N tensors if ``pred_results``
              is a tensor, or a list of N lists of tensors if
              ``pred_results`` is a list of tensors.
      """
      assert isinstance(pred_results, Tensor) or mmengine.is_seq_of(
          pred_results, Tensor
      )
  
      if mmengine.is_seq_of(pred_results, Tensor):
          for i in range(1, len(pred_results)):
              assert (
                  pred_results[0].shape[0] == pred_results[i].shape[0]
              ), "The first dimension of all tensors should be the same"
  
      batch_num = (
          len(pred_results)
          if isinstance(pred_results, Tensor)
          else len(pred_results[0])
      )
      results = []
      for i in range(batch_num):
          if isinstance(pred_results, Tensor):
              results.append(pred_results[i])
          else:
              results.append([])
              for tensor in pred_results:
                  results[i].append(tensor[i])
      return results
  
file_path: mmocr/mmocr/models/textdet/postprocessors/base.py
imports: from functools import partial
  from typing import Dict, List, Optional, Sequence, Tuple, Union
  import mmengine
  import numpy
  from torch import Tensor
  from mmocr.structures import TextDetDataSample
  from mmocr.utils import boundary_iou, rescale_polygons
label_desc: Use image node_id 6 for calling the BaseTextDetPostProcessor obj's underlying member method code with example usage: obj.split_results(pred_results) and returns: results