src/transformers/models/vit/modeling_vit.py/ViTPreTrainedModel/_set_gradient_checkpointing
class ViTPreTrainedModel:    def _set_gradient_checkpointing(self, module: ViTEncoder, value: bool = False) -> None:
        if isinstance(module, ViTEncoder):
            module.gradient_checkpointing = value