IndexError: tuple index out of range problem

tokens_tensor = torch.tensor([indexed_tokens])
encode_layers,_ = BERTModel(tokens_tensor)
embedding =encode_layers[11].squeeze(0)

what is the equivalent manner for those lines if I need to import BERT from transformer instead Pytorch? as i got

/transformers/file_utils.py", line 2329, in __getitem__
    return self.to_tuple()[k]
IndexError: tuple index out of range

is there any help please ?