def as_padded_tensor(self, tokens: Dict[(str, List[TokenType])], desired_num_tokens: Dict[(str, int)], padding_lengths: Dict[(str, int)]) -> Dict[(str, torch.Tensor)]:
    '\n        This method pads a list of tokens to ``desired_num_tokens`` and returns that padded list\n        of input tokens as a torch Tensor. If the input token list is longer than ``desired_num_tokens``\n        then it will be truncated.\n\n        ``padding_lengths`` is used to provide supplemental padding parameters which are needed\n        in some cases.  For example, it contains the widths to pad characters to when doing\n        character-level padding.\n\n        Note that this method should be abstract, but it is implemented to allow backward compatability.\n        '
    if (not self.has_warned_for_as_padded_tensor):
        warnings.warn('Using a Field with pad_token_sequence, which will be depreciated in 1.0.0.Please implement as_padded_tensor instead.', FutureWarning)
        self.has_warned_for_as_padded_tensor = True
    padded = self.pad_token_sequence(tokens, desired_num_tokens, padding_lengths)
    return {key: torch.LongTensor(array) for (key, array) in padded.items()}
This method pads a list of tokens to ``desired_num_tokens`` and returns that padded list
of input tokens as a torch Tensor. If the input token list is longer than ``desired_num_tokens``
then it will be truncated.

``padding_lengths`` is used to provide supplemental padding parameters which are needed
in some cases.  For example, it contains the widths to pad characters to when doing
character-level padding.

Note that this method should be abstract, but it is implemented to allow backward compatability.
def as_padded_tensor(self, tokens: Dict[(str, List[TokenType])], desired_num_tokens: Dict[(str, int)], padding_lengths: Dict[(str, int)]) -> Dict[(str, torch.Tensor)]:
    '\n        This method pads a list of tokens to ``desired_num_tokens`` and returns that padded list\n        of input tokens as a torch Tensor. If the input token list is longer than ``desired_num_tokens``\n        then it will be truncated.\n\n        ``padding_lengths`` is used to provide supplemental padding parameters which are needed\n        in some cases.  For example, it contains the widths to pad characters to when doing\n        character-level padding.\n\n        Note that this method should be abstract, but it is implemented to allow backward compatability.\n        '
    if (not self.has_warned_for_as_padded_tensor):
        warnings.warn('Using a Field with pad_token_sequence, which will be depreciated in 1.0.0.Please implement as_padded_tensor instead.', FutureWarning)
        self.has_warned_for_as_padded_tensor = True
    padded = self.pad_token_sequence(tokens, desired_num_tokens, padding_lengths)
    return {key: torch.LongTensor(array) for (key, array) in padded.items()}