MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / disable_checkpointing

Function disable_checkpointing

PATH/core/models/ckpt.py:217–224  ·  view source on GitHub ↗

Makes :func:`is_checkpointing_disabled` return :data:`True` within a context.

()

Source from the content-addressed store, hash-verified

215
216@contextmanager
217def disable_checkpointing() -> Generator[None, None, None]:
218 """Makes :func:`is_checkpointing_disabled` return :data:`True` within a context."""
219 orig = thread_local.is_checkpointing_disabled
220 thread_local.is_checkpointing_disabled = True
221 try:
222 yield
223 finally:
224 thread_local.is_checkpointing_disabled = orig
225
226
227@contextmanager

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected