src/transformers/models/resnet/modeling_resnet.py/ResNetPreTrainedModel/_set_gradient_checkpointing
class ResNetPreTrainedModel:    def _set_gradient_checkpointing(self, module, value=False):
        if isinstance(module, ResNetEncoder):
            module.gradient_checkpointing = value