GB1075

Graph-Break Type

Short name describing what triggered the graph break

torch.scan: combine_fn mutates init or xs

Context

Values or code snippet captured at the break point

init={init_part}, xs={xs_part}

Explanation

Explanation of why the graph break was triggered

scan only supports in-place mutation of additional_inputs (loop-invariant tensors). init is the initial carry only – from step 1 on the driver feeds combine_fn’s returned carry, so an in-place write to init would only affect step 0. xs[t] is a fresh, storage-disjoint slice each step, so a mutation cannot be observed by step t+1. Update the carry via the combine_fn return value; for in-place lifted buffers use additional_inputs.

Hints

Hints on how to resolve the graph break

Additional Information

Click here to add Additional Info

Back to Registry