src/transformers/models/chinese_clip/modeling_chinese_clip.py/ChineseCLIPPreTrainedModel/_set_gradient_checkpointing
class ChineseCLIPPreTrainedModel:    def _set_gradient_checkpointing(self, module, value=False):
        if isinstance(module, ChineseCLIPVisionEncoder) or isinstance(module, ChineseCLIPTextEncoder):
            module.gradient_checkpointing = value