MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / checkpoint

Function checkpoint

k_diffusion/models/modules.py:48–53  ·  view source on GitHub ↗
(function, *args, **kwargs)

Source from the content-addressed store, hash-verified

46
47
48def checkpoint(function, *args, **kwargs):
49 if flags.get_checkpointing():
50 kwargs.setdefault("use_reentrant", True)
51 return torch.utils.checkpoint.checkpoint(function, *args, **kwargs)
52 else:
53 return function(*args, **kwargs)
54
55
56def downscale_pos(pos):

Callers 4

forwardMethod · 0.85
forwardMethod · 0.85
forwardMethod · 0.85
forwardMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected