MCPcopy Create free account
hub / github.com/CompVis/diff2flow / forward

Method forward

diff2flow/models/unet/util.py:36–45  ·  view source on GitHub ↗
(ctx, run_function, length, *args)

Source from the content-addressed store, hash-verified

34class CheckpointFunction(torch.autograd.Function):
35 @staticmethod
36 def forward(ctx, run_function, length, *args):
37 ctx.run_function = run_function
38 ctx.input_tensors = list(args[:length])
39 ctx.input_params = list(args[length:])
40 ctx.gpu_autocast_kwargs = {"enabled": torch.is_autocast_enabled(),
41 "dtype": torch.get_autocast_gpu_dtype(),
42 "cache_enabled": torch.is_autocast_cache_enabled()}
43 with torch.no_grad():
44 output_tensors = ctx.run_function(*ctx.input_tensors)
45 return output_tensors
46
47 @staticmethod
48 def backward(ctx, *output_grads):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected