src/transformers/models/pegasus/modeling_pegasus.py/PegasusPreTrainedModel/_set_gradient_checkpointing
class PegasusPreTrainedModel:    def _set_gradient_checkpointing(self, module, value=False):
        if isinstance(module, (PegasusDecoder, PegasusEncoder)):
            module.gradient_checkpointing = value