src/transformers/models/mgp_str/modeling_mgp_str.py/MgpstrPreTrainedModel/_set_gradient_checkpointing
class MgpstrPreTrainedModel:    def _set_gradient_checkpointing(self, module: MgpstrEncoder, value: bool = False) -> None:
        if isinstance(module, MgpstrEncoder):
            module.gradient_checkpointing = value