code: def collate_encoded_documents(
      batch: List["EncodedDocument"],
  ) -> Dict[str, torch.Tensor]:
      dicts = [asdict(x) for x in batch]
      return torch.utils.data.default_collate(dicts)
  
file_path: life2vec/src/tasks/base.py
imports: import random
  from dataclasses import asdict, dataclass
  from itertools import accumulate
  from typing import TYPE_CHECKING, Callable, Dict, List, TypeVar
  import numpy
  import pandas
  import torch
  from src.data_new.augment import add_noise2time, align_document, make_timecut, resample_document, shuffle_sentences, drop_tokens
  from src.data_new.types import Background, PersonDocument
label_desc: Use image node_id 1 for calling a global function with example usage: collate_encoded_documents(batch) and returns: torch