DimConstraints¶
- class torch.fx.experimental.symbolic_shapes.DimConstraints(symbol_to_source, var_to_val, marked_dynamic, source_name_to_debug_name)[source][source]¶
Custom solver for a system of constraints on symbolic dimensions. Solutions are “static” values or simplified “dynamic” constraints.
- add(expr)[source][source]¶
Add an expression to the set of constraints.
Return whether the expression is a trivial constraint (i.e., an obvious tautology).
- Return type
- forced_specializations()[source][source]¶
Returns a dictionary of the names of symbols to their specialized value
- prettify_results(original_signature, dynamic_shapes, constraint_violation_error, forced_specializations)[source][source]¶
Format a message for constraint violation erros
- Return type
- rewrite_with_congruences(s, expr)[source][source]¶
Eliminate expressions of the form b // d and b % d while adding congruences of the form b % d == k. This leaves rational operators (in particular of the form b / d) that our inequality solver can handle. We solve the added congruences separately (using our congruence solver, see below).
- Return type
_SympyT