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

Method forward

diff2flow/models/unet/attention.py:360–369  ·  view source on GitHub ↗
(ctx, run_function, length, *args)

Source from the content-addressed store, hash-verified

358class CheckpointFunction(torch.autograd.Function):
359 @staticmethod
360 def forward(ctx, run_function, length, *args):
361 ctx.run_function = run_function
362 ctx.input_tensors = list(args[:length])
363 ctx.input_params = list(args[length:])
364 ctx.gpu_autocast_kwargs = {"enabled": torch.is_autocast_enabled(),
365 "dtype": torch.get_autocast_gpu_dtype(),
366 "cache_enabled": torch.is_autocast_cache_enabled()}
367 with torch.no_grad():
368 output_tensors = ctx.run_function(*ctx.input_tensors)
369 return output_tensors
370
371 @staticmethod
372 def backward(ctx, *output_grads):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected