src/transformers/models/ernie/modeling_ernie.py/ErniePreTrainedModel/_set_gradient_checkpointing
class ErniePreTrainedModel:    def _set_gradient_checkpointing(self, module, value=False):
        if isinstance(module, ErnieEncoder):
            module.gradient_checkpointing = value