src/transformers/models/layoutlm/modeling_layoutlm.py/LayoutLMPreTrainedModel/_set_gradient_checkpointing
class LayoutLMPreTrainedModel:    def _set_gradient_checkpointing(self, module, value=False):
        if isinstance(module, LayoutLMEncoder):
            module.gradient_checkpointing = value