array-api icon indicating copy to clipboard operation
array-api copied to clipboard

Should broadcast_arrays return a tuple instead of a list?

Open cbourjau opened this issue 8 months ago • 2 comments

Currently, broadcast_arrays is mandated to return a list. A tuple appears more appropriate on face value, though. NumPy and Dask are, in fact, returning tuples from this function. However, cupy follows the letter of the standard and returns a list. ndonnx is currently returning a list, too, but we would be willing to migrate over to returning a tuple.

cbourjau avatar Apr 26 '25 16:04 cbourjau

Would you mind filing a bug to CuPy? Maybe this is part of the NumPy 2.0 change and we'll follow.

leofang avatar Apr 26 '25 17:04 leofang

Looks like NumPy's behavior does stem from NumPy 2.0: https://numpy.org/doc/1.26/reference/generated/numpy.broadcast_arrays.html. Previously, it returned a list.

kgryte avatar Apr 27 '25 09:04 kgryte