code: def trfs2arrays(
      pooling: Model[Ragged, Floats2d], grad_factor: float
  ) -> Model[List[TransformerData], List[Floats2d]]:
      """Pool transformer data into token-aligned tensors."""
      return Model(
          "trfs2arrays",
          forward,
          layers=[pooling],
          attrs={"grad_factor": grad_factor},
      )
  
file_path: spacy-transformers/spacy_transformers/layers/trfs2arrays.py
imports: from typing import Callable, List, Optional, Tuple, cast
  import numpy
  from spacy.util import all_equal
  from transformers.file_utils import ModelOutput
  from transformers.modeling_outputs import BaseModelOutput
  from thinc.api import Model
  from thinc.types import Ragged, Floats2d
  from ..data_classes import TransformerData
  from ..align import apply_alignment
label_desc: Use image node_id 1 for calling a global function with example usage: trfs2arrays(pooling, grad_factor) and returns: Model