src/transformers/models/switch_transformers/modeling_switch_transformers.py/SwitchTransformersPreTrainedModel/_set_gradient_checkpointing
class SwitchTransformersPreTrainedModel:    def _set_gradient_checkpointing(self, module, value=False):
        if isinstance(module, (SwitchTransformersAttention, SwitchTransformersStack)):
            module.gradient_checkpointing = value