My understanding is that if you don’t specifically freeze any of the layers you will always train the whole model.
If you want to train only particular layers, you can add a condition to this code:
model = BertForSequenceClassification.from_pretrained('bert-base-uncased')

for param in model.bert.parameters():
    param.requires_grad = False