GB4774

Graph-Break Type

Short name describing what triggered the graph break

torch.map: f mutates pos_args

Context

Values or code snippet captured at the break point

pos_args={pos_args_mutated}

Explanation

Explanation of why the graph break was triggered

map only supports in-place mutation of xs (each iteration sees a storage-disjoint slice). pos_args are loop-invariant: every iteration sees the same tensor, so a mutation makes iterations depend on each other, breaking map’s independence contract and introducing a data race under any parallel lowering. Use scan or while_loop if sequential buffer updates are required.

Hints

Hints on how to resolve the graph break

Additional Information

Click here to add Additional Info

Back to Registry