Skip to content

Add test coverage for revectorize's multiple-:auto guard - #1820

Merged
polvalente merged 1 commit into
elixir-nx:mainfrom
blasphemetheus:test/revectorize-auto-guard
Aug 17, 2026
Merged

Add test coverage for revectorize's multiple-:auto guard#1820
polvalente merged 1 commit into
elixir-nx:mainfrom
blasphemetheus:test/revectorize-auto-guard

Conversation

@blasphemetheus

Copy link
Copy Markdown
Contributor

Follow-up to the review note on #1819 about giving Nx.revectorize's :target_shape a pass for the same multiple-:auto class.

Verified: revectorize already validates this — it raises a descriptive ArgumentError ("cannot have more than one :auto occurrence between target_axes and the :target_shape option") for all three combinations (two :autos in target_axes, one in each, two in :target_shape), and the single-:auto cases resolve correctly. The vectorized reshape path also picks up #1819's guard.

That existing guard had no test coverage, though — this adds a test pinning all three raise cases.

🤖 Generated with Claude Code

Follow-up to elixir-nx#1819's review: Nx.revectorize already validates that at
most one :auto appears across target_axes and the :target_shape option
(raising a descriptive ArgumentError for all three combinations), but
that guard had no test coverage. Pin it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@polvalente
polvalente merged commit ddf0754 into elixir-nx:main Aug 17, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants