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

Function enable_recomputing

PATH/core/models/ckpt.py:239–246  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

237
238@contextmanager
239def enable_recomputing() -> Generator[None, None, None]:
240 """Makes :func:`is_recomputing` return :data:`True` within a context."""
241 orig = thread_local.is_recomputing
242 thread_local.is_recomputing = True
243 try:
244 yield
245 finally:
246 thread_local.is_recomputing = orig
247
248
249def is_checkpointing() -> bool:

Callers 1

backwardMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected