# Constraint Source: https://www.tensorplay.cn/docs/generated/tensorplay.export.Constraint.html ```python class tensorplay.export.Constraint(source: Any, dim: int, name: str | None = None, min: int | None = None, max: int | None = None, warn_only: bool = False, root: str | None = None, scale: int = 1, offset: int = 0) ``` A range restriction attached to one input dimension. name ties the constraint to a named [Dim](/docs/generated/tensorplay.export.Dim.html#tensorplay.export.Dim) shared across inputs (equalities are implied). root/scale/offset describe a derived dimension whose size equals scale * root_size + offset. Constraints without a name come from dim hints or static entries.