torch.fx.experimental.symbolic_shapes.free_symbols
- torch.fx.experimental.symbolic_shapes.free_symbols(val)
Recursively collect all free symbols from a value.
This function traverses various data structures (tensors, lists, tuples, etc.) and extracts all sympy symbols contained within them. It’s useful for finding all symbolic variables that a complex nested structure depends on.
- Parameters:
val (SymInt | ) – The value to extract symbols from. Can be a symbolic type (SymInt, SymFloat, SymBool), a container (tuple, list), a tensor, or None.