(ctx, run_function, length, *args)
| 42 | class CheckpointFunction(torch.autograd.Function): |
| 43 | @staticmethod |
| 44 | def forward(ctx, run_function, length, *args): |
| 45 | ctx.run_function = run_function |
| 46 | ctx.input_tensors = list(args[:length]) |
| 47 | ctx.input_params = list(args[length:]) |
| 48 | |
| 49 | with torch.no_grad(): |
| 50 | output_tensors = ctx.run_function(*ctx.input_tensors) |
| 51 | return output_tensors |
| 52 | |
| 53 | @staticmethod |
| 54 | def backward(ctx, *output_grads): |
nothing calls this directly
no outgoing calls
no test coverage detected