Restore torch.autograd.Function and discard inputs captured for this compile cycle.
()
| 99 | |
| 100 | |
| 101 | def unpatch_compiled_func(): |
| 102 | """Restore torch.autograd.Function and discard inputs captured for this compile cycle.""" |
| 103 | global enabled_patched_func |
| 104 | enabled_patched_func = False |
| 105 | |
| 106 | global original_grad_fn |
| 107 | if original_grad_fn is not None: |
| 108 | torch.autograd.Function = original_grad_fn |
| 109 | original_grad_fn = None |
| 110 | clear_backward_inputs() |
| 111 | |
| 112 | |
| 113 | def get_backward_inputs(frame_key=None): |