Preserve batched vector inverse quadratic forms in diagonal operators - #140
Open
AHMETHAKANBEZIR1 wants to merge 1 commit into
Open
AHMETHAKANBEZIR1 wants to merge 1 commit into
AHMETHAKANBEZIR1 wants to merge 1 commit into
Conversation
Co-authored-by: Codex <noreply@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #139. A vector RHS has no RHS-column axis remaining after its quadratic form has been computed. Avoid applying column reduction when
rhs_batch_shapeis empty, preserving each independent batch result for bothDiagLinearOperatorand inheritedConstantDiagLinearOperator.For example, diagonal and RHS
torch.arange(1,11).reshape(2,5)previously returned scalar55 with the default reduction, instead of[15,40], while its log determinant still had batch shape(2,). Matrix RHS column reduction remains unchanged. This does not change generic RHS broadcasting policy or materialize dense matrices in production.Regression and verification
torch.linalg.solveandslogdetreference checks exact output shape, values and weighted gradients of diagonal parameters and RHS. Clean main1c5e24b:12 failures and84 controls pass; after the fix all96 pass.python -m unittest:5047 tests pass.git diff --checkpasses.sphinx-build -W -b htmlsucceeds. No new API/docstring.The pre-commit cache's installed Windows ASCII launcher had already been repaired to use forward slashes in its shebang; the validation code and repository hook configuration are unchanged, with no hook bypass.
Prepared autonomously with OpenAI Codex at the account owner's request; no independent human review is claimed. Reproduction, independent references and tests were run locally. Codex is recorded as commit co-author.