Short name describing what triggered the graph break
autograd.grad with external grad_fn
Values or code snippet captured at the break point
context
Explanation of why the graph break was triggered
torch.autograd.grad() cannot trace through the autograd graph because it’s output depends on a tensor that was created outside the compiled region and has a grad_fn attached. The autograd graph extends beyond the compiled region boundary, which Dynamo cannot trace.
Hints on how to resolve the graph break
tensor.detach().requires_grad_(True).