def METHOD_NAME(self, text):
    """Encodes ``text`` using an ``AutoTokenizer``, ``self._lm_tokenizer``.
    Returns a ``dict`` where keys are strings (like 'input_ids') and
    values are ``torch.Tensor``s. Moves tensors to the same device
    as the language model.
    """
    encoding = self._lm_tokenizer(
        text,
        max_length=self.max_length,
        truncation=True,
        padding="max_length",
        return_tensors="pt",
    )
    return {k: v.to(utils.device) for k, v in encoding.items()}