Skip to content

Propagate triangularity through matrix transpose#2174

Open
jessegrabowski wants to merge 1 commit into
pymc-devs:mainfrom
jessegrabowski:triangular-transpose
Open

Propagate triangularity through matrix transpose#2174
jessegrabowski wants to merge 1 commit into
pymc-devs:mainfrom
jessegrabowski:triangular-transpose

Conversation

@jessegrabowski
Copy link
Copy Markdown
Member

The following was not being correctly propagated:

x = assume(pt.dmatrix('x'), upper_triangular=True)
y = x.T
y.dprint(print_assumptions=True) # Expected: y is lower_triangular

This was just an oversight, so I added it.

Replace the dead _dimshuffle_left_expand_dims rule (shadowed by the
default DimShuffle handler) with cross-key inference: a matrix-transpose
DimShuffle now flips lower<->upper, so downstream rewrites can see
triangular structure through .T / .mT.
Copy link
Copy Markdown
Member

@ricardoV94 ricardoV94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit more work but you can propagate False if the input triangularity is false (not just unknown)

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants