src/transformers/models/donut/modeling_donut_swin.py/DonutSwinPreTrainedModel/_set_gradient_checkpointing
class DonutSwinPreTrainedModel:    def _set_gradient_checkpointing(self, module, value=False):
        if isinstance(module, DonutSwinEncoder):
            module.gradient_checkpointing = value