In Handling multiple sequences - Attention masks - Try it out, there is a caveat that may be good to mention in case someone encounters the same question.
Here, by manually tokenizing the two sentences, creating attention masks, and passing them through the model, we should be able to reproduce the same logits as in section 2, which are:
<tf.Tensor: shape=(2, 2), dtype=float32, numpy=
    array([[-1.5606991,  1.6122842],
           [ 4.169231 , -3.3464472]], dtype=float32)>

However, if you do it this way:
import tensorflow as tf
from transformers import AutoTokenizer, TFAutoModelForSequenceClassification

checkpoint = "distilbert-base-uncased-finetuned-sst-2-english"
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = TFAutoModelForSequenceClassification.from_pretrained(checkpoint)

raw_inputs = [
    "I've been waiting for a HuggingFace course my whole life.", 
    "I hate this so much!",
]

batched_tokens = [tokenizer.tokenize(r) for r in raw_inputs]
batched_ids = [tokenizer.convert_tokens_to_ids(t) for t in batched_tokens]

# Add padding
batched_ids = [ids + [tokenizer.pad_token_id] * (max(map(len, batched_ids))-len(ids))
               for ids in batched_ids]
attention_mask = [[0 if x == tokenizer.pad_token_id else 1 for x in ids]
                  for ids in batched_ids]

print(model(tf.constant(batched_ids), attention_mask=tf.constant(attention_mask)).logits)

The results will be different from section 2:
tf.Tensor(
[[-2.7276204  2.878937 ]
 [ 3.1930914 -2.668523 ]], shape=(2, 2), dtype=float32)

This is because tokenizer.tokenize does not add the special tokens [CLS] and [SEP] by default, whereas the high-level API tokenizer() does.
If we change this line in the code to:
batched_tokens = [tokenizer.tokenize(r, add_special_tokens=True) for r in raw_inputs]

the result is indeed the same:
tf.Tensor(
[[-1.5606964  1.6122813]
 [ 4.169231  -3.3464475]], shape=(2, 2), dtype=float32)