src/transformers/models/maskformer/modeling_maskformer.py/MaskFormerPreTrainedModel/_set_gradient_checkpointing
class MaskFormerPreTrainedModel:    def _set_gradient_checkpointing(self, module, value=False):
        if isinstance(module, MaskFormerPixelLevelModule):
            module.encoder.gradient_checkpointing = value
        if isinstance(module, DetrDecoder):
            module.gradient_checkpointing = value