fix: Handle scalar inputs in JoinDims.perform (closes #2197)#2205
Closed
botbikamordehai2-sketch wants to merge 1 commit into
Closed
fix: Handle scalar inputs in JoinDims.perform (closes #2197)#2205botbikamordehai2-sketch wants to merge 1 commit into
botbikamordehai2-sketch wants to merge 1 commit into
Conversation
Member
|
Vibe fix that misses the point and doesn't fix anything. Problem is fixed by #2203 |
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.
What
The
JoinDimsoperation withn_axes=0(inserting a new dimension of size 1) or when joining axes that result in a size-1 dimension from a scalar (shape()) input causes aValueErrorin the numba backend's vectorize shape check. This occurs because the numpyreshapewith-1on a scalar array produces a shape(1,)array, but the numba vectorize codegen in 3.0.4 strictly validates that the runtime shape matches the declared shape.Fix
Add a special case in
JoinDims.performwhenn_axes=0: usenp.expand_dimsinstead ofreshape. This correctly handles scalar inputs and produces an array of shape(1,)without triggering the strict vectorize shape validation. For cases wheren_axes>0, the existing reshape logic works correctly because the input is guaranteed to have at leaststart_axis + n_axesdimensions (validated inmake_node).Closes #2197