(ctx, run_function, length, *args)
| 142 | class CheckpointFunction(th.autograd.Function): |
| 143 | @staticmethod |
| 144 | def forward(ctx, run_function, length, *args): |
| 145 | ctx.run_function = run_function |
| 146 | ctx.input_tensors = list(args[:length]) |
| 147 | ctx.input_params = list(args[length:]) |
| 148 | with th.no_grad(): |
| 149 | output_tensors = ctx.run_function(*ctx.input_tensors) |
| 150 | return output_tensors |
| 151 | |
| 152 | @staticmethod |
| 153 | def backward(ctx, *output_grads): |
nothing calls this directly
no outgoing calls
no test coverage detected