MCPcopy Create free account
hub / github.com/pytorch/executorch / serialize_range_constraints

Function serialize_range_constraints

exir/serde/export_serialize.py:380–389  ·  view source on GitHub ↗
(
    range_constraints: Dict[sympy.Symbol, ValueRanges]
)

Source from the content-addressed store, hash-verified

378
379
380def serialize_range_constraints(
381 range_constraints: Dict[sympy.Symbol, ValueRanges]
382) -> Dict[str, RangeConstraint]:
383 return {
384 str(k): RangeConstraint(
385 _sympy_int_to_int(v.lower, "ceil"), # type: ignore[arg-type]
386 _sympy_int_to_int(v.upper, "floor"), # type: ignore[arg-type]
387 )
388 for k, v in range_constraints.items()
389 }
390
391
392def _is_single_tensor_return(target: torch._ops.OpOverload) -> bool:

Callers 1

serializeMethod · 0.85

Calls 3

RangeConstraintClass · 0.85
_sympy_int_to_intFunction · 0.85
itemsMethod · 0.80

Tested by

no test coverage detected