docstr: This function is to normalize multi source to aggregate them.
docstr_tok: ["This","function","is","to","normalize","multi","source","to","aggregate","them","."]
code: def normalize_multi_source(self, label_word, tokenizer, device):
      """This function is to normalize multi source to aggregate them."""
      assert self.args.multi_source_path is not None
  
      # load multi source prefix and label word
      source_paths = self.args.multi_source_path.split(",")
      self.source_prefixes = [
          torch.load(os.path.join(path, "prefix.pt"))
          for path in source_paths
      ]
  
      trans_source_prefixes = []  # n x 768
      for source_prefix in self.source_prefixes:  # n source
          trans_source_prefixes.append(
              self.convert_prefix(source_prefix)
          )
      self.trans_source_prefixes = torch.stack(
          trans_source_prefixes, dim=0
      )
  
      self.trans_target_prefix = self.convert_prefix(
          self.get_prompt(bsz=1)
      ).unsqueeze(0)
  
      source_label_words = [
          torch.load(os.path.join(path, "label_word.pt"))
          for path in source_paths
      ]
      for i in range(len(source_label_words)):
          source_label_words[i] = torch.stack(
              list(source_label_words[i].values()), dim=0
          ).mean(0)
      self.source_label_words = torch.stack(
          source_label_words, dim=0
      ).to(device)
      self.label_word_id = [
          tokenizer.encode(label, add_special_tokens=False)
          for label in label_word
      ]
  
file_path: DeepKE/src/deepke/name_entity_re/cross/seq2seq/models.py
imports: import os
  from copy import deepcopy
  import torch
  from torch import nn
  from .modeling_t5 import T5ForConditionalGeneration
label_desc: Use image node_id 5 for calling the T5Prompt obj's underlying member method code with example usage: obj.normalize_multi_source(label_word, tokenizer, device) without return types