Repository navigation
Conversation
This branch has not been deployed
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.
Fixes #4023
ReduceMax and ReduceMin currently return the input unchanged for explicitly empty axes, even with the default
noop_with_empty_axes=0. For example, an opset 18 model reducing[[3, -2, 7], [4, 6, 1]]with empty axes andkeepdims=0returns a[2, 3]tensor instead of scalar7/-2.Treat empty axes like omitted axes before choosing the existing reduction branch. This preserves modern
noop_with_empty_axes=1,keepdims, nonempty axes, duplicate-axis handling and the existing zero-size-input error. The change is limited to the two extrema branches.Add four integration tests exercising 192 serialized ONNX model combinations through
simple_eval: opset 13 axes attributes; opset 18 optional axes inputs; empty/omitted axes; positive/negative and unsorted multi-axis controls; default/0/1 keepdims and modern default/0/1 no-op. Legacy graphs do not use modern parameters. Tests check shape, values and dtype.Validation on macOS arm64, Rust 1.94.1, protoc 33.6:
tests/ops.rs:1919, comparing0.8413447and0.8413448. A supplemental run excluding that one test passes all 67 existing tests and all four new tests, plus doc-test targets.cargo test --locked -p candle-core --lib --tests: 204 pass, one ignored.cargo build ... --all-targets: pass. ONNX and workspace format checks: pass.comparison_to_empty,needless_borrow,clone_on_copy,wildcard_in_or_patterns). The new regression target passes Clippy when only those five already-observed lint categories are allowed. This supplemental check is not a strict-Clippy pass.Core strict Clippy (
cargo clippy --locked -p candle-core --all-targets -- -D warnings) also passes. Local CPU verification does not establish remote CI or other-platform results.AI-assisted implementation and testing; final code and baseline exceptions independently reviewed before submission.