src/transformers/models/swin2sr/modeling_swin2sr.py/Swin2SRPreTrainedModel/_set_gradient_checkpointing
class Swin2SRPreTrainedModel:    def _set_gradient_checkpointing(self, module, value=False):
        if isinstance(module, Swin2SREncoder):
            module.gradient_checkpointing = value