Skip to content

Fix identity elementwise multiplication - #156

Open
AryanRG wants to merge 1 commit into
cornellius-gp:mainfrom
AryanRG:fix-identity-elementwise-multiply
Open

AryanRG wants to merge 1 commit into
cornellius-gp:mainfrom
AryanRG:fix-identity-elementwise-multiply

Conversation

@AryanRG

@AryanRG AryanRG commented Oct 31, 2026

Copy link
Copy Markdown

Elementwise multiplication by IdentityLinearOperator currently returns the other matrix unchanged, including its off-diagonal entries. It can also lose the identity's batch dimensions.

This uses the inherited diagonal multiplication and explicitly constructs constant-diagonal products, avoiding an incompatible identity constructor. I * I now returns an equivalent ConstantDiagLinearOperator.

The regressions cover tensors, dense operators, identities and constant-diagonal operators, including batches and both operand orders. They fail on the base and pass with the fix. Formatting and lint checks pass. The full local suite has the same two existing batch-repeat SVD failures before and after the change.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant