torch.fx.experimental.symbolic_shapes.rename_unbacked_to¶
- torch.fx.experimental.symbolic_shapes.rename_unbacked_to(orig, new)[source]¶
Rename an unbacked SymInt into a new one.
The goal here is that you have two unbacked symbols, but actually they are the same (you allocated the second one without knowing that it was going to be the first one, e.g., due to retracing), and importantly, we don’t want to setup a deferred runtime assert because the old unbacked symbol is literally vanishing from the graph and we better not try to compute any asserts on it because we won’t know how to generate a reference to it in Inductor. This is all very delicate, TODO find a better way.