Fix squeeze value inference for scalar outputs - #2862
Open
ZedingZhang wants to merge 3 commits into
Open
ZedingZhang wants to merge 3 commits into
ZedingZhang wants to merge 3 commits into
Conversation
TobyRoseman
reviewed
Sep 17, 2026
| assert np.isclose(np.squeeze(x), v.val) | ||
|
|
||
| @staticmethod | ||
| def test_builder_eval_rank_0_from_split(): |
Collaborator
There was a problem hiding this comment.
The unit test should more closely follow the repo code in the GitHub issue. Specifically, it should call ct.convert.
Contributor
Author
There was a problem hiding this comment.
Updated the regression test to call ct.convert, as requested. This also exposed an object-dtype issue in split value inference during constant elimination, so fully known split outputs are now cast back to the input dtype.
Collaborator
There was a problem hiding this comment.
Also like the repo code, you need to call .predict on the model return by ct.convert.
Contributor
Author
There was a problem hiding this comment.
Updated. The regression test now calls .predict() on the model returned by ct.convert() with a concrete input and verifies that the scalar output is 1.0 on macOS 12+.
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
squeeze.value_inference()to the MIL input dtypeconcat -> split -> squeezepath from the issueFixes #1811.
Testing
Result: 3 passed.