MCPcopy Create free account
hub / github.com/microsoft/Cream / set_grad_checkpointing

Method set_grad_checkpointing

TinyCLIP/src/open_clip/model.py:1032–1038  ·  view source on GitHub ↗
(self, enable=True)

Source from the content-addressed store, hash-verified

1030
1031 @torch.jit.ignore
1032 def set_grad_checkpointing(self, enable=True):
1033 visual = self.image_encoder_without_ddp.visual
1034 transformer = self.text_encoder_without_ddp.transformer
1035 if hasattr(visual, 'set_grad_checkpointing'):
1036 visual.set_grad_checkpointing(enable)
1037 if transformer is not None and hasattr(transformer, 'set_grad_checkpointing'):
1038 transformer.set_grad_checkpointing(enable)
1039
1040 def image_named_params(self):
1041 return self._image_encoder.named_parameters()

Callers 3

mainFunction · 0.45
mainFunction · 0.45

Calls

no outgoing calls

Tested by 1

mainFunction · 0.36