broadcast_shapes¶
- array_api_extra.broadcast_shapes(*shapes, xp=None)¶
Compute the shape of the broadcasted arrays.
Deprecated since version 0.11.0:
broadcast_shapes()is deprecated and will be removed in v1.0.0.array_api.broadcast_shapes()exists in the standard as of v2025.12.Duplicates
numpy.broadcast_shapes(), with additional support for None and NaN sizes.- Parameters:
- Returns:
The shape of the broadcasted arrays.
- Return type:
See also
numpy.broadcast_shapesEquivalent NumPy function.
array_api.broadcast_arraysFunction to broadcast actual arrays.
Notes
This function accepts the Array API’s
Nonefor unknown sizes, as well as Dask’s non-standardmath.nan. Regardless of input, the output always containsNonefor unknown sizes.Examples
>>> import array_api_extra as xpx >>> xpx.broadcast_shapes((2, 3), (2, 1)) (2, 3) >>> xpx.broadcast_shapes((4, 2, 3), (2, 1), (1, 3)) (4, 2, 3)