MCPcopy Create free account
hub / github.com/LTH14/rcg / forward

Method forward

rdm/modules/diffusionmodules/util.py:121–128  ·  view source on GitHub ↗
(ctx, run_function, length, *args)

Source from the content-addressed store, hash-verified

119class CheckpointFunction(torch.autograd.Function):
120 @staticmethod
121 def forward(ctx, run_function, length, *args):
122 ctx.run_function = run_function
123 ctx.input_tensors = list(args[:length])
124 ctx.input_params = list(args[length:])
125
126 with torch.no_grad():
127 output_tensors = ctx.run_function(*ctx.input_tensors)
128 return output_tensors
129
130 @staticmethod
131 def backward(ctx, *output_grads):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected