_is_provably_positive and _is_provably_non_negative are general graph predicates that just happen to live in pytensor/tensor/subtensor.py. The module does use them itself for slice canonicalization, but five others import them from there — rewriting/subtensor.py, rewriting/math.py, rewriting/linalg/summary.py, assumptions/elemwise.py, and assumptions/positive_definite.py — so math rewrites and the assumptions system both pull in the indexing module just to ask whether a variable is non-negative.
No obvious destination. assumptions/ already holds two of the callers, but importing it from pytensor/tensor inverts the current direction.
Follow-up from #2380.
_is_provably_positiveand_is_provably_non_negativeare general graph predicates that just happen to live inpytensor/tensor/subtensor.py. The module does use them itself for slice canonicalization, but five others import them from there —rewriting/subtensor.py,rewriting/math.py,rewriting/linalg/summary.py,assumptions/elemwise.py, andassumptions/positive_definite.py— so math rewrites and the assumptions system both pull in the indexing module just to ask whether a variable is non-negative.No obvious destination.
assumptions/already holds two of the callers, but importing it frompytensor/tensorinverts the current direction.Follow-up from #2380.