src/transformers/models/mt5/modeling_mt5.py/MT5PreTrainedModel/_set_gradient_checkpointing
class MT5PreTrainedModel:    def _set_gradient_checkpointing(self, module, value=False):
        if isinstance(module, (MT5Attention, MT5Stack)):
            module.gradient_checkpointing = value