code: def _process_list(self, data_list: List[Any]):
      pack_tensor = []
      other_info = []
      segment_rel_pack = []
  
      batch_ext_table_map: Dict[Tuple[int, int], int] = {}
      batch_ext_table_ids: List[int] = []
      batch_ext_table_sub: List[int] = []
  
      for data in data_list:
          (
              input_ids,
              input_id_subs,
              input_pos,
              context,
              segment_ids,
              segment_rel_offset,
              segment_rel,
              sample_ids,
              num_segments,
              predict_segments,
              answer_placeholders,
              ext_table,
              token_id_table,
          ) = self._convert_to_tensors(data, [])
          rev_ext_table: Dict[int, str] = {}
          for token, mp in token_id_table.items():
              if token == "<ans>":
                  continue
              token_id = self.tokenizer.encoder[token]
              for fake_id, token_sub in mp.items():
                  if token_sub > 0:
                      if (
                          token_id,
                          token_sub,
                      ) not in batch_ext_table_map:
                          batch_ext_table_map[(token_id, token_sub)] = (
                              len(batch_ext_table_ids)
                              + self.tokenizer.vocab_size
                          )
                          batch_ext_table_ids.append(token_id)
                          batch_ext_table_sub.append(token_sub)
                      rev_ext_table[
                          batch_ext_table_map[(token_id, token_sub)]
                      ] = ext_table[fake_id]
                  else:
                      rev_ext_table[token_id] = ext_table[fake_id]
          pack_tensor.append(
              {
                  "input": torch.from_numpy(input_ids).unsqueeze(0),
                  "input_sub": torch.from_numpy(
                      input_id_subs
                  ).unsqueeze(0),
                  "input_pos": torch.from_numpy(input_pos).unsqueeze(0),
                  "context": torch.from_numpy(context).unsqueeze(0),
                  "sample_idx": torch.from_numpy(sample_ids).unsqueeze(
                      0
                  ),
                  "num_segments": torch.from_numpy(
                      num_segments
                  ).unsqueeze(0),
                  "segment": torch.from_numpy(segment_ids).unsqueeze(0),
                  "segment_rel_offset": torch.from_numpy(
                      segment_rel_offset
                  ).unsqueeze(0),
              }
          )
          segment_rel_pack.append(torch.from_numpy(segment_rel))
          other_info.append(
              {
                  "predict_segments": predict_segments,
                  "answer_placeholders": answer_placeholders,
                  "ext_table": rev_ext_table,
              }
          )
  
      keys = set(pack_tensor[0].keys())
      padded = {}
      for key in keys:
          padded[key] = pad(pack_tensor, key)
  
      max_num_rels = 0
      for rel in segment_rel_pack:
          max_num_rels = max(max_num_rels, rel.size(0))
      padded_rels = torch.zeros(
          len(segment_rel_pack), max_num_rels, dtype=torch.int32
      )
      for i, rel in enumerate(segment_rel_pack):
          padded_rels[i, : rel.size(0)] = rel
      padded["segment_rel"] = padded_rels
      padded["batch_ext_table_ids"] = torch.tensor(
          batch_ext_table_ids, dtype=torch.int32
      )
      padded["batch_ext_table_sub"] = torch.tensor(
          batch_ext_table_sub, dtype=torch.int32
      )
  
      # move to model device
      for k, v in padded.items():
          if isinstance(v, torch.Tensor):
              padded[k] = v.to(self.model.input_embedding.weight.device)
  
      return padded, other_info
  
file_path: DeepKE/example/llm/CPM-Bee/src/cpm_live/generation/bee.py
imports: from typing import Any, Dict, List, Tuple
  import numpy
  import torch
  import torch.nn.functional
  from .generation_utils import BeamHypotheses, apply_repetition_penalty
  from ..tokenizers.bee import CPMBeeTokenizer
  from ..models.bee import CPMBee
  from ..training_tasks.bee.pretrain import convert_data_to_id
  from ..utils import pad
label_desc: Use image node_id 3 for calling the CPMBeeGeneration obj's underlying member method code with example usage: obj._process_list(data_list) and returns: padded,  other_info