Skip to content

Move the _is_provably_positive helpers out of tensor/subtensor.py #2404

Description

@jessegrabowski

_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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions