[WIP] Add kron_left bivariate atom#55
Draft
Transurgeon wants to merge 3 commits intomainfrom
Draft
Conversation
Implements Z = kron(C, X) where C is a constant sparse matrix and X is an expression. Lives in src/atoms/affine/ alongside left_matmul, takes the same (param_node, u, ...) signature with param_node required to be NULL for now — the slot is wired into the struct so adding updatable parameter support later is a local change. All inner loops iterate only over the nonzeros of C (cached as active (i, j) tuples at construction), so C = I_m automatically collapses to O(m * p * q) work with no identity-detection code. Jacobian sparsity is built in two passes over the same active-tuple skeleton. wsum_hess inherits the child's sparsity and runs the same index pattern as an adjoint. Covered by six tests: forward (generic + identity), Jacobian (vector and matrix child), and weighted-sum Hessian (variable child + numerical diff against a composite exp child). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
08dc9a1 to
ed77d23
Compare
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Function names already label each static function; the ASCII bars are visual noise. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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.
Implements kron(C, X) where C is a constant sparse matrix and X is an expression. Includes forward pass, Jacobian, and weighted-sum Hessian with tests for all three.