def batch_tokenize(tokenizer, attacked_text_list):
    """ Tokenizes a list of inputs and returns their tokenized forms in a list. """
    inputs = [at.tokenizer_input for at in attacked_text_list]
    if hasattr(tokenizer, "batch_encode"):
        return tokenizer.batch_encode(inputs)
    else:
        return [tokenizer.encode(x) for x in inputs]