(seqs: List[torch.Tensor])
return torch.stack(
        [torch.cat([s, s.new_zeros(max_len - len_, s.size(-1))], dim=0) for
         s, len_ in zip(seqs, lengths)]), mask
Takes the output of a contextualizer, a list (of length batch_size)
    of Tensors with shape (seq_len, repr_dim), and produces a padded
    Tensor with these possibly-variable length items of shape
    (batch_size, seq_len, repr_dim)

    Returns
    -------
    padded_representations: torch.FloatTensor
        FloatTensor of shape (batch_size, seq_len, repr_dim) with 0 padding.
    mask: torch.FloatTensor
        A (batch_size, max_length) mask with 1's in positions without padding
        and 0's in positions with padding.
Takes the output of a contextualizer, a list (of length batch_size)
    of Tensors with shape (seq_len, repr_dim), and produces a padded
    Tensor with these possibly-variable length items of shape
    (batch_size, seq_len, repr_dim)
Takes the output of a contextualizer a list ( of length batch_size ) of Tensors with shape ( seq_len repr_dim ) and produces a padded Tensor with these possibly - variable length items of shape ( batch_size seq_len repr_dim )
def pad_contextualizer_output(seqs: List[torch.Tensor]):
    """
    Takes the output of a contextualizer, a list (of length batch_size)
    of Tensors with shape (seq_len, repr_dim), and produces a padded
    Tensor with these possibly-variable length items of shape
    (batch_size, seq_len, repr_dim)

    Returns
    -------
    padded_representations: torch.FloatTensor
        FloatTensor of shape (batch_size, seq_len, repr_dim) with 0 padding.
    mask: torch.FloatTensor
        A (batch_size, max_length) mask with 1's in positions without padding
        and 0's in positions with padding.
    """
    lengths = [len(s) for s in seqs]
    max_len = max(lengths)
    mask = get_mask_from_sequence_lengths(seqs[0].new_tensor(lengths), max_len)
    return torch.stack(
        [torch.cat([s, s.new_zeros(max_len - len_, s.size(-1))], dim=0) for
         s, len_ in zip(seqs, lengths)]), mask
def pad_contextualizer_output ( seqs : List [ torch . Tensor ] ) : lengths = [ len ( s ) for s in seqs ] max_len = max ( lengths ) mask = get_mask_from_sequence_lengths ( seqs [ 0 ] . new_tensor ( lengths ) , max_len ) return torch . stack ( [ torch . cat ( [ s , s . new_zeros ( max_len - len_ , s . size ( - 1 ) ) ] , dim = 0 ) for s , len_ in zip ( seqs , lengths ) ] ) , mask