Skip to content

Comments

feat: add broadcast_shapes to the specification#983

Merged
kgryte merged 8 commits intodata-apis:mainfrom
kgryte:feat/broadcast_shapes
Feb 19, 2026
Merged

feat: add broadcast_shapes to the specification#983
kgryte merged 8 commits intodata-apis:mainfrom
kgryte:feat/broadcast_shapes

Conversation

@kgryte
Copy link
Contributor

@kgryte kgryte commented Dec 8, 2025

This PR

  • resolves RFC: add broadcast_shapes to the specification #893 by adding support for broadcast_shapes to the specification.
  • follows NumPy et al in supporting an arbitrary number of input shapes to be broadcasted.
  • specifies that only shapes which contain integers are explicitly supported. For shapes containing sentinel values such as None for a dimension of unknown size, behavior is left unspecified and thus implementation-defined.

@kgryte kgryte added API extension Adds new functions or objects to the API. topic: Manipulation Array manipulation and transformation. labels Dec 8, 2025
Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kgryte! Overall LGTM and seems good to add this function to the standard. A few comments with the "unknown shape" one the key thing to discuss.

@lucascolley
Copy link
Member

Copy link
Member

@ev-br ev-br left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small suggestion about the unknown dimensions, LGTM otherwise.

@kgryte kgryte requested a review from ev-br February 2, 2026 07:56
@lucascolley
Copy link
Member

An issue should be opened regarding deprecation of https://data-apis.org/array-api-extra/generated/array_api_extra.broadcast_shapes.html.

@kgryte
Copy link
Contributor Author

kgryte commented Feb 19, 2026

As all remaining comments have now been resolved and this was discussed during the last workgroup meeting, I'll go ahead and merge. Any further changes can be addressed in a follow-up PR.

@kgryte kgryte merged commit 9db13b3 into data-apis:main Feb 19, 2026
3 checks passed
@kgryte kgryte deleted the feat/broadcast_shapes branch February 19, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API extension Adds new functions or objects to the API. topic: Manipulation Array manipulation and transformation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFC: add broadcast_shapes to the specification

4 participants