src/transformers/models/swin/modeling_swin.py/SwinPreTrainedModel/_set_gradient_checkpointing
class SwinPreTrainedModel:    def _set_gradient_checkpointing(self, module, value=False):
        if isinstance(module, SwinEncoder):
            module.gradient_checkpointing = value