src/transformers/models/git/modeling_git.py/GitPreTrainedModel/_set_gradient_checkpointing
class GitPreTrainedModel:    def _set_gradient_checkpointing(self, module, value=False):
        if isinstance(module, (GitEncoder, GitVisionEncoder)):
            module.gradient_checkpointing = value