(
    pooling: Model[Ragged, Floats2d], grad_factor: float
)
return Model(
        "trfs2arrays", forward, layers=[pooling], attrs={"grad_factor": grad_factor}
    )
Pool transformer data into token-aligned tensors.
Pool transformer data into token-aligned tensors.
Pool transformer data into token - aligned tensors .
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}
    )
def trfs2arrays ( pooling : Model [ Ragged , Floats2d ] , grad_factor : float ) -> Model [ List [ TransformerData ] , List [ Floats2d ] ] : return Model ( "trfs2arrays" , forward , layers = [ pooling ] , attrs = { "grad_factor" : grad_factor } )