Hi, currently mlx.core.meshgrid returns a list. I am proposing to make it return tuple for making it compliant with Array API, and how numpy, and cupy do it.
Impact
Low risk of breaking real-world code. Common workflows are fully compatible with tuples:
-
Unpacking: X, Y = mx.meshgrid(x, y)
-
Indexing & Iteration: grids[0], for g in grids:
-
Direct passing: mx.stack(mx.meshgrid(...))
Only rare cases relying on isinstance(..., list) or container mutation (.append()) would be affected.
Hi, currently
mlx.core.meshgridreturns a list. I am proposing to make it return tuple for making it compliant with Array API, and how numpy, and cupy do it.Impact
Low risk of breaking real-world code. Common workflows are fully compatible with tuples:
Unpacking: X, Y = mx.meshgrid(x, y)
Indexing & Iteration: grids[0], for g in grids:
Direct passing: mx.stack(mx.meshgrid(...))
Only rare cases relying on isinstance(..., list) or container mutation (.append()) would be affected.