src/transformers/models/bart/modeling_bart.py/BartPretrainedModel/_set_gradient_checkpointing
class BartPretrainedModel:    def _set_gradient_checkpointing(self, module, value=False):
        if isinstance(module, (BartDecoder, BartEncoder)):
            module.gradient_checkpointing = value