Skip to content

Function to get broadcast shape from a list of shapes #17217

@asmeurer

Description

@asmeurer

It would be helpful if NumPy had a function that took a bunch of shapes as input and returned the broadcasted shape of those shapes, or raised an error if they cannot be broadcast.

Right now, the only way to do this is to actually construct arrays with the given shapes and pass them to np.broadcast or np.broadcast_arrays. As far as I can tell, the actual logic to get a broadcast shape is buried inside of the PyArray_Broadcast C function

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions