src/transformers/models/mbart/modeling_mbart.py/MBartEncoder/_backward_compatibility_gradient_checkpointing
class MBartEncoder:    def _backward_compatibility_gradient_checkpointing(self):
        # Override to not delete the attribute from the config
        if self.supports_gradient_checkpointing and getattr(self.config, "gradient_checkpointing", False):
            self.gradient_checkpointing_enable()