src/transformers/models/fnet/modeling_fnet.py/FNetPreTrainedModel/_set_gradient_checkpointing
class FNetPreTrainedModel:    def _set_gradient_checkpointing(self, module, value=False):
        if isinstance(module, FNetEncoder):
            module.gradient_checkpointing = value