src/transformers/models/bert_generation/modeling_bert_generation.py/BertGenerationPreTrainedModel/_set_gradient_checkpointing
class BertGenerationPreTrainedModel:    def _set_gradient_checkpointing(self, module, value=False):
        if isinstance(module, BertEncoder):
            module.gradient_checkpointing = value