src/transformers/models/bert/modeling_bert.py/BertPreTrainedModel/_set_gradient_checkpointing
class BertPreTrainedModel:    def _set_gradient_checkpointing(self, module, value=False):
        if isinstance(module, BertEncoder):
            module.gradient_checkpointing = value