Skip to content

feat: support inferred reshape dimensions - #23

Merged
CodeWithKyrian merged 1 commit into
mainfrom
feat/reshape-infer-negative-dimension
May 30, 2026
Merged

CodeWithKyrian merged 1 commit into
mainfrom
feat/reshape-infer-negative-dimension

Conversation

@CodeWithKyrian

Copy link
Copy Markdown
Contributor

This PR adds NumPy-style -1 dimension inference to reshape().

Motivation and Context

NumPy allows one reshape dimension to be -1, meaning that dimension is inferred from the array size and the remaining requested dimensions. Supporting this makes reshape() more familiar for users coming from NumPy and completes the planned reshape behavior in the spec.

What's changed

  • Added support for a single inferred -1 dimension in reshape(), including validation for invalid or ambiguous shapes.
  • Updated the API reference and guide documentation with inferred reshape examples and exception behavior.

Breaking changes

None.

@CodeWithKyrian
CodeWithKyrian merged commit e8d1c8e into main May 30, 2026
14 checks passed
@CodeWithKyrian
CodeWithKyrian deleted the feat/reshape-infer-negative-dimension branch May 30, 2026 21:28
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.

1 participant