So, what you have shown here is a vector of shape 512. Are you calling the labels given to the tokens in your sentence the label tensor?
In sentence classification, the problem is like we have a sentence like:
“Hello, my dog is cute” we convert it to token_ids that look like [1996, 15139, 1000, 14855,…0,0] i.e of shape 1*512 i.e batch_size*num_tokens. This tensor is called the input_ids. We give another tensor called the label. For each sentence, there is a label corresponding to it. Fore example in case of sentiment classification we have label Neutral(0), Negative(1) and Positive(2). So each sentence in our batch will have a label which is nothing but a number like 0,1 or 2. So, the label tensor is of shape batch_size.