class_docstr: Key Information Extraction Inferencer.
  
  Args:
      model (str, optional): Path to the config file or the model name
          defined in metafile. For example, it could be
          "sdmgr_unet16_60e_wildreceipt" or
          "configs/kie/sdmgr/sdmgr_unet16_60e_wildreceipt.py".
          If model is not specified, user must provide the
          `weights` saved by MMEngine which contains the config string.
          Defaults to None.
      weights (str, optional): Path to the checkpoint. If it is not specified
          and model is a model name of metafile, the weights will be loaded
          from metafile. Defaults to None.
      device (str, optional): Device to run inference. If None, the available
          device will be automatically used. Defaults to None.
      scope (str, optional): The scope of the model. Defaults to "mmocr".
class_docstr_tok: ["Key","Information","Extraction","Inferencer",".","Args",":","model","(","str",",","optional",")",":","Path","to","the","config","file","or","the","model","name","defined","in","metafile",".","For","example",",","it","could","be","``","sdmgr_unet16_60e_wildreceipt","''","or","``","configs\/kie\/sdmgr\/sdmgr_unet16_60e_wildreceipt.py","''",".","If","model","is","not","specified",",","user","must","provide","the","`","weights","`","saved","by","MMEngine","which","contains","the","config","string",".","Defaults","to","None",".","weights","(","str",",","optional",")",":","Path","to","the","checkpoint",".","If","it","is","not","specified","and","model","is","a","model","name","of","metafile",",","the","weights","will","be","loaded","from","metafile",".","Defaults","to","None",".","device","(","str",",","optional",")",":","Device","to","run","inference",".","If","None",",","the","available","device","will","be","automatically","used",".","Defaults","to","None",".","scope","(","str",",","optional",")",":","The","scope","of","the","model",".","Defaults","to","``","mmocr","''","."]
docstr: A collate function designed for KIE, where the first element (input)
  is a dict and we only want to keep it as-is instead of batching
  elements inside.
  
  Returns:
      Any: Transversed Data in the same format as the data_itement of
      ``data_batch``.
docstr_tok: ["A","collate","function","designed","for","KIE",",","where","the","first","element","(","input",")","is","a","dict","and","we","only","want","to","keep","it","as-is","instead","of","batching","elements","inside",".","Returns",":","Any",":","Transversed","Data","in","the","same","format","as","the","data_itement","of","``","data_batch","``","."]
code: def kie_collate(data_batch: Sequence) -> Any:
      """A collate function designed for KIE, where the first element (input)
      is a dict and we only want to keep it as-is instead of batching
      elements inside.
  
      Returns:
          Any: Transversed Data in the same format as the data_itement of
          ``data_batch``.
      """  # noqa: E501
      transposed = list(zip(*data_batch))
      for i in range(1, len(transposed)):
          transposed[i] = pseudo_collate(transposed[i])
      return transposed
  
imports: import copy
  import os.path
  from typing import Any, Dict, List, Optional, Sequence, Union
  import mmcv
  import mmengine
  import numpy
  from mmengine.dataset import Compose, pseudo_collate
  from mmengine.runner.checkpoint import _load_checkpoint
  from mmocr.registry import DATASETS
  from mmocr.structures import KIEDataSample
  from mmocr.utils import ConfigType
  from .base_mmocr_inferencer import BaseMMOCRInferencer, ModelType, PredType
label_desc: Use image node_id 4 for calling the KIEInferencer obj's underlying member method code with example usage: obj.kie_collate(data_batch) and returns: transposed