Repository navigation
A scalar over a matrix argument is not compiled - #2289
Merged
Rafael-SOWNet merged 1 commit intoOct 31, 2026
Merged
Rafael-SOWNet merged 1 commit into
Rafael-SOWNet merged 1 commit into
Conversation
Compiled, x / A with a matrix argument A divided x by every element: [[2, 1], [0.667, 0.5]] for 2 / [[1, 2], [3, 4]], where evaluation takes a scalar over a matrix as the scalar times the inverse, [[-4, 2], [3, -1]]. The inverse is not compiled, as a negative matrix power is not, so the quotient is now refused with UncompilableNodeException. A matrix written into the expression is inverted before it is compiled, and that is unchanged. DivideFromScalar stays public, for what it says it is, and the compiler no longer uses it. AScalarOverAMatrixArgumentTest takes the refusal, which fails on master, a matrix argument over a scalar and a written matrix inverted, which pass on both. The suite, the trio, F#, AOT and the eight harnesses pass. Fixes #2287. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2289 +/- ##
==========================================
- Coverage 86.71% 86.71% -0.01%
==========================================
Files 310 310
Lines 67852 67855 +3
Branches 19691 19691
==========================================
+ Hits 58837 58838 +1
- Misses 4895 4898 +3
+ Partials 4120 4119 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Rafael-SOWNet
deleted the
a-scalar-over-a-matrix-argument-is-not-compiled-elementwise
branch
October 31, 2026 04:50
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.
Compiled,
x / Awith a matrix argumentAdividedxby every element:2 / [[1, 2], [3, 4]]came out as[[2, 1], [0.667, 0.5]]. Evaluation takes a scalar over a matrix as the scalar times the inverse,[[-4, 2], [3, -1]]. The compiler does not compute an inverse, just as it does not compute a negative matrix power, so the quotient is now refused withUncompilableNodeException. A matrix written into the expression is still inverted before compiling, as before.DivideFromScalarstays public and does what its documentation says, but the compiler no longer uses it."x / A"overGenTensor<double>, atA = [[1, 2], [3, 4]],x = 2[[2, 1], [0.667, 0.5]]UncompilableNodeExceptionAScalarOverAMatrixArgumentTest: the refusal fails on master. Its other two cases, a matrix argument over a scalar and a written matrix that gets inverted, pass on both. The suite (18,293), the trio, F#, AOT and the eight harnesses pass locally. This is a separate change from #2288, which also editsTensorCompilation.cs, in a different part of the file.Fixes #2287.
🤖 Generated with Claude Code