Skip to content

Conversation

@ev-br
Copy link
Member

@ev-br ev-br commented Jan 10, 2026

Following the upcoming 2025.12 spec (data-apis/array-api#981), change the return type.
This is a backwards compat break, yes. As long as array-api-compat targets the 2025 revision, we don't seem to need to branch on the array API version.

Also

Copilot AI review requested due to automatic review settings January 10, 2026 21:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the broadcast_arrays function to return a tuple instead of a list, following the upcoming 2025.12 array API specification. This is an acknowledged backwards compatibility break.

Changes:

  • Modified torch implementation to return tuple instead of list
  • Added wrapper for cupy to convert list return to tuple
  • Noted need for numpy < 2 workaround (not yet implemented)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
array_api_compat/torch/_aliases.py Changed return value from list comprehension to tuple generator
array_api_compat/cupy/_aliases.py Added wrapper function to convert cp.broadcast_arrays result to tuple and added to all

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ev-br ev-br marked this pull request as draft January 10, 2026 23:03
@ev-br ev-br changed the title broadcast_arrays: change the return type into a tuple broadcast_arrays et al: change the return type into a tuple Jan 11, 2026
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