Assuming that I am using one of the BERT instances for a language modeling task
from transformers import BertForMaskedLM, BertTokenizerFast
import torch
model = BertForMaskedLM.from_pretrained('bert-base-uncased')
tokenizer = BertTokenizerFast.from_pretrained('bert-base-uncased')

now let’s say that I have the next sentence
text = "Jeremy Bentham was the founder of modern utilitarianism"
inputs  =  tokenizer(text,  return_tensors="pt", add_special_tokens = True, truncation=True,  max_length=64)

If I say to mask a random token from some part of the sentence, for this example let’s put an arbitrary example of the 7th token
inputs['input_ids'][0][7] = tokenizer.mask_token_id


and then pass this to the model as
outputs = model(inputs)
scores = outputs[0]

If I want the embedding (vector) of only the masked token, how should I access it?