xnn.common.models.fast.separate_shapes#
- xnn.common.models.fast.separate_shapes()[source]#
A context in which
torch.compile()gives every dynamic size its own symbol.By default sizes that are equal when a graph is traced share one symbol (“duck shaping”); an edge count that happens to equal a feature width then ties the two, and tracing the second derivatives of such a graph can crash the process (torch 2.5). The compiled functions here are called inside this context, so their graphs are traced without it.