src/transformers/models/deit/modeling_deit.py/DeiTPreTrainedModel/_set_gradient_checkpointing
class DeiTPreTrainedModel:    def _set_gradient_checkpointing(self, module: DeiTEncoder, value: bool = False) -> None:
        if isinstance(module, DeiTEncoder):
            module.gradient_checkpointing = value