src/transformers/models/imagegpt/modeling_imagegpt.py/ImageGPTPreTrainedModel/_set_gradient_checkpointing
class ImageGPTPreTrainedModel:    def _set_gradient_checkpointing(self, module, value=False):
        if isinstance(module, ImageGPTModel):
            module.gradient_checkpointing = value